summaryrefslogtreecommitdiffstats
path: root/tags
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:20:01 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:20:01 +0000
commit9f79c8a050ff86907695027893e56080988c09d8 (patch)
treeef01b66b4a3ea89480b79fdd194f9694235d559b /tags
parentfdd5b43d3c139cf2cbd1655d2efbfaf9032a5b5e (diff)
Moving 2.x tags
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835147 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tags')
-rw-r--r--tags/java/sca/2.0-M1/BUILDING56
-rw-r--r--tags/java/sca/2.0-M1/CHANGES31
-rw-r--r--tags/java/sca/2.0-M1/LICENSE397
-rw-r--r--tags/java/sca/2.0-M1/NOTICE35
-rw-r--r--tags/java/sca/2.0-M1/README19
-rw-r--r--tags/java/sca/2.0-M1/RELEASE_NOTES71
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/pom.xml88
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/assembly/bin.xml36
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/assembly/src.xml47
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-common.xml43
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-launcher.xml41
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-modules.xml33
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-samples.xml65
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/INSTALL24
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/LICENSE1256
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/NOTICE62
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/README42
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/default.config5
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/osgi.config4
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/tuscany.bat76
-rw-r--r--tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/unmanaged.config4
-rw-r--r--tags/java/sca/2.0-M1/distribution/pom.xml37
-rw-r--r--tags/java/sca/2.0-M1/etc/policy-continuum.policy7
-rw-r--r--tags/java/sca/2.0-M1/features/all/pom.xml71
-rw-r--r--tags/java/sca/2.0-M1/features/api/pom.xml51
-rw-r--r--tags/java/sca/2.0-M1/features/core/pom.xml270
-rw-r--r--tags/java/sca/2.0-M1/features/ejava/pom.xml100
-rw-r--r--tags/java/sca/2.0-M1/features/pom.xml48
-rw-r--r--tags/java/sca/2.0-M1/features/webservice/pom.xml133
-rw-r--r--tags/java/sca/2.0-M1/itest/build-was-integration.xml68
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-api/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java38
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java30
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java201
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java50
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java113
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-api/src/main/resources/CallBackApiTest.composite33
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java70
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-basic/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java33
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java129
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java37
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java56
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-basic/src/main/resources/CallBackBasicTest.composite33
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java56
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-complex-type/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java33
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java138
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java36
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java59
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite33
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType28
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.java52
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-id/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java31
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java145
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java33
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java47
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-id/src/main/resources/CallBackIdClient.composite33
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java51
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-multiple-wires/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java27
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java49
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java49
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java32
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java27
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java45
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite38
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java64
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-separatethread/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java34
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java186
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java37
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java47
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java195
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite31
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java73
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java34
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java37
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java31
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java66
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java188
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java44
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java73
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite37
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java54
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java39
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java34
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java157
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java56
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java51
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java36
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java98
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite33
-rw-r--r--tags/java/sca/2.0-M1/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java52
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/AddService.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/AddServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorClient.java49
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorService.java34
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java63
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/DivideServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/resources/Calculator.composite49
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType27
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType43
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType27
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType27
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType27
-rw-r--r--tags/java/sca/2.0-M1/itest/component-type/src/test/java/calculator/CalculatorTestCase.java60
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java29
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java37
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java56
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java32
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java42
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java31
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java42
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java25
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java30
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java49
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java66
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java36
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java61
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java61
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.java46
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java41
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java45
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java108
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java69
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java72
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java50
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java84
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java75
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java48
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java75
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java325
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java317
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java322
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java42
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java122
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java114
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java115
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java122
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java93
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java68
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java66
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/resources/ConversationAge.composite31
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/resources/ConversationUniqueId.composite53
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversationId.composite27
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversationLifetime.composite33
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversational.composite99
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java56
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java208
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java78
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java107
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java88
-rw-r--r--tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java702
-rw-r--r--tags/java/sca/2.0-M1/itest/distribution/bin-distro-unzip/build.xml24
-rw-r--r--tags/java/sca/2.0-M1/itest/distribution/bin-distro-unzip/pom.xml80
-rw-r--r--tags/java/sca/2.0-M1/itest/distribution/binding-ws-calculator/build.xml40
-rw-r--r--tags/java/sca/2.0-M1/itest/distribution/binding-ws-calculator/pom.xml80
-rw-r--r--tags/java/sca/2.0-M1/itest/distribution/calculator-rmi/build.xml51
-rw-r--r--tags/java/sca/2.0-M1/itest/distribution/calculator-rmi/pom.xml80
-rw-r--r--tags/java/sca/2.0-M1/itest/distribution/implementation-java-calculator/build.xml40
-rw-r--r--tags/java/sca/2.0-M1/itest/distribution/implementation-java-calculator/pom.xml80
-rw-r--r--tags/java/sca/2.0-M1/itest/distribution/pom.xml43
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java57
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java32
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java30
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java37
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java57
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java115
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java45
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java116
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/main/resources/ExceptionTest.composite41
-rw-r--r--tags/java/sca/2.0-M1/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java85
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java30
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java47
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java83
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java37
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java49
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java48
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java33
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java64
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java81
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java38
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java54
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/main/resources/InterfacesTest.composite40
-rw-r--r--tags/java/sca/2.0-M1/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java131
-rw-r--r--tags/java/sca/2.0-M1/itest/operation-overloading/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java61
-rw-r--r--tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java113
-rw-r--r--tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java99
-rw-r--r--tags/java/sca/2.0-M1/itest/operation-overloading/src/main/resources/OperationOverload.composite34
-rw-r--r--tags/java/sca/2.0-M1/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java98
-rw-r--r--tags/java/sca/2.0-M1/itest/pom.xml732
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/pom.xml106
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java34
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java88
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java46
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java50
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java73
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java75
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java131
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java71
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java143
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java151
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java27
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java135
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java188
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java27
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java23
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java39
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java39
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java44
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java75
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java103
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/package-info.java27
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/resources/ConstructorPropertyInjection.composite41
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/resources/Outer.composite43
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/resources/OuterPropertyTest.composite42
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/resources/PropertyTest.composite255
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/resources/customer.xsd30
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/resources/fileProperty.txt21
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/resources/manyValuesFileProperty.txt23
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/resources/mySimpleService.composite40
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/resources/rcProps.txt22
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/main/resources/rcprops.xsd55
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java104
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java169
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java469
-rw-r--r--tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java72
-rw-r--r--tags/java/sca/2.0-M1/itest/recursive-multi-level/pom.xml61
-rw-r--r--tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java26
-rw-r--r--tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java42
-rw-r--r--tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java26
-rw-r--r--tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java39
-rw-r--r--tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite52
-rw-r--r--tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite49
-rw-r--r--tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite52
-rw-r--r--tags/java/sca/2.0-M1/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java89
-rw-r--r--tags/java/sca/2.0-M1/itest/references/pom.xml52
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java40
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java125
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java26
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java39
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java39
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java24
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java27
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java26
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/resources/AutoWiredReferencesTest.composite65
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/resources/InnerReferencesTest.composite54
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/main/resources/ManualWiredReferencesTest.composite64
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java113
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java99
-rw-r--r--tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java98
-rw-r--r--tags/java/sca/2.0-M1/itest/scopes/pom.xml54
-rw-r--r--tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java46
-rw-r--r--tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.java51
-rw-r--r--tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java25
-rw-r--r--tags/java/sca/2.0-M1/itest/scopes/src/main/resources/scopes.composite33
-rw-r--r--tags/java/sca/2.0-M1/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java113
-rw-r--r--tags/java/sca/2.0-M1/itest/services/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java27
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java25
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java31
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java27
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java28
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java24
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java24
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java34
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/resources/META-INF/sca-contribution.xml22
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/main/resources/ServicesTest.composite70
-rw-r--r--tags/java/sca/2.0-M1/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java108
-rw-r--r--tags/java/sca/2.0-M1/itest/wasAdmin.py91
-rw-r--r--tags/java/sca/2.0-M1/itest/wires/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java34
-rw-r--r--tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java51
-rw-r--r--tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java36
-rw-r--r--tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java39
-rw-r--r--tags/java/sca/2.0-M1/itest/wires/src/main/resources/WireTest.composite39
-rw-r--r--tags/java/sca/2.0-M1/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java78
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/META-INF/MANIFEST.MF39
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/pom.xml124
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java939
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java130
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeModelResolver.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java386
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java202
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java83
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java1248
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConfiguredOperationProcessor.java112
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java97
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java127
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeModelResolver.java83
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java282
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java254
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicyAttachPointProcessor.java271
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor21
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor21
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver20
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties29
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java149
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/MultiplicityReadWriteTestCase.java86
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadAllTestCase.java151
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java223
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadTestCase.java91
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java132
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyElementTestCase.java147
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java100
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java169
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolveTestCase.java103
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestAttributeProcessor.java61
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestPolicyProcessor.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingFactoryImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingImpl.java213
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WireTestCase.java148
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteAllTestCase.java158
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteNamespacesTestCase.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Calculator.composite59
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorComponent.constrainingType34
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorImpl.componentType31
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/JavaScriptReference.composite37
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Multiplicity.composite30
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/NestedCalculator.composite29
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/RMIBindingTest.composite43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllCalculator.composite128
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllDivide.composite56
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllPolicyCalculator.composite129
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/another_test_definitions.xml97
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/local.composite27
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/test_definitions.xml175
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/LICENSE281
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/META-INF/MANIFEST.MF13
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/NOTICE23
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/pom.xml31
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema18
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-all.xsd34
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-ejb.xsd43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-jms.xsd140
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-sca.xsd23
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-webservice.xsd34
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-contributions.xsd65
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-core.xsd348
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-definitions.xsd25
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-bpel.xsd43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-composite.xsd23
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-cpp.xsd53
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-ejb.xsd25
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-java.xsd24
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-jee.xsd23
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-spring.xsd24
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-web.xsd24
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-cpp.xsd40
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-java.xsd23
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-wsdl.xsd23
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-policy.xsd77
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca.xsd26
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-atom.xsd42
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-corba.xsd43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-dwr.xsd41
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-gdata.xsd43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-http.xsd41
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jms.xsd40
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jsonrpc.xsd41
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-notification.xsd42
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-rmi.xsd40
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-rss.xsd42
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-data-helper.xsd44
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-das.xsd46
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-data-xml.xsd45
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-node.xsd43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-notification.xsd42
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-osgi.xsd43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-resource.xsd42
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-script.xsd43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-widget.xsd42
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-xquery.xsd42
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca.xsd51
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/wsdli.xsd34
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/META-INF/MANIFEST.MF44
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/pom.xml57
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java77
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java124
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java28
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java155
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/BindingRRB.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java132
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java88
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java83
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java59
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java77
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java110
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java37
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConfiguredOperation.java61
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConstrainingType.java72
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java31
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultExtensionFactory.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java167
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java37
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extensible.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extension.java65
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ExtensionFactory.java28
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java27
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationSelector.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationsConfigurator.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OptimizableBinding.java66
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java27
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/WireFormat.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/AutomaticBinding.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilder.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilderExtension.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/ComponentPreProcessor.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderExtensionPoint.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultCompositeBuilderExtensionPoint.java145
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java80
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseBuilderImpl.java563
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentConfigurationBuilderImpl.java395
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferencePromotionWireBuilderImpl.java168
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java832
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java78
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServicePromotionBuilderImpl.java105
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingConfigurationBuilderImpl.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingURIBuilderImpl.java536
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java231
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeCloneBuilderImpl.java123
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeIncludeBuilderImpl.java119
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositePolicyBuilderImpl.java262
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositePromotionBuilderImpl.java228
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceConfigurationBuilderImpl.java230
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceWireBuilderImpl.java97
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceConfigurationBuilderImpl.java200
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServicePromotionBuilderImpl.java83
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java209
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationException.java38
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java752
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PrintUtil.java273
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java213
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceConfigurationUtil.java264
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ServiceConfigurationUtil.java88
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java114
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java121
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java82
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java174
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java93
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java113
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java115
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java153
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConfiguredOperationImpl.java93
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java105
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java96
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java154
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensibleImpl.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java59
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java133
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java107
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java96
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.AssemblyFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.EndpointFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.ExtensionFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilder35
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/resources/assembly-validation-messages.properties62
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/main/resources/assembly-validation-messages_it.properties30
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/AssemblyFactoryTestCase.java214
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestImplementation.java61
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterface.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterfaceContract.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestOperation.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderTestCase.java132
-rw-r--r--tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/PrintUtilTestCase.java229
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-dwr-runtime/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-dwr-runtime/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-dwr-runtime/pom.xml95
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRBinding.java31
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRBindingActivator.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRInvoker.java93
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRInvokerFactory.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRService.java81
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRServlet.java247
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/META-INF/MANIFEST.MF31
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/pom.xml79
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingInvoker.java106
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingProviderFactory.java65
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java81
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java164
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RemoteInterfaceGenerator.java102
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloException.java60
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldImpl.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldRmiImpl.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldRmiService.java31
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldService.java31
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java81
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/HelloWorldImpl.componentType23
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/HelloWorldRmiImpl.componentType27
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/RMIBindingTest.composite43
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi/META-INF/MANIFEST.MF19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi/pom.xml41
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingFactoryImpl.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingImpl.java157
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rmi.RMIBindingFactory19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca-xml/META-INF/MANIFEST.MF26
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca-xml/pom.xml49
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java130
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java97
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java85
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/resources/Calculator.composite59
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/resources/CalculatorServiceImpl.componentType33
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/META-INF/MANIFEST.MF31
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/pom.xml66
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/DistributedSCABinding.java37
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/DistributedSCABindingImpl.java116
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingFactoryImpl.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingImpl.java225
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RemoteBindingHelper.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCABindingProvider.java61
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCABindingProviderFactory.java61
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java237
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java155
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingDefinitionsProvider.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingInvoker.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.SCABindingFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml26
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java107
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-sca/src/test/resources/Calculator.composite52
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/META-INF/MANIFEST.MF60
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/pom.xml131
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java113
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProviderFactory.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java84
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java89
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java93
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java87
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java156
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProviderFactory.java99
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProcessor.java112
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProviderFactory.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyUtil.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyInterceptor.java72
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java89
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyInterceptor.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java87
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeader.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeaderString.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor21
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory20
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java59
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/mock_policies.xml36
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/META-INF/MANIFEST.MF152
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/pom.xml348
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java297
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java81
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java86
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java84
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java500
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java103
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java835
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceServlet.java295
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java330
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java104
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java218
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/WSBindingDefinitionsProvider.java66
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java111
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingHeaderConfigurator.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml54
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml504
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/modules.list1
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.4.marbin2796 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/services/services.list0
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java83
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java104
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java31
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java24
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java34
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Bar.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java103
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoImpl.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Foo.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldMultiService.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java83
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java34
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMService.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldService.java28
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java52
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java102
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java102
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java130
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/UriPrecedenceTestCase.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiServiceTestCase.java24
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleServiceTestCase.java24
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURITestCase.java24
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURITestCase.java24
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java53
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCaseOFF.java81
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCaseOFF.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java24
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCaseOFF.java24
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/AbstractHelloWorldOMTestCaseOFF.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ClientPWCBHandler.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/IntegrityPWCBHandler.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ServerPWCBHandler.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixedTestCase.java27
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCaseOFF.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCaseOFF.java27
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCaseOFF.java27
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCaseOFF.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCaseOFF.java144
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler20
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite51
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite62
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd36
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd27
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd31
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite52
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite52
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite50
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite50
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/helloworld-om-relative-uri.wsdl78
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite51
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-binding.wsdl45
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite43
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl59
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-uri.wsdl78
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite44
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.wsdl78
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite48
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.wsdl81
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld.wsdl86
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransfer.wsdl84
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.compositeOFF42
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthentication.composite.OFF51
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentiality.composite.OFF50
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrity.composite.OFF50
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml101
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties20
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jksbin1379 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml32
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixed.composite.OFF53
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/definitions.xml323
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties20
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jksbin1379 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthentication.composite.OFF51
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentiality.composite.OFF50
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrity.composite.OFF51
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml203
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jksbin1379 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl70
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import.wsdl49
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-include.wsdl94
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite32
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite32
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl.composite40
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.composite.OFF72
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/questionmark-wsdl.composite.OFF41
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/META-INF/MANIFEST.MF60
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/pom.xml94
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java339
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java841
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java305
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLGenerationException.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java511
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/resources/wsdlgen-validation-messages.properties31
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/Other.java34
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/package-info.java21
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java81
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestException.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFault.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFaultBean.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaClass.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaInterface.java57
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/META-INF/MANIFEST.MF37
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/pom.xml76
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/EndPointReferenceHelper.java223
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java410
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties28
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java116
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite59
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite63
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType45
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite60
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl26
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl58
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd136
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl58
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl45
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd33
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl63
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl76
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/META-INF/MANIFEST.MF33
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/pom.xml66
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java31
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java214
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/addressing/EndPointReference.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java322
-rw-r--r--tags/java/sca/2.0-M1/modules/binding-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory19
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/META-INF/MANIFEST.MF28
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/DefaultJavaImportExportFactory.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaExport.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImport.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java159
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java158
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoader.java383
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportImpl.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportModelResolver.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessor.java148
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportImpl.java110
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportModelResolver.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java153
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.java.JavaImportExportFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/contribution-java-validation-messages.properties23
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoaderTestCase.java262
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessorTestCase.java108
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessorTestCase.java109
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-java/src/test/resources/deployables/sample-calculator.jarbin26901 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/META-INF/MANIFEST.MF25
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/DefaultNamespaceImportExportFactory.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceExport.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImport.java59
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImportExportFactory.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportImpl.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportModelResolver.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java147
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportFactoryImpl.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportImpl.java92
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java153
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties23
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java106
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java111
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/META-INF/MANIFEST.MF27
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/pom.xml52
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyElementProcessor.java161
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java482
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLEventsStreamReader.java444
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLFragmentStreamReader.java53
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java131
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessor.java222
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionModelResolver.java72
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor20
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor20
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties24
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution-xml/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java145
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/META-INF/MANIFEST.MF46
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/pom.xml59
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java86
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Constants.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContentType.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Contribution.java117
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionMetadata.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultContributionFactory.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultExport.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultImport.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DeployedArtifact.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Export.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Import.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/PackageType.java57
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java103
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java159
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionMetadataImpl.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/DefaultExportImpl.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/DefaultImportImpl.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessor.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessorExtensionPoint.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java539
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionException.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionReadException.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionResolveException.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionRuntimeException.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionWriteException.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java66
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java378
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXAttributeProcessorExtensionPoint.java323
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java239
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java325
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidationSchemaExtensionPoint.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java258
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXAttributeProcessor.java242
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java139
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessor.java59
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessor.java61
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessorExtensionPoint.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyNamespaceContext.java114
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java110
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessor.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnrecognizedElementException.java48
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnsupportedContentTypeException.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnsupportedPackageTypeException.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLStreamReader.java395
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidationSchemaExtensionPoint.java52
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java107
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultDelegatingModelResolver.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportAllModelResolver.java80
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportModelResolver.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolver.java88
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolverExtensionPoint.java114
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ExtensibleModelResolver.java200
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolver.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolverExtensionPoint.java52
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResolverExtension.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResourceReference.java103
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/ContributionScanner.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/ContributionScannerExtensionPoint.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/DefaultContributionScannerExtensionPoint.java125
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.ContributionFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ContributionPostProcessorExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessorExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory17
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.scanner.ContributionScannerExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/main/resources/contribution-validation-messages.properties34
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/processor/URLartifactProcessorExtensionPointTestCase.java113
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolverTestCase.java91
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/ExtensibleModelResolverTestCase.java134
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/TestModelResolver.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/test/resources/deployables/sample-calculator.jarbin26901 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/test/resources/repository/sample-calculator.jarbin29164 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/test/resources/test.composite22
-rw-r--r--tags/java/sca/2.0-M1/modules/contribution/src/test/resources/test.ext0
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/META-INF/MANIFEST.MF48
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/pom.xml90
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java99
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java210
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Array2ArrayTransformer.java110
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReference2XMLStreamReader.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceDataBinding.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceTypeHelper.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceXMLAdapter.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Exception2ExceptionTransformer.java114
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java279
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java257
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/XMLStreamReader2CallableReference.java101
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java195
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java264
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java268
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--tags/java/sca/2.0-M1/modules/core-databinding/src/test/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java77
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/META-INF/MANIFEST.MF45
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/pom.xml90
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/doc/Context Model.emx673
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ComponentContextFactory.java37
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ContextFactoryExtensionPoint.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java116
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/PropertyValueFactory.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/RequestContextFactory.java34
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/DefaultEndpointResolverFactoryExtensionPoint.java180
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolver.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolverFactory.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolverFactoryExtensionPoint.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/DataExchangeSemantics.java34
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java112
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java115
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java60
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java91
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java505
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProvider.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderException.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderExtensionPoint.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java53
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java38
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java37
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java53
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReference.java93
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java83
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java107
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java119
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java138
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java117
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java53
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java59
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ContextFactoryExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactoryExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProviderExtensionPoint19
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java208
-rw-r--r--tags/java/sca/2.0-M1/modules/core/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/core/META-INF/MANIFEST.MF83
-rw-r--r--tags/java/sca/2.0-M1/modules/core/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/core/pom.xml95
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/ActivationException.java37
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivator.java137
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeAssemblyFactory.java80
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/CompositeActivatorImpl.java1072
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointReferenceImpl.java186
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointWireImpl.java186
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ReferenceParameterProcessor.java101
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ReferenceParametersImpl.java139
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentImpl.java111
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentReferenceImpl.java155
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentServiceImpl.java163
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeWireImpl.java461
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CallableReferenceExt.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/ComponentContextExt.java31
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CompositeContext.java225
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/DefaultComponentContextFactory.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/DefaultRequestContextFactory.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/ServiceReferenceExt.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CallableReferenceImpl.java605
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java446
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CompositeContextImpl.java355
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java117
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java135
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationExt.java66
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationListener.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationManager.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationState.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/impl/ConversationManagerImpl.java218
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/impl/ExtendedConversationImpl.java267
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/InstanceWrapper.java48
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/ObjectCreationException.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/ObjectFactory.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CachedProxy.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallableReferenceObjectFactory.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackInterfaceInterceptor.java57
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackReferenceObjectFactory.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackWireObjectFactory.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CglibProxyFactory.java152
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/DefaultProxyFactoryExtensionPoint.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleProxyFactory.java114
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleWireProcessor.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java194
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyCreationException.java48
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactory.java88
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactoryExtensionPoint.java53
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeWireInvoker.java264
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/WireObjectFactory.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/CallbackReferenceImpl.java270
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImpl.java191
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKCallbackInvocationHandler.java110
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java518
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKProxyFactory.java105
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/MessageFactoryImpl.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/MessageImpl.java104
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/NoMethodForOperationException.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManager.java298
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseSorter.java236
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java196
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/DefaultScopeRegistry.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/Scope.java66
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainer.java158
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainerFactory.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeRegistry.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopedImplementationProvider.java65
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopedRuntimeComponent.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetDestructionException.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetInitializationException.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetNotFoundException.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetResolutionException.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainer.java82
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainerFactory.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ConversationalScopeContainer.java293
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ConversationalScopeContainerFactory.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/HttpSessionScopeContainer.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/HttpSessionScopeContainerFactory.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/RequestScopeContainer.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/RequestScopeContainerFactory.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ScopeRegistryImpl.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainer.java59
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainerFactory.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/DefaultWorkScheduler.java191
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManager.java229
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/Work.java65
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkEvent.java80
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkItem.java167
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkListener.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ComponentContextFactory17
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.RequestContextFactory17
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.assembly.CompositeActivator18
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.conversation.ConversationManager18
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.scope.ScopeRegistry18
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.invocation.MessageFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.work.WorkScheduler18
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/CallbackInterfaceInterceptorTestCase.java.fixme62
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImplTestCase.java96
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/NonBlockingInterceptorTestCase.java.fixme74
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManagerTestCase.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/PhaseSorterTestCase.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/FailingWork.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyFailingRunnable.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyRunnable.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyRunnerListener.java154
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/Jsr237WorkSchedulerTestCase.java241
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/TestWorkListener.java155
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManagerTestCase.java244
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/TimeDelayWork.java88
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java66
-rw-r--r--tags/java/sca/2.0-M1/modules/core/src/test/resources/META-INF/services/org.apache.tuscany.sca.invocation.PhaseTest24
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/META-INF/MANIFEST.MF33
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/pom.xml112
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java142
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java77
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java66
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java251
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding20
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer30
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java129
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/ipo.xml51
-rwxr-xr-xtags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/ipo.xsd137
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/order.wsdl76
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/META-INF/MANIFEST.MF38
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/pom.xml175
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java140
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java77
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXBDataSource.java136
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java100
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java114
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java189
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java144
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java123
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStreamWriterWithOS.java246
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java84
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer26
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/JAXB2OMTestCase.java109
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/OMElement2JAXBTestCase.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/resources/ipo.xsd136
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/META-INF/MANIFEST.MF51
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/pom.xml177
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/AnyTypeXmlAdapter.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DOMElementXmlAdapter.java57
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DataConverter.java378
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DefaultXMLAdapterExtensionPoint.java60
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2SAX.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2String.java77
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java420
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java442
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java131
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBPropertyDescriptor.java302
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTypeHelper.java242
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperException.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java151
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHelper.java166
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/String2JAXB.java80
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLAdapterExtensionPoint.java52
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLRootElementUtil.java286
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java77
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding19
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer32
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint17
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/com/example/stock/StockQuoteOffer.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java121
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBindingTestCase.java130
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBReflectionTestCase.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java144
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java90
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyBean.java162
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterface.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterfaceImpl.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyJaxbBean.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MySubBean.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/POJOTestCase.java237
-rwxr-xr-xtags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/resources/ipo.xsd136
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/LICENSE244
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/META-INF/MANIFEST.MF66
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/pom.xml98
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBinding.java91
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBindingExtensionPoint.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipe.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipeTransformer.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java243
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultTransformerExtensionPoint.java306
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Mediator.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PullTransformer.java38
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PushTransformer.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/SimpleTypeMapper.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationContext.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationException.java65
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Transformer.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformerExtensionPoint.java81
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/WrapperHandler.java78
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/XMLTypeHelper.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataBinding.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataType.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/externalizable/ExternalizableDataBinding.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseDataBinding.java110
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseTransformer.java52
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DOMHelper.java163
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DirectedGraph.java452
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Group2GroupTransformer.java94
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/GroupDataBinding.java103
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Java2SimpleTypeTransformer.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java182
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/PipedTransformer.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleType2JavaTransformer.java89
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleTypeMapperImpl.java401
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/TransformationContextImpl.java113
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/XSDDataTypeConverter.java945
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java97
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLStreamReaderTransformer.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java262
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java139
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaExceptionDataBinding.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/SimpleJavaDataBinding.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java329
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/DataTypeHelper.java165
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/LRUCache.java88
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderImpl.java296
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMDataBinding.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java141
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXMLStreamReader.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXmlNodeImpl.java156
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DelegatingNamespaceContext.java310
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2Node.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2SAX.java65
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2Node.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2SAX.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValueArrayStreamReader.java403
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValuePairStreamReader.java347
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NamedProperty.java59
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NilElementStreamReader.java279
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2OutputStream.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2SimpleJavaType.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2SourceTransformer.java61
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2String.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2Writer.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2XMLStreamReader.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2Node.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2SAX.java60
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOM.java246
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOMPipe.java81
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SimpleJavaType2Node.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SimpleXmlNodeImpl.java112
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2NodeTransformer.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2ResultTransformer.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2StringTransformer.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAX2SAXAdapter.java256
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAXDataBinding.java53
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAXHelper.java86
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StreamDataPipe.java65
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2Node.java60
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2SAX.java61
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2SourceTransformer.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2XMLStreamReader.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/WrappingXMLStreamReader.java100
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Writer2ReaderDataPipe.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLDocumentStreamReader.java482
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLFragmentStreamReader.java53
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLFragmentStreamReaderImpl.java857
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLGroupDataBinding.java57
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2Node.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2SAX.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2String.java57
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamSerializer.java287
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamable.java37
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStringDataBinding.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlNode.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlNodeIterator.java355
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlTreeStreamReaderImpl.java531
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding25
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBindingExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer40
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer26
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.TransformerExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DOMHelperTestCase.java53
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DataBindingExtensionTestCase.java82
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/SimpleTypeMapperExtensionTestCase.java.fixme124
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/TransformerExtensionTestCase.java.fixme77
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/XSDDataTypeConverterTestCase.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingRegistryImplTestCase.java.fixme103
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingTestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DirectedGraphTestCase.java123
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java122
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/TransformerRegistryImplTestCase.java.fixme109
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/XMLDocumentStreamReaderTestCase.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderTestCase.java187
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOM2StAXTestCase.java104
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/JavaBean2XMLStreamReaderTestCase.java136
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java78
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/StAXHelperTestCase.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java99
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/XmlTreeStreamReaderTestCase.java198
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/ipo.xsd136
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/order.wsdl76
-rw-r--r--tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/xml/foo.xml22
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/META-INF/MANIFEST.MF24
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/pom.xml64
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java246
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java249
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/definitions-xml-validation-messages.properties22
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/Policy.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/ReadDocumentTestCase.java198
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions-xml/src/test/resources/org/apache/tuscany/sca/definitions/test_definitions.xml255
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/META-INF/MANIFEST.MF21
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/pom.xml52
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefaultDefinitionsFactory.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java82
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java34
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderImpl.java309
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsFactory.java31
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/definitions/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.DefinitionsFactory17
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/META-INF/MANIFEST.MF29
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/pom.xml88
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointResolverFactoryImpl.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointResolverImpl.java112
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory19
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml26
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/AddService.java28
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/AddServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/CalculatorService.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/CalculatorServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/DivideServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/MultiplyServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/SubtractServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/java/org/apace/tuscany/sca/binding/sca/EndpointTestCase.java206
-rw-r--r--tags/java/sca/2.0-M1/modules/endpoint/src/test/resources/Calculator.composite52
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility-equinox/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility-equinox/META-INF/MANIFEST.MF24
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility-equinox/NOTICE5
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility-equinox/pom.xml96
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java300
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java150
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java100
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/resources/test-bundle.jarbin1797 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/META-INF/MANIFEST.MF18
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/pom.xml31
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java186
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultFactoryExtensionPoint.java172
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultModuleActivatorExtensionPoint.java92
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultUtilityExtensionPoint.java186
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/FactoryExtensionPoint.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java60
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ModuleActivatorExtensionPoint.java53
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/UtilityExtensionPoint.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java245
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDeclaration.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscoverer.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java87
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.FactoryExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.UtilityExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscovererTestCase.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/DefaultExtensionPointRegistryTestCase.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/META-INF/MANIFEST.MF18
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultResourceServlet.java86
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java123
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java111
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostExtensionPoint.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletMappingException.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.ServletHostExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/META-INF/MANIFEST.MF30
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/pom.xml69
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyDefaultServlet.java90
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyLogger.java87
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java486
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java323
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/src/test/resources/content/test.html21
-rw-r--r--tags/java/sca/2.0-M1/modules/host-jetty/src/test/resources/tuscany.keyStorebin1265 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/META-INF/MANIFEST.MF15
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/pom.xml39
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHost.java147
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHostExtensionPoint.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java59
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHost.java61
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostExtensionPoint.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java90
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/LICENSE241
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/META-INF/MANIFEST.MF39
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/NOTICE12
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/pom.xml87
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java122
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppModuleActivator.java57
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppRequestDispatcher.java114
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java336
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTEI.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTag.java118
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/src/main/resources/META-INF/sca.tld51
-rw-r--r--tags/java/sca/2.0-M1/modules/host-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/META-INF/MANIFEST.MF61
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/pom.xml63
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/InstanceFactory.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/InstanceFactoryProvider.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceFactory.java86
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapper.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ArrayMultiplicityObjectFactory.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ContextInjector.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjector.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InjectionRuntimeException.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/Injector.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InvalidAccessorException.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java345
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ListMultiplicityObjectFactory.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjector.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/RequestContextObjectFactory.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceHost.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceNotFoundException.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceObjectFactory.java86
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceResolutionException.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/EventInvocationException.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/EventInvoker.java34
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/InvalidConversationSequenceException.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaCallbackRuntimeWireProcessor.java106
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextFactory.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java395
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentNameFactory.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java199
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java204
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProviderFactory.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaInstanceFactoryProvider.java182
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/MethodEventInvoker.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/NoConversationalContractException.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/PolicyHandlingInterceptor.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/module/JavaRuntimeModuleActivator.java112
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/MultiplicityTestCase.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapperTestCase.java.fixme84
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/CallbackWireObjectFactoryTestCase.java.fixme54
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjectorTestCase.java52
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactoryTestCase.java.fixme449
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/MethodEventInvokerTestCase.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjectorTestCase.java83
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/ResourceObjectFactoryTestCase.java.fixme89
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/SingletonObjectFactory.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/SingletonObjectFactoryTestCase.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/TestObjectFactory.java120
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/TestObjectFactoryTestCase.java82
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean1.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean2.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Entry.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java189
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/SuperBean.java48
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/META-INF/MANIFEST.MF29
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/pom.xml85
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationConstants.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java317
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties23
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/AddService.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/AddServiceImpl.java37
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/CalculatorService.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/CalculatorServiceImpl.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/DivideService.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/DivideServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/MultiplyService.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/MultiplyServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/SubtractService.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/SubtractServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java221
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/TestModelResolver.java88
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/WriteTestCase.java66
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/Calculator.composite66
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions.xml100
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions_with_policysets.xml133
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/META-INF/MANIFEST.MF38
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/pom.xml66
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/BaseJavaImplementation.java59
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/DefaultJavaImplementationFactory.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/IntrospectionException.java60
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaConstructorImpl.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaElementImpl.java222
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementation.java194
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementationActivator.java85
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementationFactory.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaParameterImpl.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaResourceImpl.java86
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaScopeImpl.java66
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/BaseJavaImplementationImpl.java89
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaClassIntrospectorImpl.java143
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaImplementationFactoryImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaImplementationImpl.java172
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/BaseJavaClassVisitor.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaClassVisitor.java126
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java577
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessor.java193
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AllowsPassByReferenceProcessor.java52
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AmbiguousConstructorException.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ComponentNameProcessor.java82
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessor.java84
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ContextProcessor.java84
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationIDProcessor.java72
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationProcessor.java133
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessor.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateConstructorException.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateDestructorException.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateInitException.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicatePropertyException.java34
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateReferenceException.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateResourceException.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessor.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java658
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalCallbackReferenceException.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalContextException.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalDestructorException.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalInitException.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalPropertyException.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalReferenceException.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalResourceException.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalServiceDefinitionException.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessor.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidConstructorException.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidConversationalImplementationException.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidPropertyException.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidReferenceException.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidResourceException.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidServiceTypeException.java48
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/NoConstructorException.java37
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessor.java329
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessor.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java239
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/Resource.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ResourceProcessor.java148
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessor.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java190
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceTypeNotFoundException.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/UnknownContextTypeException.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.JavaImplementationFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractProcessorTest.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AllowsPassByReferenceProcessorTestCase.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessorTestCase.java202
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorPropertyTestCase.java169
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorReferenceTestCase.java173
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorResourceTestCase.java164
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ContextProcessorTestCase.java216
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationIDProcessorTestCase.java99
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationProcessorTestCase.java153
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConvertTimeMillisTestCase.java114
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessorTestCase.java136
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessorTestCase.java60
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicConstructorTestCase.java327
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java581
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeutisticExtensibleConstructorTestCase.java154
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessorTestCase.java153
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ModelHelper.java99
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java421
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessorTestCase.java229
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessorTestCase.java237
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ResourceProcessorTestCase.java128
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessorTestCase.java116
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceCallbackTestCase.java194
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java169
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/TestAbstractPropertyProcessorTestCase.java175
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/META-INF/MANIFEST.MF36
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/pom.xml84
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationDaemonBootstrap.java111
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherBootstrap.java147
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherUtil.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationInvoker.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationProvider.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationProviderFactory.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppRequestDispatcher.java119
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppServletHost.java392
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory19
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/java/org/apache/tuscany/sca/implementation/node/NodeImplementationTestCase.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/resources/TestComposite.composite29
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/resources/TestNode.composite30
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/META-INF/MANIFEST.MF34
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/pom.xml74
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/ConfiguredNodeImplementation.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/NodeImplementation.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/NodeImplementationFactory.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/builder/impl/NodeCompositeBuilderImpl.java106
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/ConfiguredNodeImplementationImpl.java104
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/NodeImplementationFactoryImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/NodeImplementationImpl.java97
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/xml/ConfiguredNodeImplementationProcessor.java196
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/xml/NodeImplementationProcessor.java119
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilder18
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor20
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.node.NodeImplementationFactory19
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java603
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/xml/ReadTestCase.java72
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/xml/WriteTestCase.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/implementation/node/xml/TestComposite.composite29
-rw-r--r--tags/java/sca/2.0-M1/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/implementation/node/xml/TestNode.composite64
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/META-INF/MANIFEST.MF49
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/pom.xml252
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java542
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java280
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGenerator.java147
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedClassLoader.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedDataTypeImpl.java143
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java370
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java379
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java238
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java27
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java28
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java121
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java52
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl142
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl171
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/META-INF/MANIFEST.MF27
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaConstants.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java191
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties22
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/xml/ReadTestCase.java92
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/xml/WriteTestCase.java87
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/Calculator.composite53
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/CalculatorComponent.constrainingType34
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/CalculatorImpl.componentType31
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/META-INF/MANIFEST.MF38
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/pom.xml63
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/DefaultJavaInterfaceFactory.java99
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java87
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceContract.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceFactory.java82
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaOperation.java57
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceContractImpl.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceFactoryImpl.java84
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java111
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java258
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtil.java173
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaOperationImpl.java83
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java159
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/introspect/JavaInterfaceVisitor.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilDuplicateRemotableTestCase.java316
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilTestCase.java123
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/ConversationalIntrospectionTestCase.java107
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/JavaInterfaceProcessorRegistryImplTestCase.java.fixme107
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/PolicyProcessorTestCase.java112
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/META-INF/MANIFEST.MF40
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/pom.xml70
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java141
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java38
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java229
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java250
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java487
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver18
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/interface-wsdlxml-validation-messages.properties24
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java83
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java121
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java86
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java65
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java91
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java111
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java88
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java52
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite55
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType36
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType33
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl26
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl58
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd136
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl58
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl45
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd33
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl63
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl76
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/policy/stockquote_policy.wsdl62
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl67
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl49
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd29
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd22
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd29
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/META-INF/MANIFEST.MF36
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/pom.xml84
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/BPELPartnerLinkTypeExt.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLDefinition.java140
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLFactory.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterfaceContract.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLObject.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLOperation.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/InvalidWSDLException.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java284
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceContractImpl.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java99
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java159
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLObjectImpl.java61
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationImpl.java81
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java602
-rw-r--r--tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/META-INF/MANIFEST.MF27
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/pom.xml39
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/ConversationSequence.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/DataType.java119
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/IncompatibleInterfaceContractException.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContract.java81
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java115
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidCallbackException.java34
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidInterfaceException.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidOperationException.java42
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java203
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/OverloadedOperationException.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java219
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractImpl.java128
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java303
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java296
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java339
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/ElementInfo.java114
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/FaultException.java82
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/JavaXMLMapper.java143
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/TypeInfo.java100
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java190
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/XMLType.java152
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.InterfaceContractMapper18
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/test/java/org/apache/tuscany/sca/interfacedef/impl/ContractCompatibilityTestCase.java395
-rw-r--r--tags/java/sca/2.0-M1/modules/interface/src/test/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractTestCase.java68
-rw-r--r--tags/java/sca/2.0-M1/modules/launcher/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/launcher/META-INF/MANIFEST.MF27
-rw-r--r--tags/java/sca/2.0-M1/modules/launcher/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/launcher/pom.xml35
-rw-r--r--tags/java/sca/2.0-M1/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java318
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/META-INF/MANIFEST.MF16
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/pom.xml33
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/DefaultMonitorFactory.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java79
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/MonitorFactory.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Problem.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java92
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/ProblemImpl.java132
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/src/main/resources/META-INF/services/org.apache.tuscany.sca.monitor.MonitorFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/src/test/java/org/apache/tuscany/sca/monitor/MonitorTestCase.java92
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/src/test/resources/tuscany-monitor-test-messages.properties24
-rw-r--r--tags/java/sca/2.0-M1/modules/monitor/src/test/resources/tuscany-monitor-test-messages_it.properties24
-rw-r--r--tags/java/sca/2.0-M1/modules/node-api/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/node-api/META-INF/MANIFEST.MF19
-rw-r--r--tags/java/sca/2.0-M1/modules/node-api/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/node-api/pom.xml41
-rw-r--r--tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Client.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Contribution.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/ContributionLocationHelper.java101
-rw-r--r--tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java47
-rw-r--r--tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java199
-rw-r--r--tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/META-INF/MANIFEST.MF48
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/pom.xml148
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java713
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory17
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/src/test/java/hello/HelloWorld.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/src/test/java/hello/HelloWorldImpl.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/src/test/resources/HelloWorld.composite30
-rw-r--r--tags/java/sca/2.0-M1/modules/node-impl/src/test/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/META-INF/MANIFEST.MF20
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/pom.xml119
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/Contribution.java48
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/ContributionLocationHelper.java66
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/DomainManagerLauncher.java173
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java446
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherException.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeDaemonLauncher.java160
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java327
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher2.java217
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java1100
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeMain.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/J2SE-1.5.profile150
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/JavaSE-1.6.profile185
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorld.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java100
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite34
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/META-INF/MANIFEST.MF17
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/pom.xml64
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/Contribution.java48
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/DomainManagerLauncher.java180
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/LauncherException.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemonLauncher.java169
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java303
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java539
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeMain.java62
-rw-r--r--tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java130
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/META-INF/MANIFEST.MF64
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicy.java67
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProcessor.java123
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProviderFactory.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPrincipal.java80
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyInterceptor.java96
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyProvider.java89
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyInterceptor.java96
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyProvider.java87
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/token/TokenPrincipal.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicy.java85
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicyProcessor.java151
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityImplementationPolicyInterceptor.java77
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityImplementationPolicyProvider.java88
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicy.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProcessor.java132
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProviderFactory.java75
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityPolicyDefinitionsProvider.java86
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityUtil.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationImplementationPolicyProvider.java90
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationInterceptor.java76
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java72
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProcessor.java148
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProviderFactory.java72
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor27
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider19
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory21
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/definitions.xml55
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/tuscany_definitions.xml32
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/policy-security-validation-messages.properties22
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/test/java/org/apache/tuscany/sca/policy/security/PolicyProcessorTestCase.java87
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-security/src/test/resources/org/apache/tuscany/sca/policy/security/mock_policy_definitions.xml78
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml-ws/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml-ws/META-INF/MANIFEST.MF31
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml-ws/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml-ws/pom.xml130
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml-ws/src/main/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessor.java160
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/TestModelResolver.java63
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/TestPolicyProcessor.java74
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessorTestCase.java111
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml106
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/META-INF/MANIFEST.MF20
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/BindingTypeProcessor.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ImplementationTypeProcessor.java70
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentAttachPointTypeProcessor.java257
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyIntentProcessor.java420
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java503
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ProfileIntentProcessor.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/QualifiedIntentProcessor.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/SimpleIntentProcessor.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor24
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver18
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/policy-xml-validation-messages.properties44
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java286
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java72
-rw-r--r--tags/java/sca/2.0-M1/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml255
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/META-INF/MANIFEST.MF32
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/pom.xml39
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/DefaultIntentAttachPointTypeFactory.java29
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/DefaultPolicyFactory.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/Intent.java116
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPoint.java52
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPointType.java71
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPointTypeFactory.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentMap.java89
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/Policy.java33
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicyContext.java38
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java69
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java155
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySetAttachPoint.java48
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySetReference.java43
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ProfileIntent.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/QualifiedIntent.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java90
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java88
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentAttachPointTypeFactoryImpl.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentImpl.java151
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentMapImpl.java73
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyContextImpl.java93
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java60
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java149
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetReferenceImpl.java48
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ProfileIntentImpl.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/QualifiedIntentImpl.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyComputationUtils.java418
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandler.java38
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerDefinitionsLoader.java87
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerTuple.java91
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerUtils.java64
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java38
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java111
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.PolicyFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/policy/src/test/java/org/apache/tuscany/sca/policy/PolicyFactoryTestCase.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/pom.xml164
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/LICENSE243
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/META-INF/MANIFEST.MF17
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/NOTICE13
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/pom.xml35
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/CallableReference.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ComponentContext.java122
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/Constants.java23
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/Conversation.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ConversationEndedException.java56
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/NoRegisteredCallbackException.java57
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/RequestContext.java55
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceReference.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceRuntimeException.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceUnavailableException.java54
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/AllowsPassByReference.java28
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Authentication.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Callback.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ComponentName.java25
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Confidentiality.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Constructor.java25
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Context.java28
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ConversationAttributes.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ConversationID.java25
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Conversational.java27
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Destroy.java25
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/EagerInit.java25
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/EndsConversation.java24
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Init.java26
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Integrity.java58
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Intent.java48
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/OneWay.java25
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/PolicySets.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Property.java41
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Qualifier.java25
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Reference.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Remotable.java26
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Requires.java46
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Scope.java38
-rw-r--r--tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Service.java37
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/META-INF/MANIFEST.MF26
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/pom.xml65
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java144
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java230
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java225
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/DirectoryContributionScanner.java107
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/JarContributionScanner.java121
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor20
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.builder.ContributionBuilder18
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/workspace-validation-messages.properties22
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/workspace-validation-messages_it.properties21
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java100
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-xml/META-INF/MANIFEST.MF23
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-xml/pom.xml52
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceDocumentProcessor.java130
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceProcessor.java167
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-xml/src/main/resources/workspace-xml-validation-messages.properties22
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace-xml/src/test/java/org/apache/tuscany/sca/workspace/xml/ContributionWorkspaceProcessorTestCase.java95
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/META-INF/MANIFEST.MF28
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/DefaultWorkspaceFactory.java32
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/Workspace.java39
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/WorkspaceFactory.java36
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilder.java49
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilderException.java45
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilderExtensionPoint.java51
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/DefaultContributionBuilderExtensionPoint.java138
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceFactoryImpl.java40
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java147
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.WorkspaceFactory18
-rw-r--r--tags/java/sca/2.0-M1/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.builder.ContributionBuilderExtensionPoint18
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/META-INF/MANIFEST.MF37
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/pom.xml57
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelper.java184
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessor.java101
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java279
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor19
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver18
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/xsd-xml-validation-messages.properties23
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelperTestCase.java50
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessorTestCase.java89
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/src/test/resources/xsd/greeting.xsd29
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd-xml/src/test/resources/xsd/name.xsd29
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd/META-INF/MANIFEST.MF20
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd/pom.xml60
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/DefaultXSDFactory.java30
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDFactory.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java117
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDFactoryImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java232
-rw-r--r--tags/java/sca/2.0-M1/modules/xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.xsd.XSDFactory18
-rw-r--r--tags/java/sca/2.0-M1/pom.xml535
-rw-r--r--tags/java/sca/2.0-M1/samples/README232
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/README97
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/build.xml65
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/calculator.pngbin20552 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/calculator.svg329
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/pom.xml89
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/AddService.java31
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/AddServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorClientImpl.java66
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorService.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/DivideServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/MultiplyServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/SubtractServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/sample/SampleClient.java26
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/sample/SampleClientImpl.java42
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/resources/Calculator.composite59
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/test/java/calculator/CalculatorTestCase.java41
-rw-r--r--tags/java/sca/2.0-M1/samples/build-common.xml102
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/README97
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/build.xml78
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/calculator.pngbin20552 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/calculator.svg329
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/pom.xml91
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/AddService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/AddServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorClient.java62
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorService.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/DivideServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/MultiplyServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/SubtractServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/resources/Calculator.composite54
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-equinox/src/test/java/calculator/CalculatorTestCase.java65
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/META-INF/MANIFEST.MF19
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/README97
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/build.xml78
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/pom.xml109
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/AddService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java54
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java52
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorService.java34
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java69
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/resources/Calculator.composite54
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java55
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/README138
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/build.xml68
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/calculator-rmi-reference.pngbin23615 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/calculator-rmi-reference.svg412
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/pom.xml82
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java49
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java39
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java68
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/resources/CalculatorRMIReference.composite42
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java70
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIServiceImpl.java52
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/README147
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/build.xml74
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/calculator-rmi-service.pngbin20814 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/calculator-rmi-service.svg330
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/pom.xml67
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/AddService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorClient.java40
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java45
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java36
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java68
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java30
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/resources/CalculatorRMIServer.composite53
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java63
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/README97
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/build.xml63
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/calculator.pngbin20552 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/calculator.svg329
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/pom.xml78
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/AddService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/AddServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorClient.java48
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorService.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/DivideServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/MultiplyServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/SubtractServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/resources/Calculator.composite49
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--tags/java/sca/2.0-M1/samples/calculator/src/test/java/calculator/CalculatorTestCase.java66
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/README96
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/build.xml59
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/calculator.pngbin20552 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/calculator.svg329
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/pom.xml65
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/AddService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/AddServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorClient.java62
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorService.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/DivideService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/DivideServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/MultiplyService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/MultiplyServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/SubtractService.java28
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/SubtractServiceImpl.java35
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/resources/Calculator.composite54
-rw-r--r--tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/test/java/calculator/CalculatorTestCase.java73
-rw-r--r--tags/java/sca/2.0-M1/samples/logging.properties25
-rw-r--r--tags/java/sca/2.0-M1/samples/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/stest/pom.xml57
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/pom.xml105
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0001_Client.java69
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0002_Client.java80
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0003_Client.java81
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service1.java39
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service1Superset.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service2.java35
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestException.java39
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestInvocation.classbin395 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestInvocation.java42
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl.java38
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl2.java44
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl3.java49
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl4.java50
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl5.java44
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1SupersetImpl.java42
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service2Impl.java38
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient.wsdl102
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient_0002.composite47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient_0003.composite47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite1.composite40
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite10.composite47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite11.composite59
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite12.composite45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite13.composite46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite14.composite45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite15.composite43
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite16.composite48
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite17.composite46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite18.composite42
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite2.composite43
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite3.composite49
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite4.composite45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite5.composite41
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite6.composite48
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite7.composite48
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite8.composite48
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite9.composite41
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestDuplicate1.composite41
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestDuplicate2.composite41
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0001.composite33
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0002.composite48
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0003.composite64
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0004.composite62
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0005.composite49
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0006.composite47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0007.composite60
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0008.composite61
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0009.composite63
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0010.composite51
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0011.composite61
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0012.composite101
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0013.composite62
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0014.composite61
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0015.composite62
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0016.composite61
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0017.composite61
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0018.composite72
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0019.composite69
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0020.composite71
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0021.composite70
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0022.composite50
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0023.composite60
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0024.composite60
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0025.composite54
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0026.composite57
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0027.composite49
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0028.composite51
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0029.composite58
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0030.composite51
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0031.composite68
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0032.composite66
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0033.composite65
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0034.composite65
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0101.composite42
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6001.composite49
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6002.composite45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6003.composite50
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6004.composite47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_Types.xsd37
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0002_TestCase.java43
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0003_TestCase.java44
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0004_TestCase.java43
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0005_TestCase.java44
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0006_TestCase.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0007_TestCase.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0008_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0009_TestCase.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0010_TestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0011_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0012_TestCase.java48
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0013_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0014_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0015_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0016_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0017_TestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0018_TestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0019_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0020_TestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0021_TestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0022_TestCase.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0023_TestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0024_TestCase.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0025_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0026_TestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0027_TestCase.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0028_TestCase.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0029_TestCase.java44
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0030_TestCase.java44
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0031_TestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0032_TestCase.java47
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0033_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0034_TestCase.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6001_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6002_TestCase.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6003_TestCase.java45
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6004_TestCase.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java158
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/BaseTestCase.java121
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/TestConfiguration.java46
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/InvokeTest.java82
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/InvokeTestResponse.java82
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/ObjectFactory.java106
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/README.txt19
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestException.java77
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestException_Exception.java71
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestInvocation.java60
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestInvocationService.java83
-rw-r--r--tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/package-info.java20
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/core/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/core/META-INF/MANIFEST.MF6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/core/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/core/build.properties10
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/core/feature.xml61
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/core/pom.xml57
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/ejava/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/ejava/META-INF/MANIFEST.MF6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/ejava/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/ejava/build.properties10
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/ejava/feature.xml63
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/ejava/pom.xml57
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/manager/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/manager/META-INF/MANIFEST.MF6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/manager/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/manager/build.properties10
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/manager/feature.xml67
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/manager/pom.xml57
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/process/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/process/META-INF/MANIFEST.MF6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/process/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/process/build.properties10
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/process/feature.xml67
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/process/pom.xml57
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/web20/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/web20/META-INF/MANIFEST.MF6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/web20/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/web20/build.properties10
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/web20/feature.xml67
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/web20/pom.xml57
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/webservice/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/webservice/META-INF/MANIFEST.MF6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/webservice/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/webservice/build.properties10
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/webservice/feature.xml67
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/features/webservice/pom.xml57
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/META-INF/MANIFEST.MF32
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/NOTICE12
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/build.properties23
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/exsd/runtimeClasspathContainerInitializer.exsd106
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/icons/t.gifbin877 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/icons/tuscany.gifbin5603 -> 0 bytes
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseClasspathContainer.java253
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseClasspathContainerInitializer.java77
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseLibraryEntryPage.java74
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreClasspathContainer.java39
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreClasspathContainerInitializer.java38
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreLibraryEntryPage.java36
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainer.java40
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainerInitializer.java39
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainerInitializerExtensionPoint.java74
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/DomainManagerLauncherUtil.java255
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/NodeLauncherUtil.java244
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchConfigurationDelegate.java75
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchConfigurationTabGroup.java48
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchDomainManagerAction.java79
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchNodeFilter.java29
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchNodeShortcut.java88
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/log/LogUtil.java39
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewComponentTypeWizard.java53
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewComponentTypeWizardPage.java98
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewCompositeWizard.java53
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewCompositeWizardPage.java105
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/plugin.xml149
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/pom.xml145
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/src/main/assembly/jar.xml81
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-all.xsd34
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-ejb.xsd43
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-jms.xsd135
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-sca.xsd23
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-webservice.xsd26
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-contribution.xsd21
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-core.xsd350
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-definitions.xsd25
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-bpel.xsd43
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-composite.xsd23
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-cpp.xsd53
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd25
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-java.xsd24
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-spring.xsd24
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-cpp.xsd40
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-java.xsd23
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-wsdl.xsd23
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-policy.xsd76
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca.xsd22
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-atom.xsd41
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-dwr.xsd40
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-http.xsd40
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-jsonrpc.xsd40
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-notification.xsd42
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rmi.xsd40
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rss.xsd41
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-node.xsd43
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-notification.xsd42
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-osgi.xsd43
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-resource.xsd42
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-script.xsd43
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-widget.xsd42
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-xquery.xsd42
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca.xsd45
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/META-INF/MANIFEST.MF32
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/NOTICE12
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/build.properties23
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/org/apache/tuscany/sca/plugin/ejava/classpath/EJavaClasspathContainer.java39
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/org/apache/tuscany/sca/plugin/ejava/classpath/EJavaClasspathContainerInitializer.java38
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/plugin.xml30
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/pom.xml151
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/META-INF/MANIFEST.MF32
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/NOTICE12
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/build.properties23
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/org/apache/tuscany/sca/plugin/manager/classpath/ManagerClasspathContainer.java39
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/org/apache/tuscany/sca/plugin/manager/classpath/ManagerClasspathContainerInitializer.java38
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/plugin.xml30
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/pom.xml151
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/process/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/process/META-INF/MANIFEST.MF32
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/process/NOTICE12
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/process/build.properties23
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/process/org/apache/tuscany/sca/plugin/process/classpath/ProcessClasspathContainer.java39
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/process/org/apache/tuscany/sca/plugin/process/classpath/ProcessClasspathContainerInitializer.java38
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/process/plugin.xml30
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/process/pom.xml151
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/META-INF/MANIFEST.MF32
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/NOTICE12
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/build.properties23
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/org/apache/tuscany/sca/plugin/web20/classpath/Web20ClasspathContainer.java39
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/org/apache/tuscany/sca/plugin/web20/classpath/Web20ClasspathContainerInitializer.java38
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/plugin.xml30
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/pom.xml151
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/META-INF/MANIFEST.MF32
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/NOTICE12
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/build.properties23
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/org/apache/tuscany/sca/plugin/webservice/classpath/WebServiceClasspathContainer.java39
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/org/apache/tuscany/sca/plugin/webservice/classpath/WebServiceClasspathContainerInitializer.java38
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/plugin.xml30
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/pom.xml151
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/pom.xml75
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/NOTICE6
-rwxr-xr-xtags/java/sca/2.0-M1/tools/eclipse/site/updatesite/etc/generate-p2.sh29
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/pom.xml145
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/site.xml90
-rw-r--r--tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml58
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/pom.xml64
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/src/main/java/org/apache/tuscany/sca/tools/ant/generator/plugin/AntGeneratorMojo.java534
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/pom.xml81
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/AbstractIdeSupportMojo.java1136
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseClasspathWriter.java530
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseCleanMojo.java231
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipsePlugin.java1556
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseProjectWriter.java351
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/Messages.java68
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ArtifactAggregation.java73
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ArtifactMember.java61
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java387
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ModuleBundlesBuildMojo.java828
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java152
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/maven/plugin/eclipse/messages.properties78
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/tools/bundle/plugin/LICENSE.txt205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/tools/bundle/plugin/NOTICE.txt5
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/README46
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/pom.xml71
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/src/main/java/org/apache/tuscany/tools/sca/dependency/lister/plugin/DependencyListerMojo.java198
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/pom.xml304
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/ClassLoaderNameEnvironment.java195
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/CompilerRequestor.java114
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/FileCompilationUnit.java88
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/JavaCompiler.java212
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleResolver.java490
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleUtil.java618
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/resources/META-INF/plexus/components.xml28
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/pom.xml108
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/src/main/java/org/apache/tuscany/sca/tools/incremental/build/plugin/IncrementalBuildMojo.java415
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/plugin/Java2WSDLGeneratorMojo.java153
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/pom.xml70
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/ForkConfiguration.java239
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/OSGiSurefireBooter.java984
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/OSGiSurefirePlugin.java1306
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-web-junit/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-web-junit/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-web-junit/pom.xml52
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java181
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitMojo.java205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java152
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDLFileOption.java92
-rw-r--r--tags/java/sca/2.0-M1/tools/maven/pom.xml62
-rw-r--r--tags/java/sca/2.0-M1/tools/pom.xml63
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/pom.xml180
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java423
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java82
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java46
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java89
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java221
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java613
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2OMBuilder.java429
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java81
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java56
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java73
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java348
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java220
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java370
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java42
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java39
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java143
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/resources/META-INF/LICENSE.txt202
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java41
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java49
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/ExampleService.java31
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java114
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java53
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java29
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java33
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java24
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/AccountService.wsdl242
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl76
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/helloworld.wsdl121
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/interopdoc.wsdl180
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/sequences.xsd100
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/pom.xml55
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/LICENSE205
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/NOTICE6
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/pom.xml225
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java224
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java327
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java53
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java63
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java51
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java529
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/util/XMLNameUtil.java143
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/resources/META-INF/LICENSE.txt202
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl130
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java80
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/java/org/soapinterop/CreditScoreDocLit.java25
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/AccountService.wsdl242
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/AccountServiceWithFault.wsdl475
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/CreditScoreDocLit.wsdl76
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/helloworld.wsdl121
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/interopdoc.wsdl180
-rw-r--r--tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/sequences.xsd100
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/pom.xml49
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/AService.java31
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/BService.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/CService.java28
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/AServiceImpl.java49
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/BServiceImpl.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/CServiceImpl.java31
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/component.composite41
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/nonuniquename.composite33
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/serviceelement.composite42
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/servicewithbinding.composite33
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/servicewithinterface.composite32
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/zerocomponents.composite26
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/zeroimplelements.composite38
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java150
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/composite/pom.xml49
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/AService.java31
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/BService.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/CService.java28
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/AServiceImpl.java49
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/BServiceImpl.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/CServiceImpl.java31
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/resources/composite.composite41
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/composite/src/test/java/org/apache/tuscany/sca/vtest/assembly/composite/CompositeTestCase.java56
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/ctypefile/pom.xml49
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/AService.java30
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/BService.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java53
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.componentType30
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType28
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/typefile.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java111
-rw-r--r--tags/java/sca/2.0-M1/vtest/assembly/pom.xml70
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/AService.java30
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/B1Service.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/B2Service.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/AServiceImpl.java47
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/B1ServiceImpl.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/B2ServiceImpl.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/resources/conversation.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/ConversationAnnotationTestCase.java91
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/pom.xml53
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/AService.java30
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/B2Service.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/BService.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/CService.java30
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/AServiceImpl.java80
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/B2ServiceImpl.java42
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/BServiceImpl.java42
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/CServiceImpl.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/ACallbackHandler.java50
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/JaasLoginModule.java179
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/UserPrincipal.java66
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/AJass.config3
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/conversation.composite46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/definitions.xml34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/singleprincipal.composite38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/ConversationAttributesAnnotationTestCase.java93
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/SinglePricipalTestCase.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/AService.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr1Impl.java39
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr2Impl.java39
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr3Impl.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr4Impl.java39
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceImpl.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err1/AServiceErr1.composite28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err2/AServiceErr2.composite28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err3/AServiceErr3.composite28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err4/AServiceErr4.composite28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/proper/AService.composite28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/DestroyAnnotationTestCase.java159
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/AService.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/BService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/impl/AServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/impl/BServiceImpl.java59
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/resources/endsconversation.composite35
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/EndsConversationTestCase.java112
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/AService.java30
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr1Impl.java43
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr2Impl.java43
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr3Impl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr4Impl.java43
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceImpl.java53
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err1/AServiceErr1.composite28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err2/AServiceErr2.composite28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err3/AServiceErr3.composite28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err4/AServiceErr4.composite28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/proper/AService.composite33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/InitAnnotationTestCase.java167
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/AService.java31
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/BService.java28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/impl/AServiceImpl.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/impl/BServiceImpl.java43
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/resources/oneway.composite35
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/OneWayAnnotationTestCase.java78
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/pom.xml69
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AService.java82
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AnotherAService.java48
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AObject.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AServiceImpl.java240
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AnotherAServiceImpl.java116
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java87
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java87
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java87
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java88
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java88
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java88
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/resources/property.composite143
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/PropertyAnnotationTestCase.java299
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/AService.java55
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/BService.java31
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AServiceImpl.java215
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java141
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/BServiceImpl.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/resources/ab.composite51
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/ReferenceAnnotationTestCase.java229
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java43
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java43
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java36
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java48
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/JService.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/KService.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/LService.java41
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/MService.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/NService.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/OService.java41
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java112
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java114
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java116
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java116
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java75
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java86
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java131
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/JServiceImpl.java78
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/KServiceImpl.java80
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/LServiceImpl.java83
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/MServiceImpl.java81
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/NServiceImpl.java85
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/OServiceImpl.java83
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/resources/scope.composite110
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java476
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/AService.java34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/BService.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/CService.java31
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService1.java28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService2.java28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService3.java28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/EService.java30
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/FService.java30
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/GService1.java30
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/GService2.java26
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java50
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java54
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/AObject.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/AServiceImpl.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/BServiceImpl.java111
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/CServiceImpl.java34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/DServiceImpl.java41
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/EServiceImpl.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java26
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/GServiceImpl.java42
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java105
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java107
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/resources/service.composite82
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java335
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/AComponent.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BCallback.java26
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BComponent.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/AComponentImpl.java104
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/BComponentImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/resources/callablereference.composite34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java118
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java42
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java124
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java121
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java52
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite47
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java191
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/AComponent.java34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/BComponent.java39
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/AComponentImpl.java73
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/BComponentImpl.java78
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/resources/conversation.composite34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java26
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java30
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java128
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.java64
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java50
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/resources/exception.composite44
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java132
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/pom.xml64
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/AComponent.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BCallback.java27
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BComponent.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/AComponentImpl.java102
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/BComponentImpl.java61
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/resources/requestcontext.composite34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java109
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/pom.xml45
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/AComponent.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BCallback.java26
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BComponent.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/CComponent.java27
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/AComponentImpl.java119
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/BComponentImpl.java74
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/CComponentImpl.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/TestObject.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/resources/servicereference.composite39
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java106
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java30
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CService.java39
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/AServiceCallback.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/BService.java41
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/AServiceImpl.java67
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/BServiceImpl.java60
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/AServiceCallback.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/BService.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/CustomCallback.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/AServiceImpl.java61
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/BServiceImpl.java49
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/CustomCallbackImpl.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/AServiceCallback.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/BService.java41
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/AServiceImpl.java73
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/BServiceImpl.java60
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java61
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java73
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/CServiceImpl.java49
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java31
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BServiceCallback.java31
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/CService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/AServiceImpl.java61
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/BServiceImpl.java73
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/CServiceImpl.java49
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java73
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java49
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback2.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService.java39
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService2.java39
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/AServiceImpl.java79
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/BServiceImpl.java64
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/BServiceCallback.java31
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/CService.java39
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl.java73
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl2.java81
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl3.java74
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/CServiceImpl.java49
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-accessing.composite34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-custom.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-id.composite34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-multi.composite35
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackfieldnull.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite41
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java377
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/id/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/AService.java39
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/BService.java41
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CustomConversationId.java54
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/AServiceImpl.java69
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/BServiceImpl.java65
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/CServiceImpl.java56
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/resources/conversation-id.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/ConversationIDTestCase.java118
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/AService.java56
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/AServiceCallback.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/BService.java47
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/BServiceBusinessException.java53
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/CService.java34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/DService.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/AServiceImpl.java197
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/BServiceImpl.java64
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/CServiceImpl.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/DServiceImpl.java78
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/resources/lifetime.composite45
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/LifetimeTestCase.java216
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/pom.xml46
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/AService.java28
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/BService.java34
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/CService.java32
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/AServiceImpl.java47
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/BServiceImpl.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/CServiceImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/resources/parameters.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/ConversationParametersTestCase.java69
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/conversation/pom.xml63
-rw-r--r--tags/java/sca/2.0-M1/vtest/java-api/pom.xml70
-rw-r--r--tags/java/sca/2.0-M1/vtest/pom.xml56
-rw-r--r--tags/java/sca/2.0-M1/vtest/processcomments.rb198
-rw-r--r--tags/java/sca/2.0-M1/vtest/utilities/pom.xml48
-rw-r--r--tags/java/sca/2.0-M1/vtest/utilities/src/main/java/org/apache/tuscany/sca/vtest/utilities/ServiceFinder.java104
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/AService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/BService.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/CService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/DService.java45
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/AServiceImpl.java51
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/BServiceImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/CServiceImpl.java48
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/DServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/resources/nowsdl.composite61
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/NoWsdlDefaultBindingTestCase.java112
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/AService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/BService.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/CService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/DService.java45
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/AServiceImpl.java51
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/BServiceImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/CServiceImpl.java48
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/DServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite135
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/GeneratedWSDLTestCase.java162
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java213
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/pom.xml69
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BService.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP11.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP12.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/CService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/DService.java45
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/AServiceImpl.java51
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP11Impl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP12Impl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAPImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/CServiceImpl.java48
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/DServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/resources/nowsdlpromoted.composite246
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted1TestCase.java85
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted2TestCase.java118
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/AService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BService.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP11.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP12.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/CService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/DService.java45
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/AServiceImpl.java51
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP11Impl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP12Impl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAPImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/CServiceImpl.java48
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/DServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/resources/nowsdlsoapversion.composite205
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/GeneratedWSDLTestCase.java438
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlNoSoapVersionTestCase.java84
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlSoapVersionTestCase.java121
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/pom.xml68
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AClientService.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AService.java29
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AClientServiceImpl.java38
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AServiceImpl.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/aservice.wsdl139
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/endpoint-uri-resolution.composite103
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/endpointreference.composite40
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlbinding.composite45
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlendpoint.composite37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlport.composite43
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlservice.composite43
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointReferenceTestCase.java67
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointUriResolutionTestCase.java209
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlBindingTestCase.java68
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlEndpointTestCase.java66
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlPortTestCase.java66
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlServiceTestCase.java69
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/AService.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService2.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/CService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/DService.java45
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/AServiceImpl.java63
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BService2Impl.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BServiceImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/CServiceImpl.java48
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/DServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/bservice.wsdl228
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/cservice.wsdl173
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/wsdlelement.binding.composite114
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/WsdlElementBindingTestCase.java190
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/pom.xml68
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/AService.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService2.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/CService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/DService.java45
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/AServiceImpl.java62
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BService2Impl.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BServiceImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/CServiceImpl.java48
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/DServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/bservice.wsdl238
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/cservice.wsdl173
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/wsdlelement.port.composite115
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/WsdlElementPortTestCase.java188
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/pom.xml58
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/AService.java50
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService.java35
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService2.java33
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/CService.java37
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/DService.java45
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/AServiceImpl.java88
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BService2Impl.java40
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BServiceImpl.java44
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/CServiceImpl.java48
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/DServiceImpl.java70
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/bservice.wsdl225
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/cservice.wsdl173
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/wsdlelement.service.composite145
-rw-r--r--tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/WsdlElementServiceTestCase.java235
3137 files changed, 0 insertions, 278917 deletions
diff --git a/tags/java/sca/2.0-M1/BUILDING b/tags/java/sca/2.0-M1/BUILDING
deleted file mode 100644
index 00eaddbaff..0000000000
--- a/tags/java/sca/2.0-M1/BUILDING
+++ /dev/null
@@ -1,56 +0,0 @@
-Building the Apache Tuscany SCA 2.0-M1 February 2009 Release source distribution
-=======================================================================================
-
-Initial Setup
--------------
-
-1) Install J2SE 5.0 SDK, which can be downloaded from
- http://java.sun.com/j2se/1.5.0/download.jsp. Use version of 1.5.0_06 JDK or higher.
-
-2) Make sure that your JAVA_HOME environment variable is set to the newly installed
- JDK location, and that your PATH includes %JAVA_HOME%\bin (windows) or
- $JAVA_HOME$/bin (unix).
-
-3) Install Maven 2.0.7 or higher, which can be downloaded from
- http://maven.apache.org/download.html. Make sure that your PATH includes
- the MVN_HOME/bin directory.
-
-4) Make sure that your MAVEN_OPTS environment variable has -Xmx128M (or more),
- you can manually do this by executing the following in your prompt :
- Windows users:
- set MAVEN_OPTS=-Xmx128M
- Unix users:
- export MAVEN_OPTS=-Xmx128M
-
-
-Building
---------
-
-1) Change to the top level directory of Apache Tuscany source distribution.
-2) Run
-
- $> mvn -Psetup
- $> mvn
-
- This will compile Apache Tuscany and run all of the tests in the source
- distribution.
-
- Depending on the load of remote Maven 2.0 repositories, you may have
- to run "mvn" several times utill the required dependencies are
- all located in your local maven repository. It usually takes some time for
- maven to download required dependencies in the first build. Once all the
- dependencies have been downloaded you may use the -o option to run maven
- in offline mode, for example, 'mvn clean install -o'.
-
-
-Building the distributions
---------------------------
-
-1) Change to the distribution folder
-2) Run
-
- $> mvn
-
- This will build the binary and source distribution with .zip and .gz
- formats in the distribution/target directory.
-
diff --git a/tags/java/sca/2.0-M1/CHANGES b/tags/java/sca/2.0-M1/CHANGES
deleted file mode 100644
index d02a5289e5..0000000000
--- a/tags/java/sca/2.0-M1/CHANGES
+++ /dev/null
@@ -1,31 +0,0 @@
-Changes With Apache Tuscany SCA 2.0-M1 February 2009
-====================================================
-
- The first milestone release for the 2.0 codebase
-
- Features and/or Enhancements
-
- * SCA Specification support
- - The change over from OSOA SCA specification support to OASIS SCA
- specification support is now in progress. As such we don't claim to
- support either the OSOA or OASIS SCA specifications in the
- 2.0 codebase yet.
-
- * Core
- - Enable Tuscany to run inside an OSGi runtime
- - Updated SCA API package names.
-
- * Other Extensions
- - Binding RMI
- - RMI Binding
- - Binding WS
- - WebServices Binding
-
- * Samples/Tutorial/Demos
- - binding-ws-calculator/
- - calculator/
- - calculator-equinox/
- - calculator-osgi/
- - calculator-rmi-reference/
- - calculator-rmi-service/
- - implementation-java-calculator
diff --git a/tags/java/sca/2.0-M1/LICENSE b/tags/java/sca/2.0-M1/LICENSE
deleted file mode 100644
index 144d8ae692..0000000000
--- a/tags/java/sca/2.0-M1/LICENSE
+++ /dev/null
@@ -1,397 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-===============================================================================================================
-
-Apache Tuscany SCA for Java Subcomponents
-=========================================:
-
-The Tuscany SCA for Java release includes a number of subcomponents with
-separate copyright notices and license terms. Your use of the source
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses.
-
-===============================================================================================================
-
-The module itest/databindings/common includes the test schema; datagraph.xsd, sdoJava.xsd, and sdoModel.xsd
-under the following license:
-
-License for the Service Data Objects JavaDoc, Interface Definition files
-and XSD files.
-
-The Service Data Objects JavaDoc, Interface Definition files and XSD files
-are being provided by the copyright holders under the following license.
-By using and/or copying this work, you agree that you have read,
-understood and will comply with the following terms and conditions:
-
-Permission to copy, display, make derivative works of and distribute
-the Service Data Objects JavaDoc, Interface Definition files and XSD files
-(the "Artifacts") in any medium without fee or royalty is hereby granted,
-provided that you include the following on ALL copies of the Artifacts,
-or portions thereof, that you make:
-
-1. A link or URL to the Artifacts at this location:
-http://www.osoa.org/display/Main/Service+Data+Objects+Specifications
-
-2. The full text of this copyright notice as shown in the Artifacts.
-
-
-
-THE ARTIFACTS ARE PROVIDED "AS IS" AND THE AUTHORS MAKE NO
-REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THE
-ARTIFACTS AND THE IMPLEMENTATION OF THEIR CONTENTS,
-INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT OR TITLE.
-
-THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
-INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
-USE OR DISTRIBUTION OF THE ARTIFACTS.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to the Service Data
-Objects Specification or its contents without specific, written prior
-permission. Title to copyright in the Service Data Objects
-Specification will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-Revision level 1.11, last updated on 2007/12/21
-
-=================================================================================================================
-
-The module implementation-script temporarily includes one file under the following BSD license:
-
- Copyright (c) 2006, Sun Microsystems, Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- - Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- - Neither the name of the Sun Microsystems, Inc. nor the names of
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGE.
-
-=================================================================================================================
-
-The module assembly-xsd includes XSD files under the following SCA Collaboration license:
-
-License for the Service Component Architecture JavaDoc, Interface
-Definition files and XSD files.
-
-The Service Component Architecture JavaDoc, Interface Definition files,
-and XSD files are being provided by the copyright holders under the
-following license. By using and/or copying this work, you agree that
-you have read, understood and will comply with the following terms and
-conditions:
-
-Permission to copy, display, make derivative works of, and distribute
-the Service Component Architecture JavaDoc, Interface Definition Files
-and XSD files (the "Artifacts") in any medium without fee or royalty is
-hereby granted, provided that you include the following on ALL copies
-of the Artifacts, or portions thereof, that you make:
-
-1. A link or URL to the Artifacts at this location:
-http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
-
-2. The full text of this copyright notice as shown in the Artifacts.
-
-THE ARTIFACTS ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO
-REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THE
-ARTIFACTS AND THE IMPLEMENTATION OF THEIR CONTENTS, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE, NON-INFRINGEMENT OR TITLE.
-
-THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
-INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
-USE OR DISTRIBUTION OF THE ARTIFACTS.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to the Service Component
-Architecture Specification or its contents without specific, written
-prior permission. Title to copyright in the Service Component
-Architecture Specification and the JavaDoc, Interface Definition Files
-and XSD Files will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-Revision level 1.1, last updated on 2007/11/19
-
-=================================================================================================================
-The modules
-
-binding-ws-xml
-databinding
-databinding-axiom
-databinding-jaxb
-databinding-json
-databinding-sdo
-databinding-sdo-axiom
-databinding-xmlbeans
-interface-wsdl-xml
-
-Include the ipo.xsd and address.xsd information from the XML Schema Primer
-(http://www.w3.org/TR/2004/PER-xmlschema-0-20040318/) combined into the
-file ipo.xsd and extended with UK postcode structures.
-
-The ipo.xsd file is include under the following license:
-
-W3C(c) SOFTWARE NOTICE AND LICENSE
-http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-
-This work (and included software, documentation such as READMEs, or other
-related items) is being provided by the copyright holders under the following
-license. By obtaining, using and/or copying this work, you (the licensee) agree
-that you have read, understood, and will comply with the following terms and conditions.
-
-Permission to copy, modify, and distribute this software and its documentation,
-with or without modification, for any purpose and without fee or royalty is
-hereby granted, provided that you include the following on ALL copies of the
-software and documentation or portions thereof, including modifications:
-
- 1. The full text of this NOTICE in a location viewable to users of the
- redistributed or derivative work.
- 2. Any pre-existing intellectual property disclaimers, notices, or terms
- and conditions. If none exist, the W3C Software Short Notice should be
- included (hypertext is preferred, text is permitted) within the body of
- any redistributed or derivative code.
- 3. Notice of any changes or modifications to the files, including the date
- changes were made. (We recommend you provide URIs to the location from which
- the code is derived.)
-
-THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
-NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,
-WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE
-USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,
-COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
-
-The name and trademarks of copyright holders may NOT be used in advertising or
-publicity pertaining to the software without specific, written prior permission.
-Title to copyright in this software and any associated documentation will at all
-times remain with copyright holders.
diff --git a/tags/java/sca/2.0-M1/NOTICE b/tags/java/sca/2.0-M1/NOTICE
deleted file mode 100644
index f3d8ddc5b8..0000000000
--- a/tags/java/sca/2.0-M1/NOTICE
+++ /dev/null
@@ -1,35 +0,0 @@
-Apache Tuscany
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software under the BSD license
-(see the LICENSE file contained in this distribution), with
-the following copyright:
- Copyright (c) 2006, Sun Microsystems, Inc. All rights reserved.
-
-This product includes software under the Service Component Architecture JavaDoc,
-Interface Definition files and XSD files license.
- (c) Copyright SCA Collaboration 2006, 2007
-
-This product includes software under the Service Data Objects JavaDoc and
-Interface Definition file license
-
-(c) Copyright BEA Systems, Inc., International Business Machines Corporation,
-Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
-Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
-2005, 2006. All rights reserved.
-
-This product includes software under the W3C(c) Software License
-with the following copyright:
-
-Copyright (c) 2008 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(c) 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
-
-
diff --git a/tags/java/sca/2.0-M1/README b/tags/java/sca/2.0-M1/README
deleted file mode 100644
index e0869c7d27..0000000000
--- a/tags/java/sca/2.0-M1/README
+++ /dev/null
@@ -1,19 +0,0 @@
-Apache Tuscany SCA 2.0-M1 February 2009 README
-=====================================================
-
-Welcome to the Tuscany SCA 2.0-M1 release.
-
-See the RELEASE_NOTES file for information specific to this release.
-
-In the binary release see the INSTALL file for information on how to
-install the release.
-
-In the source distribution see the BUILDING file for information on
-building the source code.
-
-
-
-
-
-
-
diff --git a/tags/java/sca/2.0-M1/RELEASE_NOTES b/tags/java/sca/2.0-M1/RELEASE_NOTES
deleted file mode 100644
index 4aa75e33fa..0000000000
--- a/tags/java/sca/2.0-M1/RELEASE_NOTES
+++ /dev/null
@@ -1,71 +0,0 @@
-Apache Tuscany SCA 2.0-M1 February 2009 Release Notes
-============================================================
-
-Apache Tuscany provides a runtime based on the Service Component
-Architecture. SCA is a set of specifications aimed at simplifying SOA
-Application Development which are being standardized at OASIS as part
-of Open Composite Services Architecture (Open CSA) - http://www.oasis-opencsa.org/.
-
-Overview
---------
-
- The Apache Tuscany SCA 2.0-M1 release includes implementations of the
- main SCA specifications and recent updates from Open CSA drafts including:
-
- SCA Assembly Model V1.0
- SCA Policy Framework V1.0
- SCA Java Common Annotations and APIs V1.0
- SCA Java Component Implementation V1.0
- SCA Web Services Binding V1.0
-
- It also includes implementations of many features not yet defined
- by SCA specifications, including:
-
- - SCA bindings for RMI.
- - Databindings for JAXB, Axis2's AXIOM, DOM, SAX and StAX
-
- The Tuscany SCA Runtime can be configured as a single node SCA domain or
- as an SCA domain distributed across multiple nodes.
- In addition Tuscany SCA supports the following host-deployment options: -
- - running standalone
- - running in a OSGi enabled runtime Environment (Equinox)
- - running with distributed nodes across multiple JVMs
-
-
-
-See the CHANGES file for a detailed list of the features in this release.
-
-Support
--------
-
-For more information on Apache Tuscany visit the website at:
-
- http://tuscany.apache.org/tuscany/
-
-Any issues with this release can be reported to Apache Tuscany
-using the mailing lists or in the JIRA issue tracker.
-
- Mailing list archives:
-
- http://mail-archives.apache.org/mod_mbox/tuscany-user/
- http://mail-archives.apache.org/mod_mbox/tuscany-dev/
-
- Jira:
-
- http://issues.apache.org/jira/browse/TUSCANY
-
-To join the project's mailing lists follow the instructions at:
-
- http://incubator.apache.org/tuscany/mailing-lists.html
-
-To find out more about OASIS Open CSA go to:
-
- http://www.oasis-opencsa.org.
-
-Apache Tuscany welcomes your help. Any contribution, including code,
-testing, improving the documentation, or bug reporting is always
-appreciated.
-
-Thank you for using Apache Tuscany!
-
-- The Tuscany Team.
diff --git a/tags/java/sca/2.0-M1/distribution/all/pom.xml b/tags/java/sca/2.0-M1/distribution/all/pom.xml
deleted file mode 100644
index 4f77eb3641..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/pom.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-bundle-plugin</artifactId>
- <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>
- </configuration>
- </execution>
- </executions>
- </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-2.0-M1</finalName>
- <appendAssemblyId>true</appendAssemblyId>
- <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/assembly/bin.xml b/tags/java/sca/2.0-M1/distribution/all/src/main/assembly/bin.xml
deleted file mode 100644
index 0b5effe0bb..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/assembly/bin.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-2.0-M1</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/tags/java/sca/2.0-M1/distribution/all/src/main/assembly/src.xml b/tags/java/sca/2.0-M1/distribution/all/src/main/assembly/src.xml
deleted file mode 100644
index 5f41db62a4..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/assembly/src.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-2.0-M1-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>**/binding-dwr-runtime</exclude>
- <exclude>**/binding-dwr-runtime/**/*</exclude>
- <exclude>**/maven-eclipse.xml</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-
-</assembly>
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-common.xml b/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-common.xml
deleted file mode 100644
index 983b6addff..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-common.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-launcher.xml b/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-launcher.xml
deleted file mode 100644
index ae7aba79ca..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-launcher.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-modules.xml b/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-modules.xml
deleted file mode 100644
index 69ec47740a..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-modules.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<component>
- <fileSets>
-
- <fileSet>
- <directory>target</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>modules/**/*</include>
- <include>features/**/*</include>
- </includes>
- </fileSet>
-
- </fileSets>
-
-</component>
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-samples.xml b/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-samples.xml
deleted file mode 100644
index ccde704f5d..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/components/bin-samples.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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>
- </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/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>
- </excludes>
- </fileSet>
- </fileSets>
-</component>
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/INSTALL b/tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/INSTALL
deleted file mode 100644
index 99e7fab608..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/INSTALL
+++ /dev/null
@@ -1,24 +0,0 @@
-Installing the Apache Tuscany SCA 2.0-M1 February 2009 Release binary distribution
-=========================================================================================
-
-Unzip Tuscany binary distribution archive and you get the following:
-
-tuscany-sca-2.0-M1
- CHANGES - A note of the major changes in this release
- INSTALL - this help file
- LICENSE - the Apache License and any dependecy licenses
- NOTICE - attribution notices associated with the licenses
- README - readme for the release
- RELEASE_NOTES - description of this release
-
- /bin - Tuscany launcher (for use when running tuscany from the command line)
-
- /features - OSGi runtime configuration, Tuscany manifest and PDE target
-
- /modules - all of the individual Tuscany jars and their dependencies
-
- /samples - all the Tuscany samples, see the README in that directory
-
-
-
-
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/LICENSE b/tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/LICENSE
deleted file mode 100644
index e28fab9a1e..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/LICENSE
+++ /dev/null
@@ -1,1256 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-===============================================================================
-
-APACHE TUSCANY SUBCOMPONENTS:
-
-The Apache Tuscany binary distribution includes a number of subcomponents
-with separate copyright notices and license terms. Your use of the
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses.
-
-===============================================================================
-
-The following components come under Apache Software License 1.1
-
- commons-discovery-0.2.jar
-
-The following components come under Apache Software License 2.0
-
- app-1.0.0-v20070606.jar
- addressing-1.3.mar
- annogen-0.1.0.jar
- axiom-api-1.2.7.jar
- axiom-dom-1.2.7.jar
- axiom-impl-1.2.7.jar
- axis2-adb-1.4.1.jar
- axis2-codegen-1.4.1.jar
- axis2-kernel-1.4.1.jar
- axis2-java2wsdl-1.4.1.jar
- axis2-mtompolicy-1.4.1.jar
- axis-ant-1.4.jar
- cglib-2.2.jar
- commons-cli-1.1.jar
- commons-collections-3.1.jar
- commons-codec-1.2.jar
- commons-fileupload-1.2.jar
- commons-httpclient-3.1.jar
- commons-io-1.4.jar
- commons-logging-1.1.1.jar
- geronimo-activation_1.1_spec-1.0.1.jar
- geronimo-javamail_1.4_spec-1.2.jar
- geronimo-jms_1.1_spec-1.1.jar
- geronimo-stax-api_1.0_spec-1.0.1.jar
- httpcore-4.0-beta1.jar
- httpcore-nio-4.0-beta1.jar
- jetty-6.1.7.jar
- jetty-util-6.1.7.jar
- log4j-1.2.15.jar
- mex-1.41-impl.jar
- neethi-2.0.4.jar
- rampart-core-1.4.jar
- rampart-policy-1.4.jar
- rampart-trust-1.4.jar
- woden-api-1.0M8.jar
- woden-impl-dom-1.0M8.jar
- wss4j-1.5.4.jar
- wstx-asl-3.2.4.jar
- xalan-2.7.0.jar
- xercesImpl-2.8.1.jar
- xml-apis-1.3.03.jar
- xmlParserAPIs-2.6.0.jar
- xmlsec-1.4.2.jar
- XmlSchema-1.4.2.jar
-
-===============================================================================
-dom4j-1.6.1.jar
-
-Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
-
-Redistribution and use of this software and associated documentation
-("Software"), with or without modification, are permitted provided
-that the following conditions are met:
-
-1. Redistributions of source code must retain copyright
- statements and notices. Redistributions must also contain a
- copy of this document.
-
-2. Redistributions in binary form must reproduce the
- above copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-3. The name "DOM4J" must not be used to endorse or promote
- products derived from this Software without prior written
- permission of MetaStuff, Ltd. For written permission,
- please contact dom4j-info@metastuff.com.
-
-4. Products derived from this Software may not be called "DOM4J"
- nor may "DOM4J" appear in their names without prior written
- permission of MetaStuff, Ltd. DOM4J is a registered
- trademark of MetaStuff, Ltd.
-
-5. Due credit should be given to the DOM4J Project -
- http://www.dom4j.org
-
-THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
-NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
-METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
-===============================================================================
-The Equinox OSGi Runtime jars;
- common-3.3.0-v20070426.jar
- contenttype-3.2.100-v20070319.jar
- jobs-3.3.0-v20070423.jar
- osgi-3.3.0-v20070530.jar
- preferences-3.2.100-v20070522.jar
- registry-3.3.0-v20070522.jar
- runtime-3.3.100-v20070530.jar
-
-Eclipse Public License - v 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
-PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
-THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and
-documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-
-i) changes to the Program, and
-
-ii) additions to the Program;
-
-where such changes and/or additions to the Program originate from and
-are distributed by that particular Contributor. A Contribution
-'originates' from a Contributor if it was added to the Program by such
-Contributor itself or anyone acting on such Contributor's behalf.
-Contributions do not include additions to the Program which: (i) are
-separate modules of software distributed in conjunction with the
-Program under their own license agreement, and (ii) are not derivative
-works of the Program.
-
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents " mean patent claims licensable by a Contributor
-which are necessarily infringed by the use or sale of its Contribution
-alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this
-Agreement.
-
-"Recipient" means anyone who receives the Program under this
-Agreement, including all Contributors.
-
-2. GRANT OF RIGHTS
-
-a) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free copyright
-license to reproduce, prepare derivative works of, publicly display,
-publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and
-object code form.
-
-b) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free patent
-license under Licensed Patents to make, use, sell, offer to sell,
-import and otherwise transfer the Contribution of such Contributor, if
-any, in source code and object code form. This patent license shall
-apply to the combination of the Contribution and the Program if, at
-the time the Contribution is added by the Contributor, such addition
-of the Contribution causes such combination to be covered by the
-Licensed Patents. The patent license shall not apply to any other
-combinations which include the Contribution. No hardware per se is
-licensed hereunder.
-
-c) Recipient understands that although each Contributor grants the
-licenses to its Contributions set forth herein, no assurances are
-provided by any Contributor that the Program does not infringe the
-patent or other intellectual property rights of any other entity. Each
-Contributor disclaims any liability to Recipient for claims brought by
-any other entity based on infringement of intellectual property rights
-or otherwise. As a condition to exercising the rights and licenses
-granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For
-example, if a third party patent license is required to allow
-Recipient to distribute the Program, it is Recipient's responsibility
-to acquire that license before distributing the Program.
-
-d) Each Contributor represents that to its knowledge it has sufficient
-copyright rights in its Contribution, if any, to grant the copyright
-license set forth in this Agreement.
-
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form
-under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-
-b) its license agreement:
-
-i) effectively disclaims on behalf of all Contributors all warranties
-and conditions, express and implied, including warranties or
-conditions of title and non-infringement, and implied warranties or
-conditions of merchantability and fitness for a particular purpose;
-
-ii) effectively excludes on behalf of all Contributors all liability
-for damages, including direct, indirect, special, incidental and
-consequential damages, such as lost profits;
-
-iii) states that any provisions which differ from this Agreement are
-offered by that Contributor alone and not by any other party; and
-
-iv) states that source code for the Program is available from such
-Contributor, and informs licensees how to obtain it in a reasonable
-manner on or through a medium customarily used for software exchange.
-
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-
-b) a copy of this Agreement must be included with each copy of the
-Program.
-
-Contributors may not remove or alter any copyright notices contained
-within the Program.
-
-Each Contributor must identify itself as the originator of its
-Contribution, if any, in a manner that reasonably allows subsequent
-Recipients to identify the originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain
-responsibilities with respect to end users, business partners and the
-like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a
-commercial product offering should do so in a manner which does not
-create potential liability for other Contributors. Therefore, if a
-Contributor includes the Program in a commercial product offering,
-such Contributor ("Commercial Contributor") hereby agrees to defend
-and indemnify every other Contributor ("Indemnified Contributor")
-against any losses, damages and costs (collectively "Losses") arising
-from claims, lawsuits and other legal actions brought by a third party
-against the Indemnified Contributor to the extent caused by the acts
-or omissions of such Commercial Contributor in connection with its
-distribution of the Program in a commercial product offering. The
-obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement.
-In order to qualify, an Indemnified Contributor must: a) promptly
-notify the Commercial Contributor in writing of such claim, and b)
-allow the Commercial Contributor to control, and cooperate with the
-Commercial Contributor in, the defense and any related settlement
-negotiations. The Indemnified Contributor may participate in any such
-claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial
-product offering, Product X. That Contributor is then a Commercial
-Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance
-claims and warranties are such Commercial Contributor's responsibility
-alone. Under this section, the Commercial Contributor would have to
-defend claims against the other Contributors related to those
-performance claims and warranties, and if a court requires any other
-Contributor to pay any damages as a result, the Commercial Contributor
-must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
-PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
-WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
-OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and
-distributing the Program and assumes all risks associated with its
-exercise of rights under this Agreement , including but not limited to
-the risks and costs of program errors, compliance with applicable
-laws, damage to or loss of data, programs or equipment, and
-unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
-ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
-WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
-DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under
-applicable law, it shall not affect the validity or enforceability of
-the remainder of the terms of this Agreement, and without further
-action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-the Program itself (excluding combinations of the Program with other
-software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of
-the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it
-fails to comply with any of the material terms or conditions of this
-Agreement and does not cure such failure in a reasonable period of
-time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use
-and distribution of the Program as soon as reasonably practicable.
-However, Recipient's obligations under this Agreement and any licenses
-granted by Recipient relating to the Program shall continue and
-survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement,
-but in order to avoid inconsistency the Agreement is copyrighted and
-may only be modified in the following manner. The Agreement Steward
-reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement
-Steward has the right to modify this Agreement. The Eclipse Foundation
-is the initial Agreement Steward. The Eclipse Foundation may assign
-the responsibility to serve as the Agreement Steward to a suitable
-separate entity. Each new version of the Agreement will be given a
-distinguishing version number. The Program (including Contributions)
-may always be distributed subject to the version of the Agreement
-under which it was received. In addition, after a new version of the
-Agreement is published, Contributor may elect to distribute the
-Program (including its Contributions) under the new version. Except as
-expressly stated in Sections 2(a) and 2(b) above, Recipient receives
-no rights or licenses to the intellectual property of any Contributor
-under this Agreement, whether expressly, by implication, estoppel or
-otherwise. All rights in the Program not expressly granted under this
-Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and
-the intellectual property laws of the United States of America. No
-party to this Agreement will bring a legal action under this Agreement
-more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.
-
-===============================================================================
-
-The jars;
-activation-1.1.jar,
-jaxb-api-2.1.jar,
-jaxb-impl-2.1.9.jar,
-jaxws-api-2.1.jar,
-jsr181-api-1.0-MR1.jar,
-jsr250-api-1.0.jar,
-mail-1.4.jar,
-servlet-api-2.5.jar,
-
-COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
-
-
- 1. Definitions.
-
- 1.1. "Contributor" means each individual or entity that
- creates or contributes to the creation of Modifications.
-
- 1.2. "Contributor Version" means the combination of the
- Original Software, prior Modifications used by a
- Contributor (if any), and the Modifications made by that
- particular Contributor.
-
- 1.3. "Covered Software" means (a) the Original Software, or
- (b) Modifications, or (c) the combination of files
- containing Original Software with files containing
- Modifications, in each case including portions thereof.
-
- 1.4. "Executable" means the Covered Software in any form
- other than Source Code.
-
- 1.5. "Initial Developer" means the individual or entity
- that first makes Original Software available under this
- License.
-
- 1.6. "Larger Work" means a work which combines Covered
- Software or portions thereof with code not governed by the
- terms of this License.
-
- 1.7. "License" means this document.
-
- 1.8. "Licensable" means having the right to grant, to the
- maximum extent possible, whether at the time of the initial
- grant or subsequently acquired, any and all of the rights
- conveyed herein.
-
- 1.9. "Modifications" means the Source Code and Executable
- form of any of the following:
-
- A. Any file that results from an addition to,
- deletion from or modification of the contents of a
- file containing Original Software or previous
- Modifications;
-
- B. Any new file that contains any part of the
- Original Software or previous Modification; or
-
- C. Any new file that is contributed or otherwise made
- available under the terms of this License.
-
- 1.10. "Original Software" means the Source Code and
- Executable form of computer software code that is
- originally released under this License.
-
- 1.11. "Patent Claims" means any patent claim(s), now owned
- or hereafter acquired, including without limitation,
- method, process, and apparatus claims, in any patent
- Licensable by grantor.
-
- 1.12. "Source Code" means (a) the common form of computer
- software code in which modifications are made and (b)
- associated documentation included in or with such code.
-
- 1.13. "You" (or "Your") means an individual or a legal
- entity exercising rights under, and complying with all of
- the terms of, this License. For legal entities, "You"
- includes any entity which controls, is controlled by, or is
- under common control with You. For purposes of this
- definition, "control" means (a) the power, direct or
- indirect, to cause the direction or management of such
- entity, whether by contract or otherwise, or (b) ownership
- of more than fifty percent (50%) of the outstanding shares
- or beneficial ownership of such entity.
-
- 2. License Grants.
-
- 2.1. The Initial Developer Grant.
-
- Conditioned upon Your compliance with Section 3.1 below and
- subject to third party intellectual property claims, the
- Initial Developer hereby grants You a world-wide,
- royalty-free, non-exclusive license:
-
- (a) under intellectual property rights (other than
- patent or trademark) Licensable by Initial Developer,
- to use, reproduce, modify, display, perform,
- sublicense and distribute the Original Software (or
- portions thereof), with or without Modifications,
- and/or as part of a Larger Work; and
-
- (b) under Patent Claims infringed by the making,
- using or selling of Original Software, to make, have
- made, use, practice, sell, and offer for sale, and/or
- otherwise dispose of the Original Software (or
- portions thereof).
-
- (c) The licenses granted in Sections 2.1(a) and (b)
- are effective on the date Initial Developer first
- distributes or otherwise makes the Original Software
- available to a third party under the terms of this
- License.
-
- (d) Notwithstanding Section 2.1(b) above, no patent
- license is granted: (1) for code that You delete from
- the Original Software, or (2) for infringements
- caused by: (i) the modification of the Original
- Software, or (ii) the combination of the Original
- Software with other software or devices.
-
- 2.2. Contributor Grant.
-
- Conditioned upon Your compliance with Section 3.1 below and
- subject to third party intellectual property claims, each
- Contributor hereby grants You a world-wide, royalty-free,
- non-exclusive license:
-
- (a) under intellectual property rights (other than
- patent or trademark) Licensable by Contributor to
- use, reproduce, modify, display, perform, sublicense
- and distribute the Modifications created by such
- Contributor (or portions thereof), either on an
- unmodified basis, with other Modifications, as
- Covered Software and/or as part of a Larger Work; and
-
-
- (b) under Patent Claims infringed by the making,
- using, or selling of Modifications made by that
- Contributor either alone and/or in combination with
- its Contributor Version (or portions of such
- combination), to make, use, sell, offer for sale,
- have made, and/or otherwise dispose of: (1)
- Modifications made by that Contributor (or portions
- thereof); and (2) the combination of Modifications
- made by that Contributor with its Contributor Version
- (or portions of such combination).
-
- (c) The licenses granted in Sections 2.2(a) and
- 2.2(b) are effective on the date Contributor first
- distributes or otherwise makes the Modifications
- available to a third party.
-
- (d) Notwithstanding Section 2.2(b) above, no patent
- license is granted: (1) for any code that Contributor
- has deleted from the Contributor Version; (2) for
- infringements caused by: (i) third party
- modifications of Contributor Version, or (ii) the
- combination of Modifications made by that Contributor
- with other software (except as part of the
- Contributor Version) or other devices; or (3) under
- Patent Claims infringed by Covered Software in the
- absence of Modifications made by that Contributor.
-
- 3. Distribution Obligations.
-
- 3.1. Availability of Source Code.
-
- Any Covered Software that You distribute or otherwise make
- available in Executable form must also be made available in
- Source Code form and that Source Code form must be
- distributed only under the terms of this License. You must
- include a copy of this License with every copy of the
- Source Code form of the Covered Software You distribute or
- otherwise make available. You must inform recipients of any
- such Covered Software in Executable form as to how they can
- obtain such Covered Software in Source Code form in a
- reasonable manner on or through a medium customarily used
- for software exchange.
-
- 3.2. Modifications.
-
- The Modifications that You create or to which You
- contribute are governed by the terms of this License. You
- represent that You believe Your Modifications are Your
- original creation(s) and/or You have sufficient rights to
- grant the rights conveyed by this License.
-
- 3.3. Required Notices.
-
- You must include a notice in each of Your Modifications
- that identifies You as the Contributor of the Modification.
- You may not remove or alter any copyright, patent or
- trademark notices contained within the Covered Software, or
- any notices of licensing or any descriptive text giving
- attribution to any Contributor or the Initial Developer.
-
- 3.4. Application of Additional Terms.
-
- You may not offer or impose any terms on any Covered
- Software in Source Code form that alters or restricts the
- applicable version of this License or the recipients'
- rights hereunder. You may choose to offer, and to charge a
- fee for, warranty, support, indemnity or liability
- obligations to one or more recipients of Covered Software.
- However, you may do so only on Your own behalf, and not on
- behalf of the Initial Developer or any Contributor. You
- must make it absolutely clear that any such warranty,
- support, indemnity or liability obligation is offered by
- You alone, and You hereby agree to indemnify the Initial
- Developer and every Contributor for any liability incurred
- by the Initial Developer or such Contributor as a result of
- warranty, support, indemnity or liability terms You offer.
-
-
- 3.5. Distribution of Executable Versions.
-
- You may distribute the Executable form of the Covered
- Software under the terms of this License or under the terms
- of a license of Your choice, which may contain terms
- different from this License, provided that You are in
- compliance with the terms of this License and that the
- license for the Executable form does not attempt to limit
- or alter the recipient's rights in the Source Code form
- from the rights set forth in this License. If You
- distribute the Covered Software in Executable form under a
- different license, You must make it absolutely clear that
- any terms which differ from this License are offered by You
- alone, not by the Initial Developer or Contributor. You
- hereby agree to indemnify the Initial Developer and every
- Contributor for any liability incurred by the Initial
- Developer or such Contributor as a result of any such terms
- You offer.
-
- 3.6. Larger Works.
-
- You may create a Larger Work by combining Covered Software
- with other code not governed by the terms of this License
- and distribute the Larger Work as a single product. In such
- a case, You must make sure the requirements of this License
- are fulfilled for the Covered Software.
-
- 4. Versions of the License.
-
- 4.1. New Versions.
-
- Sun Microsystems, Inc. is the initial license steward and
- may publish revised and/or new versions of this License
- from time to time. Each version will be given a
- distinguishing version number. Except as provided in
- Section 4.3, no one other than the license steward has the
- right to modify this License.
-
- 4.2. Effect of New Versions.
-
- You may always continue to use, distribute or otherwise
- make the Covered Software available under the terms of the
- version of the License under which You originally received
- the Covered Software. If the Initial Developer includes a
- notice in the Original Software prohibiting it from being
- distributed or otherwise made available under any
- subsequent version of the License, You must distribute and
- make the Covered Software available under the terms of the
- version of the License under which You originally received
- the Covered Software. Otherwise, You may also choose to
- use, distribute or otherwise make the Covered Software
- available under the terms of any subsequent version of the
- License published by the license steward.
-
- 4.3. Modified Versions.
-
- When You are an Initial Developer and You want to create a
- new license for Your Original Software, You may create and
- use a modified version of this License if You: (a) rename
- the license and remove any references to the name of the
- license steward (except to note that the license differs
- from this License); and (b) otherwise make it clear that
- the license contains terms which differ from this License.
-
-
- 5. DISCLAIMER OF WARRANTY.
-
- COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS"
- BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
- INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED
- SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR
- PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND
- PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY
- COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE
- INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF
- ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
- WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
- ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
- DISCLAIMER.
-
- 6. TERMINATION.
-
- 6.1. This License and the rights granted hereunder will
- terminate automatically if You fail to comply with terms
- herein and fail to cure such breach within 30 days of
- becoming aware of the breach. Provisions which, by their
- nature, must remain in effect beyond the termination of
- this License shall survive.
-
- 6.2. If You assert a patent infringement claim (excluding
- declaratory judgment actions) against Initial Developer or
- a Contributor (the Initial Developer or Contributor against
- whom You assert such claim is referred to as "Participant")
- alleging that the Participant Software (meaning the
- Contributor Version where the Participant is a Contributor
- or the Original Software where the Participant is the
- Initial Developer) directly or indirectly infringes any
- patent, then any and all rights granted directly or
- indirectly to You by such Participant, the Initial
- Developer (if the Initial Developer is not the Participant)
- and all Contributors under Sections 2.1 and/or 2.2 of this
- License shall, upon 60 days notice from Participant
- terminate prospectively and automatically at the expiration
- of such 60 day notice period, unless if within such 60 day
- period You withdraw Your claim with respect to the
- Participant Software against such Participant either
- unilaterally or pursuant to a written agreement with
- Participant.
-
- 6.3. In the event of termination under Sections 6.1 or 6.2
- above, all end user licenses that have been validly granted
- by You or any distributor hereunder prior to termination
- (excluding licenses granted to You by any distributor)
- shall survive termination.
-
- 7. LIMITATION OF LIABILITY.
-
- UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
- (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE
- INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF
- COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE
- LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
- CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
- LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK
- STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
- COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
- INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
- LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL
- INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT
- APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO
- NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
- CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT
- APPLY TO YOU.
-
- 8. U.S. GOVERNMENT END USERS.
-
- The Covered Software is a "commercial item," as that term is
- defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial
- computer software" (as that term is defined at 48 C.F.R.
- 252.227-7014(a)(1)) and "commercial computer software
- documentation" as such terms are used in 48 C.F.R. 12.212 (Sept.
- 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1
- through 227.7202-4 (June 1995), all U.S. Government End Users
- acquire Covered Software with only those rights set forth herein.
- This U.S. Government Rights clause is in lieu of, and supersedes,
- any other FAR, DFAR, or other clause or provision that addresses
- Government rights in computer software under this License.
-
- 9. MISCELLANEOUS.
-
- This License represents the complete agreement concerning subject
- matter hereof. If any provision of this License is held to be
- unenforceable, such provision shall be reformed only to the
- extent necessary to make it enforceable. This License shall be
- governed by the law of the jurisdiction specified in a notice
- contained within the Original Software (except to the extent
- applicable law, if any, provides otherwise), excluding such
- jurisdiction's conflict-of-law provisions. Any litigation
- relating to this License shall be subject to the jurisdiction of
- the courts located in the jurisdiction and venue specified in a
- notice contained within the Original Software, with the losing
- party responsible for costs, including, without limitation, court
- costs and reasonable attorneys' fees and expenses. The
- application of the United Nations Convention on Contracts for the
- International Sale of Goods is expressly excluded. Any law or
- regulation which provides that the language of a contract shall
- be construed against the drafter shall not apply to this License.
- You agree that You alone are responsible for compliance with the
- United States export administration regulations (and the export
- control laws and regulation of any other countries) when You use,
- distribute or otherwise make available any Covered Software.
-
- 10. RESPONSIBILITY FOR CLAIMS.
-
- As between Initial Developer and the Contributors, each party is
- responsible for claims and damages arising, directly or
- indirectly, out of its utilization of rights under this License
- and You agree to work with Initial Developer and Contributors to
- distribute such responsibility on an equitable basis. Nothing
- herein is intended or shall be deemed to constitute any admission
- of liability.
-
-===============================================================================
-
-WSDL4j (wsdl4j-1.6.2.jar):
-
-Common Public License - v 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
- a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
- b) in the case of each subsequent Contributor:
-
- i) changes to the Program, and
-
- ii) additions to the Program;
-
- where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
-
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
-
-2. GRANT OF RIGHTS
-
- a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
-
- b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
-
- c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
-
- d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
-
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
-
- a) it complies with the terms and conditions of this Agreement; and
-
- b) its license agreement:
-
- i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
-
- ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
-
- iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
-
- iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
-
-When the Program is made available in source code form:
-
- a) it must be made available under this Agreement; and
-
- b) a copy of this Agreement must be included with each copy of the Program.
-
-Contributors may not remove or alter any copyright notices contained within the Program.
-
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-
-===============================================================================
-
-backport-util-concurrent-3.1.jar :
-
-The software comprising backport-util-concurrent is based in large
-part on the code from JSR166, and the package dl.util.concurrent.
-The software has been released to the public domain, as explained at:
-http://creativecommons.org/licenses/publicdomain, excepting portions
-of the class
-edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArrayList,
-which were adapted from class java.util.ArrayList, written by Sun
-Microsystems, Inc, which are used with kind permission, and subject
-to the following:
-
-Copyright 2002-2004 Sun Microsystems, Inc. All rights reserved. Use is
-subject to the following license terms.
-
- "Sun hereby grants you a non-exclusive, worldwide, non-transferrable
- license to use and distribute the Java Software technologies as part
- of a larger work in source and binary forms, with or without
- modification, provided that the following conditions are met:
-
- -Neither the name of or trademarks of Sun may be used to endorse or
- promote products derived from the Java Software technology without
- specific prior written permission.
-
- -Redistributions of source or binary code must be accompanied by the
- following notice and disclaimers:
-
- Portions copyright Sun Microsystems, Inc. Used with kind permission.
-
- This software is provided AS IS, without a warranty of any kind. ALL
- EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
- WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PUPOSE OR
- NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- MICROSYSTEMS, INC. AND ITS LICENSORS SHALL NOT BE LIABLE
- FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
- USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS
- DERIVATIVES. IN NO EVENT WILL SUN MICROSYSTEMS, INC. OR
- ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR
- DATA, OR FOR DIRECT, INDIRECT,CONSQUENTIAL, INCIDENTAL
- OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF
- THE THEORY OR LIABILITY, ARISING OUT OF THE USE OF OR
- INABILITY TO USE SOFTWARE, EVEN IF SUN MICROSYSTEMS, INC.
- HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
- You acknowledge that Software is not designed, licensed or intended for
- use in the design, construction, operation or maintenance of any nuclear
- facility."
-
-===============================================================================
-
-jdom-1.0.jar :
-
-$Id: LICENSE.txt,v 1.11 2004/02/06 09:32:57 jhunter Exp $
-
- Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions, and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions, and the disclaimer that follows
- these conditions in the documentation and/or other materials
- provided with the distribution.
-
- 3. The name "JDOM" must not be used to endorse or promote products
- derived from this software without prior written permission. For
- written permission, please contact <request_AT_jdom_DOT_org>.
-
- 4. Products derived from this software may not be called "JDOM", nor
- may "JDOM" appear in their name, without prior written permission
- from the JDOM Project Management <request_AT_jdom_DOT_org>.
-
- In addition, we request (but do not require) that you include in the
- end-user documentation provided with the redistribution and/or in the
- software itself an acknowledgement equivalent to the following:
- "This product includes software developed by the
- JDOM Project (http://www.jdom.org/)."
- Alternatively, the acknowledgment may be graphical using the logos
- available at http://www.jdom.org/images/logos.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many
- individuals on behalf of the JDOM Project and was originally
- created by Jason Hunter <jhunter_AT_jdom_DOT_org> and
- Brett McLaughlin <brett_AT_jdom_DOT_org>. For more information
- on the JDOM Project, please see <http://www.jdom.org/>.
-
-================================================================================
-
-The jaxen-1.1.1.jar:
-
- $Id: LICENSE.txt,v 1.5 2006/02/05 21:49:04 elharo Exp $
-
- Copyright 2003-2006 The Werken Company. All Rights Reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the Jaxen Project nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
-OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-================================================================================
-The asm-3.1.jar are distributed under the license:
-
-Copyright (c) 2000-2005 INRIA, France Telecom
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-3. Neither the name of the copyright holders nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGE.
-
-================================================================================
-
-The tuscany-assembly-xsd jar includes XSD files under the following SCA Collaboration license:
-
-License for the Service Component Architecture JavaDoc, Interface
-Definition files and XSD files.
-
-The Service Component Architecture JavaDoc, Interface Definition files,
-and XSD files are being provided by the copyright holders under the
-following license. By using and/or copying this work, you agree that
-you have read, understood and will comply with the following terms and
-conditions:
-
-Permission to copy, display, make derivative works of, and distribute
-the Service Component Architecture JavaDoc, Interface Definition Files
-and XSD files (the "Artifacts") in any medium without fee or royalty is
-hereby granted, provided that you include the following on ALL copies
-of the Artifacts, or portions thereof, that you make:
-
-1. A link or URL to the Artifacts at this location:
-http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
-
-2. The full text of this copyright notice as shown in the Artifacts.
-
-THE ARTIFACTS ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO
-REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THE
-ARTIFACTS AND THE IMPLEMENTATION OF THEIR CONTENTS, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE, NON-INFRINGEMENT OR TITLE.
-
-THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
-INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
-USE OR DISTRIBUTION OF THE ARTIFACTS.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to the Service Component
-Architecture Specification or its contents without specific, written
-prior permission. Title to copyright in the Service Component
-Architecture Specification and the JavaDoc, Interface Definition Files
-and XSD Files will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-Revision level 1.1, last updated on 2007/11/19
-
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/NOTICE b/tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/NOTICE
deleted file mode 100644
index da0b215a77..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/release/bin/NOTICE
+++ /dev/null
@@ -1,62 +0,0 @@
-Apache Tuscany
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-This product includes/uses XmlSchema developed at
-The Apache Software Foundation (http://ws.apache.org/commons/XmlSchema)
- Portions Copyright 2006 International Business Machines Corp.
-
-This product includes/uses the Jetty Servlet Engine (http://jetty.mortbay.org),
-developed by Mort Bay Consulting (http://www.mortbay.com)
-
-This product includes/uses DOM4J : the flexible XML framework for java (http://www.dom4j.org/)
- Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
-
-This product includes/uses software, AOP alliance (http://aopalliance.sourceforge.net)
-License: Public Domain
-
-This product includes software from the GlassFish project (https://glassfish.dev.java.net/)
- Copyright (c) 2006, Sun Microsystems, Inc.
-
-This product includes/uses the Sourceforge wsdl4j project (http://sourceforge.net/projects/wsdl4j/)
-
-This product includes/uses JDOM (http://www.jdom.org/)
- Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin. All rights reserved.
-
-This product includes/uses javacc (https://javacc.dev.java.net/)
- Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-
-This product includes/uses ASM (http://asm.objectweb.org)
- Copyright (c) 2000-2005 INRIA, France Telecom. All rights reserved.
-
-This product includes/uses Jaxen (http://jaxen.codehaus.org/)
- Copyright 2003-2006 The Werken Company. All Rights Reserved.
-
-This product includes/uses Serp (http://serp.sourceforge.net/) under the BSD license:
- Copyright (c) 2002, A. Abram White. All rights reserved.
-
-This product also includes software under the BSD license
-with the following copyright:
- Copyright (c) 2006, Sun Microsystems, Inc. All rights reserved.
-
-This product also includes "OSGi Materials."
- Copyright (c) 2000, 2006
- OSGi Alliance Bishop Ranch 6
- 2400 Camino Ramon, Suite 375
- San Ramon, CA 94583 USA
- All Rights Reserved.
-
-This product includes software under the Service Component Architecture JavaDoc,
-Interface Definition files and XSD files license.
- (c) Copyright SCA Collaboration 2006, 2007
-
-This product includes software under the Service Data Objects JavaDoc and
-Interface Definition file license
-
-(c) Copyright BEA Systems, Inc., International Business Machines Corporation,
-Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
-Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
-2005, 2006. All rights reserved.
-
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/README b/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/README
deleted file mode 100644
index 3d042d0e3f..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/README
+++ /dev/null
@@ -1,42 +0,0 @@
-The bin folder contains bat and shell scripts to help with using Tuscany.
-You can use the "tuscany.bat" script to start a standalone runtime and
-deploy your SCA contributions.
-
-For example, change to the implementation-java-calculator sample included
-in the Tuscany distribution and enter the following command:
-
-..\..\bin\tuscany.bat target\implementation-java-calculator.jar
-
-The script also supports things such as using a Java remote debugger,
-for help enter use the "/?" parameter, eg:
-
-..\..\bin\tuscany.bat /?
-
-To simplify the use of the script add the absolute file path of the bin
-folder to your environment path:
-
-set PATH=%PATH%;\Tuscany\tuscany-sca-2.0-M1\bin
-
-and that enables running the script by just "tuscany", for example, in the
-implementation-java-calculator sample again you can enter:
-
-tuscany target\implementation-java-calculator.jar
-
-Tuscany developers may find it useful to add the script from their SVN checkout
-development build to their environment so as to start runtimes using their local
-trunk build, for example:
-
-set PATH=%PATH%;\Tuscany\SVN\trunk\distribution\all\target\apache-tuscany-sca-all-2.0-SNAPSHOT-dir\tuscany-sca-2.0-SNAPSHOT\bin
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/default.config b/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/default.config
deleted file mode 100644
index e7e8c2a5ac..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/default.config
+++ /dev/null
@@ -1,5 +0,0 @@
-classpath=modules/**
-mainClass=[firstArgJarManifestMainClass]|org.apache.tuscany.sca.node.NodeMain2
--Djava.util.logging.config.file={TUSCANY_HOME}/samples/logging.properties
-
-
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/osgi.config b/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/osgi.config
deleted file mode 100644
index c8b9c57e53..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/osgi.config
+++ /dev/null
@@ -1,4 +0,0 @@
-classpath=modules/**
--Djava.util.logging.config.file={TUSCANY_HOME}/samples/logging.properties
-mainClass=org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher2
-
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/tuscany.bat b/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/tuscany.bat
deleted file mode 100644
index 6dfb29ff8b..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/tuscany.bat
+++ /dev/null
@@ -1,76 +0,0 @@
-@echo off
-
-REM # Licensed to the Apache Software Foundation (ASF) under one
-REM # or more contributor license agreements. See the NOTICE file
-REM # distributed with this work for additional information
-REM # regarding copyright ownership. The ASF licenses this file
-REM # to you under the Apache License, Version 2.0 (the
-REM # "License"); you may not use this file except in compliance
-REM # with the License. You may obtain a copy of the License at
-REM #
-REM # http://www.apache.org/licenses/LICENSE-2.0
-REM #
-REM # Unless required by applicable law or agreed to in writing,
-REM # software distributed under the License is distributed on an
-REM # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-REM # KIND, either express or implied. See the License for the
-REM # specific language governing permissions and limitations
-REM # under the License.
-
-if "%1"=="/?" goto help
-
-if not "%TUSCANY_HOME%"=="" goto gotHome
-SET TUSCANY_HOME=%~dp0\..
-if not "%TUSCANY_HOME%"=="" goto gotHome
-echo.
-echo cannot find TUSCANY_HOME please set TUSCANY_HOME variable to the Tuscany installation dir
-echo.
-goto error
-:gotHome
-
-
-set _XDEBUG=
-if not %1==debug goto skipDebug
-set _XDEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y
-shift
-:skipDebug
-
-set _FORK=
-if not %1==fork goto skipFork
-set _FORK=start
-shift
-:skipFORK
-
-set _CMD_LINE_ARGS=
-:argsLoop
-if %1a==a goto doneInit
-set _CMD_LINE_ARGS=%_CMD_LINE_ARGS% %1
-shift
-goto argsLoop
-
-
-:doneInit
-
-%_FORK% java %_XDEBUG% -jar %TUSCANY_HOME%/bin/launcher.jar %_CMD_LINE_ARGS%
-
-goto end
-
-:help
-
-echo Apache Tuscany SCA runtime launcher
-echo TUSCANY [debug] [fork] contributions
-echo debug enable Java remote debugging
-echo fork start a new command prompt window to run the contributions
-echo contributions list of SCA contribution file names seperated by spaces. All
-echo deployable composites found in the contributions will be run.
-
-goto end
-
-:error
-set ERROR_CODE=1
-
-
-:end
-@endlocal
-exit /B %ERROR_CODE%
-
diff --git a/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/unmanaged.config b/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/unmanaged.config
deleted file mode 100644
index f289528a40..0000000000
--- a/tags/java/sca/2.0-M1/distribution/all/src/main/release/launcher/unmanaged.config
+++ /dev/null
@@ -1,4 +0,0 @@
-classpath=modules/**
--Djava.util.logging.config.file={TUSCANY_HOME}/samples/logging.properties
-mainClass=[firstArgJarManifestMainClass]
-
diff --git a/tags/java/sca/2.0-M1/distribution/pom.xml b/tags/java/sca/2.0-M1/distribution/pom.xml
deleted file mode 100644
index 663335011e..0000000000
--- a/tags/java/sca/2.0-M1/distribution/pom.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- </parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Distributions</name>
-
- <modules>
- <module>all</module>
- </modules>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/etc/policy-continuum.policy b/tags/java/sca/2.0-M1/etc/policy-continuum.policy
deleted file mode 100644
index c929703993..0000000000
--- a/tags/java/sca/2.0-M1/etc/policy-continuum.policy
+++ /dev/null
@@ -1,7 +0,0 @@
-grant codeBase "file:/home/continuum/data/working-directory/277/-" {
- permission java.security.AllPermission;
-};
-
-grant codeBase "file:~/.m2/-" {
- permission java.security.AllPermission;
-};
diff --git a/tags/java/sca/2.0-M1/features/all/pom.xml b/tags/java/sca/2.0-M1/features/all/pom.xml
deleted file mode 100644
index 47c55eedfc..0000000000
--- a/tags/java/sca/2.0-M1/features/all/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <type>pom</type>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <type>pom</type>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-launcher</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/features/api/pom.xml b/tags/java/sca/2.0-M1/features/api/pom.xml
deleted file mode 100644
index b632be69ac..0000000000
--- a/tags/java/sca/2.0-M1/features/api/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
-
- <!-- Node API -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/features/core/pom.xml b/tags/java/sca/2.0-M1/features/core/pom.xml
deleted file mode 100644
index 2730629e46..0000000000
--- a/tags/java/sca/2.0-M1/features/core/pom.xml
+++ /dev/null
@@ -1,270 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
-
- <!-- SCA API -->
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
--->
-
- <!-- Assembly model -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xsd</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Bindings -->
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-corba-runtime</artifactId>
- <version>2.0-M1</version>
- </dependency-->
-
- <!-- Contribution model -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-java</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Core runtime -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Databindings -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Data API -->
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>2.0-M1</version>
- </dependency-->
-
- <!-- Policy definitions -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Domain support -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Core Extensibility -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility-equinox</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Hosts -->
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba-jse</artifactId>
- <version>2.0-M1</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-M1</version>
- </dependency>
-
- <!-- Implementation types -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node-runtime</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
-
- <!-- Interface models -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-jaxws</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Node runtime -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-webapp</artifactId>
- <version>2.0-M1</version>
- <type>war</type>
- </dependency>
- -->
-
- <!-- Monitoring -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-monitor</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Policy models -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security-jsr250</artifactId>
- <version>2.0-M1</version>
- </dependency-->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- XMLSchema support -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/features/ejava/pom.xml b/tags/java/sca/2.0-M1/features/ejava/pom.xml
deleted file mode 100644
index 5ef99a5f17..0000000000
--- a/tags/java/sca/2.0-M1/features/ejava/pom.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-feature-ejava</artifactId>
- <name>Apache Tuscany SCA JEE 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-M1</version>
- </dependency>
-
- <!-- Bindings -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>2.0-M1</version>
- </dependency>
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ejb-runtime</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-M1</version>
- </dependency>
--->
-
- <!-- Hosts -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-rmi</artifactId>
- <version>2.0-M1</version>
- </dependency>
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba-jee</artifactId>
- <version>2.0-M1</version>
- </dependency>
--->
-
- <!-- Implementations -->
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-ejb</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-spring</artifactId>
- <version>2.0-M1</version>
- </dependency>
--->
-
- <!-- Policies -->
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-transaction</artifactId>
- <version>2.0-M1</version>
- </dependency>
--->
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/features/pom.xml b/tags/java/sca/2.0-M1/features/pom.xml
deleted file mode 100644
index e4efa61b6c..0000000000
--- a/tags/java/sca/2.0-M1/features/pom.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- </parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Features</name>
-
- <modules>
- <module>all</module>
- <module>api</module>
- <module>core</module>
- <module>ejava</module>
- <module>webservice</module>
-<!--
- <module>webapp</module>
- <module>manager</module>
- <module>process</module>
- <module>repository</module>
- <module>web20</module>
--->
- </modules>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/features/webservice/pom.xml b/tags/java/sca/2.0-M1/features/webservice/pom.xml
deleted file mode 100644
index 4e3833c814..0000000000
--- a/tags/java/sca/2.0-M1/features/webservice/pom.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
-
- <!-- Bindings -->
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency-->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</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-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Databindings -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-axiom</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb-axiom</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo-axiom</artifactId>
- <version>2.0-M1</version>
- </dependency-->
-
- <!-- Hosts -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Policy models -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml-ws</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/build-was-integration.xml b/tags/java/sca/2.0-M1/itest/build-was-integration.xml
deleted file mode 100644
index 03de4c050f..0000000000
--- a/tags/java/sca/2.0-M1/itest/build-was-integration.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<project name="was-integration" default="main" basedir=".">
-
- <property environment="env"/>
-
- <target name="startServer">
- <exec dir="." executable="${env.WAS_HOME}/bin/startServer.sh">
- <arg value="server1" />
- <!--
- <arg value="-username" />
- <arg value="${sWasUser}" />
- <arg value="-password" />
- <arg value="${sWasPassword}" />
- -->
- </exec>
- </target>
-
- <target name="stopServer">
- <exec dir="." executable="${env.WAS_HOME}/bin/stopServer.sh">
- <arg value="server1" />
- <!--
- <arg value="-username" />
- <arg value="${sWasUser}" />
- <arg value="-password" />
- <arg value="${sWasPassword}" />
- -->
- </exec>
- </target>
-
- <target name="installApplication">
- <echo>Installing war ${application.war} on ${application.server} using name ${application.name} and context root ${application.contextRoot} </echo>
- <exec dir="." executable="${env.WAS_HOME}/bin/wsadmin.sh">
- <arg line="-conntype SOAP -lang jython -f ${was.python.script} installApplicationOnServer ${application.war} ${application.name} ${application.contextRoot} ${application.server}" />
- </exec>
-
- <echo>Starting application ${application.name} on ${application.server}</echo>
- <exec dir="." executable="${env.WAS_HOME}/bin/wsadmin.sh">
- <arg line="-conntype SOAP -lang jython -f ${was.python.script} startApplicationOnServer ${application.name} ${application.server}" />
- </exec>
- </target>
-
- <target name="uninstallApplication">
- <echo>Uninstalling ${application.name} </echo>
- <exec dir="." executable="${env.WAS_HOME}/bin/wsadmin.sh">
- <arg line="-conntype SOAP -lang jython -f ${was.python.script} uninstallApplicationOnServer ${application.name}" />
- </exec>
- </target>
-
-
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/callback-api/pom.xml b/tags/java/sca/2.0-M1/itest/callback-api/pom.xml
deleted file mode 100644
index 71dabe0c3e..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-api/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-callback-api</artifactId>
- <name>Apache Tuscany SCA Callback API Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <properties>
- <was.ant.script>${basedir}/../build-was-integration.xml</was.ant.script>
- <was.python.script>${basedir}/../wasAdmin.py</was.python.script>
- </properties>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java b/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java
deleted file mode 100644
index b013462f9f..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-/**
- *
- */
-public interface CallBackApiCallBack {
- /**
- * This function is defined in CallBackApiClientImpl
- */
- void callBackMessage(String aString);
-
- /**
- * This function is defined in CallBackApiClientImpl
- */
- void callBackIncrement(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java b/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java
deleted file mode 100644
index 252e4dc45f..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface CallBackApiClient {
- /**
- * This function is defined in CallBackApiClientImpl
- */
- void run();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java b/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
deleted file mode 100644
index d883dc2d6f..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.junit.Assert;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackApiClient.class)
-public class CallBackApiClientImpl implements CallBackApiClient, CallBackApiCallBack {
-
- @Reference
- protected CallBackApiService aCallBackService;
-
- private static String returnMessage = null;
- private static int callBackCount = 0;
- private static Object monitor = new Object();
-
- /**
- * This test calls function test 3a,3a1,3b,3c
- */
- public void run() {
-
- // This tests basic callback patterns.
-
- // Test3a is the basic callback where the target calls back prior to
- // returning to the client.
- test3a();
-
- test3a1();
-
- // Test3b is where the target does not call back to the client.
- test3b();
-
- // Test3c is where the target calls back multiple times to the client.
- test3c();
- }
-
- /**
- * This test is the basic callback where the target calls back prior to returning to the client.
- */
-
- private void test3a() {
- aCallBackService.knockKnock("Knock Knock");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackApiITest - test3a", "Who's There", this.getReturnMessage());
-
- }
-
- /**
- * This test is the basic callback where the target calls back prior to returning to the client.
- */
- private void test3a1() {
- aCallBackService.knockKnockByRef("Knock Knock");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackApiITest - test3a", "Who's There", this.getReturnMessage());
-
- }
-
- /**
- * This test is the basic callback where the target does not call back to the client
- */
- private void test3b() {
- aCallBackService.noCallBack("No Reply Desired");
- Assert.assertEquals("CallBackApiITest - test3b", 1, 1);
- }
-
- /**
- * This test is the basic callback where the target calls back multiple times to the client
- */
-
- private void test3c() {
- aCallBackService.multiCallBack("Call me back 3 times");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (this.getCallBackCount() < 3 && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackApiITest - test3c", 3, this.getCallBackCount());
- }
-
- /**
- * This function returns a string
- *
- * @param void
- * @return String result string
- */
-
- public String getReturnMessage() {
- return returnMessage;
- }
-
- /**
- * This function set the returnMessage string
- *
- * @param String
- */
- public void setReturnMessage(String aReturnMessage) {
- returnMessage = aReturnMessage;
- }
-
- /**
- * This function returns the callBackCount variable
- *
- * @return Integer callBackCount variable
- */
- public int getCallBackCount() {
- return callBackCount;
- }
-
- /**
- * This function increments callBackCount variable by 1
- */
- public void incrementCallBackCount() {
- callBackCount++;
- }
-
- /**
- * This function prints a message synched with setReturnMessage function
- *
- * @param String
- */
- public void callBackMessage(String aString) {
- System.out.println("Entering callback callBackMessage: " + aString);
- synchronized (monitor) {
- this.setReturnMessage(aString);
- monitor.notify();
- }
- }
-
- /**
- * This function prints a message synched with incrementCallBackCount function
- *
- * @param String
- */
- public void callBackIncrement(String aString) {
- System.out.println("Entering callback increment: " + aString);
- synchronized (monitor) {
- this.incrementCallBackCount();
- monitor.notify();
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java b/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java
deleted file mode 100644
index afb7c45e2c..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-@Callback(CallBackApiCallBack.class)
-/**
- *
- */
-public interface CallBackApiService {
- /**
- * This function is defined in CallBackApiServiceImpl
- */
- void knockKnock(String aString);
-
- /**
- * This function is defined in CallBackApiServiceImpl
- */
- void knockKnockByRef(String aString);
-
- /**
- * This function is defined in CallBackApiServiceImpl
- */
- void noCallBack(String aString);
-
- /**
- * This function is defined in CallBackApiServiceImpl
- */
- void multiCallBack(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java b/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
deleted file mode 100644
index bdac56d222..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackApiService.class)
-public class CallBackApiServiceImpl implements CallBackApiService {
-
- @Context
- protected ComponentContext componentContext;
- /**
- * Object of CallBackApiCallBack class
- */
- private CallBackApiCallBack callback;
-
- @Callback
- protected CallableReference<CallBackApiCallBack> callbackRef;
-
- /**
- * This function get an object of CallBackApiServiceImpl by calling getCallBackInterface function and calls the
- * callBackMessage function.
- *
- * @param aString String passed by a function call
- */
-
- public void knockKnock(String aString) {
-
- System.out.println("CallBackApiServiceImpl message received: " + aString);
- callback = this.getCallBackInterface();
- callback.callBackMessage("Who's There");
- System.out.println("CallBackApiServiceImpl response sent");
- }
-
- /**
- * This function calls the callBackMessage function. <br>
- * The reference to this function is received from Call back reference to the class CallBackApiService.
- *
- * @param aString String passed by a function call
- */
- public void knockKnockByRef(String aString) {
-
- System.out.println("CallBackApiServiceImpl message received: " + aString);
- callbackRef.getService().callBackMessage("Who's There");
- System.out.println("CallBackApiServiceImpl response sent");
- }
-
- /**
- * This function get an object of CallBackApiServiceImpl by calling getCallBackInterface function. <br>
- * This function then places multiple callBack using the callbackIncrement function defined in
- * callBack.ApiServiceImpl
- *
- * @param aString String passed by a function call
- */
- public void multiCallBack(String aString) {
-
- callback = this.getCallBackInterface();
-
- System.out.println("CallBackApiServiceImpl message received: " + aString);
- callback.callBackIncrement("Who's There 1");
- System.out.println("CallBackApiServiceImpl response sent");
- callback.callBackIncrement("Who's There 2");
- System.out.println("CallBackApiServiceImpl response sent");
- callback.callBackIncrement("Who's There 3");
- System.out.println("CallBackApiServiceImpl response sent");
- }
-
- /**
- * This function does not callBack any function.
- *
- * @param aString String passed by a function call
- */
- public void noCallBack(String aString) {
- System.out.println("CallBackApiServiceImpl message received: " + aString);
- }
-
- /**
- * This function get an object of CallBackApiServiceImpl from the present componentContext
- *
- * @param void
- */
- private CallBackApiCallBack getCallBackInterface() {
- System.out.println("CallBackApiServiceImpl getting request context");
- RequestContext rc = componentContext.getRequestContext();
- System.out.println("CallBackApiServiceImpl getting callback from request context");
- callback = rc.getCallback();
- System.out.println("CallBackApiServiceImpl returning callback");
- return callback;
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-api/src/main/resources/CallBackApiTest.composite b/tags/java/sca/2.0-M1/itest/callback-api/src/main/resources/CallBackApiTest.composite
deleted file mode 100644
index 946c4862ee..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-api/src/main/resources/CallBackApiTest.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://callback"
- name="CallBackApiTest">
-
- <component name="CallBackApiClient">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackApiClientImpl"/>
- <reference name="aCallBackService" target="CallBackApiService"/>
- </component>
-
- <component name="CallBackApiService">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackApiServiceImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M1/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 19eb25631e..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://callback"
- xmlns:t="http://callback">
- <deployable composite="t:CallBackApiTest" />
-</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java b/tags/java/sca/2.0-M1/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
deleted file mode 100644
index 75fab95efb..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-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;
-
-public class CallBackApiTestCase {
-
- private static Node node;
- private CallBackApiClient aCallBackClient;
-
- /**
- * This function uses the Instance of CallBackApiClient.class <br>
- * This function calls the run function defined in the CallBackApiClinet Interface <br>
- * which in turn executes the following test cases. <br>
- * 1. Basic callback patterns <br>
- * 2. Test in which the target does not call back to the client <br>
- * 3. Test in which the target calls back multiple times to the client.
- */
- @Test
- public void testCallBackBasic() {
- aCallBackClient = node.getService(CallBackApiClient.class, "CallBackApiClient");
- aCallBackClient.run();
- }
-
- /**
- * This function creates the Node instance and gets an Instance of CallBackApiClient.class
- */
-
- @BeforeClass
- public static void setUp() throws Exception {
- if (node == null) {
- String location = ContributionLocationHelper.getContributionLocation("CallBackApiTest.composite");
- node = NodeFactory.newInstance().createNode("CallBackApiTest.composite", new Contribution("c1", location));
- node.start();
- }
- }
-
- /**
- * This function destroys the Node instance that was created in setUp()
- */
-
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-basic/pom.xml b/tags/java/sca/2.0-M1/itest/callback-basic/pom.xml
deleted file mode 100644
index c1d4974091..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-basic/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-callback-basic</artifactId>
- <name>Apache Tuscany SCA Callback Basic Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <properties>
- <was.ant.script>${basedir}/../build-was-integration.xml</was.ant.script>
- <was.python.script>${basedir}/../wasAdmin.py</was.python.script>
- </properties>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java b/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
deleted file mode 100644
index 291a72b9d6..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-/**
- *
- */
-public interface CallBackBasicCallBack {
-
- void callBackMessage(String aString);
-
- void callBackIncrement(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java b/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
deleted file mode 100644
index 19f366c423..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface CallBackBasicClient {
-
- void run();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java b/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
deleted file mode 100644
index 4bb6b29a8d..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.junit.Assert;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackBasicClient.class)
-public class CallBackBasicClientImpl implements CallBackBasicClient, CallBackBasicCallBack {
-
- @Reference
- protected CallBackBasicService aCallBackService;
- private static String returnMessage = null;
- private static int callBackCount = 0;
- private static Object monitor = new Object();
-
- public void run() {
-
- // This tests basic callback patterns.
-
- // Test1 is the basic callback where the target calls back prior to
- // returning to the client.
- test1a();
-
- // Test2 is where the target does not call back to the client.
- test1b();
-
- // Test3 is where the target calls back multiple times to the client.
- test1c();
- }
-
- private void test1a() {
- aCallBackService.knockKnock("Knock Knock");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackBasicITest - test1a", "Who's There", this.getReturnMessage());
-
- }
-
- private void test1b() {
- aCallBackService.noCallBack("No Reply Desired");
- Assert.assertEquals("CallBackBasicITest - test1b", 1, 1);
- }
-
- private void test1c() {
- aCallBackService.multiCallBack("Call me back 3 times");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (this.getCallBackCount() < 3 && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackBasicITest - test1c", 3, this.getCallBackCount());
- }
-
- public String getReturnMessage() {
- return returnMessage;
- }
-
- public void setReturnMessage(String aReturnMessage) {
- returnMessage = aReturnMessage;
- }
-
- public int getCallBackCount() {
- return callBackCount;
- }
-
- public void incrementCallBackCount() {
- callBackCount++;
- }
-
- public void callBackMessage(String aString) {
- System.out.println("Entering callback callBackMessage: " + aString);
- synchronized (monitor) {
- this.setReturnMessage(aString);
- monitor.notify();
- }
- }
-
- public void callBackIncrement(String aString) {
- System.out.println("Entering callback increment: " + aString);
- synchronized (monitor) {
- this.incrementCallBackCount();
- monitor.notify();
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java b/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
deleted file mode 100644
index 5396879e83..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-@Callback(CallBackBasicCallBack.class)
-/**
- *
- */
-public interface CallBackBasicService {
-
- void knockKnock(String aString);
-
- void noCallBack(String aString);
-
- void multiCallBack(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java b/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
deleted file mode 100644
index 07010f61e1..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackBasicService.class)
-public class CallBackBasicServiceImpl implements CallBackBasicService {
-
- @Callback
- protected CallBackBasicCallBack callback;
-
- public void knockKnock(String aString) {
-
- System.out.println("CallBackBasicServiceImpl message received: " + aString);
- callback.callBackMessage("Who's There");
- System.out.println("CallBackBasicServiceImpl response sent");
-
- }
-
- public void multiCallBack(String aString) {
-
- System.out.println("CallBackBasicServiceImpl message received: " + aString);
- callback.callBackIncrement("Who's There 1");
- System.out.println("CallBackBasicServiceImpl response sent");
- callback.callBackIncrement("Who's There 2");
- System.out.println("CallBackBasicServiceImpl response sent");
- callback.callBackIncrement("Who's There 3");
- System.out.println("CallBackBasicServiceImpl response sent");
-
- }
-
- public void noCallBack(String aString) {
-
- System.out.println("CallBackBasicServiceImpl message received: " + aString);
- // System.out.println("CallBackBasicServiceImpl No response desired");
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/resources/CallBackBasicTest.composite b/tags/java/sca/2.0-M1/itest/callback-basic/src/main/resources/CallBackBasicTest.composite
deleted file mode 100644
index c506956088..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/resources/CallBackBasicTest.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://callback"
- name="CallBackBasicTest">
-
- <component name="CallBackBasicClient">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/>
- <reference name="aCallBackService" target="CallBackBasicService"/>
- </component>
-
- <component name="CallBackBasicService">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M1/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index adf28214f6..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://callback"
- xmlns:t="http://callback">
- <deployable composite="t:CallBackBasicTest" />
-</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java b/tags/java/sca/2.0-M1/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java
deleted file mode 100644
index 43b812faed..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test;
-
-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.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class CallBackBasicTestCase {
-
- private static Node node;
- private CallBackBasicClient aCallBackClient;
-
- @Test
- public void testCallBackBasic() {
- aCallBackClient.run();
- }
-
- @Before
- public void setUp() throws Exception {
- if (node == null) {
- String location = ContributionLocationHelper.getContributionLocation("CallBackBasicTest.composite");
- node = NodeFactory.newInstance().createNode("CallBackBasicTest.composite", new Contribution("c1", location));
- node.start();
- }
-
- aCallBackClient = node.getService(CallBackBasicClient.class, "CallBackBasicClient");
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-complex-type/pom.xml b/tags/java/sca/2.0-M1/itest/callback-complex-type/pom.xml
deleted file mode 100644
index 6d16d3f3f3..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-complex-type/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-callback-complex-type</artifactId>
- <name>Apache Tuscany SCA Callback Complex Type Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java b/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java
deleted file mode 100644
index 627d37e27d..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-/**
- *
- */
-public interface CallBackCTypeCallBack {
-
- void callBackMessage(String aString);
-
- void callBackIncrement(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java b/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java
deleted file mode 100644
index 966ad17b9a..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface CallBackCTypeClient {
-
- void run();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java b/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java
deleted file mode 100644
index d2dc0add75..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import org.junit.Assert;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackCTypeClient.class)
-public class CallBackCTypeClientImpl implements CallBackCTypeClient, CallBackCTypeCallBack {
-
- @Reference
- protected CallBackCTypeService aCallBackService;
- private static String returnMessage = null;
- private static int callBackCount = 0;
- private static Object monitor = new Object();
-
- public CallBackCTypeClientImpl() {
- }
-
- public void run() {
-
- // This test is the same as the Basic Callback except it uses a
- // componentType side file.
- // This test currently fails because the integration test environment
- // does not properly copy
- // the componentType files to the target folder. This is documented in
- // Tuscany-967.
-
- // Test12a is the basic callback where the target calls back prior to
- // returning to the client.
- test12a();
-
- // Test12b is where the target does not call back to the client.
- test12b();
-
- // Test12c is where the target calls back multiple times to the client.
- test12c();
-
- }
-
- private void test12a() {
- aCallBackService.knockKnock("Knock Knock");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackBasicITest - test12a -", "Who's There", this.getReturnMessage());
-
- }
-
- private void test12b() {
- aCallBackService.noCallBack("No Reply Desired");
- Assert.assertEquals("CallBackBasicITest - test12b -", 1, 1);
- }
-
- private void test12c() {
- aCallBackService.multiCallBack("Call me back 3 times");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (this.getCallBackCount() < 3 && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackBasicITest - test12c -", 3, this.getCallBackCount());
- }
-
- public String getReturnMessage() {
- return returnMessage;
- }
-
- public void setReturnMessage(String aReturnMessage) {
- returnMessage = aReturnMessage;
- }
-
- public int getCallBackCount() {
- return callBackCount;
- }
-
- public void incrementCallBackCount() {
- callBackCount++;
- }
-
- public void callBackMessage(String aString) {
- System.out.println("Entering callback callBackMessage: " + aString);
- synchronized (monitor) {
- this.setReturnMessage(aString);
- monitor.notify();
- }
- }
-
- public void callBackIncrement(String aString) {
- System.out.println("Entering callback increment: " + aString);
- synchronized (monitor) {
- this.incrementCallBackCount();
- monitor.notify();
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java b/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java
deleted file mode 100644
index e3fb7d6238..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-// @Callback(CallBackCTypeCallBack.class)
-/**
- *
- */
-public interface CallBackCTypeService {
-
- void knockKnock(String aString);
-
- void noCallBack(String aString);
-
- void multiCallBack(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java b/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
deleted file mode 100644
index f7a1a195ed..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackCTypeService.class)
-public class CallBackCTypeServiceImpl implements CallBackCTypeService {
-
- @Callback
- protected CallBackCTypeCallBack callback;
-
- public CallBackCTypeServiceImpl() {
- }
-
- public void knockKnock(String aString) {
-
- System.out.println("CallBackCTypeServiceImpl message received: " + aString);
- callback.callBackMessage("Who's There");
- System.out.println("CallBackCTypeServiceImpl response sent");
-
- }
-
- public void multiCallBack(String aString) {
-
- System.out.println("CallBackCTypeServiceImpl message received: " + aString);
- callback.callBackIncrement("Who's There 1");
- System.out.println("CallBackCTypeServiceImpl response sent");
- callback.callBackIncrement("Who's There 2");
- System.out.println("CallBackCTypeServiceImpl response sent");
- callback.callBackIncrement("Who's There 3");
- System.out.println("CallBackCTypeServiceImpl response sent");
-
- }
-
- public void noCallBack(String aString) {
-
- System.out.println("CallBackCTypeServiceImpl message received: " + aString);
- System.out.println("CallBackCTypeServiceImpl No response desired");
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite b/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite
deleted file mode 100644
index 3f48f16389..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://callback"
- name="CallBackCTypeTest">
-
- <component name="CallBackCTypeClient">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackCTypeClientImpl"/>
- <reference name="aCallBackService" target="CallBackCTypeService"/>
- </component>
-
- <component name="CallBackCTypeService">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackCTypeServiceImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType b/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType
deleted file mode 100644
index ff38134df5..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0" >
-
- <service name="CallBackCTypeService">
- <interface.java interface="org.apache.tuscany.sca.test.CallBackCTypeService"
- callbackInterface="org.apache.tuscany.sca.test.CallBackCTypeCallBack"/>
- </service>
-
-</componentType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.java b/tags/java/sca/2.0-M1/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.java
deleted file mode 100644
index 5c2b4d4388..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCaseFIXME.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.After;
-import org.junit.Before;
-
-//FIXME Fix this test case
-public class CallBackCTypeTestCaseFIXME extends TestCase {
-
- private Node node;
- private CallBackCTypeClient aCallBackClient;
-
- public void testCallBackBasic() {
- aCallBackClient.run();
- }
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation(".composite");
- node = NodeFactory.newInstance().createNode("CallBackCTypeClient.composite");
-
- aCallBackClient = node.getService(CallBackCTypeClient.class, "CallBackCTypeClient");
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-id/pom.xml b/tags/java/sca/2.0-M1/itest/callback-id/pom.xml
deleted file mode 100644
index b3879c4e50..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-id/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-callback-id</artifactId>
- <name>Apache Tuscany SCA Callback ID Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java b/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java
deleted file mode 100644
index 643cb3beb8..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-/**
- *
- */
-public interface CallBackIdCallBack {
-
- void callBackMessage(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java b/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java
deleted file mode 100644
index 6e5a0c7654..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface CallBackIdClient {
-
- void run();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java b/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java
deleted file mode 100644
index aaf99a534b..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import org.junit.Assert;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackIdClient.class)
-public class CallBackIdClientImpl implements CallBackIdClient, CallBackIdCallBack {
-
- @Context
- protected ComponentContext componentContext;
-
- @Reference
- protected ServiceReference<CallBackIdService> aCallBackService;
-
- private static String returnMessage = null;
- private static Object monitor = new Object();
- private static Object callBackId;
-
- public void run() {
-
- // This tests the use of the set/get callbackId API both SCA generated
- // and client specified.
-
- // Test1 uses a SCA generated callback ID and compare that with the
- // callbackID returned during callback.
- test11a();
-
- // Test2 uses a Client specified callback ID and compare that with the
- // callbackID returned during callback.
- test11b();
-
- }
-
- private void test11a() {
-
- // Retrieve this services callback ID and save it. Once the callback is
- // received the callback ID will be compared with the one
- // returned. Equal is good.
-
- Object origCallBackId = aCallBackService.getCallbackID();
- aCallBackService.getService().knockKnock("Knock Knock - Test1");
- int count = 0;
-
- //
- // If we cannot get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert.assertEquals("CallBackIdITest - test11a - SCA Generated Id", origCallBackId, this.getCallBackId());
-
- }
-
- private void test11b() {
-
- // Set the services callback ID and save it. Once the callback is
- // received the callback ID will be compared with the one
- // returned. Equal is good.
-
- String origCallBackId = "CallBackId1";
- aCallBackService.setCallbackID(origCallBackId);
-
- aCallBackService.getService().knockKnock("Knock Knock - Test2");
- int count = 0;
-
- //
- // If we can't get a response in 30 seconds consider this a failure
- //
-
- synchronized (monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- Assert
- .assertEquals("CallBackIdITest - 11b - Client Specified Id", origCallBackId, (String)this.getCallBackId());
-
- }
-
- public String getReturnMessage() {
- return returnMessage;
- }
-
- public void setReturnMessage(String aReturnMessage) {
- returnMessage = aReturnMessage;
- }
-
- public void callBackMessage(String aString) {
-
- System.out.println("Entering callback callBackMessage: " + aString);
- RequestContext rc = componentContext.getRequestContext();
- Object callBackId = rc.getServiceReference().getCallbackID();
-
- synchronized (monitor) {
- this.setReturnMessage(aString);
- this.setCallBackId(callBackId);
- monitor.notify();
- }
- }
-
- protected Object getCallBackId() {
- return callBackId;
- }
-
- protected void setCallBackId(Object aCallBackId) {
- callBackId = aCallBackId;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java b/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java
deleted file mode 100644
index cc7907f6ae..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-@Callback(CallBackIdCallBack.class)
-/**
- *
- */
-public interface CallBackIdService {
-
- void knockKnock(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java b/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java
deleted file mode 100644
index 4f04959b9d..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-id/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackIdService.class)
-public class CallBackIdServiceImpl implements CallBackIdService {
-
- @Callback
- protected CallBackIdCallBack callback;
- @Context
- protected ComponentContext compositeContext;
-
- public void knockKnock(String aString) {
-
- System.out.println("CallBackIdServiceImpl message received: " + aString);
- RequestContext rc = compositeContext.getRequestContext();
- Object callBackId = rc.getServiceReference().getCallbackID();
- System.out.println("CallBackIdServiceImpl callbackID: " + callBackId);
-
- callback.callBackMessage("Who's There");
- System.out.println("CallBackIdServiceImpl response sent");
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-id/src/main/resources/CallBackIdClient.composite b/tags/java/sca/2.0-M1/itest/callback-id/src/main/resources/CallBackIdClient.composite
deleted file mode 100644
index c9a6ba6258..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-id/src/main/resources/CallBackIdClient.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://callback"
- name="CallBackIdTest">
-
- <component name="CallBackIdClient">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackIdClientImpl"/>
- <reference name="aCallBackService" target="CallBackIdService"/>
- </component>
-
- <component name="CallBackIdService">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackIdServiceImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java b/tags/java/sca/2.0-M1/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java
deleted file mode 100644
index 56fd46d1b0..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-id/src/test/java/org/apache/tuscany/sca/test/CallBackIdTestCase.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-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.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class CallBackIdTestCase {
-
- private Node node;
- private CallBackIdClient aCallBackClient;
-
- @Test
- public void testCallBackBasic() {
- aCallBackClient.run();
- }
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("CallBackIdClient.composite");
- node = NodeFactory.newInstance().createNode("CallBackIdClient.composite", new Contribution("c1", location));
- node.start();
- aCallBackClient = node.getService(CallBackIdClient.class, "CallBackIdClient");
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/pom.xml b/tags/java/sca/2.0-M1/itest/callback-multiple-wires/pom.xml
deleted file mode 100644
index aa2c5c9e81..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-callback-multiple-wires</artifactId>
- <name>Apache Tuscany SCA Callback With Mutiple Wires Test</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java b/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java
deleted file mode 100644
index 7c80d222fc..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.callback;
-
-/**
- * The client interface
- */
-public interface MyClient {
-
- void aClientMethod();
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java b/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java
deleted file mode 100644
index 0fe34b9d68..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.callback;
-
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * Demonstrates a component-to-component callback invocation
- */
-@Service(MyClient.class)
-@Scope("COMPOSITE")
-public class MyClientImpl1 implements MyClient, MyServiceCallback {
-
- private MyService myService;
- static String result;
-
- @Reference
- public void setMyService(MyService myService) {
- this.myService = myService;
- }
-
- public void aClientMethod() {
- myService.someMethod("-> someMethod1");
- }
-
- public void receiveResult(String result) {
- System.out.println("Work thread " + Thread.currentThread());
- System.out.println("Result: " + result);
- MyClientImpl1.result = result;
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java b/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java
deleted file mode 100644
index 6b455a1f5b..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.callback;
-
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * Demonstrates a component-to-component callback invocation
- */
-@Service(MyClient.class)
-@Scope("COMPOSITE")
-public class MyClientImpl2 implements MyClient, MyServiceCallback {
-
- private MyService myService;
- static String result;
-
- @Reference
- public void setMyService(MyService myService) {
- this.myService = myService;
- }
-
- public void aClientMethod() {
- myService.someMethod("-> someMethod2");
- }
-
- public void receiveResult(String result) {
- System.out.println("Work thread " + Thread.currentThread());
- System.out.println("Result: " + result);
- MyClientImpl2.result = result;
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java b/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java
deleted file mode 100644
index 66758a1e73..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.callback;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.OneWay;
-
-/**
- * This service that will be invoked in a non-blocking fashion
- */
-@Callback(MyServiceCallback.class)
-public interface MyService {
-
- @OneWay
- void someMethod(String arg);
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java b/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java
deleted file mode 100644
index f198efae51..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.callback;
-
-/**
- * The callback interface for {@link MyService}.
- */
-public interface MyServiceCallback {
-
- void receiveResult(String result);
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java b/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java
deleted file mode 100644
index 49df5aa17a..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.callback;
-
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements MyService and uses a callback.
- */
-@Service(MyService.class)
-@Scope("COMPOSITE")
-public class MyServiceImpl implements MyService {
-
- @Context
- protected RequestContext requestContext;
-
- public void someMethod(String arg) {
- // invoke the callback
- try {
- MyServiceCallback myServiceCallback = requestContext.getCallback();
- myServiceCallback.receiveResult(arg + " -> receiveResult");
- } catch (RuntimeException e) {
- System.out.println("RuntimeException invoking receiveResult: " + e.toString());
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite b/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
deleted file mode 100644
index 3dae3ca3a8..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://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/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java b/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java
deleted file mode 100644
index bd3cce74b4..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.callback;
-
-import static org.junit.Assert.assertEquals;
-
-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.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * A TestCase that demonstrates resolving the client service and initiating the callback sequence
- */
-public class CallbackMultiWireTestCase {
-
- private Node node;
- private MyClient myClient1;
- private MyClient myClient2;
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("CallbackMultiWireTest.composite");
- node = NodeFactory.newInstance().createNode("CallbackMultiWireTest.composite", new Contribution("c1", location));
- node.start();
- myClient1 = node.getService(MyClient.class, "MyClientComponent1");
- myClient2 = node.getService(MyClient.class, "MyClientComponent2");
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-
- @Test
- public void test() throws Exception {
- System.out.println("Main thread " + Thread.currentThread());
- myClient1.aClientMethod();
- myClient2.aClientMethod();
- System.out.println("Sleeping ...");
- Thread.sleep(300);
- assertEquals("-> someMethod1 -> receiveResult", MyClientImpl1.result);
- assertEquals("-> someMethod2 -> receiveResult", MyClientImpl2.result);
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-separatethread/pom.xml b/tags/java/sca/2.0-M1/itest/callback-separatethread/pom.xml
deleted file mode 100644
index 185575094f..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-separatethread/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-callback-separatethread</artifactId>
- <name>Apache Tuscany SCA Callback Using Separate Thread Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java b/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java
deleted file mode 100644
index dc66003604..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * This is the client interface for the call backs in a separate thread tests
- */
-@Remotable
-public interface CallBackSeparateThreadClient {
-
- /**
- * This tests call back patterns using separate threads.
- */
- void runTests();
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java b/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java
deleted file mode 100644
index f03144db8a..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.junit.Assert;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This is the client implementation for the call backs in a separate thread tests
- */
-@Service(CallBackSeparateThreadClient.class)
-public class CallBackSeparateThreadClientImpl implements CallBackSeparateThreadClient, EventProcessorCallBack {
- /**
- * Max time to wait to receive events. If not all the events are received then timeout.
- */
- private static final int TIMEOUT = 30 * 1000;
-
- /**
- * Counts the number of fast call backs.
- */
- private static final AtomicInteger FAST_CALLBACK_COUNT = new AtomicInteger();
-
- /**
- * Counts the number of slow call backs.
- */
- private static final AtomicInteger SLOW_CALLBACK_COUNT = new AtomicInteger();
-
- /**
- * This is our injected reference to the EventProcessorService
- */
- @Reference
- protected EventProcessorService aCallBackService;
-
- /**
- * This tests call back patterns using separate threads.
- */
- public void runTests() {
- try {
- // Register for fast call back
- registerForFastCallback();
-
- // Wait for a few fast call backs
- System.out.println("Waiting for some fast call backs");
- waitForSomeFastCallbacks();
-
- try {
- // Register for slow call back
- registerForSlowCallback();
-
- // Wait for a few fast call backs
- System.out.println("Waiting for some fast calls");
- waitForSomeFastCallbacks();
-
- // Wait for a few slow call backs
- System.out.println("Waiting for some slow calls");
- waitForSomeSlowCallbacks();
- } finally {
- unregisterForSlowCallback();
- }
-
- System.out.println("Done");
- } finally {
- unregisterForFastCallback();
- }
- }
-
- /**
- * Waits for some fast call backs to be fired
- */
- private void waitForSomeFastCallbacks() {
- // Reset the fast call back count
- FAST_CALLBACK_COUNT.set(0);
-
- // Wait until we have 10 fast call backs or timeout occurs
- final long start = System.currentTimeMillis();
- do {
- if (FAST_CALLBACK_COUNT.get() >= 10) {
- System.out.println("Received enough fast notifications");
- return;
- }
-
- try {
- Thread.sleep(5);
- } catch (InterruptedException e) {
- Assert.fail("Unexpeceted exception " + e);
- }
- } while (System.currentTimeMillis() - start < TIMEOUT);
-
- // If we get to here then we did not receive enough events
- Assert.fail("Did not receive enough fast events");
- }
-
- /**
- * Waits for some slow call backs to be fired
- */
- private void waitForSomeSlowCallbacks() {
- // Reset the slow call back count
- SLOW_CALLBACK_COUNT.set(0);
-
- // Wait until we have 4 slow call backs or timeout
- final long start = System.currentTimeMillis();
- do {
- if (SLOW_CALLBACK_COUNT.get() >= 4) {
- System.out.println("Received enough slow notifications");
- return;
- }
-
- try {
- Thread.sleep(5);
- } catch (InterruptedException e) {
- Assert.fail("Unexpeceted exception " + e);
- }
- } while (System.currentTimeMillis() - start < TIMEOUT);
-
- // If we get to here then we did not receive enough events
- Assert.fail("Did not receive enough slow events");
- }
-
- /**
- * Register to receive fast call backs
- */
- private void registerForFastCallback() {
- aCallBackService.registerForEvent("FAST");
- }
-
- /**
- * Register to receive slow call backs
- */
- private void registerForSlowCallback() {
- aCallBackService.registerForEvent("SLOW");
- }
-
- /**
- * Unregister to receive fast call backs
- */
- private void unregisterForFastCallback() {
- aCallBackService.unregisterForEvent("FAST");
- }
-
- /**
- * Unregister to receive slow call backs
- */
- private void unregisterForSlowCallback() {
- aCallBackService.unregisterForEvent("SLOW");
- }
-
- /**
- * Method that is called when an Event is delivered.
- *
- * @param aEventName The name of the Event
- * @param aEventData The Event data
- */
- public void eventNotification(String aEventName, Object aEventData) {
- // System.out.println("Received Event : " + aEventName + " " + aEventData);
-
- if (aEventName.equals("FAST")) {
- final int newValue = FAST_CALLBACK_COUNT.incrementAndGet();
- //System.out.println("Received total of " + newValue + " fast call backs");
- } else if (aEventName.equals("SLOW")) {
- final int newValue = SLOW_CALLBACK_COUNT.incrementAndGet();
- //System.out.println("Received total of " + newValue + " slow call backs");
- } else {
- System.out.println("Unknown event type of " + aEventName);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java b/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java
deleted file mode 100644
index 137ea6a658..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The call back interface for the EventProcessorService that is implemented
- * by the client to receive event notifications
- */
-@Remotable
-public interface EventProcessorCallBack {
- /**
- * Call back notifying client of an Event
- *
- * @param aEventName The name of the Event
- * @param aEventData The data for the Event
- */
- void eventNotification(String aEventName, Object aEventData);
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java b/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java
deleted file mode 100644
index a00578427c..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Sample Event Processor Service
- */
-@Conversational
-@Callback(EventProcessorCallBack.class)
-@Remotable
-public interface EventProcessorService {
-
- /**
- * Registers the client to receive notifications for the specified event
- *
- * @param aEventName The name of the Event to register
- */
- void registerForEvent(String aEventName);
-
- /**
- * Unregisters the client so it no longer receives notifications for the specified event
- *
- * @param aEventName The name of the Event to unregister
- */
- void unregisterForEvent(String aEventName);
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java b/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java
deleted file mode 100644
index 692ffbe8dd..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * Sample Event Processor Service Implementation
- */
-@Service(EventProcessorService.class)
-@Scope("CONVERSATION")
-public class EventProcessorServiceImpl implements EventProcessorService {
-
- /**
- * Reference to the call back
- */
- @Callback
- protected CallableReference<EventProcessorCallBack> clientCallback;
-
- /**
- * This map contains the call backs for each of the registered Event names
- */
- private final Map<String, CallableReference<EventProcessorCallBack>> eventListeners;
-
- /**
- * The list of all Event Generators we create
- */
- private final EventGenerator[] allEventGenerators;
-
- /**
- * Constructor. Starts the Event Generators
- */
- public EventProcessorServiceImpl() {
- eventListeners = new ConcurrentHashMap<String, CallableReference<EventProcessorCallBack>>();
-
- // We will simulate an Event generator
- allEventGenerators = new EventGenerator[2];
- allEventGenerators[0] = new EventGenerator("FAST", 10); // Generate the FAST event every 10ms
- allEventGenerators[1] = new EventGenerator("SLOW", 50); // Generate the SLOW event every 50ms
- }
-
- /**
- * Registers the client to receive notifications for the specified event
- *
- * @param aEventName The name of the Event to register
- */
- public void registerForEvent(String aEventName) {
- // Register for the Event
- eventListeners.put(aEventName, clientCallback);
-
- // Send the "register" started event to the client
- receiveEvent(aEventName, "SameThread: Registered to receive notifications for " + aEventName);
- }
-
- /**
- * Unregisters the client so it no longer receives notifications for the specified event
- *
- * @param aEventName The name of the Event to unregister
- */
- public void unregisterForEvent(String aEventName) {
- // Send the "register" started event to the client
- receiveEvent(aEventName, "SameThread: Unregister from receiving notifications for " + aEventName);
-
- eventListeners.remove(aEventName);
- }
-
- /**
- * This method is called whenever the EventProcessorService receives an Event
- *
- * @param aEventName The name of the Event received
- * @param aEventData The Event data
- */
- private void receiveEvent(String aEventName, Object aEventData) {
- // Get the listener for the Event
- final CallableReference<EventProcessorCallBack> callback = eventListeners.get(aEventName);
- if (callback == null) {
- //System.out.println("No registered listeners for " + aEventName);
- return;
- }
-
- // Trigger the call back
- // System.out.println("Notifying " + callback + " of event " + aEventName);
- callback.getService().eventNotification(aEventName, aEventData);
- // System.out.println("Done notify " + callback + " of event " + aEventName);
- }
-
- /**
- * Shuts down the Event Processor
- */
- @Destroy
- public void shutdown() {
- System.out.println("Shutting down the EventProcessor");
-
- // Clear list of call back locations as we don't want to send any more notifications
- eventListeners.clear();
-
- // Stop the Event Generators
- for (EventGenerator generator : allEventGenerators) {
- generator.stop();
- }
- }
-
- /**
- * Utility class for generating Events
- */
- private final class EventGenerator {
- /**
- * The Timer we are using to generate the events
- */
- private final Timer timer = new Timer();
-
- /**
- * Lock object to ensure that we can cancel the timer cleanly.
- */
- private final Object lock = new Object();
-
- /**
- * Constructor
- *
- * @param aEventName The name of the Event to generate
- * @param frequencyInMilliseconds How frequently we should generate the Events
- */
- private EventGenerator(String aEventName, int frequencyInMilliseconds) {
- timer.schedule(new EventGeneratorTimerTask(aEventName),
- frequencyInMilliseconds,
- frequencyInMilliseconds);
- }
-
- /**
- * Stop this Event Generator
- */
- private void stop() {
- synchronized (lock) {
- timer.cancel();
- }
- }
-
- /**
- * The TimerTask that is invoked by the Timer for the EventGenerator
- */
- private final class EventGeneratorTimerTask extends TimerTask {
- /**
- * The name of the Event we should generate
- */
- private final String eventName;
-
- /**
- * Constructor
- *
- * @param aEventName The name of the Event we should generate
- */
- private EventGeneratorTimerTask(String aEventName) {
- eventName = aEventName;
- }
-
- /**
- * Timer calls this method and it will generate an Event
- */
-
- public void run() {
- synchronized(lock) {
- // System.out.println("Generating new event " + eventName);
- receiveEvent(eventName, "Separate Thread Notification: " + UUID.randomUUID().toString());
- }
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite b/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
deleted file mode 100644
index e111e5074c..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://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/tags/java/sca/2.0-M1/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java b/tags/java/sca/2.0-M1/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java
deleted file mode 100644
index c216cab1be..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-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.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * This test case will attempt to trigger a call back using a separate thread
- */
-public class CallBackSeparateThreadTestCase {
-
- /**
- * The Node we are using
- */
- private Node node;
-
- /**
- * The client the tests should use
- */
- private CallBackSeparateThreadClient aCallBackClient;
-
- /**
- * Run the call back in separate thread tests
- */
- @Test
- public void testCallBackSeparateThread() {
- aCallBackClient.runTests();
- }
-
- /**
- * Load the Call back in separate thread composite and look up the client.
- */
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("CallBackSeparateThreadTest.composite");
- node = NodeFactory.newInstance().createNode("CallBackSeparateThreadTest.composite", new Contribution("c1", location));
- node.start();
- aCallBackClient = node.getService(CallBackSeparateThreadClient.class, "CallBackSeparateThreadClient");
- }
-
- /**
- * Shutdown the SCA node
- */
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/pom.xml b/tags/java/sca/2.0-M1/itest/callback-set-callback/pom.xml
deleted file mode 100644
index 5da3ddcf71..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-callback-set-callback</artifactId>
- <name>Apache Tuscany SCA Set Callback Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java b/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java
deleted file mode 100644
index e54b9b4004..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Callback;
-
-// @Remotable
-@Callback(CallBackSetCallbackCallback.class)
-/**
- *
- */
-public interface CallBackSetCalbackService {
-
- void knockKnock(String aString);
-
- boolean setCallbackIllegally(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java b/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java
deleted file mode 100644
index f80401836e..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.junit.Assert;
-
-public class CallBackSetCallbackBadCallback {
-
- public CallBackSetCallbackBadCallback() {
- super();
- }
-
- public void callback(String aString) {
- //
- // This callback method should never be called.
- //
- System.out.println("CallBackSetCallbackBadCallback: callback called");
- Assert.fail("CallBackSetCallbackBadCallback: callback called");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java b/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java
deleted file mode 100644
index a15bcd90ae..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-// @Remotable
-/**
- *
- */
-public interface CallBackSetCallbackCallback {
-
- void callBackMessage(String aString);
-
- void callBackIncrement(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java b/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java
deleted file mode 100644
index 3e72b7ef3c..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import java.io.File;
-
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackSetCallbackCallback.class)
-public class CallBackSetCallbackCallbackImpl implements CallBackSetCallbackCallback {
-
- private static String returnMessage = null;
- private static int callBackCount = 0;
-
- public String getReturnMessage() {
- return returnMessage;
- }
-
- public void setReturnMessage(String aReturnMessage) {
- returnMessage = aReturnMessage;
- }
-
- public int getCallBackCount() {
- return callBackCount;
- }
-
- public void incrementCallBackCount() {
- callBackCount++;
- }
-
- public void callBackMessage(String aString) {
-
- System.out.println("Entering CallBackSetCallbackCallbackImpl callBackMessage: " + aString);
-
- File aFile = new File("target/test4_marker");
- try {
- aFile.createNewFile();
- } catch (Exception ex) {
- System.out.println("Error Creating target/test4_marker marker file");
- ex.printStackTrace();
- }
-
- }
-
- public void callBackIncrement(String aString) {
- System.out.println("Entering callback increment: " + aString);
- this.incrementCallBackCount();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java b/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java
deleted file mode 100644
index 6fd13eec5f..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface CallBackSetCallbackClient {
-
- void run();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java b/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java
deleted file mode 100644
index 08c8b94a2f..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import java.io.File;
-
-import org.junit.Assert;
-import org.oasisopen.sca.NoRegisteredCallbackException;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackSetCallbackClient.class)
-public class CallBackSetCallbackClientImpl implements CallBackSetCallbackClient {
-
- @Reference
- protected ServiceReference<CallBackSetCalbackService> aCallBackService;
- @Reference
- protected ServiceReference<CallBackSetCallbackCallback> callBack;
-
- public void run() {
-
- // This test various aspects of the setCallback() API in a stateless
- // scope.
-
- /*
- * test4 Client does not implement the callback interface but calls
- * setCallback with a service reference before invoking the target,
- * Verify successful execution.
- */
-
- test4();
-
- /*
- * test5 The client does not implement the callback interface and does
- * not call setCallback() before invoking the target. Verify a
- * NoRegisteredCallbackException is thrown.
- */
-
- test5();
-
- /*
- * test6() The client calls setCallback() with an object that is not a
- * service reference and the callback interface is stateless. Verify
- * that an appropriate exception is thrown. When calling setCallback
- * with an object the interface must be stateful. Stateless interfaces
- * require a service Reference.
- */
-
- test6();
-
- /*
- * test10 The target calls setCallback() on its own service reference,
- * e.g. getRequestContext().getServiceReference().getCallback(). Verify
- * an appropriate exception occurs.
- */
-
- test10();
- }
-
- private void test4() {
-
- //
- // Since callbacks do not synchronously return and this test results in
- // a callback to a component other
- // than this client I am using a marker file to determine the outcome.
- // The presence of the marker
- // file will be used for the Assertion test. If it exists then the
- // callback occurred and all is good.
- //
-
- // Make sure the marker file is not present before starting the test.
- File aFile = new File("target/test4_marker");
- if (aFile.exists()) {
- aFile.delete();
- }
-
- aCallBackService.setCallback(callBack);
-
- aCallBackService.getService().knockKnock("Knock Knock");
-
- // Lets give the callback a little time to complete....
-
- int count = 0;
- long timeout = 1000;
-
- while (count++ < 30 && (aFile.exists() == false)) {
- try {
- Thread.sleep(timeout);
- } catch (InterruptedException ie) {
- }
- }
-
- Assert.assertEquals("CallBackSetCallback - Test4", true, aFile.exists());
-
- aCallBackService.setCallback(null); // leave this in the default state for next test
-
- }
-
- private void test5() {
-
- boolean correctException = false;
-
- //
- // The backend service is expecting a callback reference to be set. This
- // test will not
- // set one so an exception is expected. According to the spec if a
- // client calls a method on
- // a service reference prior to calling setCallback() then a
- // NoRegisteredCallbackException
- // will be thrown on the client.
- //
-
- try {
- aCallBackService.getService().knockKnock("Knock Knock");
- } catch (NoRegisteredCallbackException NotRegEx) {
- correctException = true;
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- Assert.assertEquals("CallBackSetCallback - Test5", true, correctException);
-
- }
-
- private void test6() {
-
- boolean correctException = false;
-
- //
- // This test is to specify an Object that is not a service reference
- // that does implement
- // the callback interface. However because this callback service is
- // stateless the expected
- // result is an appropriate exception.
- //
-
- try {
- aCallBackService.setCallback(new CallBackSetCallbackObjectCallback());
- aCallBackService.getService().knockKnock("Knock Knock");
- }
- //
- // This should catch an appropriate exception.
- //
- catch (IllegalArgumentException goodEx) {
- correctException = true;
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- Assert.assertEquals("CallBackSetCallback - Test6", true, correctException);
-
- }
-
- private void test10() {
-
- //
- // The appropriate exception should be thrown and caught on the service side.
- // If this happens, the setCallbackIllegally() method will return true.
- // If not, this method will return false.
- //
-
- aCallBackService.setCallback(callBack); // ensure no client-side exception
-
- boolean result =
- aCallBackService.getService().setCallbackIllegally("Try to set callback on your own service reference");
-
- Assert.assertEquals("CallBackSetCallback - Test10", true, result);
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java b/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java
deleted file mode 100644
index afedcdf7f1..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-public class CallBackSetCallbackObjectCallback implements CallBackSetCallbackCallback {
-
- private int callBackCount = 0;
-
- public CallBackSetCallbackObjectCallback() {
- super();
- }
-
- public void incrementCallBackCount() {
- callBackCount++;
- }
-
- public void callBackMessage(String aString) {
-
- System.out.println("Entering CallBackSetCallbackObjectCallback callBackMessage: " + aString);
-
- }
-
- public void callBackIncrement(String aString) {
- System.out.println("Entering callback increment: " + aString);
- this.incrementCallBackCount();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java b/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java
deleted file mode 100644
index 78bc793c81..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackSetCalbackService.class)
-public class CallBackSetCallbackServiceImpl implements CallBackSetCalbackService {
-
- @Callback
- protected CallBackSetCallbackCallback callback;
- @Context
- protected ComponentContext context;
-
- public void knockKnock(String aString) {
-
- try {
- System.out.println("CallBackBasicServiceImpl message received: " + aString);
- callback.callBackMessage("Who's There");
- System.out.println("CallBackBasicServiceImpl response sent");
- return;
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- }
-
- public boolean setCallbackIllegally(String aString) {
-
- System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() message received: " + aString);
-
- boolean exceptionProduced = false;
- RequestContext requestContext = null;
- ServiceReference serviceRef = null;
-
- try {
- requestContext = context.getRequestContext();
- serviceRef = (ServiceReference)requestContext.getServiceReference();
- serviceRef.setCallback(serviceRef);
- } catch (ClassCastException goodEx) {
- exceptionProduced = true;
- System.out.println("Test10 appropriate exception caught during setCallback to own service reference");
- } catch (Exception badEx) {
- System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() " + badEx.toString());
- badEx.printStackTrace();
- }
-
- // Return a flag indicating whether we got the exception we are looking for
- return exceptionProduced;
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite b/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite
deleted file mode 100644
index 3552ddecab..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/main/resources/CallBackSetCallbackTest.composite
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://callback"
- name="CallBackSetCallbackTest">
-
- <component name="CallBackSetCallbackClient">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackClientImpl"/>
- <reference name="aCallBackService" target="CallBackSetCallbackService"/>
- <reference name="callBack" target="CallBackSetCallbackCallback"/>
- </component>
-
- <component name="CallBackSetCallbackCallback">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackCallbackImpl"/>
- </component>
-
- <component name="CallBackSetCallbackService">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackServiceImpl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java b/tags/java/sca/2.0-M1/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java
deleted file mode 100644
index 5aaf596d85..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-callback/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackTestCase.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import junit.framework.TestCase;
-
-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.After;
-import org.junit.Before;
-
-//FIXME Fix this test case
-public class CallBackSetCallbackTestCase extends TestCase {
-
- private Node node;
- private CallBackSetCallbackClient aCallBackClient;
-
- public void testCallBackSetCallback() {
- aCallBackClient.run();
- }
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("CallBackSetCallbackTest.composite");
- node =
- NodeFactory.newInstance().createNode("CallBackSetCallbackTest.composite", new Contribution("c1", location));
- node.start();
- aCallBackClient = node.getService(CallBackSetCallbackClient.class, "CallBackSetCallbackClient");
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/pom.xml b/tags/java/sca/2.0-M1/itest/callback-set-conversation/pom.xml
deleted file mode 100644
index 90beb9e570..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-callback-set-conversation</artifactId>
- <name>Apache Tuscany SCA Callback Set Conversation Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java b/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java
deleted file mode 100644
index 77837fdb77..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import java.io.Serializable;
-
-import org.junit.Assert;
-
-public class CallBackSetCallbackConvBadCallback implements Serializable {
-
- public CallBackSetCallbackConvBadCallback() {
- super();
- }
-
- public void callback(String aString) {
- //
- // This callback method should never be called.
- //
- System.out.println("CallBackSetCallbackBadCallback: callback called");
- Assert.fail("CallBackSetCallbackConvBadCallback: callback called");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java b/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java
deleted file mode 100644
index 825d1d6486..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-// @Remotable
-@Conversational
-/**
- *
- */
-public interface CallBackSetCallbackConvCallback {
-
- void callBackMessage(String aString);
-
- void callBackIncrement(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java b/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java
deleted file mode 100644
index b5c3e6e8b8..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface CallBackSetCallbackConvClient {
-
- void run();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java b/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java
deleted file mode 100644
index 12a206affa..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.junit.Assert;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackSetCallbackConvClient.class)
-@Scope("CONVERSATION")
-public class CallBackSetCallbackConvClientImpl implements CallBackSetCallbackConvClient {
-
- @Context
- protected ComponentContext componentContext;
-
- @Reference
- protected CallBackSetCallbackConvService aCallBackService;
-
- private CallBackSetCallbackConvObjectCallback aCallbackObject = null;
-
- public void run() {
-
- // This tests aspects of the setCallback() API within a conversational
- // scope.
-
- /*
- * test7 The client calls setCallback() with an object that is not a
- * service reference and the callback interface is stateful. Verify
- * successful execution.
- */
- test7();
-
- /*
- * test8() The client calls setCallback() with an object that does not
- * implement the callback interface. Verify an appropriate exception is
- * thrown. This requires a STATEFUL interface.
- */
- test8();
-
- /*
- * test9 The client calls setCallback() with an object that is not
- * Serializable. Verify an appropriate exception is thrown. This
- * requires a STATEFUL callback interface. Move from the stateless test
- * case.
- */
- test9();
- }
-
- private void test7() {
-
- //
- // This test is to specify an Object that is not a service reference
- // that does implement
- // the callback interface and is Serializable. Verify successful
- // execution.
- //
-
- aCallbackObject = new CallBackSetCallbackConvObjectCallback();
- aCallbackObject.incrementCallBackCount();
-
- ServiceReference<CallBackSetCallbackConvService> aCallBackServiceRef = componentContext.cast(aCallBackService);
- aCallBackServiceRef.setCallback(aCallbackObject);
- aCallBackService.knockKnock("Knock Knock 7");
-
- Assert.assertEquals("CallBackSetCallbackConv - Test7", 2, aCallbackObject.getCount());
-
- }
-
- private void test8() {
-
- boolean correctException = false;
-
- //
- // This test is to specify an Object that is not a service reference
- // that does not implement
- // the callback interface. The expected result is an appropriate
- // exception.
- //
-
- try {
- ServiceReference<CallBackSetCallbackConvService> aCallBackServiceRef =
- componentContext.cast(aCallBackService);
- aCallBackServiceRef.setCallback(new CallBackSetCallbackConvBadCallback());
- aCallBackService.knockKnock("Knock Knock 8");
- }
-
- //
- // This should catch an appropriate exception.
- //
-
- catch (IllegalArgumentException goodEx) {
- System.out.println("correct exception " + goodEx);
- correctException = true;
- }
-
- catch (Exception ex) {
- // This means an inappropriate exception occurred
- ex.printStackTrace();
- }
-
- Assert.assertEquals("CallBackSetCallbackConv - Test8", true, correctException);
-
- }
-
- private void test9() {
-
- boolean correctException = false;
-
- //
- // This test is to specify an Object that is not a service reference
- // that does implement
- // the callback interface but does not implement Serializable. Verify
- // an appropriate exception
- // is thrown.
- //
-
- try {
- ServiceReference<CallBackSetCallbackConvService> aCallBackServiceRef =
- componentContext.cast(aCallBackService);
- aCallBackServiceRef.setCallback(new CallBackSetCallbackConvNonSerCallback());
- aCallBackService.knockKnock("Knock Knock 9");
- }
- //
- // This should catch an appropriate exception.
- //
- catch (IllegalArgumentException goodEx) {
- System.out.println("correct exception " + goodEx);
- correctException = true;
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- Assert.assertEquals("CallBackSetCallbackConv - Test9", true, correctException);
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java b/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java
deleted file mode 100644
index bd17731fa1..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.junit.Assert;
-
-public class CallBackSetCallbackConvNonSerCallback implements CallBackSetCallbackConvCallback {
-
- private int callBackCount = 0;
-
- public CallBackSetCallbackConvNonSerCallback() {
- super();
- }
-
- public synchronized void incrementCallBackCount() {
- callBackCount++;
- }
-
- public synchronized int getCount() {
- return callBackCount;
- }
-
- public void callBackMessage(String aString) {
- //
- // This callback method should never be called.
- //
- System.out.println("Entering CallBackSetCallbackConvNonSerCallback callBackMessage: " + aString);
- Assert.fail("CallBackSetCallbackConvNonSerCallback: callbackMessage called");
- }
-
- public void callBackIncrement(String aString) {
- //
- // This callback method should never be called.
- //
- System.out.println("Entering callbackIncrement: " + aString);
- this.incrementCallBackCount();
- Assert.fail("CallBackSetCallbackConvNonSerCallback: callbackIncrement called");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java b/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java
deleted file mode 100644
index f7c718adab..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import java.io.Serializable;
-
-public class CallBackSetCallbackConvObjectCallback implements CallBackSetCallbackConvCallback, Serializable {
- private int callBackCount = 0;
-
- public CallBackSetCallbackConvObjectCallback() {
- super();
- }
-
- public synchronized void incrementCallBackCount() {
- callBackCount++;
- }
-
- public synchronized int getCount() {
- return callBackCount;
- }
-
- public void callBackMessage(String aString) {
-
- System.out.println("Entering CallBackSetCallbackObjectCallback callBackMessage: " + aString);
-
- }
-
- public void callBackIncrement(String aString) {
-
- System.out.println("Entering callback increment: " + aString);
-
- this.incrementCallBackCount();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java b/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java
deleted file mode 100644
index 74c19961ba..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-
-// @Remotable
-@Conversational
-@Callback(CallBackSetCallbackConvCallback.class)
-/**
- *
- */
-public interface CallBackSetCallbackConvService {
-
- void knockKnock(String aString);
-
- void setCallbackIllegally(String aString);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java b/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java
deleted file mode 100644
index d79b9278e2..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import java.io.File;
-
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CallBackSetCallbackConvService.class)
-@Scope("CONVERSATION")
-public class CallBackSetCallbackConvServiceImpl implements CallBackSetCallbackConvService {
-
- @Callback
- protected CallBackSetCallbackConvCallback callback;
- @Context
- protected ComponentContext context;
-
- public void knockKnock(String aString) {
-
- System.out.println("CallBackSetCallbackConvServiceImpl message received: " + aString);
- callback.callBackMessage("Who's There");
- callback.callBackIncrement("This should do it");
- System.out.println("CallBackSetCallbackConvServiceImpl response sent");
-
- }
-
- public void setCallbackIllegally(String aString) {
-
- System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() message received: " + aString);
-
- boolean exceptionProduced = false;
- RequestContext requestContext = null;
- ServiceReference serviceRef = null;
-
- // Context is not working properly so we can't trust that this is
- // working.....
- try {
- requestContext = context.getRequestContext();
- serviceRef = (ServiceReference)requestContext.getServiceReference();
- } catch (Exception ex) {
- System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() " + ex.toString());
- ex.printStackTrace();
- return;
- }
-
- // Ok, call setCallback with my own service reference.
- try {
- serviceRef.setCallback(serviceRef);
- } catch (NullPointerException npe) {
- // This is not an appropriate exception.
- System.out.println("Test10 NPE exception during setCallback to own service reference");
- npe.printStackTrace();
- return;
- }
- // This needs to catch the appropriate exception, once we figure out
- // what is needs to be!
- catch (Exception ex) {
- exceptionProduced = true;
- System.out.println("Test10 appropriate exception caught during setCallback to own service reference");
- }
- ;
-
- // If we get the exception we are looking for then create the marker
- // file.
- if (exceptionProduced == true) {
- File aFile = new File("target/test10_marker");
- try {
- aFile.createNewFile();
- } catch (Exception ex) {
- System.out.println("Error Creating target/test10_marker marker file");
- ex.printStackTrace();
- }
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite b/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite
deleted file mode 100644
index ce73417f94..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/main/resources/CallBackSetCallbackConvTest.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://callback"
- name="CallBackSetCallbackConvTest">
-
- <component name="CallBackSetCallbackConvClient">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackConvClientImpl"/>
- <reference name="aCallBackService" target="CallBackSetCallbackConvService"/>
- </component>
-
-
- <component name="CallBackSetCallbackConvService">
- <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackConvServiceImpl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java b/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java
deleted file mode 100644
index a61682da06..0000000000
--- a/tags/java/sca/2.0-M1/itest/callback-set-conversation/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvTestCase.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-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.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class CallBackSetCallbackConvTestCase {
-
- private Node node;
- private CallBackSetCallbackConvClient aCallBackClient;
-
- @Test
- public void testCallBackSetCallback() {
- aCallBackClient.run();
- }
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("CallBackSetCallbackConvTest.composite");
- node = NodeFactory.newInstance().createNode("CallBackSetCallbackConvTest.composite", new Contribution("c1", location));
- node.start();
- aCallBackClient = node.getService(CallBackSetCallbackConvClient.class, "CallBackSetCallbackConvClient");
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/component-type/pom.xml b/tags/java/sca/2.0-M1/itest/component-type/pom.xml
deleted file mode 100644
index c15cb3ec23..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-component-type</artifactId>
- <name>Apache Tuscany SCA Component Type Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
-
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/AddService.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/AddService.java
deleted file mode 100644
index 188451ebac..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The Add service interface
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 8b6fe066a6..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorClient.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorClient.java
deleted file mode 100644
index 6f978bd9be..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorClient.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package 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 location = ContributionLocationHelper.getContributionLocation("Calculator.composite");
- Node node = NodeFactory.newInstance().createNode("Calculator.composite", new Contribution("c1", location));
- node.start();
-
- CalculatorService calculatorService =
- node.getService(CalculatorService.class, "CalculatorServiceComponent/CalculatorService");
-
- // 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/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index c89043276e..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The Calculator service interface.
- */
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 1209ac128a..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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 void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- 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/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/DivideService.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 30d248208b..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index f7ac0b7287..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605938..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index b7dca792b2..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/SubtractService.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index bf0d1882b6..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 77b128ab8d..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/Calculator.composite b/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/Calculator.composite
deleted file mode 100644
index b229787657..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/Calculator.composite
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- 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/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType b/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType
deleted file mode 100644
index 00c48e5a35..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType
+++ /dev/null
@@ -1,27 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
- <service name="AddService">
- <interface.java interface="calculator.AddService"/>
- </service>
-
-</componentType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType b/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType
deleted file mode 100644
index 74bedc0a98..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
- <service name="CalculatorService">
- <interface.java interface="calculator.CalculatorService"/>
- </service>
-
- <reference name="addService">
- <interface.java interface="calculator.AddService"/>
- </reference>
-
- <reference name="subtractService">
- <interface.java interface="calculator.SubtractService"/>
- </reference>
-
- <reference name="multiplyService">
- <interface.java interface="calculator.MultiplyService"/>
- </reference>
-
- <reference name="divideService">
- <interface.java interface="calculator.DivideService"/>
- </reference>
-
-</componentType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType b/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType
deleted file mode 100644
index 289fcc3e11..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType
+++ /dev/null
@@ -1,27 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
- <service name="DivideService">
- <interface.java interface="calculator.DivideService"/>
- </service>
-
-</componentType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType b/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType
deleted file mode 100644
index 2d8a879cda..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType
+++ /dev/null
@@ -1,27 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
- <service name="MultiplyService">
- <interface.java interface="calculator.MultiplyService"/>
- </service>
-
-</componentType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType b/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType
deleted file mode 100644
index 6214955141..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType
+++ /dev/null
@@ -1,27 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
- <service name="SubtractService">
- <interface.java interface="calculator.SubtractService"/>
- </service>
-
-</componentType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/component-type/src/test/java/calculator/CalculatorTestCase.java b/tags/java/sca/2.0-M1/itest/component-type/src/test/java/calculator/CalculatorTestCase.java
deleted file mode 100644
index ac3ccc3d08..0000000000
--- a/tags/java/sca/2.0-M1/itest/component-type/src/test/java/calculator/CalculatorTestCase.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * This shows how to test the Calculator service component.
- */
-public class CalculatorTestCase {
-
- private CalculatorService calculatorService;
- private Node node;
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("Calculator.composite");
- node = NodeFactory.newInstance().createNode("Calculator.composite", new Contribution("c1", location));
- node.start();
- calculatorService = node.getService(CalculatorService.class, "CalculatorServiceComponent/CalculatorService");
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-
- @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/tags/java/sca/2.0-M1/itest/conversations/pom.xml b/tags/java/sca/2.0-M1/itest/conversations/pom.xml
deleted file mode 100644
index 79304fe65f..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-conversations</artifactId>
- <name>Apache Tuscany SCA Conversations Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java
deleted file mode 100644
index a3b83dfc14..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest;
-
-import java.io.Serializable;
-
-/**
- * @version $Rev$ $Date$
- */
-public class Record implements Serializable {
- public String id;
- public String conversationId;
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java
deleted file mode 100644
index 946ad93d7d..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest;
-
-import java.util.Hashtable;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TestResult {
- public static Hashtable<Object, Boolean> results = new Hashtable<Object, Boolean>();
- private static int completed = 0;
-
- public static synchronized void updateCompleted() {
- ++completed;
- }
-
- public static synchronized int getCompleted() {
- return completed;
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java
deleted file mode 100644
index 27939e3996..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/AService.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple conversational Service that uses another Conversational Service
- */
-@Conversational
-public interface AService {
-
- /**
- * Returns the state for this service.
- *
- * @return The state for this service
- */
- String getState();
-
- /**
- * Returns the state for the other service that this service is using
- *
- * @return The state for the other service that this service is using
- */
- String getStateOnB();
-
- /**
- * Sets the state for this service.
- *
- * @param aState The state for this service
- */
- void setState(String aState);
-
- /**
- * Sets the state for the other service that this service is using
- *
- * @param aState The state for the other service that this service is using
- */
- void setStateOnB(String aState);
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java
deleted file mode 100644
index 7887417e55..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.OneWay;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * @version $Rev$ $Date$
- */
-
-@Remotable
-public interface Alpha {
- @OneWay
- void run(int param);
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java
deleted file mode 100644
index 735bcee176..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/BService.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple conversational Service
- */
-@Conversational
-public interface BService {
-
- /**
- * Returns the state for this service.
- *
- * @return The state for this service
- */
- String getState();
-
- /**
- * Sets the state for this service.
- *
- * @param aState The state for this service
- */
- void setState(String aState);
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java
deleted file mode 100644
index 1c5d2cdbb8..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * @version $Rev$ $Date$
- */
-
-@Remotable
-public interface Beta {
- CallableReference<Gamma> getRef(int param);
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java
deleted file mode 100644
index cebbea0701..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/CService.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple conversational Service that uses another Conversational Service
- */
-@Conversational
-public interface CService {
-
- String getState();
-
- void setState(String aState);
-
- Object getConversationID();
-
- Object getConversationObjectConversationId();
-
- void setConversationID(String theID);
-
- void endConversation();
-
- void endConversationViaAnnotatedMethod();
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java
deleted file mode 100644
index 3f04e9f09e..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Constants.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-public interface Constants {
-
- String A_INITIAL_VALUE = "Initial Value of A";
- String B_INITIAL_VALUE = "Initial Value of B";
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java
deleted file mode 100644
index 9ca4abb9d3..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-@Conversational
-public interface ConversationIdService {
-
- String getCIDField();
-
- String getCIDSetter();
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java
deleted file mode 100644
index 734fb9fe7b..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The callback interface used when testing conversational callbacks
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-@Remotable
-@Conversational
-public interface ConversationalCallback {
-
- void init();
-
- void destroy();
-
- void initializeCount(int count);
-
- void incrementCount();
-
- int retrieveCount();
-
- void businessException() throws Exception;
-
- @EndsConversation
- String endConversation();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java
deleted file mode 100644
index 99f4c85d8f..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The client for the conversational itest. Is implemented by clients
- * offering both stateless and stateful callbacks
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-
-@Remotable
-public interface ConversationalClient {
-
- int runConversationFromInjectedReference();
-
- int runConversationFromInjectedReference2();
-
- int runConversationFromServiceReference();
-
- int runConversationWithUserDefinedConversationId();
-
- String runConversationCheckUserDefinedConversationId();
-
- int runConversationCheckingScope();
-
- int runConversationWithCallback();
-
- int runConversationHavingPassedReference();
-
- String runConversationBusinessException();
-
- String runConversationBusinessExceptionCallback();
-
- int runConversationCallingEndedConversation();
-
- int runConversationCallingEndedConversationCallback();
-
- String runConversationCallingEndedConversationCheckConversationId();
-
- String runConversationCallingEndedConversationCallbackCheckConversationId();
-
- int runConversationAgeTimeout();
-
- int runConversationIdleTimeout();
-
- int runConversationPrincipleError();
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java
deleted file mode 100644
index fb4ecb56e7..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The client that calls into an existing conversation by accepting
- * a reference to that conversation
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-
-@Remotable
-public interface ConversationalReferenceClient {
-
- void incrementCount(CallableReference<ConversationalService> conversationalService);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java
deleted file mode 100644
index 21a4db737e..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The service interface used when testing conversations
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-@Remotable
-@Conversational
-@Callback(ConversationalCallback.class)
-public interface ConversationalService {
-
- void init();
-
- void destroy();
-
- void initializeCount(int count);
-
- void incrementCount();
-
- int retrieveCount();
-
- void businessException() throws Exception;
-
- void initializeCountCallback(int count);
-
- void incrementCountCallback();
-
- int retrieveCountCallback();
-
- void businessExceptionCallback() throws Exception;
-
- @EndsConversation
- String endConversation();
-
- String endConversationCallback();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java
deleted file mode 100644
index 48c1644b87..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The service interface used when testing conversations
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-@Remotable
-@Conversational
-@Callback(NonConversationalCallback.class)
-public interface ConversationalServiceNonConversationalCallback {
-
- void init();
-
- void destroy();
-
- void initializeCount(int count);
-
- void incrementCount();
-
- int retrieveCount();
-
- void businessException() throws Exception;
-
- void initializeCountCallback(int count);
-
- void incrementCountCallback();
-
- int retrieveCountCallback();
-
- void businessExceptionCallback() throws Exception;
-
- @EndsConversation
- String endConversation();
-
- String endConversationCallback();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.java
deleted file mode 100644
index 2c205c2cae..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/DService.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-
-/**
- * Simple conversational Service
- */
-@Conversational
-public interface DService {
-
- /**
- * Returns the state for this service.
- *
- * @return The state for this service
- */
- String getState();
-
- /**
- * Sets the state for this service.
- *
- * @param aState The state for this service
- */
- void setState(String aState);
-
- @EndsConversation
- void endConversationViaAnnotatedMethod();
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java
deleted file mode 100644
index 48c203ab35..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.apache.tuscany.sca.itest.Record;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * @version $Rev$ $Date$
- */
-
-@Remotable
-@Conversational
-public interface Gamma {
- void start(int param);
-
- boolean hasNext();
-
- Record next();
-
- @EndsConversation
- void stop();
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java
deleted file mode 100644
index 614c0a96b5..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The callback interface used when testing conversational callbacks
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-@Remotable
-public interface NonConversationalCallback {
-
- void init();
-
- void destroy();
-
- void initializeCount(int count);
-
- void incrementCount();
-
- int retrieveCount();
-
- void businessException() throws Exception;
-
- String endConversation();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java
deleted file mode 100644
index 86a96aaa75..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AServiceImpl.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.AService;
-import org.apache.tuscany.sca.itest.conversational.BService;
-import org.apache.tuscany.sca.itest.conversational.Constants;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * Simple conversational Service that uses another Conversational Service
- */
-@Service(AService.class)
-@Scope("CONVERSATION")
-public class AServiceImpl implements AService {
-
- /**
- * The state
- */
- private String state = Constants.A_INITIAL_VALUE;
-
- /**
- * The reference to the other service
- */
- private BService b;
-
- /**
- * Constructor
- *
- */
- public AServiceImpl() {
- System.out.println("---> AServiceImpl constructor for " + this);
- }
-
- /**
- * Inject the reference to the other service
- * @param aB The other service.
- */
- @Reference(name = "b")
- public void setB(BService aB) {
- System.out.println("---> Setting reference to B on " + this + " to " + aB);
- this.b = aB;
- }
-
- /**
- * Returns the state for this service.
- *
- * @return The state for this service
- */
- public String getState() {
- return state;
- }
-
- /**
- * Returns the state for the other service that this service is using
- *
- * @return The state for the other service that this service is using
- */
- public String getStateOnB() {
- return b.getState();
- }
-
- /**
- * Sets the state for this service.
- *
- * @param aState The state for this service
- */
- public void setState(String aState) {
- this.state = aState;
- }
-
- /**
- * Sets the state for the other service that this service is using
- *
- * @param aState The state for the other service that this service is using
- */
- public void setStateOnB(String aState) {
- b.setState(aState);
- }
-
- /**
- * Sets the conversation ID for this service
- * @param id The Conversation ID
- */
- @ConversationID
- public void setConversationID(String id) {
- System.out.println("Conversation ID for " + this + " is set to " + id);
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java
deleted file mode 100644
index b56186ea88..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.Record;
-import org.apache.tuscany.sca.itest.TestResult;
-import org.apache.tuscany.sca.itest.conversational.Alpha;
-import org.apache.tuscany.sca.itest.conversational.Beta;
-import org.apache.tuscany.sca.itest.conversational.Gamma;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * @version $Rev$ $Date$
- */
-
-@Service(Alpha.class)
-@Scope("COMPOSITE")
-public class AlphaImpl implements Alpha {
- @Reference
- public Beta beta;
-
- @Context
- protected ComponentContext componentContext;
-
- public void run(int param) {
- CallableReference<Gamma> gammaRef = null;
- boolean testPassed = true;
- try {
- gammaRef = beta.getRef(param);
- while (gammaRef.getService().hasNext()) {
- Record record = gammaRef.getService().next();
- if (!record.conversationId.equals(gammaRef.getConversation().getConversationID())) {
- // Record returned is not from this conversation.
- testPassed = false;
- }
- }
- } catch (Exception ex) {
- testPassed = false;
- ex.printStackTrace();
- } finally {
- TestResult.updateCompleted();
- if (gammaRef != null) {
- TestResult.results.put(gammaRef.getConversation().getConversationID(), testPassed);
- gammaRef.getService().stop();
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java
deleted file mode 100644
index f394770ffc..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BServiceImpl.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.BService;
-import org.apache.tuscany.sca.itest.conversational.Constants;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * Simple conversational Service
- */
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl implements BService {
-
- /**
- * The state for this service
- */
- private String state = Constants.B_INITIAL_VALUE;
-
- /**
- * Constructor
- */
- public BServiceImpl() {
- System.out.println("---> BServiceImpl constructor for " + this);
- }
-
- /**
- * Returns the state for this service.
- *
- * @return The state for this service
- */
- public String getState() {
- return state;
- }
-
- /**
- * Sets the state for this service.
- *
- * @param aState The state for this service
- */
- public void setState(String aState) {
- this.state = aState;
- }
-
- /**
- * Sets the conversation ID for this service
- * @param id The Conversation ID
- */
- @ConversationID
- public void setConversationID(String id) {
- System.out.println("Conversation ID for " + this + " is set to " + id);
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java
deleted file mode 100644
index b94e8a6452..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.Beta;
-import org.apache.tuscany.sca.itest.conversational.Gamma;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * @version $Rev$ $Date$
- */
-
-@Service(Beta.class)
-@Scope("COMPOSITE")
-public class BetaImpl implements Beta {
- @Context
- protected ComponentContext componentContext;
-
- @Reference
- public Gamma gamma;
-
- public CallableReference<Gamma> getRef(int param) {
- ServiceReference<Gamma> gammaRef = componentContext.getServiceReference(Gamma.class, "gamma");
- Gamma g = gammaRef.getService();
- g.start(param);
- return gammaRef;
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java
deleted file mode 100644
index 737c2940dd..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/CServiceImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.CService;
-import org.apache.tuscany.sca.itest.conversational.DService;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * Simple conversational Service that uses another Conversational Service
- */
-@Service(CService.class)
-@Scope("CONVERSATION")
-public class CServiceImpl implements CService {
-
- private ServiceReference<DService> dServiceRef;
-
- @Reference(name = "d")
- public void setD(ServiceReference<DService> servRef) {
- this.dServiceRef = servRef;
- }
-
- public String getState() {
- return dServiceRef.getService().getState();
- }
-
- public void setState(String aState) {
- dServiceRef.getService().setState(aState);
- }
-
- /*
- * When the coversationId is set manually the client may access the
- * conversation id that will be used by the reference using
- * ServiceReference.getConversationId()
- */
- public Object getConversationID() {
- return dServiceRef.getConversationID();
- }
-
- /*
- * Whether the conversation ID is chosen by the client or is generated by
- * the system, the client may access the conversation ID by calling
- * Conversation.getConversationID().
- */
- public Object getConversationObjectConversationId() {
- // TODO Auto-generated method stub
- if (dServiceRef.getConversation() != null) {
- return dServiceRef.getConversation().getConversationID();
- } else {
- return null;
- }
- }
-
- public void endConversation() {
- dServiceRef.getConversation().end();
- }
-
- public void endConversationViaAnnotatedMethod() {
- dServiceRef.getService().endConversationViaAnnotatedMethod();
- }
-
- public void setConversationID(String theID) {
- dServiceRef.setConversationID(theID);
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java
deleted file mode 100644
index 8f2736ad2d..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalService;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(ConversationalService.class)
-@Scope("CONVERSATION")
-@ConversationAttributes(maxAge = "1 seconds")
-public class ConversationAgeComponentImpl implements ConversationalService {
-
- private int count;
-
- public void businessException() throws Exception {
- }
-
- public void businessExceptionCallback() throws Exception {
- }
-
- public void destroy() {
- }
-
- public String endConversation() {
- return null;
- }
-
- public String endConversationCallback() {
- return null;
- }
-
- public void incrementCount() {
- }
-
- public void incrementCountCallback() {
- }
-
- public void init() {
- }
-
- public void initializeCount(int count) {
- this.count = count;
- }
-
- public void initializeCountCallback(int count) {
- }
-
- public int retrieveCount() {
- return count;
- }
-
- public int retrieveCountCallback() {
- return 0;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java
deleted file mode 100644
index 8b3a8663d8..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationIdService;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(ConversationIdService.class)
-@Scope("CONVERSATION")
-public class ConversationIdComponentImpl implements ConversationIdService {
-
- @ConversationID
- public String cid;
-
- private String setterCid;
-
- public String getCIDField() {
- return cid;
- }
-
- public String getCIDSetter() {
- return setterCid;
- }
-
- @ConversationID
- public void setCID(String cid) {
- this.setterCid = cid;
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java
deleted file mode 100644
index ae8bee8040..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalService;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(ConversationalService.class)
-@Scope("CONVERSATION")
-@ConversationAttributes(maxIdleTime = "1 seconds")
-public class ConversationMaxIdleComponentImpl implements ConversationalService {
-
- private int count;
-
- public void businessException() throws Exception {
- }
-
- public void businessExceptionCallback() throws Exception {
- }
-
- public void destroy() {
- }
-
- public String endConversation() {
- return null;
- }
-
- public String endConversationCallback() {
- return null;
- }
-
- public void incrementCount() {
- }
-
- public void incrementCountCallback() {
- }
-
- public void init() {
- }
-
- public void initializeCount(int count) {
- this.count = count;
- }
-
- public void initializeCountCallback(int count) {
- }
-
- public int retrieveCount() {
- return count;
- }
-
- public int retrieveCountCallback() {
- return 0;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java
deleted file mode 100644
index 3784dfd53e..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalCallback;
-import org.apache.tuscany.sca.itest.conversational.ConversationalClient;
-import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient;
-import org.apache.tuscany.sca.itest.conversational.ConversationalService;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * The client for the conversational itest which presents a stateful
- * callback interface
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-
-@Service(interfaces = {ConversationalClient.class})
-@Scope("CONVERSATION")
-@ConversationAttributes(maxAge = "10 minutes", maxIdleTime = "5 minutes", singlePrincipal = false)
-public class ConversationalClientStatefulImpl implements ConversationalClient, ConversationalCallback {
-
- @Context
- protected ComponentContext componentContext;
-
- @Reference
- protected ConversationalService conversationalService;
-
- @Reference
- protected ConversationalService conversationalService2;
-
- @Reference
- protected ConversationalReferenceClient conversationalReferenceClient;
-
- private int clientCount = 0;
- private int callbackCount = 0;
-
- // a static member variable that records the number of times this service is called
- public static StringBuffer calls = new StringBuffer();
-
- // From ConversationalClient
- public int runConversationFromInjectedReference() {
- calls.append("runConversationFromInjectedReference,");
- conversationalService.initializeCount(1);
- conversationalService.incrementCount();
- clientCount = conversationalService.retrieveCount();
- conversationalService.endConversation();
-
- return clientCount;
- }
-
- public int runConversationFromInjectedReference2() {
- calls.append("runConversationFromInjectedReference2,");
-
- conversationalService2.initializeCount(1);
- conversationalService2.incrementCount();
-
- // stick in a call to the first reference to
- // make sure the two references don't clash
- conversationalService.initializeCount(1);
-
- clientCount = conversationalService2.retrieveCount();
- conversationalService2.endConversation();
-
- // end the conversation through the first reference
- conversationalService.endConversation();
-
- return clientCount;
- }
-
- public int runConversationFromServiceReference() {
- calls.append("runConversationFromServiceReference,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- // serviceReference.getConversation().end();
-
- return clientCount;
- }
-
- public int runConversationWithUserDefinedConversationId() {
- calls.append("runConversationWithUserDefinedConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation1");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- // serviceReference.getConversation().end();
-
- return clientCount;
- }
-
- public String runConversationCheckUserDefinedConversationId() {
- calls.append("runConversationCheckUserDefinedConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation2");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
-
- String clientConversationId = serviceReference.getConversationID().toString();
- String serverConversationId = callableReference.endConversation();
-
- if (clientConversationId.equals("MyConversation2") && serverConversationId.equals("MyConversation2")) {
- return clientConversationId;
- } else {
- return "client = " + clientConversationId + "server = " + serverConversationId;
- }
-
- }
-
- public int runConversationCheckingScope() {
- calls.append("runConversationCheckingScope,");
- // run a conversation
- return runConversationFromInjectedReference();
-
- // test will then use a static method to find out how many times
- // init/destroy were called
- }
-
- public int runConversationWithCallback() {
- calls.append("runConversationWithCallback,");
- callbackCount = 2;
- conversationalService.initializeCountCallback(1);
- conversationalService.incrementCountCallback();
- clientCount = conversationalService.retrieveCountCallback();
- conversationalService.endConversationCallback();
-
- return clientCount;
- }
-
- public int runConversationHavingPassedReference() {
- calls.append("runConversationHavingPassedReference,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- conversationalReferenceClient.incrementCount(serviceReference);
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- serviceReference.getConversation().end();
-
- return clientCount;
- }
-
- public String runConversationBusinessException() {
- calls.append("runConversationbusinessException,");
- try {
- conversationalService.initializeCount(1);
- conversationalService.businessException();
- clientCount = conversationalService.retrieveCount();
- conversationalService.endConversation();
- } catch (Exception ex) {
- return ex.getMessage();
- }
-
- return "No Exception Returned";
- }
-
- public String runConversationBusinessExceptionCallback() {
- calls.append("runConversationbusinessExceptionCallback,");
- try {
- conversationalService.initializeCountCallback(1);
- conversationalService.businessExceptionCallback();
- clientCount = conversationalService.retrieveCountCallback();
- conversationalService.endConversationCallback();
- } catch (Exception ex) {
- return ex.getMessage();
- }
-
- return "No Exception Returned";
- }
-
- public int runConversationCallingEndedConversation() {
- calls.append("runConversationCallingEndedConversation,");
- conversationalService.initializeCount(1);
- conversationalService.endConversation();
- return conversationalService.retrieveCount();
- }
-
- public int runConversationCallingEndedConversationCallback() {
- calls.append("runConversationCallingEndedConversationCallback,");
- conversationalService.initializeCountCallback(1);
- conversationalService.endConversationCallback();
- return conversationalService.retrieveCountCallback();
- }
-
- public String runConversationCallingEndedConversationCheckConversationId() {
- calls.append("runConversationCallingEndedConversationCheckConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation3");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- if (serviceReference.getConversation() == null) {
- return null;
- } else {
- return serviceReference.getConversation().getConversationID().toString();
- }
- }
-
- public String runConversationCallingEndedConversationCallbackCheckConversationId() {
- calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation3");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversationCallback();
-
- if (serviceReference.getConversation() == null) {
- return null;
- } else {
- return serviceReference.getConversation().getConversationID().toString();
- }
- }
-
- public int runConversationAgeTimeout() {
- calls.append("runConversationAgeTimeout,");
- // done in other testing
- return clientCount;
- }
-
- public int runConversationIdleTimeout() {
- calls.append("runConversationIdleTimeout,");
- // done in other testing
- return clientCount;
- }
-
- public int runConversationPrincipleError() {
- calls.append("runConversationPrincipleError,");
- // TODO - when policy framework is done
- return clientCount;
- }
-
- // From ConversationalCallback
- @Init
- public void init() {
- calls.append("init,");
- }
-
- @Destroy
- public void destroy() {
- calls.append("destroy,");
- }
-
- public void initializeCount(int count) {
- calls.append("initializeCount,");
- callbackCount += count;
- }
-
- public void incrementCount() {
- calls.append("incrementCount,");
- callbackCount++;
- }
-
- public int retrieveCount() {
- calls.append("retrieveCount,");
- return callbackCount;
- }
-
- public void businessException() throws Exception {
- throw new Exception("Business Exception");
- }
-
- public String endConversation() {
- calls.append("endConversation,");
- callbackCount = 0;
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java
deleted file mode 100644
index 137dfc4108..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalClient;
-import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient;
-import org.apache.tuscany.sca.itest.conversational.ConversationalService;
-import org.apache.tuscany.sca.itest.conversational.NonConversationalCallback;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * The client for the conversational itest which presents a stateful
- * callback interface
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-
-@Service(interfaces = {ConversationalClient.class})
-@Scope("CONVERSATION")
-@ConversationAttributes(maxAge = "10 minutes", maxIdleTime = "5 minutes", singlePrincipal = false)
-public class ConversationalClientStatefulNonConversationalCallbackImpl implements ConversationalClient,
- NonConversationalCallback {
-
- @Context
- protected ComponentContext componentContext;
-
- @Reference
- protected ConversationalService conversationalService;
-
- @Reference
- protected ConversationalService conversationalService2;
-
- @Reference
- protected ConversationalReferenceClient conversationalReferenceClient;
-
- private int clientCount = 0;
- private int callbackCount = 0;
-
- // a static member variable that records the number of times this service is called
- public static StringBuffer calls = new StringBuffer();
-
- // From ConversationalClient
- public int runConversationFromInjectedReference() {
- calls.append("runConversationFromInjectedReference,");
- conversationalService.initializeCount(1);
- conversationalService.incrementCount();
- clientCount = conversationalService.retrieveCount();
- conversationalService.endConversation();
-
- return clientCount;
- }
-
- public int runConversationFromInjectedReference2() {
- calls.append("runConversationFromInjectedReference2,");
-
- conversationalService2.initializeCount(1);
- conversationalService2.incrementCount();
-
- // stick in a call to the first reference to
- // make sure the two references don't clash
- conversationalService.initializeCount(1);
-
- clientCount = conversationalService2.retrieveCount();
- conversationalService2.endConversation();
-
- // end the conversation through the first reference
- conversationalService.endConversation();
-
- return clientCount;
- }
-
- public int runConversationFromServiceReference() {
- calls.append("runConversationFromServiceReference,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- // serviceReference.getConversation().end();
-
- return clientCount;
- }
-
- public int runConversationWithUserDefinedConversationId() {
- calls.append("runConversationWithUserDefinedConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation1");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- // serviceReference.getConversation().end();
-
- return clientCount;
- }
-
- public String runConversationCheckUserDefinedConversationId() {
- calls.append("runConversationCheckUserDefinedConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation2");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- return callableReference.endConversation();
-
- }
-
- public int runConversationCheckingScope() {
- calls.append("runConversationCheckingScope,");
- // run a conversation
- return runConversationFromInjectedReference();
-
- // test will then use a static method to find out how many times
- // init/destroy were called
- }
-
- public int runConversationWithCallback() {
- calls.append("runConversationWithCallback,");
- callbackCount = 2;
- conversationalService.initializeCountCallback(1);
- conversationalService.incrementCountCallback();
- clientCount = conversationalService.retrieveCountCallback();
- conversationalService.endConversationCallback();
-
- return clientCount;
- }
-
- public int runConversationHavingPassedReference() {
- calls.append("runConversationHavingPassedReference,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- conversationalReferenceClient.incrementCount(serviceReference);
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- // serviceReference.getConversation().end();
-
- return clientCount;
- }
-
- public String runConversationBusinessException() {
- calls.append("runConversationbusinessException,");
- try {
- conversationalService.initializeCount(1);
- conversationalService.businessException();
- clientCount = conversationalService.retrieveCount();
- conversationalService.endConversation();
- } catch (Exception ex) {
- return ex.getMessage();
- }
-
- return "No Exception Returned";
- }
-
- public String runConversationBusinessExceptionCallback() {
- calls.append("runConversationbusinessExceptionCallback,");
- try {
- conversationalService.initializeCountCallback(1);
- conversationalService.businessExceptionCallback();
- clientCount = conversationalService.retrieveCountCallback();
- conversationalService.endConversationCallback();
- } catch (Exception ex) {
- return ex.getMessage();
- }
-
- return "No Exception Returned";
- }
-
- public String runConversationCallingEndedConversationCheckConversationId() {
- calls.append("runConversationCallingEndedConversationCheckConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation3");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- if (serviceReference.getConversation() == null) {
- return null;
- } else {
- return serviceReference.getConversation().getConversationID().toString();
- }
- }
-
- public String runConversationCallingEndedConversationCallbackCheckConversationId() {
- calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation3");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversationCallback();
-
- if (serviceReference.getConversation() == null) {
- return null;
- } else {
- return serviceReference.getConversation().getConversationID().toString();
- }
- }
-
- public int runConversationCallingEndedConversation() {
- calls.append("runConversationCallingEndedConversation,");
- conversationalService.initializeCount(1);
- conversationalService.endConversation();
- return conversationalService.retrieveCount();
- }
-
- public int runConversationCallingEndedConversationCallback() {
- calls.append("runConversationCallingEndedConversationCallback,");
- conversationalService.initializeCountCallback(1);
- conversationalService.endConversationCallback();
- return conversationalService.retrieveCountCallback();
- }
-
- public int runConversationAgeTimeout() {
- calls.append("runConversationAgeTimeout,");
- // done in other testing
- return clientCount;
- }
-
- public int runConversationIdleTimeout() {
- calls.append("runConversationIdleTimeout,");
- // done in other testing
- return clientCount;
- }
-
- public int runConversationPrincipleError() {
- calls.append("runConversationPrincipleError,");
- // TODO - when policy framework is done
- return clientCount;
- }
-
- // From ConversationalCallback
- @Init
- public void init() {
- calls.append("init,");
- }
-
- @Destroy
- public void destroy() {
- calls.append("destroy,");
- }
-
- public void initializeCount(int count) {
- calls.append("initializeCount,");
- callbackCount += count;
- }
-
- public void incrementCount() {
- calls.append("incrementCount,");
- callbackCount++;
- }
-
- public int retrieveCount() {
- calls.append("retrieveCount,");
- return callbackCount;
- }
-
- public void businessException() throws Exception {
- throw new Exception("Business Exception");
- }
-
- public String endConversation() {
- calls.append("endConversation,");
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java
deleted file mode 100644
index c9c5138515..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalCallback;
-import org.apache.tuscany.sca.itest.conversational.ConversationalClient;
-import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient;
-import org.apache.tuscany.sca.itest.conversational.ConversationalService;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * The client for the conversational itest which presents a stateful
- * callback interface
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-
-@Service(interfaces = {ConversationalClient.class})
-public class ConversationalClientStatelessImpl implements ConversationalClient, ConversationalCallback {
-
- @Context
- protected ComponentContext componentContext;
-
- @Reference
- protected ConversationalService conversationalService;
-
- @Reference
- protected ConversationalService conversationalService2;
-
- @Reference
- protected ConversationalReferenceClient conversationalReferenceClient;
-
- private int clientCount = 0;
- private int callbackCount = 0;
-
- // a static member variable that records the number of times this service is called
- public static StringBuffer calls = new StringBuffer();
-
- // From ConversationalClient
- public int runConversationFromInjectedReference() {
- calls.append("runConversationFromInjectedReference,");
- conversationalService.initializeCount(1);
- conversationalService.incrementCount();
- clientCount = conversationalService.retrieveCount();
- conversationalService.endConversation();
-
- return clientCount;
- }
-
- public int runConversationFromInjectedReference2() {
- calls.append("runConversationFromInjectedReference2,");
-
- // now test the second reference
- conversationalService2.initializeCount(1);
- conversationalService2.incrementCount();
-
- // stick in a call to the first reference to
- // make sure the two references don't clash
- conversationalService.initializeCount(1);
-
- clientCount = conversationalService2.retrieveCount();
- conversationalService2.endConversation();
-
- // end the conversation through the first reference
- conversationalService.endConversation();
-
- return clientCount;
- }
-
- public int runConversationFromServiceReference() {
- calls.append("runConversationFromServiceReference,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- // serviceReference.getConversation().end();
-
- return clientCount;
- }
-
- public int runConversationWithUserDefinedConversationId() {
- calls.append("runConversationWithUserDefinedConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation1");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- // serviceReference.getConversation().end();
-
- return clientCount;
- }
-
- public String runConversationCheckUserDefinedConversationId() {
- calls.append("runConversationCheckUserDefinedConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation2");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
-
- String clientConversationId = serviceReference.getConversationID().toString();
- String serverConfersationId = callableReference.endConversation();
-
- if (clientConversationId.equals("MyConversation2") && serverConfersationId.equals("MyConversation2")) {
- return clientConversationId;
- } else {
- return "client = " + clientConversationId + "server = " + serverConfersationId;
- }
- }
-
- public int runConversationCheckingScope() {
- calls.append("runConversationCheckingScope,");
- // run a conversation
- return runConversationFromInjectedReference();
-
- // test will then use a static method to find out how many times
- // init/destroy were called
- }
-
- public int runConversationWithCallback() {
- calls.append("runConversationWithCallback,");
- conversationalService.initializeCountCallback(1);
- conversationalService.incrementCountCallback();
- clientCount = conversationalService.retrieveCountCallback();
- conversationalService.endConversationCallback();
-
- return clientCount;
- }
-
- public int runConversationHavingPassedReference() {
- calls.append("runConversationHavingPassedReference,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- conversationalReferenceClient.incrementCount(serviceReference);
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- serviceReference.getConversation().end();
-
- return clientCount;
- }
-
- public String runConversationBusinessException() {
- calls.append("runConversationbusinessException,");
- try {
- conversationalService.initializeCount(1);
- conversationalService.businessException();
- clientCount = conversationalService.retrieveCount();
- conversationalService.endConversation();
- } catch (Exception ex) {
- return ex.getMessage();
- }
-
- return "No Exception Returned";
- }
-
- public String runConversationBusinessExceptionCallback() {
- calls.append("runConversationbusinessExceptionCallback,");
- try {
- conversationalService.initializeCountCallback(1);
- conversationalService.businessExceptionCallback();
- clientCount = conversationalService.retrieveCountCallback();
- conversationalService.endConversationCallback();
- } catch (Exception ex) {
- return ex.getMessage();
- }
-
- return "No Exception Returned";
- }
-
- public int runConversationCallingEndedConversation() {
- calls.append("runConversationCallingEndedConversation,");
- conversationalService.initializeCount(1);
- conversationalService.endConversation();
- return conversationalService.retrieveCount();
- }
-
- public int runConversationCallingEndedConversationCallback() {
- calls.append("runConversationCallingEndedConversationCallback,");
- conversationalService.initializeCountCallback(1);
- conversationalService.endConversationCallback();
- return conversationalService.retrieveCountCallback();
- }
-
- public String runConversationCallingEndedConversationCheckConversationId() {
- calls.append("runConversationCallingEndedConversationCheckConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation3");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversation();
-
- if (serviceReference.getConversation() == null) {
- return null;
- } else {
- return serviceReference.getConversation().getConversationID().toString();
- }
- }
-
- public String runConversationCallingEndedConversationCallbackCheckConversationId() {
- calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,");
- ServiceReference<ConversationalService> serviceReference =
- componentContext.getServiceReference(ConversationalService.class, "conversationalService");
- serviceReference.setConversationID("MyConversation3");
-
- ConversationalService callableReference = serviceReference.getService();
-
- callableReference.initializeCount(1);
- callableReference.incrementCount();
- clientCount = callableReference.retrieveCount();
- callableReference.endConversationCallback();
-
- if (serviceReference.getConversation() == null) {
- return null;
- } else {
- return serviceReference.getConversation().getConversationID().toString();
- }
- }
-
- public int runConversationAgeTimeout() {
- calls.append("runConversationAgeTimeout,");
- // done in other testing
- return clientCount;
- }
-
- public int runConversationIdleTimeout() {
- calls.append("runConversationIdleTimeout,");
- // done in other testing
- return clientCount;
- }
-
- public int runConversationPrincipleError() {
- calls.append("runConversationPrincipleError,");
- // TODO - when policy framework is done
- return clientCount;
- }
-
- // From ConversationalCallback
- @Init
- public void init() {
- calls.append("init,");
-
- }
-
- @Destroy
- public void destroy() {
- calls.append("destroy,");
-
- }
-
- public void initializeCount(int count) {
- calls.append("initializeCount,");
- callbackCount = 0;
- }
-
- public void incrementCount() {
- calls.append("incrementCount,");
- callbackCount++;
- }
-
- public int retrieveCount() {
- calls.append("retrieveCount,");
- return callbackCount;
- }
-
- public void businessException() throws Exception {
- throw new Exception("Business Exception");
- }
-
- public String endConversation() {
- calls.append("endConversation,");
- callbackCount = 0;
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java
deleted file mode 100644
index 134ffda75d..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient;
-import org.apache.tuscany.sca.itest.conversational.ConversationalService;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * A client component that accepts a reference to an ongoing conversation
- * and takes part in that conversation
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-
-@Service(interfaces = {ConversationalReferenceClient.class})
-public class ConversationalReferenceClientImpl implements ConversationalReferenceClient {
-
- public void incrementCount(CallableReference<ConversationalService> conversationalService) {
- ConversationalService callableReference = conversationalService.getService();
-
- callableReference.incrementCount();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java
deleted file mode 100644
index 73a6d7d27e..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import java.util.HashMap;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalCallback;
-import org.apache.tuscany.sca.itest.conversational.ConversationalService;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * The service used when testing stateful conversations
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-@Service(ConversationalService.class)
-@Scope("REQUEST")
-public class ConversationalServiceRequestImpl implements ConversationalService {
-
- @ConversationID
- protected String conversationId;
-
- @Callback
- protected ConversationalCallback conversationalCallback;
-
- // static area in which to hold conversational data
- private static HashMap<String, Integer> conversationalState = new HashMap<String, Integer>();
-
- // a static member variable that records the number of times this service is called
- public static StringBuffer calls = new StringBuffer();
-
- @Init
- public void init() {
- calls.append("init,");
- }
-
- @Destroy
- public void destroy() {
- calls.append("destroy,");
- }
-
- public void initializeCount(int count) {
- calls.append("initializeCount,");
- Integer conversationalCount = Integer.valueOf(count);
- conversationalState.put(conversationId, conversationalCount);
- }
-
- public void incrementCount() {
- calls.append("incrementCount,");
- Integer conversationalCount = conversationalState.get(conversationId);
- conversationalCount++;
- conversationalState.put(conversationId, conversationalCount);
- }
-
- public int retrieveCount() {
- calls.append("retrieveCount,");
- Integer count = conversationalState.get(conversationId);
- if (count != null) {
- return count.intValue();
- } else {
- return -999;
- }
- }
-
- public void businessException() throws Exception {
- throw new Exception("Business Exception");
- }
-
- public void initializeCountCallback(int count) {
- calls.append("initializeCountCallback,");
- initializeCount(count);
- conversationalCallback.initializeCount(count);
- }
-
- public void incrementCountCallback() {
- calls.append("incrementCountCallback,");
- incrementCount();
- conversationalCallback.incrementCount();
- }
-
- public int retrieveCountCallback() {
- calls.append("retrieveCountCallback,");
- return conversationalCallback.retrieveCount();
- }
-
- public void businessExceptionCallback() throws Exception {
- calls.append("businessExceptionCallback,");
- conversationalCallback.businessException();
- }
-
- public String endConversation() {
- calls.append("endConversation,");
- conversationalState.remove(conversationId);
- return conversationId;
- }
-
- public String endConversationCallback() {
- calls.append("endConversationCallback,");
- return conversationalCallback.endConversation();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java
deleted file mode 100644
index 5bafa5e075..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalCallback;
-import org.apache.tuscany.sca.itest.conversational.ConversationalService;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * The service used when testing stateful conversations
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-@Service(ConversationalService.class)
-@Scope("CONVERSATION")
-@ConversationAttributes(maxAge = "10 minutes", maxIdleTime = "5 minutes", singlePrincipal = false)
-public class ConversationalServiceStatefulImpl implements ConversationalService {
-
- @ConversationID
- protected String conversationId;
-
- @Callback
- protected ConversationalCallback conversationalCallback;
-
- // local count - accumulates during the conversation
- private int count = 0;
-
- // a static member variable that records the number of times this service is called
- public static StringBuffer calls = new StringBuffer();
-
- @Init
- public void init() {
- calls.append("init,");
- }
-
- @Destroy
- public void destroy() {
- calls.append("destroy,");
- }
-
- public void initializeCount(int count) {
- calls.append("initializeCount,");
- this.count = count;
- }
-
- public void incrementCount() {
- calls.append("incrementCount,");
- count++;
- }
-
- public int retrieveCount() {
- calls.append("retrieveCount,");
- return count;
- }
-
- public void businessException() throws Exception {
- throw new Exception("Business Exception");
- }
-
- public void initializeCountCallback(int count) {
- calls.append("initializeCountCallback,");
- this.count = count;
- conversationalCallback.initializeCount(count);
- }
-
- public void incrementCountCallback() {
- calls.append("incrementCountCallback,");
- count++;
- conversationalCallback.incrementCount();
- }
-
- public int retrieveCountCallback() {
- calls.append("retrieveCountCallback,");
- return conversationalCallback.retrieveCount();
- }
-
- public void businessExceptionCallback() throws Exception {
- calls.append("businessExceptionCallback,");
- conversationalCallback.businessException();
- }
-
- public String endConversation() {
- calls.append("endConversation,");
- count = 0;
- return conversationId;
- }
-
- public String endConversationCallback() {
- calls.append("endConversationCallback,");
- return conversationalCallback.endConversation();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java
deleted file mode 100644
index 8d63ebbbef..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalServiceNonConversationalCallback;
-import org.apache.tuscany.sca.itest.conversational.NonConversationalCallback;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * The service used when testing stateful conversations
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-@Service(ConversationalServiceNonConversationalCallback.class)
-@Scope("CONVERSATION")
-@ConversationAttributes(maxAge = "10 minutes", maxIdleTime = "5 minutes", singlePrincipal = false)
-public class ConversationalServiceStatefulNonConversationalCallbackImpl implements
- ConversationalServiceNonConversationalCallback {
-
- @ConversationID
- protected String conversationId;
-
- @Callback
- protected NonConversationalCallback nonConversationalCallback;
-
- // local count - accumulates during the conversation
- private int count = 0;
-
- // a static member variable that records the number of times this service is called
- public static StringBuffer calls = new StringBuffer();
-
- @Init
- public void init() {
- calls.append("init,");
- }
-
- @Destroy
- public void destroy() {
- calls.append("destroy,");
- }
-
- public void initializeCount(int count) {
- calls.append("initializeCount,");
- this.count = count;
- }
-
- public void incrementCount() {
- calls.append("incrementCount,");
- count++;
- }
-
- public int retrieveCount() {
- calls.append("retrieveCount,");
- return count;
- }
-
- public void businessException() throws Exception {
- throw new Exception("Business Exception");
- }
-
- public void initializeCountCallback(int count) {
- calls.append("initializeCountCallback,");
- this.count = count;
- nonConversationalCallback.initializeCount(count);
- }
-
- public void incrementCountCallback() {
- calls.append("incrementCountCallback,");
- count++;
- nonConversationalCallback.incrementCount();
- }
-
- public int retrieveCountCallback() {
- calls.append("retrieveCountCallback,");
- return nonConversationalCallback.retrieveCount();
- }
-
- public void businessExceptionCallback() throws Exception {
- calls.append("businessExceptionCallback,");
- nonConversationalCallback.businessException();
- }
-
- public String endConversation() {
- calls.append("endConversation,");
- count = 0;
- return conversationId;
- }
-
- public String endConversationCallback() {
- calls.append("endConversationCallback,");
- return nonConversationalCallback.endConversation();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java
deleted file mode 100644
index ecf108c656..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import java.util.HashMap;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalCallback;
-import org.apache.tuscany.sca.itest.conversational.ConversationalService;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * The service used when testing stateful conversations
- *
- * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $
- */
-@Service(ConversationalService.class)
-@Scope("STATELESS")
-public class ConversationalServiceStatelessImpl implements ConversationalService {
-
- @ConversationID
- protected String conversationId;
-
- @Callback
- protected ConversationalCallback conversationalCallback;
-
- // static area in which to hold conversational data
- private static HashMap<String, Integer> conversationalState = new HashMap<String, Integer>();
-
- // a static member variable that records the number of times this service is called
- public static StringBuffer calls = new StringBuffer();
-
- @Init
- public void init() {
- calls.append("init,");
- }
-
- @Destroy
- public void destroy() {
- calls.append("destroy,");
- }
-
- public void initializeCount(int count) {
- calls.append("initializeCount,");
- Integer conversationalCount = Integer.valueOf(count);
- conversationalState.put(conversationId, conversationalCount);
- }
-
- public void incrementCount() {
- calls.append("incrementCount,");
- Integer conversationalCount = conversationalState.get(conversationId);
- conversationalCount++;
- conversationalState.put(conversationId, conversationalCount);
- }
-
- public int retrieveCount() {
- calls.append("retrieveCount,");
- Integer count = conversationalState.get(conversationId);
- if (count != null) {
- return count.intValue();
- } else {
- return -999;
- }
- }
-
- public void businessException() throws Exception {
- throw new Exception("Business Exception");
- }
-
- public void initializeCountCallback(int count) {
- calls.append("initializeCountCallback,");
- initializeCount(count);
- conversationalCallback.initializeCount(count);
- }
-
- public void incrementCountCallback() {
- calls.append("incrementCountCallback,");
- incrementCount();
- conversationalCallback.incrementCount();
- }
-
- public int retrieveCountCallback() {
- calls.append("retrieveCountCallback,");
- return conversationalCallback.retrieveCount();
- }
-
- public void businessExceptionCallback() throws Exception {
- calls.append("businessExceptionCallback,");
- conversationalCallback.businessException();
- }
-
- public String endConversation() {
- calls.append("endConversation,");
- conversationalState.remove(conversationId);
- return conversationId;
- }
-
- public String endConversationCallback() {
- calls.append("endConversationCallback,");
- return conversationalCallback.endConversation();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java
deleted file mode 100644
index ee09e99f1b..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.itest.conversational.ConversationalService;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(ConversationalService.class)
-public class ConversationalServiceStatelessScopeImpl implements ConversationalService {
-
- @ConversationID
- protected String cid;
-
- static Map<String, Integer> state = new HashMap<String, Integer>();
-
- public void destroy() {
- // TODO Auto-generated method stub
-
- }
-
- public String endConversation() {
- state.remove(cid);
- return cid;
- }
-
- public String endConversationCallback() {
- // TODO Auto-generated method stub
- return null;
-
- }
-
- public void incrementCount() {
- state.put(cid, Integer.valueOf(state.get(cid) + 1));
- }
-
- public void businessException() throws Exception {
- throw new Exception("Business Exception");
- }
-
- public void incrementCountCallback() {
- // TODO Auto-generated method stub
-
- }
-
- public void init() {
- // TODO Auto-generated method stub
-
- }
-
- public void initializeCount(int count) {
- state.put(cid, Integer.valueOf(count));
- }
-
- public void initializeCountCallback(int count) {
- // TODO Auto-generated method stub
-
- }
-
- public void businessExceptionCallback() throws Exception {
- throw new Exception("Business Exception");
- }
-
- public int retrieveCount() {
- return state.get(cid);
- }
-
- public int retrieveCountCallback() {
- // TODO Auto-generated method stub
- return 0;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java
deleted file mode 100644
index ad0c1fb7da..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/DServiceImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import org.apache.tuscany.sca.itest.conversational.DService;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * Simple conversational Service
- */
-@Service(DService.class)
-@Scope("CONVERSATION")
-public class DServiceImpl implements DService {
-
- /**
- * The state for this service
- */
- private String state = "Initial state value";
-
- /**
- * Returns the state for this service.
- *
- * @return The state for this service
- */
- public String getState() {
- return state;
- }
-
- /**
- * Sets the state for this service.
- *
- * @param aState The state for this service
- */
- public void setState(String aState) {
- this.state = aState;
- }
-
- /**
- * Sets the conversation ID for this service
- * @param id The Conversation ID
- */
- @ConversationID
- public void setConversationID(String id) {
- System.out.println("Setting conversation ID at service = " + id);
- }
-
- public void endConversationViaAnnotatedMethod() {
- System.out.println("Annotated Ends Conversation");
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java b/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java
deleted file mode 100644
index 55390189cf..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.conversational.impl;
-
-import java.util.ArrayList;
-
-import org.apache.tuscany.sca.itest.Record;
-import org.apache.tuscany.sca.itest.conversational.Gamma;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * @version $Rev$ $Date$
- */
-
-@Service(Gamma.class)
-@Scope("CONVERSATION")
-public class GammaImpl implements Gamma {
- @ConversationID
- public String conversationId;
-
- private ArrayList<Record> list;
-
- public void start(int param) {
- list = new ArrayList<Record>();
- fillList(param, conversationId);
- }
-
- public boolean hasNext() {
- return !list.isEmpty();
- }
-
- public Record next() {
- return list.remove(0);
- }
-
- public void stop() {
- list = null;
- }
-
- private void fillList(int param, String cid) {
- for (int i = 0; i < param; i++) {
- Record record = new Record();
- record.id = "id_" + i;
- record.conversationId = cid;
- list.add(record);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/ConversationAge.composite b/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/ConversationAge.composite
deleted file mode 100644
index abd1c35ced..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/ConversationAge.composite
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- name="ConversationalIdTest">
-
- <component name="ConversationAgeComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationAgeComponentImpl"/>
- </component>
-
- <component name="ConversationIdleComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationMaxIdleComponentImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/ConversationUniqueId.composite b/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/ConversationUniqueId.composite
deleted file mode 100644
index 831449a079..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/ConversationUniqueId.composite
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://conversations"
- name="ConversationUniqueIdTest">
-
- <component name="Alpha">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.AlphaImpl"/>
- <service name="Alpha">
- <binding.sca />
- </service>
- <reference name="beta" target="Beta">
- <binding.sca/>
- </reference>
- </component>
-
- <component name="Beta">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.BetaImpl"/>
- <service name="Beta">
- <binding.sca />
- </service>
- <reference name="gamma" target="Gamma">
- <binding.sca />
- </reference>
- </component>
-
- <component name="Gamma">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.GammaImpl"/>
- <service name="Gamma">
- <binding.sca/>
- </service>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversationId.composite b/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversationId.composite
deleted file mode 100644
index e61eb08194..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversationId.composite
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- name="ConversationalIdTest">
-
- <component name="ConversationIdComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationIdComponentImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversationLifetime.composite b/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversationLifetime.composite
deleted file mode 100644
index 3b79dc43d9..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversationLifetime.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://conversations"
- name="conversationLifetimeTest">
-
- <component name="ConversationalCComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.CServiceImpl"/>
- <reference name="d" target="ConversationalDComponent" />
- </component>
-
- <component name="ConversationalDComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.DServiceImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversational.composite b/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversational.composite
deleted file mode 100644
index 4da3ce74d5..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/main/resources/conversational.composite
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://conversations"
- name="ConversationalITest">
-
- <component name="ConversationalStatelessClientStatelessService">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl"/>
- <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
- <reference name="conversationalService" target="ConversationalServiceStatelessSL"/>
- <reference name="conversationalService2" target="ConversationalServiceStatelessSL"/>
- </component>
-
- <component name="ConversationalStatelessClientStatefulService">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl"/>
- <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
- <reference name="conversationalService" target="ConversationalServiceStateful"/>
- <reference name="conversationalService2" target="ConversationalServiceStateful"/>
- </component>
-
- <component name="ConversationalStatefulClientStatelessService">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl"/>
- <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
- <reference name="conversationalService" target="ConversationalServiceStatelessSL"/>
- <reference name="conversationalService2" target="ConversationalServiceStatelessSL"/>
- </component>
-
- <component name="ConversationalStatefulClientStatefulService">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl"/>
- <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
- <reference name="conversationalService" target="ConversationalServiceStateful"/>
- <reference name="conversationalService2" target="ConversationalServiceStateful"/>
- </component>
-
- <component name="ConversationalStatelessClientRequestService">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl"/>
- <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
- <reference name="conversationalService" target="ConversationalServiceRequest"/>
- <reference name="conversationalService2" target="ConversationalServiceRequest"/>
- </component>
-
- <component name="ConversationalStatefulClientNonConversationalCallbackStatefulService">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl"/>
- <reference name="conversationalReferenceClient" target="ConversationalReferenceClient"/>
- <reference name="conversationalService" target="ConversationalServiceStatefulNonConversationalCallback"/>
- <reference name="conversationalService2" target="ConversationalServiceStatefulNonConversationalCallback"/>
- </component>
-
- <component name="ConversationalReferenceClient">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalReferenceClientImpl"/>
- </component>
-
- <component name="ConversationalServiceStateful">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl"/>
- </component>
-
- <component name="ConversationalServiceStateless">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessScopeImpl"/>
- </component>
-
- <component name="ConversationalServiceStatelessSL">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl"/>
- </component>
-
- <component name="ConversationalServiceRequest">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl"/>
- </component>
-
- <component name="ConversationalServiceStatefulNonConversationalCallback">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl"/>
- </component>
-
- <component name="ConversationalAComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.AServiceImpl"/>
- <reference name="b" target="ConversationalBComponent" />
- </component>
-
- <component name="ConversationalBComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.conversational.impl.BServiceImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java b/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java
deleted file mode 100644
index e64a9acbe2..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationIdTestCase.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.conversational;
-
-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.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ConversationIdTestCase {
-
- private Node node;
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("conversationId.composite");
- node = NodeFactory.newInstance().createNode("conversationId.composite", new Contribution("c1", location));
- node.start();
- }
-
- @After
- public void tearDown() throws Exception {
- if (node != null) {
- node.stop();
- }
- }
-
- @Test
- public void testConversationId() {
- ConversationIdService service = node.getService(ConversationIdService.class, "ConversationIdComponent");
- Assert.assertNotNull(service.getCIDField());
- Assert.assertNotNull(service.getCIDSetter());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java b/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java
deleted file mode 100644
index 2b1aea3ff3..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationLifetimeTestCase.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.conversational;
-
-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 ConversationLifetimeTestCase {
-
- private static Node node;
-
- @BeforeClass
- public static void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("conversationLifetime.composite");
- node = NodeFactory.newInstance().createNode("conversationLifetime.composite", new Contribution("c1", location));
- node.start();
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- if (node != null) {
- node.stop();
- }
- }
-
- /**
- * Following a clarification re. the wording of the Java Common Annotations and APIs 1.00 Specification
- * (see TUSCANY-2055) the following is accepted to be the intended operation
- *
- * Whether the conversation ID is chosen by the user or is generated by the system, the client
- * may access the conversation ID by calling getConversationID() on the current conversation object.
- *
- * ServiceReference.getConversationID() - Returns the id supplied by the user that will be associated with
- * future conversations initiated through this reference, or null if no ID has been set by the user.
- *
- * ServiceReference.setConversationID(Object conversationId) - Set an ID, supplied by the user, to associate with any future conversation
- * started through this reference. If the value supplied is null then the id will be generated
- * by the implementation. Throws an IllegalStateException if a conversation is currently
- * associated with this reference.
- *
- */
-
- /**
- * Verify that ServiceReference.getConversationID() returns null before a conversation
- * ID has been set manually.
- */
- @Test
- public void getConversationID() {
- CService service = node.getService(CService.class, "ConversationalCComponent");
- service.getState();
- Assert.assertNull(service.getConversationID());
- }
-
- /**
- * Verify that ServiceReference.getConversationID() returns any value previous set through the
- * setConversationID() API.
- */
- @Test
- public void getConversationID2() {
- String userProvidedID = "A conversation ID";
- CService service = node.getService(CService.class, "ConversationalCComponent");
- service.setConversationID(userProvidedID);
- service.getState();
- Assert.assertEquals(service.getConversationID(), userProvidedID);
- }
-
- /**
- * Whether the conversation ID is chosen by the user or is generated by the system, the client
- * may access the conversation ID by calling getConversationID() on the current conversation object.
- * Here test the manually set conversationID
- */
- @Test
- public void getConversationID3() {
- String userProvidedID = "A conversation ID 3";
- CService service = node.getService(CService.class, "ConversationalCComponent");
- service.setConversationID(userProvidedID);
- service.getState();
- Assert.assertEquals(service.getConversationObjectConversationId(), userProvidedID);
- }
-
- /**
- * Whether the conversation ID is chosen by the user or is generated by the system, the client
- * may access the conversation ID by calling getConversationID() on the current conversation object.
- * Here test the auto generated conversationId
- */
- @Test
- public void getConversationID4() {
- CService service = node.getService(CService.class, "ConversationalCComponent");
- service.getState();
- Assert.assertNotNull(service.getConversationObjectConversationId());
- }
-
- /**
- * Java Common Annotations and APIs 1.00 Specification line 494-495 Verify:
- * If a method is invoked on a service reference after an
- * "@EndsConversation" method has been called then a new conversation will
- * automatically be started.
- */
- @Test
- public void implicitStartNewConversationAfterEnd() {
- CService service = node.getService(CService.class, "ConversationalCComponent");
- service.getState();
- Object firstID = service.getConversationObjectConversationId();
- service.endConversationViaAnnotatedMethod();
- service.getState();
- Assert.assertNotSame(firstID, service.getConversationObjectConversationId());
- }
-
- /**
- * Java Common Annotations and APIs 1.00 Specification line 495-495 Verify: If a
- * method is invoked on a service reference after an "@EndsConversation"
- * method has been called then a new conversation will automatically be
- * started. Note: Uses Conversation.end() rather than "@EndsConversation"
- */
- @Test
- public void implicitStartNewConversationAfterEnd2() {
- CService service = node.getService(CService.class, "ConversationalCComponent");
- service.getState();
- Object firstID = service.getConversationObjectConversationId();
- service.endConversation();
- service.getState();
- Assert.assertNotSame(firstID, service.getConversationObjectConversationId());
- }
-
- /**
- * Java Common Annotations and APIs 1.00 Specification line 495-497 Verify:
- * If ServiceReference.getConversationID() is called after the
- * "@EndsConversation" method is called, but before the next conversation
- * has been started, it will return null.
- */
- @Test
- public void nullConversationIDAfterEndConversation() {
- CService service = node.getService(CService.class, "ConversationalCComponent");
- service.getState();
- service.endConversationViaAnnotatedMethod();
- Assert.assertNull(service.getConversationObjectConversationId());
- }
-
- /**
- * Java Common Annotations and APIs 1.00 Specification line 495-497 Verify:
- * If ServiceReference.getConversationID() is called after the
- * "@EndsConversation" method is called, but before the next conversation
- * has been started, it will return null. Note: Uses explicit set of Conversation ID
- */
- @Test
- public void nullConversationIDAfterEndConversation1a() {
- CService service = node.getService(CService.class, "ConversationalCComponent");
- service.setConversationID("User provided ID");
- service.getState();
- service.endConversationViaAnnotatedMethod();
- Assert.assertNull(service.getConversationObjectConversationId());
- }
-
- /**
- * Java Common Annotations and APIs 1.00 Specification line 495-497 Verify: If
- * ServiceReference.getConversationID() is called after the
- * "@EndsConversationmethod" is called, but before the next conversation has
- * been started, it will return null. Note: Uses Conversation.end() rather
- * than "@EndsConversation"
- */
- @Test
- public void nullConversationIDAfterEndConversation2() {
- CService service = node.getService(CService.class, "ConversationalCComponent");
- service.getState();
- service.endConversation();
- Assert.assertNull(service.getConversationObjectConversationId());
- }
-
- /**
- * Java Common Annotations and APIs 1.00 Specification line 495-497 Verify: If
- * ServiceReference.getConversationID() is called after the
- * "@EndsConversationmethod" is called, but before the next conversation has
- * been started, it will return null. Note: Uses Conversation.end() rather
- * than "@EndsConversation". Note 2: Uses explicit set of Conversation ID
- */
- @Test
- public void nullConversationIDAfterEndConversation2a() {
- CService service = node.getService(CService.class, "ConversationalCComponent");
- service.setConversationID("User provided ID");
- service.getState();
- service.endConversation();
- Assert.assertNull(service.getConversationObjectConversationId());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java b/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java
deleted file mode 100644
index f9bb69aa30..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.conversational;
-
-import org.apache.tuscany.sca.itest.TestResult;
-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.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConversationUniqueIdTestCase {
-
- private Node node;
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("ConversationUniqueId.composite");
- node = NodeFactory.newInstance().createNode("ConversationUniqueId.composite", new Contribution("c1", location));
- node.start();
- }
-
- @After
- public void tearDown() throws Exception {
- if (node != null) {
- node.stop();
- }
- }
-
- @Ignore("I'm seeing NPE in GammaImpl.hasNext()")
- @Test
- public void testConversationUniqueId() {
- Alpha alpha = node.getService(Alpha.class, "Alpha");
- int numConversations = 3;
-
- for (int i = 0; i < numConversations; ++i) {
- alpha.run(5);
- }
-
- // Wait for the conversations to complete
- while (TestResult.getCompleted() < numConversations) {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- }
- }
-
- Assert.assertEquals(TestResult.results.size(), numConversations);
- for (Boolean value : TestResult.results.values()) {
- Assert.assertTrue(value);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java b/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java
deleted file mode 100644
index a686754d3a..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalAgeTestCase.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.conversational;
-
-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;
-import org.oasisopen.sca.ConversationEndedException;
-
-public class ConversationalAgeTestCase {
-
- private static Node node;
-
- @BeforeClass
- public static void setUp() throws Exception {
- System.setProperty("org.apache.tuscany.sca.core.conversation.ConversationManager.ReaperInterval", "2");
- String location = ContributionLocationHelper.getContributionLocation("ConversationAge.composite");
- node = NodeFactory.newInstance().createNode("ConversationAge.composite", new Contribution("c1", location));
- node.start();
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- System.clearProperty("org.apache.tuscany.sca.core.conversation.ConversationManager.ReaperInterval");
- if (node != null) {
- node.stop();
- }
- }
-
- @Test
- public void testMaxAge() throws InterruptedException {
-
- ConversationalService conversationalService =
- node.getService(ConversationalService.class, "ConversationAgeComponent");
-
- Assert.assertEquals(0, conversationalService.retrieveCount());
- conversationalService.initializeCount(42);
- Assert.assertEquals(42, conversationalService.retrieveCount());
- Assert.assertEquals(42, conversationalService.retrieveCount());
- Thread.sleep(500);
- try {
- Assert.assertEquals(42, conversationalService.retrieveCount());
- } catch (ConversationEndedException e) {
- Assert.fail();
- }
- }
-
- @Test
- public void testAgeExpired() throws InterruptedException {
-
- ConversationalService conversationalService =
- node.getService(ConversationalService.class, "ConversationAgeComponent");
-
- Assert.assertEquals(0, conversationalService.retrieveCount());
- conversationalService.initializeCount(42);
- Assert.assertEquals(42, conversationalService.retrieveCount());
- Assert.assertEquals(42, conversationalService.retrieveCount());
- Thread.sleep(1100);
- try {
- Assert.assertEquals(0, conversationalService.retrieveCount());
- Assert.fail();
- } catch (ConversationEndedException e) {
- // expected
- }
- }
-
- @Test
- public void testMaxIdle() throws InterruptedException {
-
- ConversationalService conversationalService =
- node.getService(ConversationalService.class, "ConversationIdleComponent");
-
- Assert.assertEquals(0, conversationalService.retrieveCount());
- conversationalService.initializeCount(42);
- Assert.assertEquals(42, conversationalService.retrieveCount());
- Assert.assertEquals(42, conversationalService.retrieveCount());
- Thread.sleep(1100);
- try {
- Assert.assertEquals(0, conversationalService.retrieveCount());
- } catch (ConversationEndedException e) {
- // expected
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java b/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java
deleted file mode 100644
index ee1bf84fc4..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalJ2SETestCase.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.conversational;
-
-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.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ConversationalJ2SETestCase {
-
- private Node node;
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("conversational.composite");
- node = NodeFactory.newInstance().createNode("conversational.composite", new Contribution("c1", location));
- node.start();
- }
-
- @After
- public void tearDown() throws Exception {
- if (node != null) {
- node.stop();
- }
- }
-
- @Test
- public void testStatefulConversation() {
- ConversationalService conversationalService =
- node.getService(ConversationalService.class, "ConversationalServiceStateful");
-
- conversationalService.initializeCount(1);
- Assert.assertEquals(1, conversationalService.retrieveCount());
- conversationalService.incrementCount();
- Assert.assertEquals(2, conversationalService.retrieveCount());
- conversationalService.endConversation();
-
- Assert.assertEquals(0, conversationalService.retrieveCount());
-
- conversationalService.initializeCount(4);
- Assert.assertEquals(4, conversationalService.retrieveCount());
- conversationalService.incrementCount();
- Assert.assertEquals(5, conversationalService.retrieveCount());
- conversationalService.endConversation();
-
- }
-
- @Test
- public void testStatelessConversation() {
- ConversationalService conversationalService =
- node.getService(ConversationalService.class, "ConversationalServiceStateless");
-
- conversationalService.initializeCount(1);
- Assert.assertEquals(1, conversationalService.retrieveCount());
- conversationalService.incrementCount();
- Assert.assertEquals(2, conversationalService.retrieveCount());
- conversationalService.endConversation();
-
- conversationalService.initializeCount(4);
- Assert.assertEquals(4, conversationalService.retrieveCount());
- conversationalService.incrementCount();
- Assert.assertEquals(5, conversationalService.retrieveCount());
- conversationalService.endConversation();
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java b/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java
deleted file mode 100644
index 56bca7ac78..0000000000
--- a/tags/java/sca/2.0-M1/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationalTestCase.java
+++ /dev/null
@@ -1,702 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.conversational;
-
-import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulImpl;
-import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatefulNonConversationalCallbackImpl;
-import org.apache.tuscany.sca.itest.conversational.impl.ConversationalClientStatelessImpl;
-import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceRequestImpl;
-import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulImpl;
-import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatefulNonConversationalCallbackImpl;
-import org.apache.tuscany.sca.itest.conversational.impl.ConversationalServiceStatelessImpl;
-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 ConversationalTestCase {
-
- private static Node node;
- private static ConversationalClient conversationalStatelessClientStatelessService;
- private static ConversationalClient conversationalStatelessClientStatefulService;
- private static ConversationalClient conversationalStatefulClientStatelessService;
- private static ConversationalClient conversationalStatefulClientStatefulService;
- private static ConversationalClient conversationalStatelessClientRequestService;
- private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService;
-
- @BeforeClass
- public static void setUp() throws Exception {
- try {
- String location = ContributionLocationHelper.getContributionLocation("conversational.composite");
- node = NodeFactory.newInstance().createNode("conversational.composite", new Contribution("c1", location));
- node.start();
-
- conversationalStatelessClientStatelessService =
- node.getService(ConversationalClient.class, "ConversationalStatelessClientStatelessService");
-
- conversationalStatelessClientStatefulService =
- node.getService(ConversationalClient.class, "ConversationalStatelessClientStatefulService");
-
- conversationalStatefulClientStatelessService =
- node.getService(ConversationalClient.class, "ConversationalStatefulClientStatelessService");
-
- conversationalStatefulClientStatefulService =
- node.getService(ConversationalClient.class, "ConversationalStatefulClientStatefulService");
- conversationalStatelessClientRequestService =
- node.getService(ConversationalClient.class, "ConversationalStatelessClientRequestService");
- conversationalStatefulClientNonConversationalCallbackStatelessService =
- node.getService(ConversationalClient.class,
- "ConversationalStatefulClientNonConversationalCallbackStatefulService");
-
- } catch (Exception ex) {
- System.err.println(ex.toString());
- }
-
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- }
-
- private void resetCallStack() {
-
- // reset the place where we record the sequence of calls passing
- // through each component instance
- ConversationalServiceStatelessImpl.calls = new StringBuffer();
- ConversationalServiceStatefulImpl.calls = new StringBuffer();
- ConversationalClientStatelessImpl.calls = new StringBuffer();
- ConversationalClientStatefulImpl.calls = new StringBuffer();
- ConversationalClientStatefulNonConversationalCallbackImpl.calls = new StringBuffer();
- ConversationalServiceStatefulNonConversationalCallbackImpl.calls = new StringBuffer();
-
- }
-
- // stateless client stateful service tests
- // =======================================
- @Test
- public void testStatelessStatefulConversationFromInjectedReference() {
- int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatelessStatefulConversationFromInjectedReference2() {
- int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference2();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatelessStatefulConversationFromServiceReference() {
- int count = conversationalStatelessClientStatefulService.runConversationFromServiceReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatelessStatefulConversationWithUserDefinedConversationId() {
- int count = conversationalStatelessClientStatefulService.runConversationWithUserDefinedConversationId();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatelessStatefulConversationCheckUserDefinedConversationId() {
- String conversationId =
- conversationalStatelessClientStatefulService.runConversationCheckUserDefinedConversationId();
- Assert.assertEquals("MyConversation2", conversationId);
- }
-
- @Test
- public void testStatelessStatefulConversationCheckingScope() {
- resetCallStack();
- conversationalStatelessClientStatefulService.runConversationCheckingScope();
- Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
- ConversationalServiceStatefulImpl.calls.toString());
- }
-
- @Test
- public void testStatelessStatefulConversationWithCallback() {
- resetCallStack();
- int count = conversationalStatelessClientStatefulService.runConversationWithCallback();
- Assert.assertEquals(0, count);
-
- Assert
- .assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,",
- ConversationalClientStatelessImpl.calls.toString());
- }
-
- //@Test
- public void testStatelessStatefulConversationHavingPassedReference() {
- int count = conversationalStatelessClientStatefulService.runConversationHavingPassedReference();
- Assert.assertEquals(3, count);
- }
-
- @Test
- public void testStatelessStatefulConversationBusinessException() {
- String message = conversationalStatelessClientStatefulService.runConversationBusinessException();
- Assert.assertEquals("Business Exception", message);
- }
-
- @Test
- public void testStatelessStatefulConversationBusinessExceptionCallback() {
- String message = conversationalStatelessClientStatefulService.runConversationBusinessExceptionCallback();
- Assert.assertEquals("Business Exception", message);
- }
-
- @Test
- public void testStatelessStatefulConversationCallingEndedConversation() {
- int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversation();
- Assert.assertEquals(0, count);
- }
-
- @Test
- public void testStatelessStatefulConversationCallingEndedConversationCallback() {
- int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCallback();
- Assert.assertEquals(0, count);
- }
-
- @Test
- public void testStatelessStatefulConversationCallingEndedConversationCheckConversationId() {
- String id =
- conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- //@Test
- public void testStatelessStatefulConversationCallingEndedConversationCallbackCheckConversationId() {
- String id =
- conversationalStatelessClientStatefulService
- .runConversationCallingEndedConversationCallbackCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- // stateless client stateless service tests
- // ========================================
- @Test
- public void testStatelessStatelessConversationFromInjectedReference() {
- int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatelessStatelessConversationFromInjectedReference2() {
- int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference2();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatelessStatelessConversationFromServiceReference() {
- int count = conversationalStatelessClientStatelessService.runConversationFromServiceReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatelessStatelessConversationWithUserDefinedConversationId() {
- int count = conversationalStatelessClientStatelessService.runConversationWithUserDefinedConversationId();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatelessStatelessConversationCheckUserDefinedConversationId() {
- String conversationId =
- conversationalStatelessClientStatelessService.runConversationCheckUserDefinedConversationId();
- Assert.assertEquals("MyConversation2", conversationId);
- }
-
- @Test
- public void testStatelessStatelessConversationCheckingScope() {
- resetCallStack();
- conversationalStatelessClientStatelessService.runConversationCheckingScope();
- Assert
- .assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,",
- ConversationalServiceStatelessImpl.calls.toString());
- }
-
- @Test
- public void testStatelessStatelessConversationWithCallback() {
- resetCallStack();
- int count = conversationalStatelessClientStatelessService.runConversationWithCallback();
- Assert.assertEquals(0, count);
-
- Assert
- .assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,",
- ConversationalClientStatelessImpl.calls.toString());
- }
-
- //@Test
- public void testStatelessStatelessConversationHavingPassedReference() {
- int count = conversationalStatelessClientStatelessService.runConversationHavingPassedReference();
- Assert.assertEquals(3, count);
- }
-
- @Test
- public void testStatelessStatelessConversationCallingEndedConversation() {
- int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversation();
- Assert.assertEquals(-999, count);
- }
-
- @Test
- public void testStatelessStatelessConversationCallingEndedConversationCallback() {
- int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCallback();
- Assert.assertEquals(0, count);
- }
-
- @Test
- public void testStatelessStatelessConversationCallingEndedConversationCheckConversationId() {
- String id =
- conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- //@Test
- public void testStatelessStatelessConversationCallingEndedConversationCallbackCheckConversationId() {
- String id =
- conversationalStatelessClientStatelessService
- .runConversationCallingEndedConversationCallbackCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- // stateful client stateful service tests
- // ======================================
- @Test
- public void testStatefulStatefulConversationFromInjectedReference() {
- int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulStatefulConversationFromInjectedReference2() {
- int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference2();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulStatefulConversationFromServiceReference() {
- int count = conversationalStatefulClientStatefulService.runConversationFromServiceReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulStatefulConversationWithUserDefinedConversationId() {
- int count = conversationalStatefulClientStatefulService.runConversationWithUserDefinedConversationId();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulStatefulConversationCheckUserDefinedConversationId() {
- String conversationId =
- conversationalStatefulClientStatefulService.runConversationCheckUserDefinedConversationId();
- Assert.assertEquals("MyConversation2", conversationId);
- }
-
- @Test
- public void testStatefulStatefulConversationCheckingScope() {
- resetCallStack();
- conversationalStatefulClientStatefulService.runConversationCheckingScope();
- Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
- ConversationalServiceStatefulImpl.calls.toString());
- }
-
- @Test
- public void testStatefulStatefulConversationWithCallback() {
- resetCallStack();
- int count = conversationalStatefulClientStatefulService.runConversationWithCallback();
- Assert.assertEquals(4, count);
-
- Assert
- .assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
- ConversationalClientStatefulImpl.calls.toString());
- }
-
- //@Test
- public void testStatefulStatefulConversationHavingPassedReference() {
- int count = conversationalStatefulClientStatefulService.runConversationHavingPassedReference();
- Assert.assertEquals(3, count);
- }
-
- @Test
- public void testStatefulStatefulConversationCallingEndedConversation() {
- int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversation();
- Assert.assertEquals(0, count);
- }
-
- @Test
- public void testStatefulStatefulConversationCallingEndedConversationCallback() {
- int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCallback();
- Assert.assertEquals(0, count);
- }
-
- @Test
- public void testStatefulStatefulConversationCallingEndedConversationCheckConversationId() {
- String id =
- conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- @Test
- public void testStatefulStatefulConversationCallingEndedConversationCallbackCheckConversationId() {
- String id =
- conversationalStatefulClientStatefulService
- .runConversationCallingEndedConversationCallbackCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- // stateful client stateless service tests
- // =======================================
- @Test
- public void testStatefulStatelessConversationFromInjectedReference() {
- int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulStatelessConversationFromInjectedReference2() {
- int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference2();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulStatelessConversationFromServiceReference() {
- int count = conversationalStatefulClientStatelessService.runConversationFromServiceReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulStatelessConversationWithUserDefinedConversationId() {
- int count = conversationalStatefulClientStatelessService.runConversationWithUserDefinedConversationId();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulStatelessConversationCheckUserDefinedConversationId() {
- String conversationId =
- conversationalStatefulClientStatelessService.runConversationCheckUserDefinedConversationId();
- Assert.assertEquals("MyConversation2", conversationId);
- }
-
- @Test
- public void testStatefulStatelessConversationCheckingScope() {
- resetCallStack();
- conversationalStatefulClientStatelessService.runConversationCheckingScope();
- Assert
- .assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,",
- ConversationalServiceStatelessImpl.calls.toString());
- }
-
- @Test
- public void testStatefulStatelessConversationWithCallback() {
- resetCallStack();
- int count = conversationalStatefulClientStatelessService.runConversationWithCallback();
- Assert.assertEquals(4, count);
-
- Assert
- .assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
- ConversationalClientStatefulImpl.calls.toString());
- }
-
- //@Test
- public void testStatefulStatelessConversationHavingPassedReference() {
- int count = conversationalStatefulClientStatelessService.runConversationHavingPassedReference();
- Assert.assertEquals(3, count);
- }
-
- @Test
- public void testStatefulStatelessConversationCallingEndedConversation() {
- int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversation();
- Assert.assertEquals(-999, count);
- }
-
- @Test
- public void testStatefulStatelessConversationCallingEndedConversationCallback() {
- int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCallback();
- Assert.assertEquals(0, count);
- }
-
- @Test
- public void testStatefulStatelessConversationCallingEndedConversationCheckConversationId() {
- String id =
- conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- @Test
- public void testStatefulStatelessConversationCallingEndedConversationCallbackCheckConversationId() {
- String id =
- conversationalStatefulClientStatelessService
- .runConversationCallingEndedConversationCallbackCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- // stateless client request scope service tests
- // ============================================
- @Test
- public void testStatelessRequestConversationFromInjectedReference() {
- int count = conversationalStatelessClientRequestService.runConversationFromInjectedReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatelessRequestConversationFromInjectedReference2() {
- int count = conversationalStatelessClientRequestService.runConversationFromInjectedReference2();
- Assert.assertEquals(1, count);
- }
-
- @Test
- public void testStatelessRequestConversationFromServiceReference() {
- int count = conversationalStatelessClientRequestService.runConversationFromServiceReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatelessRequestConversationWithUserDefinedConversationId() {
- int count = conversationalStatelessClientRequestService.runConversationWithUserDefinedConversationId();
- Assert.assertEquals(2, count);
- }
-
- //@Test
- public void testStatelessRequestConversationCheckUserDefinedConversationId() {
- String conversationId =
- conversationalStatelessClientRequestService.runConversationCheckUserDefinedConversationId();
- Assert.assertEquals("MyConversation2", conversationId);
- }
-
- @Test
- public void testStatelessRequestConversationCheckingScope() {
- resetCallStack();
- ConversationalServiceRequestImpl.calls = new StringBuffer();
- conversationalStatelessClientRequestService.runConversationCheckingScope();
- Assert.assertEquals("initializeCount,incrementCount,retrieveCount,endConversation,",
- ConversationalServiceRequestImpl.calls.toString());
- }
-
- @Test
- public void testStatelessRequestConversationWithCallback() {
- resetCallStack();
- ConversationalClientStatelessImpl.calls = new StringBuffer();
- int count = conversationalStatelessClientRequestService.runConversationWithCallback();
- Assert.assertEquals(0, count);
-
- Assert
- .assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,",
- ConversationalClientStatelessImpl.calls.toString());
- }
-
- //@Test
- public void testStatelessRequestConversationHavingPassedReference() {
- int count = conversationalStatelessClientRequestService.runConversationHavingPassedReference();
- Assert.assertEquals(3, count);
- }
-
- @Test
- public void testStatelessRequestConversationBusinessException() {
- String message = conversationalStatelessClientRequestService.runConversationBusinessException();
- Assert.assertEquals("Business Exception", message);
- }
-
- @Test
- public void testStatelessRequestConversationBusinessExceptionCallback() {
- String message = conversationalStatelessClientRequestService.runConversationBusinessExceptionCallback();
- Assert.assertEquals("Business Exception", message);
- }
-
- @Test
- public void testStatelessRequestConversationCallingEndedConversation() {
- int count = conversationalStatelessClientRequestService.runConversationCallingEndedConversation();
- Assert.assertEquals(-999, count);
- }
-
- @Test
- public void testStatelessRequestConversationCallingEndedConversationCallback() {
- int count = conversationalStatelessClientRequestService.runConversationCallingEndedConversationCallback();
- Assert.assertEquals(0, count);
- }
-
- @Test
- public void testStatelessRequestConversationCallingEndedConversationCheckConversationId() {
- String id =
- conversationalStatelessClientRequestService.runConversationCallingEndedConversationCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- //@Test
- public void testStatelessRequestConversationCallingEndedConversationCallbackCheckConversationId() {
- String id =
- conversationalStatelessClientRequestService
- .runConversationCallingEndedConversationCallbackCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- // stateful client non conversational callback stateful service tests
- // ==================================================================
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationFromInjectedReference() {
- int count =
- conversationalStatefulClientNonConversationalCallbackStatelessService
- .runConversationFromInjectedReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationFromInjectedReference2() {
- int count =
- conversationalStatefulClientNonConversationalCallbackStatelessService
- .runConversationFromInjectedReference2();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationFromServiceReference() {
- int count =
- conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationFromServiceReference();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationWithUserDefinedConversationId() {
- int count =
- conversationalStatefulClientNonConversationalCallbackStatelessService
- .runConversationWithUserDefinedConversationId();
- Assert.assertEquals(2, count);
- }
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationCheckUserDefinedConversationId() {
- String conversationId =
- conversationalStatefulClientNonConversationalCallbackStatelessService
- .runConversationCheckUserDefinedConversationId();
- Assert.assertEquals("MyConversation2", conversationId);
- }
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationCheckingScope() {
- resetCallStack();
- conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationCheckingScope();
- Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,",
- ConversationalServiceStatefulNonConversationalCallbackImpl.calls.toString());
- }
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationWithCallback() {
- resetCallStack();
- int count = conversationalStatefulClientNonConversationalCallbackStatelessService.runConversationWithCallback();
- Assert.assertEquals(0, count);
-
- Assert
- .assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,",
- ConversationalClientStatefulNonConversationalCallbackImpl.calls.toString());
- }
-
- //@Test
- public void testStatefulNonConversationalCallbackStatefulConversationHavingPassedReference() {
- int count =
- conversationalStatefulClientNonConversationalCallbackStatelessService
- .runConversationHavingPassedReference();
- Assert.assertEquals(0, count);
- }
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversation() {
- int count =
- conversationalStatefulClientNonConversationalCallbackStatelessService
- .runConversationCallingEndedConversation();
- Assert.assertEquals(0, count);
- }
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCallback() {
- int count =
- conversationalStatefulClientNonConversationalCallbackStatelessService
- .runConversationCallingEndedConversationCallback();
- Assert.assertEquals(0, count);
- }
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCheckConversationId() {
- String id =
- conversationalStatefulClientNonConversationalCallbackStatelessService
- .runConversationCallingEndedConversationCheckConversationId();
- Assert.assertEquals(null, id);
- }
-
- @Test
- public void testStatefulNonConversationalCallbackStatefulConversationCallingEndedConversationCallbackCheckConversationId() {
- String id =
- conversationalStatefulClientNonConversationalCallbackStatelessService
- .runConversationCallingEndedConversationCallbackCheckConversationId();
- Assert.assertEquals("MyConversation3", id);
- }
-
- private static final String NEW_A_VALUE = "First Instance - TestCode Set state on A";
- private static final String NEW_B_VALUE = "First Instance - TestCode Set state on B";
- private static final String SECOND_NEW_A_VALUE = "Second Instance - TestCode Set state on A";
- private static final String SECOND_NEW_B_VALUE = "Second Instance - TestCode Set state on B";
-
- @Test
- public void testMultipleConversations() {
- //////////
- // Tests on first instance
- //////////
- System.out.println("========= First instance tests =========");
- AService aService = node.getService(AService.class, "ConversationalAComponent");
-
- // Make sure initial values are correct
- Assert.assertEquals(Constants.A_INITIAL_VALUE, aService.getState());
- Assert.assertEquals(Constants.B_INITIAL_VALUE, aService.getStateOnB());
-
- // Set some new values
- aService.setState(NEW_A_VALUE);
- aService.setStateOnB(NEW_B_VALUE);
-
- // Verify the set worked
- Assert.assertEquals(NEW_A_VALUE, aService.getState());
- Assert.assertEquals(NEW_B_VALUE, aService.getStateOnB());
-
- //////////
- // Tests on second instance
- //////////
- System.out.println("========= Second instance tests =========");
-
- // Do another look up
- AService aService2 = node.getService(AService.class, "ConversationalAComponent");
-
- // Make sure initial values are correct on the second instance
- Assert.assertEquals(Constants.A_INITIAL_VALUE, aService2.getState());
- Assert.assertEquals(Constants.B_INITIAL_VALUE, aService2.getStateOnB());
-
- // Set some new values on the second instance
- aService2.setState(SECOND_NEW_A_VALUE);
- aService2.setStateOnB(SECOND_NEW_B_VALUE);
-
- // Verify the set worked on the second instance
- Assert.assertEquals(SECOND_NEW_A_VALUE, aService2.getState());
- Assert.assertEquals(SECOND_NEW_B_VALUE, aService2.getStateOnB());
-
- // Verify the values have not been changed on the first instance
- Assert.assertEquals(NEW_A_VALUE, aService.getState());
- Assert.assertEquals(NEW_B_VALUE, aService.getStateOnB());
-
- System.out.println("========= Done instance tests =========");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/distribution/bin-distro-unzip/build.xml b/tags/java/sca/2.0-M1/itest/distribution/bin-distro-unzip/build.xml
deleted file mode 100644
index 5f04a612d8..0000000000
--- a/tags/java/sca/2.0-M1/itest/distribution/bin-distro-unzip/build.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project name="itest-unzip" default="unzip">
- <target name="unzip">
- <unzip src="../../../distribution/all/target/apache-tuscany-sca-all-2.0-M1.zip"
- dest="../../../distribution/all/target/apache-tuscany-sca-all-2.0-M1-dir"/>
- </target>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/distribution/bin-distro-unzip/pom.xml b/tags/java/sca/2.0-M1/itest/distribution/bin-distro-unzip/pom.xml
deleted file mode 100644
index 16a30620b5..0000000000
--- a/tags/java/sca/2.0-M1/itest/distribution/bin-distro-unzip/pom.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <name>Apache Tuscany SCA Bin Distro Unzip</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-all</artifactId>
- <type>pom</type>
- <version>2.0-M1</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>
- <ant antfile="./build.xml"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/distribution/binding-ws-calculator/build.xml b/tags/java/sca/2.0-M1/itest/distribution/binding-ws-calculator/build.xml
deleted file mode 100644
index 6a8f555d49..0000000000
--- a/tags/java/sca/2.0-M1/itest/distribution/binding-ws-calculator/build.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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-2.0-M1-dir/tuscany-sca-2.0-M1" />
-
- <target name="run">
-
- <ant antfile="build.xml"
- dir="${distro.root}/samples/binding-ws-calculator"/>
-
- </target>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/distribution/binding-ws-calculator/pom.xml b/tags/java/sca/2.0-M1/itest/distribution/binding-ws-calculator/pom.xml
deleted file mode 100644
index ed33973b01..0000000000
--- a/tags/java/sca/2.0-M1/itest/distribution/binding-ws-calculator/pom.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-binidng-ws-calculator</artifactId>
- <name>Apache Tuscany SCA Distribution itest binding-ws-calculator</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-M1</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>
- <ant antfile="./build.xml" target="run"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/distribution/calculator-rmi/build.xml b/tags/java/sca/2.0-M1/itest/distribution/calculator-rmi/build.xml
deleted file mode 100644
index 6ff60f29bb..0000000000
--- a/tags/java/sca/2.0-M1/itest/distribution/calculator-rmi/build.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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-2.0-M1-dir/tuscany-sca-2.0-M1" />
-
- <target name="run">
-
- <parallel>
-
- <daemons>
- <ant antfile="build.xml"
- dir="${distro.root}/samples/calculator-rmi-service"/>
- </daemons>
-
- <sequential>
- <sleep seconds="2"/>
- <ant antfile="build.xml"
- dir="${distro.root}/samples/calculator-rmi-reference"/>
- </sequential>
-
- </parallel>
-
- </target>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/distribution/calculator-rmi/pom.xml b/tags/java/sca/2.0-M1/itest/distribution/calculator-rmi/pom.xml
deleted file mode 100644
index e021b1b9c5..0000000000
--- a/tags/java/sca/2.0-M1/itest/distribution/calculator-rmi/pom.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-calculator-rmi</artifactId>
- <name>Apache Tuscany SCA Distribution itest calculator-rmi</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-M1</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>
- <ant antfile="./build.xml" target="run"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/distribution/implementation-java-calculator/build.xml b/tags/java/sca/2.0-M1/itest/distribution/implementation-java-calculator/build.xml
deleted file mode 100644
index 311a2001ca..0000000000
--- a/tags/java/sca/2.0-M1/itest/distribution/implementation-java-calculator/build.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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-2.0-M1-dir/tuscany-sca-2.0-M1" />
-
- <target name="run">
-
- <ant antfile="build.xml"
- dir="${distro.root}/samples/implementation-java-calculator"/>
-
- </target>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/distribution/implementation-java-calculator/pom.xml b/tags/java/sca/2.0-M1/itest/distribution/implementation-java-calculator/pom.xml
deleted file mode 100644
index 710a21fd75..0000000000
--- a/tags/java/sca/2.0-M1/itest/distribution/implementation-java-calculator/pom.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-implementation-java-calculator</artifactId>
- <name>Apache Tuscany SCA Distribution itest implementation-java-calculator</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-M1</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>
- <ant antfile="./build.xml" target="run"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/distribution/pom.xml b/tags/java/sca/2.0-M1/itest/distribution/pom.xml
deleted file mode 100644
index 580b29e788..0000000000
--- a/tags/java/sca/2.0-M1/itest/distribution/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <packaging>pom</packaging>
- <artifactId>itest-distribution</artifactId>
- <name>Apache Tuscany SCA Distribution Integration Tests</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>
- </modules>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/pom.xml b/tags/java/sca/2.0-M1/itest/exceptions/pom.xml
deleted file mode 100644
index a012d4e236..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-exceptions</artifactId>
- <name>Apache Tuscany SCA Exceptions Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java b/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java
deleted file mode 100644
index 1f57116bac..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.exceptions;
-
-public class Checked extends Exception {
- private static final long serialVersionUID = -129752837478357452L;
-
- /**
- *
- */
- public Checked() {
-
- }
-
- /**
- * @param message
- */
- public Checked(String message) {
- super(message);
-
- }
-
- /**
- * @param cause
- */
- public Checked(Throwable cause) {
- super(cause);
-
- }
-
- /**
- * @param message
- * @param cause
- */
- public Checked(String message, Throwable cause) {
- super(message, cause);
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java b/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java
deleted file mode 100644
index 112aefc747..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.exceptions;
-
-public interface ExceptionHandler {
-
- void testing();
-
- Checked getTheBad();
-
- String getTheGood();
-
- UnChecked getTheUgly();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java b/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java
deleted file mode 100644
index 53a6c70b57..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.exceptions;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Remote exception thrower
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface ExceptionRemoteThrower extends ExceptionThrower {
-}
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java b/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java
deleted file mode 100644
index ace219991b..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.exceptions;
-
-/**
- * Local exception thrower
- * @version $Rev$ $Date$
- */
-public interface ExceptionThrower {
- Checked BAD = new Checked("theBad");
- UnChecked UGLY = new UnChecked("theUgly");
- String SO_THEY_SAY = "All is good that ends good.";
-
- String theGood() throws Checked;
-
- String theBad() throws Checked;
-
- String theUgly() throws Checked;
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java b/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java
deleted file mode 100644
index 453528444d..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.exceptions;
-
-public class UnChecked extends RuntimeException {
- private static final long serialVersionUID = -1318118082838092244L;
-
- /**
- *
- */
- public UnChecked() {
-
- }
-
- /**
- * @param message
- */
- public UnChecked(String message) {
- super(message);
-
- }
-
- /**
- * @param cause
- */
- public UnChecked(Throwable cause) {
- super(cause);
-
- }
-
- /**
- * @param message
- * @param cause
- */
- public UnChecked(String message, Throwable cause) {
- super(message, cause);
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java b/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
deleted file mode 100644
index 26b9f0a383..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.exceptions.impl;
-
-import org.apache.tuscany.sca.test.exceptions.Checked;
-import org.apache.tuscany.sca.test.exceptions.ExceptionHandler;
-import org.apache.tuscany.sca.test.exceptions.ExceptionThrower;
-import org.apache.tuscany.sca.test.exceptions.UnChecked;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-@Scope("COMPOSITE")
-public class ExceptionHandlerImpl implements ExceptionHandler {
- static final String INIT = "INIT";
-
- private ExceptionThrower exceptionThrower;
-
- private String theGood;
-
- private Checked theBad;
-
- private UnChecked theUgly;
-
- public void testing() {
-
- assert exceptionThrower != null : "'exceptionThrower' never wired";
- String result = INIT;
- try {
- theGood = result = exceptionThrower.theGood();
- assert result == ExceptionThrower.SO_THEY_SAY;
- } catch (Throwable e) {
- assert result == INIT;
- assert false;
- e.printStackTrace();
- }
-
- result = INIT;
- try {
- result = exceptionThrower.theBad();
- // incredible
- assert false : "Expected 'Check' Exception";
-
- } catch (Checked e) {
- // This is good...
- assert result == INIT;
- theBad = e;
- } catch (Throwable t) {
- // This is not so good.
- t.printStackTrace();
- assert result == INIT;
- assert false : "Got wrong exception '" + t.getClass().getName();
- }
-
- result = INIT;
- try {
- result = exceptionThrower.theUgly();
- // incredible
- assert false : "Expected 'UnCheck' Exception";
-
- } catch (Checked e) {
- // This is not so good...
- assert false : "Got wrong exception '" + e.getClass().getName();
- assert result == INIT;
- } catch (UnChecked e) {
- theUgly = e;
-
- } catch (Throwable t) {
- // This is not good.
- assert false;
- assert result == INIT;
-
- System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT);
- }
-
- }
-
- @Reference
- public void setExceptionThrower(ExceptionThrower exceptionThrower) {
- this.exceptionThrower = exceptionThrower;
- }
-
- public String getTheGood() {
- return theGood;
- }
-
- public Checked getTheBad() {
- return theBad;
- }
-
- public UnChecked getTheUgly() {
- return theUgly;
- }
-
- public ExceptionThrower getExceptionThrower() {
- return exceptionThrower;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java b/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java
deleted file mode 100644
index cd62338841..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.exceptions.impl;
-
-import org.apache.tuscany.sca.test.exceptions.Checked;
-import org.apache.tuscany.sca.test.exceptions.ExceptionRemoteThrower;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-@Service(ExceptionRemoteThrower.class)
-public class ExceptionRemoteThrowerImpl implements ExceptionRemoteThrower {
- public String theBad() throws Checked {
- throw BAD;
- }
-
- public String theGood() throws Checked {
- return SO_THEY_SAY;
- }
-
- public String theUgly() throws Checked {
- throw UGLY;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java b/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java
deleted file mode 100644
index 56b9fc6f5b..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.exceptions.impl;
-
-import org.apache.tuscany.sca.test.exceptions.Checked;
-import org.apache.tuscany.sca.test.exceptions.ExceptionThrower;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-@Service(ExceptionThrower.class)
-public class ExceptionThrowerImpl implements ExceptionThrower {
-
- public String theBad() throws Checked {
- throw BAD;
- }
-
- public String theGood() throws Checked {
- return SO_THEY_SAY;
- }
-
- public String theUgly() throws Checked {
- throw UGLY;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java b/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java
deleted file mode 100644
index c5b54ff902..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.exceptions.impl;
-
-import org.apache.tuscany.sca.test.exceptions.Checked;
-import org.apache.tuscany.sca.test.exceptions.ExceptionHandler;
-import org.apache.tuscany.sca.test.exceptions.ExceptionRemoteThrower;
-import org.apache.tuscany.sca.test.exceptions.ExceptionThrower;
-import org.apache.tuscany.sca.test.exceptions.UnChecked;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-@Scope("COMPOSITE")
-public class RemoteExceptionHandlerImpl implements ExceptionHandler {
- static final String INIT = "INIT";
-
- private ExceptionRemoteThrower exceptionThrower;
-
- private String theGood;
-
- private Checked theBad;
-
- private UnChecked theUgly;
-
- public void testing() {
-
- assert exceptionThrower != null : "'exceptionThrower' never wired";
- String result = INIT;
- try {
- theGood = result = exceptionThrower.theGood();
- assert result == ExceptionThrower.SO_THEY_SAY;
- } catch (Throwable e) {
- assert result == INIT;
- assert false;
- e.printStackTrace();
- }
-
- result = INIT;
- try {
- result = exceptionThrower.theBad();
- // incredible
- assert false : "Expected 'Check' Exception";
-
- } catch (Checked e) {
- // This is good...
- assert result == INIT;
- theBad = e;
- } catch (Throwable t) {
- // This is not so good.
- t.printStackTrace();
- assert result == INIT;
- assert false : "Got wrong exception '" + t.getClass().getName();
- }
-
- result = INIT;
- try {
- result = exceptionThrower.theUgly();
- // incredible
- assert false : "Expected 'UnCheck' Exception";
-
- } catch (Checked e) {
- // This is not so good...
- assert false : "Got wrong exception '" + e.getClass().getName();
- assert result == INIT;
- } catch (UnChecked e) {
- theUgly = e;
-
- } catch (Throwable t) {
- // This is not good.
- assert false;
- assert result == INIT;
-
- System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT);
- }
-
- }
-
- @Reference
- public void setExceptionThrower(ExceptionRemoteThrower exceptionThrower) {
- this.exceptionThrower = exceptionThrower;
- }
-
- public String getTheGood() {
- return theGood;
- }
-
- public Checked getTheBad() {
- return theBad;
- }
-
- public UnChecked getTheUgly() {
- return theUgly;
- }
-
- public ExceptionRemoteThrower getExceptionThrower() {
- return exceptionThrower;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/main/resources/ExceptionTest.composite b/tags/java/sca/2.0-M1/itest/exceptions/src/main/resources/ExceptionTest.composite
deleted file mode 100644
index d27797c2fe..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/main/resources/ExceptionTest.composite
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:foo="http://foo" targetNamespace="http://foo"
- name="ExceptionTest">
- <component name="main">
- <implementation.java class="org.apache.tuscany.sca.test.exceptions.impl.ExceptionHandlerImpl" />
- <reference name="exceptionThrower" target="exceptionThrower" />
- </component>
-
- <component name="exceptionThrower">
- <implementation.java class="org.apache.tuscany.sca.test.exceptions.impl.ExceptionThrowerImpl" />
- </component>
-
- <component name="mainRemote">
- <implementation.java class="org.apache.tuscany.sca.test.exceptions.impl.RemoteExceptionHandlerImpl" />
- <reference name="exceptionThrower" target="exceptionThrowerRemote" />
- </component>
-
- <component name="exceptionThrowerRemote">
- <implementation.java class="org.apache.tuscany.sca.test.exceptions.impl.ExceptionRemoteThrowerImpl" />
- </component>
-
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java b/tags/java/sca/2.0-M1/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java
deleted file mode 100644
index 7794348476..0000000000
--- a/tags/java/sca/2.0-M1/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.exceptions;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertSame;
-
-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;
-
-public class ExceptionsTestCase {
-
- private static Node node;
-
- /**
- * Test exception handling over a local interface
- */
- @Test
- public void testLocal() {
- ExceptionHandler exceptionHandler = node.getService(ExceptionHandler.class, "main");
- exceptionHandler.testing();
- assertEquals(ExceptionThrower.SO_THEY_SAY, exceptionHandler.getTheGood());
- assertNotNull(exceptionHandler.getTheBad());
- assertEquals(Checked.class, exceptionHandler.getTheBad().getClass());
- assertSame(ExceptionThrower.BAD, exceptionHandler.getTheBad());
- assertNotNull(exceptionHandler.getTheUgly());
- assertEquals(UnChecked.class, exceptionHandler.getTheUgly().getClass());
- assertSame(ExceptionThrower.UGLY, exceptionHandler.getTheUgly());
- }
-
- /**
- * Test exception handling over a remotable interface
- */
- @Test
- public void testRemote() {
- ExceptionHandler exceptionHandler = node.getService(ExceptionHandler.class, "mainRemote");
- exceptionHandler.testing();
- assertEquals(ExceptionThrower.SO_THEY_SAY, exceptionHandler.getTheGood());
- assertNotNull(exceptionHandler.getTheBad());
- assertEquals(Checked.class, exceptionHandler.getTheBad().getClass());
- assertNotSame(ExceptionThrower.BAD, exceptionHandler.getTheBad());
- assertNotNull(exceptionHandler.getTheUgly());
- assertEquals(UnChecked.class, exceptionHandler.getTheUgly().getClass());
-
- // [rfeng] We're not in a position to copy non business exceptions
- // assertNotSame(ExceptionThrower.UGLY, exceptionHandler.getTheUgly());
-
- }
-
- @BeforeClass
- public static void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("ExceptionTest.composite");
- node = NodeFactory.newInstance().createNode("ExceptionTest.composite", new Contribution("c1", location));
- node.start();
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/pom.xml b/tags/java/sca/2.0-M1/itest/interfaces/pom.xml
deleted file mode 100644
index c80a276ae4..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-interfaces</artifactId>
- <name>Apache Tuscany SCA Interface Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java
deleted file mode 100644
index f4131593d5..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.interfaces;
-
-/**
- * only for callBack
- */
-public interface LocalCallbackInterface {
-
- void callbackMethod(String str);
-
- void modifyParameter(ParameterObject po);
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java
deleted file mode 100644
index 5fc9ed51b3..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.interfaces;
-
-import org.oasisopen.sca.annotation.OneWay;
-
-/*
- * itest for interface: local,method-overloading
- */
-public interface LocalClientComponent {
-
- String foo1(ParameterObject po);
-
- String foo1(String str) throws Exception;
-
- String foo2(String str, int i);
-
- String foo2(int i, String str) throws Exception;
-
- void callback(String str);
-
- void callModifyParameter();
-
- @OneWay
- void onewayMethod(String str);
-
- String getCallbackValue();
-
- String getOnewayValue();
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
deleted file mode 100644
index 6cd937af12..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.interfaces;
-
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(LocalClientComponent.class)
-public class LocalClientComponentImpl implements LocalClientComponent, LocalCallbackInterface {
-
- @Reference
- protected LocalServiceComponent aCallBackService;
- private static String callbackValue;
- private static String onewayValue;
-
- public String foo1(ParameterObject po) {
- po.field1 = "AComponent";
- return "AComponent";
- }
-
- public String foo1(String str) throws Exception {
- return str + "AComponent";
- }
-
- public String foo2(String str, int i) {
- return str + "AComponent" + i;
- }
-
- public String foo2(int i, String str) throws Exception {
- return str + "AComponent" + i;
- }
-
- public void callback(String str) {
- aCallBackService.callback(str);
- }
-
- public void callbackMethod(String str) {
- callbackValue = str;
- }
-
- public void callModifyParameter() {
- this.aCallBackService.modifyParameter();
- }
-
- public String getCallbackValue() {
- return callbackValue;
- }
-
- public void onewayMethod(String str) {
- onewayValue = str;
- try {
- Thread.sleep(200);
- } catch (Exception e) {
- //do nothing
- }
- }
-
- public String getOnewayValue() {
- return onewayValue;
- }
-
- public void modifyParameter(ParameterObject po) {
- po.field1 = "AComponent";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java
deleted file mode 100644
index 05a9d09bdd..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.interfaces;
-
-import org.oasisopen.sca.annotation.Callback;
-
-/**
- * Local be-directional callBackService
- */
-@Callback(LocalCallbackInterface.class)
-public interface LocalServiceComponent {
-
- String foo(String str);
-
- void callback(String str);
-
- void modifyParameter();
-
- ParameterObject getPO();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java
deleted file mode 100644
index ab0b18191c..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.interfaces;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(LocalServiceComponent.class)
-public class LocalServiceComponentImpl implements LocalServiceComponent {
-
- @Callback
- protected LocalCallbackInterface callback;
-
- private static ParameterObject po;
-
- public void callback(String str) {
- callback.callbackMethod(str);
- }
-
- public void modifyParameter() {
- po = new ParameterObject("CallBack");
- callback.modifyParameter(po);
- }
-
- public String foo(String str) {
- return str;
- }
-
- public ParameterObject getPO() {
- return po;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java
deleted file mode 100644
index 724d94dffb..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.interfaces;
-
-import java.io.Serializable;
-
-public class ParameterObject implements Serializable {
- private static final long serialVersionUID = 1L;
- public String field1;
-
- public ParameterObject() {
- this.field1 = null;
- }
-
- public ParameterObject(String field1) {
- this.field1 = field1;
- }
-
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if (o instanceof ParameterObject) {
- ParameterObject other = (ParameterObject)o;
- if (field1 != null) {
- return field1.equals(other.field1);
- }
- }
- return false;
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java
deleted file mode 100644
index be3fa4c15a..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.interfaces;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * only for callBack
- */
-@Remotable
-public interface RemoteCallbackInterface {
-
- void callbackMethod(String str);
-
- void modifyParameter(ParameterObject po);
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java
deleted file mode 100644
index 9f34dfd274..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.interfaces;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/*
- * different signatures
- */
-
-@Remotable
-public interface RemoteClientComponent {
-
- String foo1(ParameterObject po);
-
- String foo3(ParameterObject po);
-
- String foo2(int i, String str1) throws Exception;
-
- void callback(String str);
-
- void callModifyParameter();
-
- String getCallbackValue();
-
- void onewayMethod(String str);
-
- String getOnewayValue();
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java
deleted file mode 100644
index 541b1f1508..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.interfaces;
-
-import org.oasisopen.sca.annotation.AllowsPassByReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(RemoteClientComponent.class)
-public class RemoteClientComponentImpl implements RemoteClientComponent, RemoteCallbackInterface {
-
- @Reference
- protected RemoteServiceComponent aCallBackService;
- private static String callbackValue;
- private static String onewayValue;
-
- public String foo1(ParameterObject po) {
- po.field1 = "BComponent";
- return "BComponent";
- }
-
- @AllowsPassByReference
- public String foo3(ParameterObject po) {
- po.field1 = "BComponent";
- return "BComponent";
- }
-
- public String foo2(int i, String str) throws Exception {
- return str + "BComponent" + i;
- }
-
- public void callback(String str) {
- aCallBackService.callback(str);
- }
-
- public void callModifyParameter() {
- this.aCallBackService.modifyParameter();
- }
-
- public void callbackMethod(String str) {
- callbackValue = str;
- }
-
- public String getCallbackValue() {
- return callbackValue;
- }
-
- public void onewayMethod(String str) {
- onewayValue = str;
- try {
- Thread.sleep(200);
- } catch (Exception e) {
- //do nothing
- }
- }
-
- public String getOnewayValue() {
- return onewayValue;
- }
-
- public void modifyParameter(ParameterObject po) {
- po.field1 = "BComponent";
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java
deleted file mode 100644
index b29b298ab6..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.interfaces;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-@Callback(RemoteCallbackInterface.class)
-public interface RemoteServiceComponent {
-
- String foo(String str);
-
- void callback(String str);
-
- void modifyParameter();
-
- ParameterObject getPO();
-
- String[] bar(int[][] intArray);
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java b/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java
deleted file mode 100644
index 00a0f5645b..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.interfaces;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(RemoteServiceComponent.class)
-public class RemoteServiceComponentImpl implements RemoteServiceComponent {
-
- @Callback
- protected RemoteCallbackInterface callback;
-
- private static ParameterObject po;
-
- public void callback(String str) {
- callback.callbackMethod(str);
- }
-
- public void modifyParameter() {
- po = new ParameterObject("CallBack");
- callback.modifyParameter(po);
- }
-
- public String foo(String str) {
- return str;
- }
-
- public ParameterObject getPO() {
- return po;
- }
-
- public String[] bar(int[][] intArray) {
- return new String[] {"int"};
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/interfaces/src/main/resources/InterfacesTest.composite b/tags/java/sca/2.0-M1/itest/interfaces/src/main/resources/InterfacesTest.composite
deleted file mode 100644
index 0361d8c83c..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/main/resources/InterfacesTest.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed 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://www.osoa.org/xmlns/sca/1.0" 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/tags/java/sca/2.0-M1/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java b/tags/java/sca/2.0-M1/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java
deleted file mode 100644
index 57ba18d0d6..0000000000
--- a/tags/java/sca/2.0-M1/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.interfaces;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-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;
-
-public class InterfacesTestCase {
- private static Node node;
-
- @BeforeClass
- public static void init() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("InterfacesTest.composite");
- node = NodeFactory.newInstance().createNode("InterfacesTest.composite", new Contribution("c1", location));
- node.start();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- node.stop();
- }
-
- @Test
- public void testLocalClient() {
- LocalServiceComponent service = node.getService(LocalServiceComponent.class, "LocalServiceComponent");
- LocalClientComponent local = node.getService(LocalClientComponent.class, "LocalClientComponent");
-
- try {
- ParameterObject po = new ParameterObject();
- assertEquals("AComponent", local.foo1(po));
- assertEquals("AComponent", po.field1);
-
- assertEquals("AAComponent", local.foo1("A"));
-
- assertEquals("AAComponent1", local.foo2("A", 1));
- assertEquals("AAComponent1", local.foo2(1, "A"));
- } catch (Exception e) {
- fail();
- }
-
- try {
- // test local callback
- local.callback("CallBack");
- Thread.sleep(100);
- assertEquals("CallBack", local.getCallbackValue());
-
- local.callModifyParameter();
- Thread.sleep(100);
- assertEquals("AComponent", service.getPO().field1);
- } catch (Exception e) {
- e.printStackTrace();
- fail("CallBack failed");
- }
-
- try {
- local.onewayMethod("OneWay");
- Thread.sleep(100);
- assertEquals("OneWay", local.getOnewayValue());
- } catch (Exception e) {
- fail("OneWay failed");
- }
- }
-
- @Test
- public void testRemoteClient() {
- RemoteServiceComponent service = node.getService(RemoteServiceComponent.class, "RemoteServiceComponent");
- RemoteClientComponent remote = node.getService(RemoteClientComponent.class, "RemoteClientComponent");
-
- try {
- // Test Pass By Value
- ParameterObject po = new ParameterObject("NotBComponent");
- assertEquals("BComponent", remote.foo1(po));
- assertEquals("NotBComponent", po.field1);
-
- assertEquals("BBComponent1", remote.foo2(1, "B"));
-
- // Test allowsPassByReference
- assertEquals("BComponent", remote.foo3(po));
- assertEquals("BComponent", po.field1);
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
-
- try {
- remote.callback("CallBack");
- Thread.sleep(100);
- assertEquals("CallBack", remote.getCallbackValue());
-
- remote.callModifyParameter();
- Thread.sleep(100);
- assertEquals("CallBack", service.getPO().field1);
- } catch (Exception e) {
- fail("CallBack failed");
- }
-
- try {
- remote.onewayMethod("OneWay");
- Thread.sleep(100);
- assertEquals("OneWay", remote.getOnewayValue());
- } catch (Exception e) {
- fail("OneWay failed");
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/operation-overloading/pom.xml b/tags/java/sca/2.0-M1/itest/operation-overloading/pom.xml
deleted file mode 100644
index efead87521..0000000000
--- a/tags/java/sca/2.0-M1/itest/operation-overloading/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-operation-overloading</artifactId>
- <name>Apache Tuscany SCA Operation Overloading Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java b/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java
deleted file mode 100644
index 1f589b44f4..0000000000
--- a/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.opoverload;
-
-/**
- * This is an Interface which has methods declared but not implemented, These methods will be implemented in
- * OverloadATarget Class and OverloadASource This class has methods with overloaded parameters.
- */
-
-//@AllowsPassByReference
-public interface OverloadASourceTarget {
- String opName = "operationA:";
-
- /**
- * Method with no parameters
- */
- String operationA();
-
- /**
- * Method with one integer parameter
- */
- String operationA(int parm1);
-
- /**
- * Method with one integer parameter and one string parameter
- */
- String operationA(int parm1, String parm2);
-
- /**
- * Method with one one string parameter and one integer parameter
- */
- String operationA(String parm1, int parm2);
-
- /**
- * Method with one string parameter
- */
- String operationA(String string);
-
- /**
- * Method which throws an illegal argument exception in case of any exceptions.
- */
- String[] operationAall();
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java b/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java
deleted file mode 100644
index a30d3611fb..0000000000
--- a/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.opoverload.impl;
-
-import java.util.ArrayList;
-
-import org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class Implements the interface OverloadASourceTarget, and gives implementation for all methods which are
- * declared in the OverloadASourceTarget interface.
- */
-@Service(OverloadASourceTarget.class)
-public class OverloadASource implements OverloadASourceTarget {
- public OverloadASourceTarget overloadASourceTarget;
-
- /**
- * This is a default constructor
- */
- public OverloadASource() {
-
- }
-
- /**
- * @return
- * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA()
- */
- public String[] operationAall() {
- assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
- ArrayList<String> ret = new ArrayList<String>();
- ret.add(overloadASourceTarget.operationA());
- ret.add(overloadASourceTarget.operationA(11));
- ret.add(overloadASourceTarget.operationA("eleven"));
- ret.add(overloadASourceTarget.operationA(3, "three"));
- ret.add(overloadASourceTarget.operationA("four", 4));
- return (String[])ret.toArray(new String[ret.size()]);
- }
-
- /**
- * @return
- * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA()
- */
- public String operationA() {
- assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
- return overloadASourceTarget.operationA();
- }
-
- /**
- * @param parm1
- * @return
- * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(int)
- */
- public String operationA(int parm1) {
- assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
- return overloadASourceTarget.operationA(parm1);
- }
-
- /**
- * @param parm1
- * @param parm2
- * @return
- * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(int, java.lang.String)
- */
- public String operationA(int parm1, String parm2) {
- assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
- return overloadASourceTarget.operationA(parm1, parm2);
- }
-
- public String operationA(String string) {
- assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
- return overloadASourceTarget.operationA(string);
- }
-
- /**
- * @param parm1
- * @param parm2
- * @return
- * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(java.lang.String, int)
- */
- public String operationA(String parm1, int parm2) {
- assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
- return overloadASourceTarget.operationA(parm1, parm2);
- }
-
- /**
- * This method which is used by all the overloaded functions to set the source target
- */
- @Reference
- public void setOverloadASourceTarget(OverloadASourceTarget overloadASourceTarget) {
- assert overloadASourceTarget != null : "reference overloadASourceTarget is set tonull";
- this.overloadASourceTarget = overloadASourceTarget;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java b/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java
deleted file mode 100644
index 9ec60eb78f..0000000000
--- a/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.test.opoverload.impl;
-
-import org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class Implements the interface OverloadASourceTarget, and gives implementation for all methods which are
- * declared in the OverloadASourceTarget interface.
- */
-@Service(OverloadASourceTarget.class)
-public class OverloadATarget implements OverloadASourceTarget {
-
- /**
- * This is a default Constructor
- */
- public OverloadATarget() {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(int)
- */
- public String operationA(int parm1) {
- final String ret = opName + parm1;
- out(ret);
- return ret;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(int, java.lang.String)
- */
- public String operationA(int parm1, String parm2) {
- final String ret = opName + parm1 + parm2;
- out(ret);
- return ret;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA()
- */
- public String operationA() {
- out(opName);
- return opName;
-
- }
-
- public String operationA(String parm1, int parm2) {
- final String ret = opName + parm1 + parm2;
- out(ret);
- return ret;
- }
-
- public String operationA(String parm1) {
- final String ret = opName + parm1;
- out(ret);
- return ret;
- }
-
- /**
- * This method is used to print the message returned by all the overloaded functions
- */
- private void out(String msg) {
-
- java.lang.System.out.println(msg);
- }
-
- public String[] operationAall() {
- throw new IllegalArgumentException("not supported");
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/resources/OperationOverload.composite b/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/resources/OperationOverload.composite
deleted file mode 100644
index cbf5aa2078..0000000000
--- a/tags/java/sca/2.0-M1/itest/operation-overloading/src/main/resources/OperationOverload.composite
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://foo"
- xmlns:foo="http://foo"
- name="OperationOverload">
-
- <component name="OverloadASourceComponent">
- <implementation.java class="org.apache.tuscany.sca.test.opoverload.impl.OverloadASource" />
- <reference name="overloadASourceTarget" target="OverloadATargetComponent"/>
- </component>
-
- <component name="OverloadATargetComponent">
- <implementation.java class="org.apache.tuscany.sca.test.opoverload.impl.OverloadATarget" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java b/tags/java/sca/2.0-M1/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java
deleted file mode 100644
index 62e5c14ce2..0000000000
--- a/tags/java/sca/2.0-M1/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.opoverload.impl;
-
-import static org.junit.Assert.assertEquals;
-
-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.apache.tuscany.sca.test.opoverload.OverloadASourceTarget;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-public class OverloadATestCase {
-
- private static Node node;
- private static OverloadASourceTarget overloadA;
-
- /**
- * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This
- * test verifies the values compared are same as the values retrieved from the SCA runtime.
- */
- @Test
- public void testOperationAall() {
- String[] result = overloadA.operationAall();
- assertEquals(5, result.length);
- assertEquals(OverloadASourceTarget.opName, result[0]);
- assertEquals(OverloadASourceTarget.opName + 11, result[1]);
- assertEquals(OverloadASourceTarget.opName + "eleven", result[2]);
- assertEquals(OverloadASourceTarget.opName + 3 + "three", result[3]);
- assertEquals(OverloadASourceTarget.opName + "four" + 4, result[4]);
- }
-
- @Test
- public void testOperationAInt() {
- String result = overloadA.operationA(29);
- assertEquals(OverloadASourceTarget.opName + 29, result);
- }
-
- @Test
- public void testOperationAString() {
- String result = overloadA.operationA("rick:-)");
- assertEquals(OverloadASourceTarget.opName + "rick:-)", result);
- }
-
- @Test
- public void testOperationAIntString() {
- String result = overloadA.operationA(123, "Tuscany");
- assertEquals(OverloadASourceTarget.opName + 123 + "Tuscany", result);
- }
-
- @Test
- public void testOperationStringInt() {
- String result = overloadA.operationA("StringInt", 77);
- assertEquals(OverloadASourceTarget.opName + "StringInt" + 77, result);
- }
-
- /**
- * setUp() is a method in JUnit Frame Work which is executed before all others methods in the class extending
- * unit.framework.TestCase. So this method is used to create a test Embedded SCA node, to start the SCA node and
- * to get a reference to the contribution service
- */
-
- @BeforeClass
- public static void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("OperationOverload.composite");
- node = NodeFactory.newInstance().createNode("OperationOverload.composite", new Contribution("c1", location));
- node.start();
- overloadA = node.getService(OverloadASourceTarget.class, "OverloadASourceComponent");
- }
-
- /**
- * tearDown() is a method in JUnit Frame Work which is executed after all other methods in the class extending
- * unit.framework.TestCase. So this method is used to close the SCA node.
- */
-
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/pom.xml b/tags/java/sca/2.0-M1/itest/pom.xml
deleted file mode 100644
index b2363cee14..0000000000
--- a/tags/java/sca/2.0-M1/itest/pom.xml
+++ /dev/null
@@ -1,732 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-itest</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
- <properties>
- <was.ant.script>${basedir}/build-was-integration.xml</was.ant.script>
- <was.python.script>${basedir}/wasAdmin.py</was.python.script>
- </properties>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>callback-api</module>
- <module>callback-basic</module>
- <module>callback-complex-type</module>
- <module>callback-id</module>
- <module>callback-multiple-wires</module>
- <module>callback-separatethread</module>
- <module>callback-set-callback</module>
- <module>callback-set-conversation</module>
- <module>component-type</module>
- <module>conversations</module>
- <!--module>definitions-multiple</module-->
- <module>exceptions</module>
- <module>interfaces</module>
-<!--
- <module>operation-overloading</module>
--->
- <!-- wait until databinding-sdo is in
- <module>properties</module>
- -->
- <module>recursive-multi-level</module>
- <module>references</module>
- <module>distribution</module>
- <module>scopes</module>
- <module>services</module>
- <module>wires</module>
- </modules>
- </profile>
-
- <profile>
- <id>old</id>
- <modules>
- <module>bpel</module>
- <module>builder</module>
- <module>callablereferences</module>
- <module>callablereferences-ws</module>
- <module>callback-api</module>
- <module>callback-basic</module>
- <module>callback-complex-type</module>
- <module>callback-id</module>
- <module>callback-multiple-wires</module>
- <module>callback-separatethread</module>
- <module>callback-set-callback</module>
- <module>callback-set-conversation</module>
- <module>component-type</module>
- <module>contribution</module>
- <!--
- <module>contribution-classloader</module>
- -->
- <module>contribution-import-export</module>
- <module>conversations</module>
- <module>conversations-ws</module>
- <module>corba</module>
- <module>databindings</module>
- <module>exceptions</module>
- <module>exceptions-cross-binding</module>
- <module>exceptions-cross-binding-ws</module>
- <module>exceptions-simple-ws</module>
- <module>extended-api</module>
- <module>interfaces</module>
- <!--
- <module>interop-soap-client</module>
- <module>interop-soap-round2-client</module>
- <module>interop-soap-service</module>
- -->
- <module>jms</module>
- <module>jms-args</module>
- <module>jms-callbacks</module>
- <module>jms-definitions</module>
- <module>jms-format</module>
- <module>jms-selectors</module>
- <module>large-sdo-ws</module>
- <module>late-reference-resolution</module>
- <module>oneway</module>
- <module>operation-overloading</module>
- <!--
- <module>osgi-implementation</module>
- <module>osgi-contribution</module>
- -->
- <module>policy</module>
- <module>policy-security</module>
- <module>policy-security-basicauth</module>
- <module>policy-security-jsr250</module>
- <module>policy-security-token</module>
- <!--
- <module>promotion-interface-missmatch</module>
- -->
- <module>properties</module>
- <module>recursive</module>
- <module>recursive-multi-level</module>
- <module>recursive-ws</module>
- <module>references</module>
- <module>scopes</module>
- <module>serialization</module>
- <module>services</module>
- <module>spring</module>
- <module>transaction</module>
- <module>validation</module>
- <module>wires</module>
- <module>wsdl</module>
- <module>wsdl2java</module>
- <module>wsdlless</module>
- <module>wsdl-multiple</module>
- <module>ws-void-args-return</module>
- </modules>
- </profile>
-
- <!--
- This profile handles generation of jar/war artifacts to be used in executing tests in a web-container
- -->
- <profile>
- <id>webapp</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- <!--
- <file>
- <exists>src</exists>
- </file>
- -->
- </activation>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-webapp</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-webapp-junit</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <modules>
- <module>callback-api</module>
- <module>callback-basic</module>
- <module>callback-id</module>
- <module>callback-multiple-wires</module>
- <module>callback-set-callback</module>
- <module>callback-set-conversation</module>
- <module>conversations</module>
- <module>exceptions</module>
- <module>exceptions-cross-binding</module>
- <module>extended-api</module>
- <module>oneway</module>
- <module>operation-overloading</module>
- <module>references</module>
- <module>services</module>
- <module>component-type</module>
- <module>interfaces</module>
- <module>wires</module>
- <module>scopes</module>
- <module>large-sdo-ws</module>
- </modules>
-
-
- <build>
- <pluginManagement>
- <plugins>
- <!-- Skip local junit test cases -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.3.1</version>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
-
- <plugins>
-
- <!-- Create jar containing the jUnit tests -->
- <!--
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
- <executions>
- <execution>
- <configuration>
- <finalName>junit</finalName>
- </configuration>
- <phase>test</phase>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- -->
-
- <!-- Generate web-xml -->
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-web-junit</artifactId>
- <version>2.0-M1</version>
- <executions>
- <execution>
- <id>generate-web-xml</id>
- <phase>process-resources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- Create war and include jUnit test classes -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <primaryArtifact>false</primaryArtifact>
- <!-- Exclude a few jars to avoid conflicts -->
- <warSourceExcludes>WEB-INF/lib/tuscany-host-jetty-*.jar,WEB-INF/lib/tuscany-host-jetty-*.jar,servlet-api-*.jar, WEB-INF/lib/catalina*.jar,WEB-INF/classes/META-INF/sca-contribution*.xml</warSourceExcludes>
- <webResources>
- <!-- Add the tests jar into the WAR -->
- <!--
- <resource>
- <directory>${project.build.directory}</directory>
- <includes>
- <include>*-tests.jar</include>
- </includes>
- <targetPath>WEB-INF/lib</targetPath>
- </resource>
- -->
-
- <resource>
- <directory>${project.build.directory}/test-classes</directory>
- <targetPath>WEB-INF/classes</targetPath>
- </resource>
-
- <resource>
- <directory>${project.build.directory}/classes/META-INF</directory>
- <includes>
- <include>sca-contribution*.xml</include>
- </includes>
- <targetPath>META-INF</targetPath>
- </resource>
-
- <!-- Add the junit -->
- <resource>
- <directory>${settings.localRepository}/junit/junit/4.2</directory>
- <includes>
- <include>junit-4.2.jar</include>
- </includes>
- <targetPath>WEB-INF/lib</targetPath>
- </resource>
-
- </webResources>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>war</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>tomcat</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- <!--
- <file>
- <exists>src</exists>
- </file>
- -->
- </activation>
- <properties>
- <http.port>8085</http.port>
- <http.base>http://127.0.0.1:${http.port}</http.base>
- <tomcat.home>${env.CATALINA_HOME}</tomcat.home>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-web-junit</artifactId>
- <version>2.0-M1</version>
- <executions>
- <execution>
- <id>generate-web-xml</id>
- <phase>process-resources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <execution>
- <id>web-junit-test</id>
- <configuration>
- <url>${http.base}/${project.build.finalName}/junit?op=runAll</url>
- </configuration>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <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>
- <container>
- <containerId>tomcat5x</containerId>
- <type>installed</type>
- <home>${tomcat.home}</home>
- <systemProperties>
- <org.apache.commons.logging.Log>
- org.apache.commons.logging.impl.SimpleLog
- </org.apache.commons.logging.Log>
- </systemProperties>
- </container>
- <wait>false</wait>
- <configuration>
- <properties>
- <cargo.servlet.port>${http.port}</cargo.servlet.port>
- </properties>
- <deployables>
- <deployable>
- <location>${project.build.directory}/${project.build.finalName}.war</location>
- <pingURL>${http.base}/${project.build.finalName}/junit?op=list</pingURL>
- <type>war</type>
- </deployable>
- </deployables>
- <home>${project.build.directory}/cargo-tomcat</home>
- </configuration>
- </configuration>
-
- </plugin>
- </plugins>
- </build>
- </profile>
-
-
- <profile>
- <id>jetty</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- <!--
- <file>
- <exists>src</exists>
- </file>
- -->
- </activation>
- <properties>
- <http.port>8085</http.port>
- <http.base>http://127.0.0.1:${http.port}</http.base>
- <jetty.home>${env.JETTY_HOME}</jetty.home>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-web-junit</artifactId>
- <version>2.0-M1</version>
- <executions>
- <execution>
- <id>generate-web-xml</id>
- <phase>process-resources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <execution>
- <id>web-junit-test</id>
- <configuration>
- <url>${http.base}/${project.build.finalName}/junit?op=runAll</url>
- </configuration>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <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>
- <container>
- <containerId>jetty6x</containerId>
- <type>embedded</type>
- <home>${jetty.home}</home>
- <systemProperties>
- <org.apache.commons.logging.Log>
- org.apache.commons.logging.impl.SimpleLog
- </org.apache.commons.logging.Log>
- </systemProperties>
- </container>
- <wait>false</wait>
- <configuration>
- <properties>
- <cargo.servlet.port>${http.port}</cargo.servlet.port>
- </properties>
- <deployables>
- <deployable>
- <location>${project.build.directory}/${project.build.finalName}.war</location>
- <pingURL>${http.base}/${project.build.finalName}/junit?op=list</pingURL>
- <type>war</type>
- </deployable>
- </deployables>
- <home>${project.build.directory}/cargo-jetty</home>
- </configuration>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>geronimo</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- <!--
- <file>
- <exists>${geronimo.home}</exists>
- </file>
- -->
- </activation>
- <properties>
- <http.port>8080</http.port>
- <http.base>http://127.0.0.1:${http.port}</http.base>
- <geronimo.home>${env.GERONIMO_HOME}</geronimo.home>
- </properties>
-
- <build>
- <plugins>
- <!-- Generate web-xml and geronimo deployment descriptor -->
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-web-junit</artifactId>
- <version>2.0-M1</version>
- <executions>
- <execution>
- <id>generate-web-xml</id>
- <configuration>
- <geronimo>true</geronimo>
- </configuration>
- <phase>process-resources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <execution>
- <id>web-junit-test</id>
- <configuration>
- <url>${http.base}/${project.build.finalName}/junit?op=runAll</url>
- </configuration>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.geronimo.plugins</groupId>
- <artifactId>geronimo-maven-plugin</artifactId>
- <version>2.1.1</version>
- <configuration>
- <geronimoHome>${geronimo.home}</geronimoHome>
- </configuration>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start</goal>
- </goals>
- <configuration>
- <background>true</background>
- </configuration>
- </execution>
- <execution>
- <id>deploy-war</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>deploy</goal>
- </goals>
- <configuration>
- <moduleArchive>${project.build.directory}/${project.build.finalName}.war</moduleArchive>
- </configuration>
- </execution>
- <execution>
- <id>undeploy-war</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>undeploy</goal>
- </goals>
- <configuration>
- <moduleId>${groupId}/${artifactId}/${version}/war</moduleId>
- </configuration>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- <configuration>
- <username>system</username>
- <password>manager</password>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>websphere</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <properties>
- <http.port>8080</http.port>
- <http.base>http://127.0.0.1:${http.port}</http.base>
- <websphere.home>${env.WAS_HOME}</websphere.home>
- </properties>
-
- <build>
- <plugins>
- <!-- Generate web-xml and geronimo deployment descriptor -->
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-web-junit</artifactId>
- <version>2.0-M1</version>
- <executions>
- <execution>
- <id>generate-web-xml</id>
- <phase>process-resources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <execution>
- <id>web-junit-test</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <url>${http.base}/${project.build.finalName}/junit?op=runAll</url>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!--WAS ant integration -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <!-- start Websphere server -->
- <execution>
- <id>start-container</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <ant antfile="${was.ant.script}" target="startServer"/>
- </tasks>
- </configuration>
- </execution>
- <!-- Deploy war application -->
- <execution>
- <id>deploy-war</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <ant antfile="${was.ant.script}" target="installApplication">
- <property name="was.python.script" value="${was.python.script}"/>
- <property name="application.war" value="${project.build.directory}/${project.build.finalName}.war"/>
- <property name="application.name" value="${project.build.finalName}.war"/>
- <property name="application.contextRoot" value="${project.build.finalName}"/>
- <property name="application.server" value="server1"/>
- </ant>
- </tasks>
- </configuration>
- </execution>
- <!-- unDeploy war application -->
- <execution>
- <id>undeploy-war</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <ant antfile="${was.ant.script}" target="uninstallApplication">
- <property name="was.python.script" value="${was.python.script}"/>
- <property name="application.name" value="${project.build.finalName}.war"/>
- </ant>
- </tasks>
- </configuration>
- </execution>
- <!-- Stop Websphere server -->
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <ant antfile="${was.ant.script}" target="stopServer"/>
- </tasks>
- </configuration>
- </execution>
-
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
-
- </profiles>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/properties/pom.xml b/tags/java/sca/2.0-M1/itest/properties/pom.xml
deleted file mode 100644
index 91607ddf02..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/pom.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-properties</artifactId>
- <name>Apache Tuscany SCA Properties Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</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-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>2.0-M1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java
deleted file mode 100644
index b0fd64c9da..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package mysca.test.myservice.impl;
-
-public interface MyService {
- /**
- * This is a method to get the location property value from the sca runtime environment. It is implemented in the
- * class MyServiceImpl
- */
- String getLocation();
-
- /**
- * This is a method to get the year property value from the sca runtime environment. It is implemented in the class
- * MyServiceImpl
- */
- String getYear();
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java
deleted file mode 100644
index 7b44ef02e4..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package mysca.test.myservice.impl;
-
-import java.util.logging.Logger;
-
-import org.oasisopen.sca.annotation.ComponentName;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class Implements the interface MyService and gives implementation for all methods which are declared in that
- * interface. scope is specified as Composite using
- *
- * @scope annotation.
- */
-
-@Service(MyService.class)
-public class MyServiceImpl implements MyService {
-
- @Property(name = "location")
- protected String location = "RTP";
-
- @Property(name = "year")
- protected String year = "2006";
-
- @ComponentName
- protected String componentName;
-
- private Logger logger;
-
- /**
- * @ to print the message in the log
- */
- public MyServiceImpl() {
- logger = Logger.getAnonymousLogger();
- logger.info("creating service instance...");
- }
-
- /**
- * @Init annotation to Start the service. Which is executed all the time
- */
- @Init
- public void start() {
- logger.info("Start service..");
- }
-
- /**
- * @Destroy annotation to stop the service. Which is executed in the end
- */
- @Destroy
- public void stop() {
- logger.info("Stop service..");
-
- }
-
- public String getComponentName() {
- return componentName;
- }
-
- public String getLocation() {
- return location;
- }
-
- public String getYear() {
- return year;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java
deleted file mode 100644
index e8c4341cf2..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package mysca.test.myservice.impl;
-
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class Implements the interface MyService and gives implementation for all methods which are declared in that
- * interface. scope is specified as Composite using
- *
- * @scope annotation.
- */
-
-@Service(MyService.class)
-public class MyTotalServiceImpl implements MyService {
-
- // default required==true so it is 1:1
- @Reference
- public MyService myService;
-
- public String getLocation() {
- return myService.getLocation();
- }
-
- public String getYear() {
- return myService.getYear();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java
deleted file mode 100644
index 68ce5a3cb6..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest;
-
-/**
- * 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 ABCDComponentImpl Class
- */
-public interface ABCDComponent {
-
- /**
- * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
- * ABCDComponentImpl
- */
- String getA();
-
- /**
- * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
- * ABCDComponentImpl
- */
- String getB();
-
- /**
- * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
- * ABCDComponentImpl
- */
- String getC();
-
- /**
- * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
- * ABCDComponentImpl
- */
- String getD();
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java
deleted file mode 100644
index c8d0d4cae4..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * This class Implements the interface ABCDComponent and gives implementation for all methods which are declared in that
- * interface. scope is specified as Composite using
- *
- * @scope annotation.
- */
-@Scope("COMPOSITE")
-public class ABCDComponentImpl implements ABCDComponent {
- private ABComponent abComponent;
- private CDComponent cdComponent;
-
- /**
- * It is a method which injects the property value to the variable 'abComponent' from the SCA runtime environment
- * using
- *
- * @Property Annotations.
- */
- @Reference
- public void setAb(ABComponent component) {
- this.abComponent = component;
- }
-
- /**
- * It is a method which injects the property value to the variable 'cdComponent' from the SCA runtime environment
- * using
- *
- * @Property Annotations.
- */
- @Reference
- public void setCd(CDComponent component) {
- this.cdComponent = component;
- }
-
- public String getA() {
- return this.abComponent.getA();
- }
-
- public String getB() {
- return this.abComponent.getB();
- }
-
- public String getC() {
- return this.cdComponent.getC();
- }
-
- public String getD() {
- return this.cdComponent.getD();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java
deleted file mode 100644
index b727935bc1..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import java.util.Collection;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * 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 ABComponentImpl Class
- */
-@Remotable
-public interface ABComponent {
-
- /**
- * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
- * ABComponentImpl
- */
-
- String getA();
-
- /**
- * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
- * ABComponentImpl
- */
- String getB();
-
- /**
- * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
- * ABComponentImpl
- */
- String getZ();
-
- /**
- * This is a method to get an integer property value from the SCA runtime environment. It is implemented in the
- * class ABComponentImpl
- */
- int getIntValue();
-
- /**
- * This is a method to get a string property value from the SCA runtime environment. It is implemented in the class
- * ABComponentImpl
- */
- String getF();
-
- /**
- * This is a method to get collection of property values from the SCA runtime environment. It is implemented in the
- * class ABComponentImpl
- */
- Collection<String> getManyStringValues();
-
- /**
- * This is a method to get collection of property value from the SCA runtime environment. It is implemented in the
- * class ABComponentImpl
- */
- Collection<Integer> getManyIntegers();
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java
deleted file mode 100644
index e402131ce2..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import java.util.Collection;
-
-import org.oasisopen.sca.annotation.Property;
-
-/**
- * This class Implements the interface ABComponent and gives implementation for all methods which are declared in that
- * interface.
- */
-
-public class ABComponentImpl implements ABComponent {
-
- private String aProperty;
- private String bProperty;
- private int intValue;
- private Collection<String> manyStringValues;
- private Collection<Integer> manyIntegerValues;
- private String zProperty;
- private String fProperty;
-
- /**
- * It is a method which injects the property value to the variable 'zProperty' from the SCA runtime environment
- * using Annotations.
- */
- @Property(name = "xpath")
- public void setZProperty(final String value) {
- this.zProperty = value;
- }
-
- /**
- * It is a method which injects collection of property values to the variable 'manyStringValues' from the SCA
- * runtime environment using Annotations.
- */
- @Property(name = "foobar")
- public void setManyStringValues(final Collection<String> value) {
- this.manyStringValues = value;
- }
-
- /**
- * It is a method which injects collection of integer property values to the variable 'manyIntegerValues' from the
- * SCA runtime environment using Annotations.
- */
- @Property(name = "fooInts")
- public void setManyIntegers(final Collection<Integer> value) {
- this.manyIntegerValues = value;
- }
-
- /**
- * It is a method which injects the property value to the variable 'aProperty' from the SCA runtime environment
- * using Annotations.
- */
- @Property
- public void setA(final String A) {
- this.aProperty = A;
- }
-
- /**
- * It is a method which injects the property value to the variable 'bProperty' from the SCA runtime environment
- * using Annotations.
- */
- @Property
- public void setB(final String B) {
- this.bProperty = B;
- }
-
- /**
- * It is a method which injects the property value to the variable 'fProperty' from the SCA runtime environment
- * using Annotations.
- */
- @Property
- public void setF(final String F) {
- this.fProperty = F;
- }
-
- /**
- * It is a method which injects integer property value to the variable 'intValue' from the SCA runtime environment
- * using Annotations.
- */
- @Property
- public void setOne(final int value) {
- this.intValue = value;
- }
-
- public String getA() {
- return this.aProperty;
- }
-
- public String getB() {
- return this.bProperty;
- }
-
- public int getIntValue() {
- return this.intValue;
- }
-
- public String getZ() {
- return this.zProperty;
- }
-
- public String getF() {
- return this.fProperty;
- }
-
- public Collection<String> getManyStringValues() {
- return manyStringValues;
- }
-
- public Collection<Integer> getManyIntegers() {
- return manyIntegerValues;
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java
deleted file mode 100644
index 52f9871d1b..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import java.util.Collection;
-
-/**
- * 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 CDComponentImpl Class
- */
-public interface CDComponent {
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * CDComponentImpl Class
- */
- String getC();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * CDComponentImpl Class
- */
- String getC2();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * CDComponentImpl Class
- */
- String getD();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * CDComponentImpl Class
- */
- String getNoSource();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * CDComponentImpl Class
- */
- String getFileProperty();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * CDComponentImpl Class
- */
- Collection<String> getManyValuesFileProperty();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * CDComponentImpl Class
- */
- int getOverrideValue();
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java
deleted file mode 100644
index fceda9d9ae..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import java.util.Collection;
-
-import org.oasisopen.sca.annotation.Property;
-
-/**
- * This class Implements the interface CDComponent and gives implementation for all methods which are declared in that
- * interface.
- */
-public class CDComponentImpl implements CDComponent {
-
- private String cProperty;
- private String dProperty;
- private String nosource;
- private String fileProperty;
- private Collection<String> manyValuesFileProperty;
- private int overrideNumber;
- private String cProperty2;
-
- /**
- * It is a method which injects the property value to the variable 'cProperty2' from the SCA runtime environment
- * using
- *
- * @Property Annotations.
- */
- @Property(name = "nonFileProperty")
- public void setC2(final String value) {
- this.cProperty2 = value;
- }
-
- /**
- * It is a method which injects the property value to the variable 'overrideNumber' from the SCA runtime environment
- * using
- *
- * @Property Annotations.
- */
- @Property(name = "two")
- public void setOverrideNumber(final int value) {
- this.overrideNumber = value;
- }
-
- /**
- * It is a method which injects the property value to the variable 'fileProperty' from the SCA runtime environment
- * using
- *
- * @Property Annotations.
- */
- @Property(name = "fileProperty")
- public void setFileProp(final String value) {
- this.fileProperty = value;
- }
-
- /**
- * It is a method which injects the property value to the variable 'manyValuesFileProperty' from the SCA runtime
- * environment using
- *
- * @Property Annotations.
- */
- @Property(name = "manyValuesFileProperty")
- public void setFileManyValueProp(final Collection<String> values) {
- this.manyValuesFileProperty = values;
- }
-
- /**
- * It is a method which injects the property value to the variable 'cProperty' from the SCA runtime environment
- * using
- *
- * @Property Annotations.
- */
- @Property
- public void setC(final String C) {
- this.cProperty = C;
- }
-
- /**
- * It is a method which injects the property value to the variable 'dProperty' from the SCA runtime environment
- * using
- *
- * @Property Annotations.
- */
- @Property
- public void setD(final String D) {
- this.dProperty = D;
- }
-
- /**
- * It is a method which injects the property value to the variable 'nosource' from the SCA runtime environment using
- *
- * @Property Annotations.
- */
- @Property
- public void setNosource(final String value) {
- this.nosource = value;
- }
-
- public String getFileProperty() {
- return this.fileProperty;
- }
-
- public String getC() {
- return this.cProperty;
- }
-
- public String getC2() {
- return this.cProperty2;
- }
-
- public String getD() {
- return this.dProperty;
- }
-
- public String getNoSource() {
- return this.nosource;
- }
-
- public int getOverrideValue() {
- return this.overrideNumber;
- }
-
- public Collection<String> getManyValuesFileProperty() {
- return this.manyValuesFileProperty;
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
deleted file mode 100644
index 87f87d6c22..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java
deleted file mode 100644
index acd1f26670..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-/**
- * This is an Interface for the services
- */
-public interface OverrideService {
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java
deleted file mode 100644
index 71dce41efc..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-/**
- * An implementation for the interface OverrideService.
- */
-
-public class OverrideServiceImpl implements OverrideService {
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
deleted file mode 100644
index 5217ede572..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
deleted file mode 100644
index 5f8f28e46a..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.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/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java
deleted file mode 100644
index a57ccd90c8..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-/**
- * This is an Interface for the services.
- */
-public interface PropertyService {
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java
deleted file mode 100644
index c147a2affe..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.cdi;
-
-public interface Bar {
- public String getBar();
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java
deleted file mode 100644
index 7c700903d6..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.cdi;
-
-import org.oasisopen.sca.annotation.Constructor;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(Bar.class)
-public class Foo1 implements Bar {
-
- @Property
- protected String bar;
-
- @Constructor( {"bar"})
- public Foo1(String b) {
- this.bar = b;
- }
-
- public String getBar() {
- return this.bar;
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java
deleted file mode 100644
index 1d2e563095..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.cdi;
-
-import org.oasisopen.sca.annotation.Constructor;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(Bar.class)
-public class Foo2 implements Bar {
-
- protected String bar;
-
- @Constructor
- public Foo2(@Property(name = "bar") String b) {
- this.bar = b;
- }
-
- public String getBar() {
- return this.bar;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java
deleted file mode 100644
index 54082e297a..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.cdi;
-
-import org.oasisopen.sca.annotation.Constructor;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(Bar.class)
-public class Foo3 implements Bar {
-
- protected String bar;
-
- @Constructor
- public Foo3() {
- this.bar = "bar";
- }
-
- public String getBar() {
- return this.bar;
- }
-
- @Property(name = "bar")
- public void setBar(String b) {
- this.bar = b;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java
deleted file mode 100644
index 15fb49ea4e..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.06.07 at 03:30:47 PM EDT
-//
-package test.jaxb.props;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the test.jaxb.props package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private final static QName _MyRCProps_QNAME = new QName("http://test.sca.jaxb/rcprops", "MyRCProps");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: test.jaxb.props
- *
- */
- public ObjectFactory() {
- }
-
- /**
- * Create an instance of {@link ReturnCodeProperties }
- *
- */
- public ReturnCodeProperties createReturnCodeProperties() {
- return new ReturnCodeProperties();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link ReturnCodeProperties }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://test.sca.jaxb/rcprops", name = "MyRCProps")
- public JAXBElement<ReturnCodeProperties> createMyRCProps(ReturnCodeProperties value) {
- return new JAXBElement<ReturnCodeProperties>(_MyRCProps_QNAME, ReturnCodeProperties.class, null, value);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java
deleted file mode 100644
index 0a1d4a34a3..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.06.07 at 03:30:47 PM EDT
-//
-package test.jaxb.props;
-
-import java.math.BigInteger;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * <p>Java class for ReturnCodeProperties complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="ReturnCodeProperties">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="AInt" type="{http://www.w3.org/2001/XMLSchema}int"/>
- * &lt;element name="BInteger" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "ReturnCodeProperties", namespace = "http://test.sca.jaxb/rcprops", propOrder = {"a", "b"})
-public class ReturnCodeProperties {
-
- @XmlElement(name = "AInt")
- protected int a;
- @XmlElement(name = "BInteger", required = true)
- protected BigInteger b;
-
- /**
- * Gets the value of the a property.
- *
- */
- public int getA() {
- return a;
- }
-
- /**
- * Sets the value of the a property.
- *
- */
- public void setA(int value) {
- this.a = value;
- }
-
- /**
- * Gets the value of the b property.
- *
- * @return
- * possible object is
- * {@link BigInteger }
- *
- */
- public BigInteger getB() {
- return b;
- }
-
- /**
- * Sets the value of the b property.
- *
- * @param value
- * allowed object is
- * {@link BigInteger }
- *
- */
- public void setB(BigInteger value) {
- this.b = value;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/package-info.java b/tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/package-info.java
deleted file mode 100644
index 6a6fdd00cc..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/java/test/jaxb/props/package-info.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.06.07 at 03:30:47 PM EDT
-//
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://test.sca.jaxb/rcprops", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package test.jaxb.props;
-
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/ConstructorPropertyInjection.composite b/tags/java/sca/2.0-M1/itest/properties/src/main/resources/ConstructorPropertyInjection.composite
deleted file mode 100644
index 70a251fa16..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/ConstructorPropertyInjection.composite
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- name="ConstructorPropertyInjection">
-
- <component name="Foo1Component">
- <implementation.java
- class="org.apache.tuscany.sca.itest.cdi.Foo1" />
- <property name="bar">fubar</property>
- </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">fubar</property>
- </component>
-
-</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/Outer.composite b/tags/java/sca/2.0-M1/itest/properties/src/main/resources/Outer.composite
deleted file mode 100644
index b3e529e8b5..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/Outer.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:foo="http://foo" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xsi:schemaLocation="http://www.osoa.org/xmlns/sca/1.0 http://www.osoa.org/xmlns/sca/1.0" 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/tags/java/sca/2.0-M1/itest/properties/src/main/resources/OuterPropertyTest.composite b/tags/java/sca/2.0-M1/itest/properties/src/main/resources/OuterPropertyTest.composite
deleted file mode 100644
index 5237e964a3..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/OuterPropertyTest.composite
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:foo="http://foo"
- targetNamespace="http://foo"
- name="OuterPropertyTest"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <component name="OuterComponent">
- <implementation.composite name="foo:PropertyTest"/>
- <property name="number">125</property>
- <property name="complex" type="foo:MyComplexType">
- <foo:MyComplexValue xsi:type="foo:MyComplexType" >
- <foo:a>Overriden A</foo:a>
- <foo:b>Overriden B</foo:b>
- <foo:c>Overriden C</foo:c>
- <foo:d>Overriden D</foo:d>
- <foo:x>
- <foo:y>Overriden Y</foo:y>
- <foo:z>Overriden Z</foo:z>
- </foo:x>
- </foo:MyComplexValue>
- </property>
- </component>
-</composite>
-
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/PropertyTest.composite b/tags/java/sca/2.0-M1/itest/properties/src/main/resources/PropertyTest.composite
deleted file mode 100644
index 75deddbdad..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/PropertyTest.composite
+++ /dev/null
@@ -1,255 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:foo="http://foo"
- xmlns:cust="http://www.example.com/Customer"
- xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:rcp="http://test.sca.jaxb/rcprops"
- targetNamespace="http://foo"
- name="PropertyTest"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <service name="ProperterTestService" promote="ABComponent">
- <interface.java interface="org.apache.tuscany.sca.itest.ABComponent"/>
- </service>
-
- <dbsdo:import.sdo location="customer.xsd" />
- <!-- dbsdo:import.sdo factory="com.example.customer.sdo.SdoFactory" / -->
-
- <property name="number" type="xsd:int">1</property>
- <property name="complex" type="foo:MyComplexType" >
- <foo:MyComplexValue xsi:type="foo:MyComplexType" >
- <foo:a>a</foo:a>
- <foo:b>b</foo:b>
- <foo:c>c</foo:c>
- <foo:d>d</foo:d>
- <foo:x>
- <foo:y>y</foo:y>
- <foo:z>z</foo:z>
- </foo:x>
- </foo:MyComplexValue>
- </property>
-
- <property name="moreComplex" type="foo:MyMoreComplexType">
- <MyMoreComplexValue xmlns="">
- <numberSetArray>
- <integerNumber>1</integerNumber>
- <floatNumber>11</floatNumber>
- <doubleNumber>111</doubleNumber>
- </numberSetArray>
- <numberSetArray>
- <integerNumber>2</integerNumber>
- <floatNumber>22</floatNumber>
- <doubleNumber>222</doubleNumber>
- </numberSetArray>
- <stringArray>TestString_1</stringArray>
- <stringArray>TestString_2</stringArray>
- <intArray>10</intArray>
- <intArray>20</intArray>
- <integerNumber>27</integerNumber>
- <floatNumber>79.34</floatNumber>
- <doubleNumber>184.52</doubleNumber>
- <doubleArray>50.05</doubleArray>
- <doubleArray>25.52</doubleArray>
- <numberSet>
- <integerNumber>54</integerNumber>
- <floatNumber>158.68</floatNumber>
- <doubleNumber>369.04</doubleNumber>
- </numberSet>
- </MyMoreComplexValue>
- </property>
-
- <property name="complexFoo" type="foo:MyMoreComplexType">
- <MyMoreComplexValue xmlns="">
- <stringArray>TestString_3</stringArray>
- <stringArray>TestString_4</stringArray>
- <intArray>100</intArray>
- <intArray>200</intArray>
- </MyMoreComplexValue>
- </property>
-
- <component name="ABCDComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.ABCDComponentImpl"/>
- <reference name="ab" target="ABComponent"/>
- <reference name="cd" target="CDComponent"/>
- </component>
-
- <component name="ABComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.ABComponentImpl"/>
- <property name="a" source="$complex/foo:MyComplexValue/foo:a"/>
- <property name="b" source="$complex/foo:MyComplexValue/foo:b"/>
- <property name="f" source="$complex/foo:MyComplexValue/foo:a">f</property>
- <property name="xpath" source="$complex/foo:MyComplexValue/foo:x/*[local-name()='z']"/>
- <property name="one" source="$number"/>
- <property name="foobar" many="true">"Apache" "Tuscany" "Java SCA"</property>
- <property name="fooInts" many="true">123 456 789</property>
- </component>
-
-
- <component name="CDComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.CDComponentImpl"/>
- <property name="c" source="$complex/foo:MyComplexValue/foo:c"/>
- <property name="d" source="$complex/foo:MyComplexValue/foo:d"/>
- <property name="nosource">aValue</property>
- <property name="fileProperty" file="fileProperty.txt"/>
- <property name="manyValuesFileProperty" many="true" file="manyValuesFileProperty.txt"/>
- <property name="nonFileProperty" file="fileProperty.txt" source="$complex/foo:MyComplexValue/foo:c"/>
- <property name="two" source="$number">25</property>
- </component>
-
- <component name="PropertyComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.PropertyComponentImpl"/>
- <property name="complexPropertyOne" source="$moreComplex"></property>
- <property name="complexPropertyTwo">
- <MyAnotherComplexValue xmlns="">
- <stringArray>TestString_1</stringArray>
- <stringArray>TestString_2</stringArray>
- <intArray>10</intArray>
- <integerNumber>27</integerNumber>
- <floatNumber>79.34</floatNumber>
- <doubleArray>25.52</doubleArray>
- <doubleNumber>184.52</doubleNumber>
- <doubleArray>50.05</doubleArray>
- <intArray>20</intArray>
- <numberSetArray>
- <integerNumber>1</integerNumber>
- <floatNumber>11</floatNumber>
- <doubleNumber>111</doubleNumber>
- </numberSetArray>
- <numberSetArray>
- <integerNumber>2</integerNumber>
- <floatNumber>22</floatNumber>
- <doubleNumber>222</doubleNumber>
- </numberSetArray>
- <numberSet>
- <integerNumber>54</integerNumber>
- <floatNumber>158.68</floatNumber>
- <doubleNumber>369.04</doubleNumber>
- </numberSet>
- </MyAnotherComplexValue>
- </property>
- <property name="complexPropertyThree" element="foo:PropertyThreeElement">
- <PropertyThreeElement xmlns="">
- <stringArray>TestElementString_1</stringArray>
- <stringArray>TestElementString_2</stringArray>
- <intArray>10</intArray>
- <integerNumber>27</integerNumber>
- <floatNumber>79.34</floatNumber>
- <doubleArray>25.52</doubleArray>
- <doubleNumber>184.52</doubleNumber>
- <doubleArray>50.05</doubleArray>
- <intArray>20</intArray>
- <numberSetArray>
- <integerNumber>1</integerNumber>
- <floatNumber>11</floatNumber>
- <doubleNumber>111</doubleNumber>
- </numberSetArray>
- <numberSetArray>
- <integerNumber>2</integerNumber>
- <floatNumber>22</floatNumber>
- <doubleNumber>222</doubleNumber>
- </numberSetArray>
- <numberSet>
- <integerNumber>54</integerNumber>
- <floatNumber>158.68</floatNumber>
- <doubleNumber>369.04</doubleNumber>
- </numberSet>
- </PropertyThreeElement>
- </property>
- <property name="complexPropertyFour" element="foo:PropertyFourElement" many="true">
- <PropertyFourElement xmlns="">
- <integerNumber>1</integerNumber>
- <floatNumber>11.11</floatNumber>
- <doubleNumber>111.111</doubleNumber>
- <numberSet>
- <integerNumber>11</integerNumber>
- <floatNumber>1111.1111</floatNumber>
- <doubleNumber>11111.11111</doubleNumber>
- </numberSet>
- </PropertyFourElement>
- <PropertyFourElement xmlns="">
- <integerNumber>2</integerNumber>
- <floatNumber>22.22</floatNumber>
- <doubleNumber>222.222</doubleNumber>
- <numberSet>
- <integerNumber>22</integerNumber>
- <floatNumber>2222.2222</floatNumber>
- <doubleNumber>22222.22222</doubleNumber>
- </numberSet>
- </PropertyFourElement>
- <PropertyFourElement xmlns="">
- <integerNumber>3</integerNumber>
- <floatNumber>33.33</floatNumber>
- <doubleNumber>333.333</doubleNumber>
- <numberSet>
- <integerNumber>33</integerNumber>
- <floatNumber>3333.3333</floatNumber>
- <doubleNumber>33333.33333</doubleNumber>
- </numberSet>
- </PropertyFourElement>
- </property>
- <property name="complexPropertyFive" source="$complexFoo"/>
- <property name="sdoProperty" type="cust:Customer">
- <cust:customer>
- <cust:firstName>Firstly Name</cust:firstName>
- <cust:middleName>Middler Name</cust:middleName>
- <cust:lastName>Lasting Name</cust:lastName>
- </cust:customer>
- </property>
- <property name="customerSdo" type="cust:Customer">
- <cust:customer>
- <cust:firstName>Sdo Firstly Name</cust:firstName>
- <cust:middleName>Sdo Middler Name</cust:middleName>
- <cust:lastName>Sdo Lasting Name</cust:lastName>
- </cust:customer>
- </property>
- <property name="location" type="xsd:string">RTP</property>
- <property name="year" type="xsd:string">2006</property>
- <property name="daysOfTheWeek" many="true" type="xsd:string">"Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday"</property>
- <property name="integerNumbers" many="true" type="xsd:int">1 2 3 4 5 6 7 8 9 10</property>
- <property name="intNumbers" many="true" type="xsd:int">10 9 8 7 6 5 4 3 2 1 0</property>
- <property name="sdoArray" many="true" type="cust:Customer">
- <cust:customer>
- <cust:firstName>Firstly Name 1</cust:firstName>
- <cust:middleName>Middler Name 1</cust:middleName>
- <cust:lastName>Lasting Name 1</cust:lastName>
- </cust:customer>
- <cust:customer>
- <cust:firstName>Firstly Name 2</cust:firstName>
- <cust:middleName>Middler Name 2</cust:middleName>
- <cust:lastName>Lasting Name 2</cust:lastName>
- </cust:customer>
- <cust:customer>
- <cust:firstName>Firstly Name 3</cust:firstName>
- <cust:middleName>Middler Name 3</cust:middleName>
- <cust:lastName>Lasting Name 3</cust:lastName>
- </cust:customer>
- </property>
- <property name="complexJAXBPropertyOne" type="rcp:ReturnCodeProperties">
- <MyRCProps xmlns="http://test.sca.jaxb/rcprops">
- <AInt>10</AInt>
- <BInteger>10</BInteger>
- </MyRCProps>
- </property>
- <property name="complexJAXBPropertyTwo" type="rcp:ReturnCodeProperties" file="rcProps.txt"/>
- </component>
-</composite>
-
-
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/customer.xsd b/tags/java/sca/2.0-M1/itest/properties/src/main/resources/customer.xsd
deleted file mode 100644
index 8861d7e7b8..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/customer.xsd
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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/tags/java/sca/2.0-M1/itest/properties/src/main/resources/fileProperty.txt b/tags/java/sca/2.0-M1/itest/properties/src/main/resources/fileProperty.txt
deleted file mode 100644
index 0d3d9ead83..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/fileProperty.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<filePropertyTest>fileValue</filePropertyTest>
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/manyValuesFileProperty.txt b/tags/java/sca/2.0-M1/itest/properties/src/main/resources/manyValuesFileProperty.txt
deleted file mode 100644
index 450f397b30..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/manyValuesFileProperty.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<manyFilePropertyValues>
- "fileValueOne" "fileValueTwo" "fileValueThree" "fileValueFour"
-</manyFilePropertyValues>
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/mySimpleService.composite b/tags/java/sca/2.0-M1/itest/properties/src/main/resources/mySimpleService.composite
deleted file mode 100644
index 75fdd24add..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/mySimpleService.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osoa.org/xmlns/sca/1.0 http://www.osoa.org/xmlns/sca/1.0 ">
-
-
- <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/tags/java/sca/2.0-M1/itest/properties/src/main/resources/rcProps.txt b/tags/java/sca/2.0-M1/itest/properties/src/main/resources/rcProps.txt
deleted file mode 100644
index 052c291fd0..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/rcProps.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed 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.
--->
-<MyRCProps xmlns="http://test.sca.jaxb/rcprops">
- <AInt>20</AInt>
- <BInteger>20</BInteger>
-</MyRCProps>
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/rcprops.xsd b/tags/java/sca/2.0-M1/itest/properties/src/main/resources/rcprops.xsd
deleted file mode 100644
index 21289fa7b2..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/main/resources/rcprops.xsd
+++ /dev/null
@@ -1,55 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 elementFormDefault="qualified" targetNamespace="http://test.sca.jaxb/rcprops"
- xmlns:tns="http://test.sca.jaxb/rcprops" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
- xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
-
- <!-- Use some JAXB customizations -->
-
- <annotation>
- <appinfo>
- <jaxb:schemaBindings>
- <jaxb:package name="test.jaxb.props" />
- </jaxb:schemaBindings>
- </appinfo>
- </annotation>
-
- <element name="MyRCProps" type="tns:ReturnCodeProperties" />
-
- <complexType name="ReturnCodeProperties">
- <sequence>
- <element name="AInt" type="xsd:int">
- <annotation>
- <appinfo>
- <jaxb:property name="a" />
- </appinfo>
- </annotation>
- </element>
- <element name="BInteger" type="xsd:integer">
- <annotation>
- <appinfo>
- <jaxb:property name="b" />
- </appinfo>
- </annotation>
- </element>
- </sequence>
- </complexType>
-</schema>
-
-
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java b/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java
deleted file mode 100644
index efc635c72b..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest;
-
-import static org.junit.Assert.assertEquals;
-import mysca.test.myservice.impl.MyService;
-
-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;
-
-public class MyTotalServiceTestCase {
- private static MyService service1;
- private static MyService service2;
- private static MyService service3;
-
- private static Node node;
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the local
- * property variables defined in the implementation file with the expected values 'RTP' and '2006'
- */
- @Test
- public void testPropertyDefault() {
- assertEquals("RTP", service1.getLocation());
- assertEquals("2006", service1.getYear());
- }
-
- /**
- * 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 service2 from the SCA runtime environment with the expected values 'Raleigh'
- * and '2008'. This overrides the local property values
- */
- @Test
- public void testPropertyOverride() {
- assertEquals("Raleigh", service2.getLocation());
- assertEquals("2008", service2.getYear());
- }
-
- /**
- * 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 service3 from the SCA runtime environment with the expected values 'Durham'
- * and '2009'
- */
- @Test
- public void testPropertyNestedOverride() {
- assertEquals("Durham", service3.getLocation());
- assertEquals("2009", service3.getYear());
- }
-
- /**
- * 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 setUp() throws Exception {
-
- String location = ContributionLocationHelper.getContributionLocation("Outer.composite");
- node = NodeFactory.newInstance().createNode("Outer.composite", new Contribution("c1", location));
- node.start();
- service1 = node.getService(MyService.class, "MyServiceComponent/MyService");
- service2 = node.getService(MyService.class, "MyServiceComponentNew/MyService");
- service3 = node.getService(MyService.class, "MySimpleServiceInRecursiveAnother");
- }
-
- /**
- * 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 tearDown() {
- node.stop();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java b/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
deleted file mode 100644
index da1ec5186f..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java b/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
deleted file mode 100644
index caf5a5e052..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 static org.junit.Assert.assertNotNull;
-
-import java.math.BigInteger;
-import java.util.Arrays;
-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.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import test.jaxb.props.ReturnCodeProperties;
-
-import commonj.sdo.DataObject;
-
-/**
- * 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
- * 'PropertyTest.composite'. It basically tests all types of property values returned from SCA runtime environment.
- */
-public class PropertyTestCase {
- private static Node node;
- private static ABComponent abService;
- private static CDComponent cdService;
- private static ABCDComponent abcdService;
- private static PropertyComponent propertyService;
-
- /**
- * 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 'a'
- */
- @Test
- public void testA() {
- assertEquals("a", abService.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 'b'
- */
- @Test
- public void testB() {
- assertEquals("b", abService.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 'c'
- */
- @Test
- public void testC() {
- assertEquals("c", cdService.getC());
- }
-
- /**
- * 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 'c'
- */
- @Test
- public void testC2() {
- assertEquals("c", cdService.getC2());
- }
-
- /**
- * 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 'd'
- */
- @Test
- public void testD() {
- assertEquals("d", cdService.getD());
- }
-
- /**
- * 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 'a'
- */
- @Test
- public void testF() {
- assertEquals("a", abService.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 'z'
- */
- @Test
- public void testZ() {
- assertEquals("z", abService.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 1.
- */
- @Test
- public void testIntValue() {
- assertEquals(1, abService.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 1.
- */
- @Test
- public void testDefaultValue() {
- assertEquals(1, abService.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 1.
- */
- @Test
- public void testDefaultValueOverride() {
- assertEquals(1, cdService.getOverrideValue());
- }
-
- /**
- * 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 'aValue'
- */
- @Test
- public void testNoSource() {
- assertEquals("aValue", cdService.getNoSource());
- }
-
- /**
- * 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
- * 'fileValue'
- */
- @Test
- public void testFileProperty() {
- assertEquals("fileValue", cdService.getFileProperty());
- }
-
- /**
- * 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 4 and
- * 'fileValueTwo' respectively.
- */
- @Test
- public void testManyValuesFileProperty() {
- Iterator<String> iterator = cdService.getManyValuesFileProperty().iterator();
- iterator.next();
- String secondValue = iterator.next();
- assertEquals(4, cdService.getManyValuesFileProperty().size());
- assertEquals("fileValueTwo", secondValue);
- }
-
- /**
- * 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 'a' ,
- * 'b', 'c' and 'd' respectively.
- */
- @Test
- public void testABCD() {
- assertEquals("a", abcdService.getA());
- assertEquals("b", abcdService.getB());
- assertEquals("c", abcdService.getC());
- assertEquals("d", abcdService.getD());
- }
-
- /**
- * 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 'RTP'
- * and '2006' respectively
- */
- @Test
- public void testDefaultProperty() {
- assertEquals("RTP", propertyService.getLocation());
- assertEquals("2006", propertyService.getYear());
-
- }
-
- /**
- * 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 = abService.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 respectively.
- */
- @Test
- public void testManySimpleIntegerValues() {
- Iterator<Integer> iterator = abService.getManyIntegers().iterator();
- assertEquals(123, iterator.next().intValue());
- assertEquals(456, iterator.next().intValue());
- assertEquals(789, iterator.next().intValue());
- }
-
- /**
- * 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
- * 'TestString_1' and 2 respectively.
- */
- @Test
- public void testComplexPropertyOne() {
- ComplexPropertyBean propBean = propertyService.getComplexPropertyOne();
- assertNotNull(propBean);
- assertEquals("TestString_1", propBean.getStringArray()[0]);
- assertEquals(2, propBean.numberSetArray[1].integerNumber);
- }
-
- /**
- * 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 integer number
- * and a float number
- */
- @Test
- public void testComplexPropertyTwo() {
- ComplexPropertyBean propBean = propertyService.getComplexPropertyTwo();
- assertNotNull(propBean);
- assertEquals(10, propBean.intArray[0]);
- assertEquals((float)22, propBean.numberSetArray[1].floatNumber);
- }
-
- /**
- * 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 value first
- * element in the string array and the float number
- */
- @Test
- public void testComplexPropertyThree() {
- ComplexPropertyBean propBean = propertyService.getComplexPropertyThree();
- assertNotNull(propBean);
- assertEquals("TestElementString_1", propBean.stringArray[0]);
- assertEquals((float)22, propBean.numberSetArray[1].floatNumber);
- }
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the
- * complex property value obtained using a service from the SCA runtime environment with the expected values
- * 1, 222.222 and 33 respectively.
- */
- @Test
- public void testComplexPropertyFour() {
- Object[] propBeanCollection = propertyService.getComplexPropertyFour().toArray();
- assertNotNull(propBeanCollection);
- assertEquals(1, ((ComplexPropertyBean)propBeanCollection[0]).getIntegerNumber());
- assertEquals(222.222, ((ComplexPropertyBean)propBeanCollection[1]).getDoubleNumber());
- assertEquals(33, ((ComplexPropertyBean)propBeanCollection[2]).getNumberSet().getIntegerNumber());
- }
-
- /**
- * 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
- * 'TestString_3', 'TestString_4', 100 and 200.
- */
- @Test
- public void testComplexPropertyFive() {
- ComplexPropertyBean propBean = propertyService.getComplexPropertyFive();
- assertNotNull(propBean);
- assertEquals("TestString_3", propBean.getStringArray()[0]);
- assertEquals("TestString_4", propBean.getStringArray()[1]);
- assertEquals(100, propBean.getIntArray()[0]);
- assertEquals(200, propBean.getIntArray()[1]);
- }
-
- /**
- * 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 string values
- * 'Firstly Name' , 'Middler Name' and 'Lasting Name' respectively
- */
- @Test
- public void testSDOProperty1() {
- DataObject dataObject = propertyService.getSdoProperty();
- assertNotNull(dataObject);
- assertEquals("Firstly Name", dataObject.get("firstName"));
- assertEquals("Middler Name", dataObject.getString("middleName"));
- assertEquals("Lasting Name", dataObject.getString("lastName"));
- }
-
- /**
- * 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 string values
- * 'Sdo Firstly Name', 'Sdo Middler Name' and 'Sdo Lasting Name' respectively
- */
- @Test
- public void testSDOProperty2() {
- DataObject dataObject = propertyService.getCustomerSdo();
- assertNotNull(dataObject);
- assertEquals("Sdo Firstly Name", dataObject.get("firstName"));
- assertEquals("Sdo Middler Name", dataObject.getString("middleName"));
- assertEquals("Sdo Lasting Name", dataObject.getString("lastName"));
- }
-
- @Test
- public void testGetLocationFromComponentContext() {
- String location = propertyService.getLocation();
- assertNotNull(location);
- String locationFromCC = propertyService.getLocationFromComponentContext();
- assertNotNull(locationFromCC);
- assertEquals(location, locationFromCC);
- }
-
- @Test
- public void testGetInjectedStringArrayProperty() {
- String[] daysOfWeek = propertyService.getDaysOfTheWeek();
- assertNotNull(daysOfWeek);
-
- String[] expected = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
- Assert.assertTrue(Arrays.equals(expected, daysOfWeek));
- }
-
- @Test
- public void testGetInjectedIntegerArrayProperty() {
- Integer[] numbers = propertyService.getIntegerNumbers();
- assertNotNull(numbers);
-
- Integer[] expected = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
- Assert.assertTrue(Arrays.equals(expected, numbers));
- }
-
- @Test
- public void testGetInjectedIntArrayProperty() {
- int[] numbers = propertyService.getIntNumbers();
- assertNotNull(numbers);
-
- int[] expected = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
- Assert.assertTrue(Arrays.equals(expected, numbers));
- }
-
- @Test
- public void testGetInjectedSdoArrayProperty() {
- DataObject[] sdos = propertyService.getSdoArrayProperty();
- assertNotNull(sdos);
-
- for (int i = 1; i <= 3; i++) {
- DataObject dataObject = sdos[i - 1];
- assertEquals("Firstly Name " + i, dataObject.get("firstName"));
- assertEquals("Middler Name " + i, dataObject.getString("middleName"));
- assertEquals("Lasting Name " + i, dataObject.getString("lastName"));
- }
- }
-
- @Test
- public void testComplexJAXBProperty() {
- ReturnCodeProperties rc = propertyService.getComplexJAXBPropertyOne();
- assertEquals(10, rc.getA());
- assertEquals(new BigInteger("10"), rc.getB());
- }
-
- @Test
- public void testComplexJAXBPropertyFromFile() {
- ReturnCodeProperties rc = propertyService.getComplexJAXBPropertyTwo();
- System.out.println("SKSK: a =" + rc.getA());
- System.out.println("SKSK: b =" + rc.getB());
- assertEquals(20, rc.getA());
- assertEquals(new BigInteger("20"), rc.getB());
- }
-
- /**
- * 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 4 services namely 'abService'
- * service, 'cdService' service, 'abcdService' service and 'propertyService' service
- */
- @BeforeClass
- public static void init() throws Exception {
- try {
- String location = ContributionLocationHelper.getContributionLocation("PropertyTest.composite");
- node = NodeFactory.newInstance().createNode("PropertyTest.composite", new Contribution("c1", location));
- node.start();
- } catch (Exception e) {
- e.printStackTrace();
- }
- abService = node.getService(ABComponent.class, "ABComponent");
- cdService = node.getService(CDComponent.class, "CDComponent");
- abcdService = node.getService(ABCDComponent.class, "ABCDComponent");
- propertyService = node.getService(PropertyComponent.class, "PropertyComponent");
- }
-
- /**
- * 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();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java b/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java
deleted file mode 100644
index a0213ced46..0000000000
--- a/tags/java/sca/2.0-M1/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.cdi;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class ConstructorPropertyInjectionTestCase {
- private static org.apache.tuscany.sca.node.Node node;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- String location = ContributionLocationHelper.getContributionLocation("ConstructorPropertyInjection.composite");
- node = NodeFactory.newInstance().createNode("ConstructorPropertyInjection.composite", new Contribution("c1", location));
- node.start();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * 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();
- }
-
- @Test
- public void testFoo1() throws Exception {
- Bar foo = node.getService(Bar.class, "Foo1Component");
- assertEquals("fubar", foo.getBar());
- }
-
- @Test
- public void testFoo2() throws Exception {
- Bar foo = node.getService(Bar.class, "Foo2Component");
- assertEquals("fubar", foo.getBar());
- }
-
- @Test
- public void testFoo3() throws Exception {
- Bar foo = node.getService(Bar.class, "Foo3Component");
- assertEquals("fubar", foo.getBar());
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/recursive-multi-level/pom.xml b/tags/java/sca/2.0-M1/itest/recursive-multi-level/pom.xml
deleted file mode 100644
index 1962371779..0000000000
--- a/tags/java/sca/2.0-M1/itest/recursive-multi-level/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <!--relativePath>../pom.xml</relativePath-->
- </parent>
- <artifactId>itest-recursive-multi-level</artifactId>
- <name>Apache Tuscany SCA Recusive Multi-Level Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <!-- XPathFactory -->
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java b/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java
deleted file mode 100644
index 986c8305dd..0000000000
--- a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package mysca.test.myservice;
-
-public interface MyService {
- String getLocation();
-
- String getYear();
-}
diff --git a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java b/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java
deleted file mode 100644
index 6cad998042..0000000000
--- a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package mysca.test.myservice;
-
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(MyService.class)
-public class MyServiceImpl implements MyService {
-
- @Property(name = "location")
- protected String location = "ABC";
-
- @Property(name = "year")
- protected String year = "2006";
-
- public String getLocation() {
- return location;
- }
-
- public String getYear() {
- return year;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java b/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java
deleted file mode 100644
index 261eff2584..0000000000
--- a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package mysca.test.myservice;
-
-public interface MySimpleTotalService {
- String getLocation();
-
- String getYear();
-}
diff --git a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java b/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java
deleted file mode 100644
index f3c9280f96..0000000000
--- a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package mysca.test.myservice;
-
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(MySimpleTotalService.class)
-public class MySimpleTotalServiceImpl implements MySimpleTotalService {
- // default required==true so it is 1:1
- @Reference
- public MyService myService;
-
- public String getLocation() {
- return myService.getLocation();
- }
-
- public String getYear() {
- return myService.getYear();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite b/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite
deleted file mode 100644
index 975f61c664..0000000000
--- a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:foo="http://foo"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xsi:schemaLocation="http://www.osoa.org/xmlns/sca/1.0 http://www.osoa.org/xmlns/sca/1.0"
- name="TotalComposite1Auto"
- targetNamespace="http://foo"
- local="true"
- autowire="false">
-
- <property name="newLocation" type="xsd:anyURI">Level 1</property>
- <property name="newYear" type="xsd:anyURI">2001</property>
-
- <component name="ServiceComponentLevel1Auto">
- <implementation.java class="mysca.test.myservice.MyServiceImpl"/>
- <property name="location" source="$newLocation"/>
- <property name="year" source="$newYear"/>
- </component>
-
- <service name="MyServiceLevel1Auto" promote="TotalServiceComponentLevel1Auto/MySimpleTotalService">
- <interface.java interface="mysca.test.myservice.MySimpleTotalService"/>
- </service>
-
- <component name="TotalServiceComponentLevel1Auto">
- <implementation.java class="mysca.test.myservice.MySimpleTotalServiceImpl"/>
- <reference name="myService" autowire="true"/>
- </component>
-
- <reference name="myServiceReference1Auto" promote="TotalServiceComponentLevel1Auto/myService">
- <interface.java interface="mysca.test.myservice.MyService"/>
- </reference>
-</composite>
-
diff --git a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite b/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite
deleted file mode 100644
index f9bbcc76d8..0000000000
--- a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:foo="http://foo"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xsi:schemaLocation="http://www.osoa.org/xmlns/sca/1.0 http://www.osoa.org/xmlns/sca/1.0"
- name="TotalComposite2Auto"
- targetNamespace="http://foo"
- local="true"
- autowire="false">
-
- <property name="newLocation" type="xsd:anyURI">Level 2</property>
- <property name="newYear" type="xsd:anyURI">2002</property>
-
- <component name="ServiceComponentLevel2Auto">
- <implementation.java class="mysca.test.myservice.MyServiceImpl"/>
- <property name="location">Default 2</property>
- <property name="year">1992</property>
- </component>
-
- <service name="MyServiceLevel2Auto" promote="TotalServiceInRecursive2Auto/MyServiceLevel1Auto"/>
-
- <component name="TotalServiceInRecursive2Auto">
- <implementation.composite name="foo:TotalComposite1Auto"/>
- <reference name="myServiceReference1Auto" autowire="true"/>
- <property name="newLocation" source="$newLocation"/>
- <property name="newYear" source="$newYear"/>
- </component>
-
- <reference name="myServiceReference2Auto" promote="TotalServiceInRecursive2Auto/myServiceReference1Auto"/>
-</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite b/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite
deleted file mode 100644
index 09fd10fb7e..0000000000
--- a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:foo="http://foo"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xsi:schemaLocation="http://www.osoa.org/xmlns/sca/1.0 http://www.osoa.org/xmlns/sca/1.0"
- name="TotalComposite3Auto"
- targetNamespace="http://foo"
- local="true"
- autowire="false">
-
- <property name="newLocation" type="xsd:anyURI">Level 3</property>
- <property name="newYear" type="xsd:anyURI">2003</property>
-
- <component name="ServiceComponentLevel3Auto">
- <implementation.java class="mysca.test.myservice.MyServiceImpl"/>
- <property name="location">Default 3</property>
- <property name="year">1993</property>
- </component>
-
- <service name="MyServiceLevel3Auto" promote="TotalServiceInRecursive3Auto/MyServiceLevel2Auto">
- </service>
-
- <component name="TotalServiceInRecursive3Auto" autowire="true">
- <implementation.composite name="foo:TotalComposite2Auto"/>
- <reference name="myServiceReference2Auto"/>
- <property name="newLocation" source="$newLocation"/>
- <property name="newYear" source="$newYear"/>
- </component>
-
- <reference name="myServiceReference3Auto" promote="TotalServiceInRecursive3Auto/myServiceReference2Auto">
- </reference>
-
-</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java b/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java
deleted file mode 100644
index da14cdef13..0000000000
--- a/tags/java/sca/2.0-M1/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test.sca.tests;
-
-import static org.junit.Assert.assertEquals;
-import mysca.test.myservice.MySimpleTotalService;
-
-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;
-
-/**
- * Tests to make sure that autowiring and recusive composite work together
- *
- */
-public class MultiLevelTestCase {
- private static Node node1;
- private static Node node2;
- private static Node node3;
- private static MySimpleTotalService myService1;
- private static MySimpleTotalService myService2;
- private static MySimpleTotalService myService3;
-
- @BeforeClass
- public static void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("TotalService1Auto.composite");
- Contribution contribution = new Contribution("c1", location);
- try {
- node1 = NodeFactory.newInstance().createNode("TotalService1Auto.composite", contribution);
- } catch (Exception e) {
- e.printStackTrace();
- }
- node2 = NodeFactory.newInstance().createNode("TotalService2Auto.composite", contribution);
- node3 = NodeFactory.newInstance().createNode("TotalService3Auto.composite", contribution);
-
- node1.start();
- node2.start();
- node3.start();
-
- myService1 = node1.getService(MySimpleTotalService.class, "TotalServiceComponentLevel1Auto");
- myService2 = node2.getService(MySimpleTotalService.class, "TotalServiceInRecursive2Auto/MyServiceLevel1Auto");
- myService3 = node3.getService(MySimpleTotalService.class, "TotalServiceInRecursive3Auto/MyServiceLevel2Auto");
- }
-
- @Test
- public void testLevel1() {
- assertEquals("Level 1", myService1.getLocation());
- assertEquals("2001", myService1.getYear());
- }
-
- @Test
- public void testLevel2() {
- assertEquals("Default 2", myService2.getLocation());
- assertEquals("1992", myService2.getYear());
- }
-
- @Test
- public void testLevel3() {
- assertEquals("Default 3", myService3.getLocation());
- assertEquals("1993", myService3.getYear());
- }
-
- @AfterClass
- public static void tearDown() {
- node1.stop();
- node2.stop();
- node3.stop();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/pom.xml b/tags/java/sca/2.0-M1/itest/references/pom.xml
deleted file mode 100644
index 581d56aab1..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/pom.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-references</artifactId>
- <name>Apache Tuscany SCA References Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java b/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java
deleted file mode 100644
index f8c0850118..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-public interface AComponent {
-
- String fooB();
-
- String fooC();
-
- String fooBC();
-
- String fooD1();
-
- String fooD2();
-
- String fooMultipleD();
-
- String fooMultipleDArray();
-
- String fooMultipleDServiceRef();
-
- DComponent getDReference();
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java b/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java
deleted file mode 100644
index 49c3deb84d..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.references;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-
-public class AComponentImpl implements AComponent {
-
- @Reference(name = "bReference")
- protected BComponent b;
-
- @Reference
- protected CComponent cReference;
-
- @Reference(required = false)
- protected DComponent dReference;
-
- @Reference(name = "dReferences")
- public Collection<DComponent> dReferences;
-
- @Reference(name = "dReferenceArray")
- public DComponent[] dReferenceArray;
-
- @Reference(name = "dServiceReferences")
- public List<ServiceReference<DComponent>> dServiceReferences;
-
- private DComponent dReference1;
-
- private DComponent dReference2;
-
- @Reference(name = "dReference1")
- public void setDReference(DComponent dReference) {
- this.dReference1 = dReference;
- }
-
- @Reference
- public void setDReference2(DComponent dReference2) {
- this.dReference2 = dReference2;
- }
-
- public String fooB() {
- return b.bFoo();
- }
-
- public String fooC() {
- return cReference.cFoo();
- }
-
- public String fooBC() {
- return b.fooC();
- }
-
- public String fooD() {
- return dReference1.dFoo();
- }
-
- public String fooD1() {
- return dReference1.dFoo();
- }
-
- public String fooD2() {
- return dReference2.dFoo();
- }
-
- public String fooMultipleDArray() {
- StringBuffer str = new StringBuffer();
- for (DComponent d : dReferenceArray) {
- str.append(d.getComponentName());
- str.append(',');
- }
- if (str.length() > 0) {
- str.deleteCharAt(str.length() - 1);
- }
- return str.toString();
- }
-
- public String fooMultipleD() {
- StringBuffer str = new StringBuffer();
- for (DComponent d : dReferences) {
- str.append(d.getComponentName());
- str.append(',');
- }
- if (str.length() > 0) {
- str.deleteCharAt(str.length() - 1);
- }
- return str.toString();
- }
-
- public String fooMultipleDServiceRef() {
- StringBuffer str = new StringBuffer();
- for (ServiceReference<DComponent> d : dServiceReferences) {
- str.append(d.getService().getComponentName());
- str.append(',');
- }
- if (str.length() > 0) {
- str.deleteCharAt(str.length() - 1);
- }
- return str.toString();
- }
-
- public DComponent getDReference() {
- return dReference;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java b/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java
deleted file mode 100644
index 785920bb2d..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-public interface BComponent {
-
- String bFoo();
-
- String fooC();
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java b/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java
deleted file mode 100644
index 211e6160f6..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-import org.oasisopen.sca.annotation.Reference;
-
-public class BComponentImpl implements BComponent {
-
- protected CComponent cReference;
-
- public BComponentImpl(@Reference(name = "cReference") CComponent cReference) {
- this.cReference = cReference;
- }
-
- public String bFoo() {
- return "BComponent";
- }
-
- public String fooC() {
- return "B" + cReference.cFoo();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java b/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java
deleted file mode 100644
index 47a1f9bde8..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-import org.oasisopen.sca.annotation.Reference;
-
-public class BComponentWrongTargetImpl implements BComponent {
-
- protected CComponent cReference;
-
- public BComponentWrongTargetImpl(@Reference(name = "cReference") CComponent cReference) {
- this.cReference = cReference;
- }
-
- public String bFoo() {
- return "BComponentWrongTarget";
- }
-
- public String fooC() {
- return "B" + cReference.cFoo();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java b/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java
deleted file mode 100644
index d436c28adc..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-public interface CComponent {
-
- String cFoo();
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java b/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java
deleted file mode 100644
index a1823e1cdc..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-public class CComponentImpl implements CComponent {
-
- public String cFoo() {
- return "CComponent";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java b/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java
deleted file mode 100644
index 80617bdec2..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-public interface DComponent {
-
- String dFoo();
-
- String getComponentName();
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java b/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java
deleted file mode 100644
index d181ac96ca..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-import org.oasisopen.sca.annotation.ComponentName;
-
-public class DComponentImpl implements DComponent {
- @ComponentName
- public String name;
-
- public String dFoo() {
- return "DComponent";
- }
-
- public String getComponentName() {
- return name;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/main/resources/AutoWiredReferencesTest.composite b/tags/java/sca/2.0-M1/itest/references/src/main/resources/AutoWiredReferencesTest.composite
deleted file mode 100644
index 894f6681c2..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/resources/AutoWiredReferencesTest.composite
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed 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://www.osoa.org/xmlns/sca/1.0" xmlns:foo="http://foo" targetNamespace="http://foo"
- name="AutowireReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autowire="true">
-
- <service name="AComponent" promote="AComponent">
- <interface.java interface="org.apache.tuscany.sca.itest.references.AComponent" />
- </service>
-
- <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/tags/java/sca/2.0-M1/itest/references/src/main/resources/InnerReferencesTest.composite b/tags/java/sca/2.0-M1/itest/references/src/main/resources/InnerReferencesTest.composite
deleted file mode 100644
index 6cadc52c13..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/resources/InnerReferencesTest.composite
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed 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://www.osoa.org/xmlns/sca/1.0" xmlns:foo="http://foo" targetNamespace="http://foo"
- name="InnerReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <service name="AComponent" promote="AComponent">
- <interface.java interface="org.apache.tuscany.sca.itest.references.AComponent" />
- </service>
-
- <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/tags/java/sca/2.0-M1/itest/references/src/main/resources/ManualWiredReferencesTest.composite b/tags/java/sca/2.0-M1/itest/references/src/main/resources/ManualWiredReferencesTest.composite
deleted file mode 100644
index 708960974b..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/main/resources/ManualWiredReferencesTest.composite
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed 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://www.osoa.org/xmlns/sca/1.0" xmlns:foo="http://foo" targetNamespace="http://foo"
- name="ManualWiredReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autowire="true">
-
- <service name="AComponent" promote="AComponent">
- <interface.java interface="org.apache.tuscany.sca.itest.references.AComponent" />
- </service>
-
- <component name="AComponent" >
- <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
- <reference name="bReference" target="BComponent" />
- <reference name="cReference" target="CComponent/CComponentImpl">
- <!-- reference name="cReference" target="CComponent"-->
- <binding.sca uri="DComponent"/>
- </reference>
- <reference name="dReference1" >
- <binding.sca uri="DComponent"/>
- </reference>
- <reference name="DReference2" target="DComponent" >
- <!-- binding.ws uri="DComponent"/-->
- </reference>
- <reference name="dReferences" target="DComponent DComponent1" />
- <reference name="dReferenceArray" target="DComponent DComponent1" />
- <reference name="dServiceReferences" target="DComponent DComponent1" />
-
- </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" />
- <service name="DComponentImpl">
- <binding.sca/>
- <!-- binding.ws/-->
- </service>
- </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/tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java b/tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java
deleted file mode 100644
index 1034bda02d..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-import static org.junit.Assert.assertEquals;
-
-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 AutoWiredReferenceTestCase {
- private static Node node;
- private static AComponent acomponent;
- private static AComponent acomponentAutowire;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- String location = ContributionLocationHelper.getContributionLocation("AutoWiredReferencesTest.composite");
- node =
- NodeFactory.newInstance().createNode("AutoWiredReferencesTest.composite",
- new Contribution("c1", location));
- node.start();
- acomponent = node.getService(AComponent.class, "AComponent");
- acomponentAutowire = node.getService(AComponent.class, "AComponentAutowire");
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- node.stop();
- }
-
- @Test
- public void testBReference() {
- assertEquals("BComponent", acomponent.fooB());
- }
-
- @Test
- public void testCReference() {
- assertEquals("CComponent", acomponent.fooC());
- }
-
- @Test
- public void testBCReference() {
- assertEquals("BCComponent", acomponent.fooBC());
- }
-
- @Test(expected = NullPointerException.class)
- public void testD1Reference() {
- acomponent.fooD1();
- }
-
- @Test
- public void testD2Reference() {
- assertEquals("DComponent", acomponent.fooD2());
- }
-
- @Test
- public void testMultiDReferenceArray() {
- String components = acomponent.fooMultipleDArray();
- Assert.assertTrue(components.contains("DComponent1"));
- }
-
- @Test
- public void testMultiDServiceReference() {
- String components = acomponent.fooMultipleDServiceRef();
- Assert.assertTrue(components.contains("DComponent"));
- Assert.assertTrue(components.contains("DComponent1"));
- }
-
- @Test
- public void testRequiredFalseReference() {
- try {
- acomponent.getDReference().dFoo();
- } catch (Exception e) {
- Assert.assertTrue(true);
- }
- }
-
- @Test
- public void testTargetPrecendence() {
- try {
- assertEquals("BComponent", acomponentAutowire.fooB());
- } catch (Exception e) {
- Assert.assertTrue(true);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java b/tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java
deleted file mode 100644
index db2e3f175d..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-import static org.junit.Assert.assertEquals;
-
-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 InnerReferenceTestCase {
- private static Node node;
- private static AComponent acomponent;
-
- @BeforeClass
- public static void init() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("InnerReferencesTest.composite");
- node = NodeFactory.newInstance().createNode("InnerReferencesTest.composite", new Contribution("c1", location));
- node.start();
- acomponent = node.getService(AComponent.class, "AComponent");
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- node.stop();
- }
-
- @Test
- public void testBReference() {
- assertEquals("BComponent", acomponent.fooB());
- }
-
- @Test
- public void testCReference() {
- assertEquals("CComponent", acomponent.fooC());
- }
-
- @Test
- public void testBCReference() {
- assertEquals("BCComponent", acomponent.fooBC());
- }
-
- @Test
- public void testD1Reference() {
- assertEquals("DComponent", acomponent.fooD1());
- }
-
- @Test
- public void testD2Reference() {
- assertEquals("DComponent", acomponent.fooD2());
- }
-
- @Test
- public void testMultiDReference() {
- String components = acomponent.fooMultipleD();
- Assert.assertTrue(components.contains("DComponent"));
- Assert.assertTrue(components.contains("DComponent1"));
- }
-
- @Test
- public void testMultiDReferenceArray() {
- String components = acomponent.fooMultipleDArray();
- Assert.assertTrue(components.equals("DComponent1"));
- }
-
- @Test
- public void testMultiDServiceReference() {
- String components = acomponent.fooMultipleDServiceRef();
- Assert.assertTrue(components.contains("DComponent"));
- Assert.assertTrue(components.contains("DComponent1"));
- }
-
- @Test(expected = NullPointerException.class)
- public void testRequiredFalseReference() {
- acomponent.getDReference().dFoo();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java b/tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java
deleted file mode 100644
index 6349e4f827..0000000000
--- a/tags/java/sca/2.0-M1/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.references;
-
-import static org.junit.Assert.assertEquals;
-
-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.Ignore;
-import org.junit.Test;
-
-public class ManualWiredReferenceTestCase {
- private static Node node;
- private static AComponent acomponent;
-
- @BeforeClass
- public static void init() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("ManualWiredReferencesTest.composite");
- node = NodeFactory.newInstance().createNode("ManualWiredReferencesTest.composite", new Contribution("c1", location));
- node.start();
- acomponent = node.getService(AComponent.class, "AComponent");
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- node.stop();
- }
-
- @Test
- public void testBReference() {
- assertEquals("BComponent", acomponent.fooB());
- }
-
- @Test
- public void testCReference() {
- assertEquals("CComponent", acomponent.fooC());
- }
-
- @Test
- public void testBCReference() {
- assertEquals("BCComponent", acomponent.fooBC());
- }
-
- @Test
- public void testD1Reference() {
- acomponent.fooD1();
- }
-
- @Ignore
- @Test
- public void testD2Reference() {
- assertEquals("DComponent", acomponent.fooD2());
- }
-
- @Test
- public void testMultiDReferenceArray() {
- String components = acomponent.fooMultipleDArray();
- Assert.assertTrue(components.contains("DComponent1"));
- }
-
- @Test
- public void testMultiDServiceReference() {
- String components = acomponent.fooMultipleDServiceRef();
- Assert.assertTrue(components.contains("DComponent"));
- Assert.assertTrue(components.contains("DComponent1"));
- }
-
- @Test
- public void testRequiredFalseReference() {
- try {
- acomponent.getDReference().dFoo();
- } catch (Exception e) {
- Assert.assertTrue(true);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/scopes/pom.xml b/tags/java/sca/2.0-M1/itest/scopes/pom.xml
deleted file mode 100644
index 19e8bd32ec..0000000000
--- a/tags/java/sca/2.0-M1/itest/scopes/pom.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <name>Apache Tuscany SCA Scopes Integration Tests</name>
- <artifactId>itest-scopes</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java b/tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java
deleted file mode 100644
index 208ac3ba44..0000000000
--- a/tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.scopes;
-
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * Test Composite scope
- */
-@Scope("COMPOSITE")
-public class CompositeScopeStateVerifierImpl implements StateVerifier {
-
- // State data for this module (composite).
- // In order to support thread-based state verification,
- // the module state needs to be a ThreadLocal.
- ThreadLocal<Integer> moduleState;
-
- public CompositeScopeStateVerifierImpl() {
- moduleState = new ThreadLocal<Integer>();
- }
-
- public void setState(int i) {
- moduleState.set(i);
- }
-
- public boolean checkState(int i) {
- return (moduleState.get() == i);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.java b/tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.java
deleted file mode 100644
index ff116070b5..0000000000
--- a/tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.scopes;
-
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * Test request scope
- */
-@Scope("REQUEST")
-public class RequestScopeStateVerifierImpl implements StateVerifier {
- // State data for this request thread.
- int requestState;
-
- public void setState(int i) {
- requestState = i;
- }
-
- public boolean checkState(int i) {
- return (requestState == i);
- }
-
- @Init
- public void init() {
- requestState = 0;
- }
-
- @Destroy
- public void destroy() {
- requestState = -1;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java b/tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java
deleted file mode 100644
index e6bf08ccf2..0000000000
--- a/tags/java/sca/2.0-M1/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.scopes;
-
-public interface StateVerifier {
- void setState(int i);
-
- boolean checkState(int i);
-}
diff --git a/tags/java/sca/2.0-M1/itest/scopes/src/main/resources/scopes.composite b/tags/java/sca/2.0-M1/itest/scopes/src/main/resources/scopes.composite
deleted file mode 100644
index 54a1b66830..0000000000
--- a/tags/java/sca/2.0-M1/itest/scopes/src/main/resources/scopes.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- 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/tags/java/sca/2.0-M1/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java b/tags/java/sca/2.0-M1/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java
deleted file mode 100644
index 959a6067ee..0000000000
--- a/tags/java/sca/2.0-M1/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test;
-
-import static org.junit.Assert.fail;
-
-import org.apache.tuscany.sca.itest.scopes.StateVerifier;
-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.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ScopeTestCase {
-
- /**
- * Number of threads to drive each scope container.
- */
- private static final int NUM_THREADS = 4;
-
- /**
- * Number of iterations per thread.
- */
- private static final int ITERATIONS = 200;
-
- private Node node;
-
- /**
- * Test scope containers.
- *
- * The request scope container isn't hooked up for some reason so the code below
- * that tests request scope is commented out.
- * Code could be added to test session scope once it is supported in a standalone environment.
- *
- * @throws InterruptedException Test failed
- */
- @Test
- public void testScopes() throws InterruptedException {
-
- Thread[] moduleScopeThreadTable = new Thread[NUM_THREADS];
- Thread[] requestScopeThreadTable = new Thread[NUM_THREADS];
-
- for (int i = 0; i < NUM_THREADS; i++) {
- moduleScopeThreadTable[i] = new ModuleScopeTestThread();
- requestScopeThreadTable[i] = new RequestScopeTestThread();
- }
- for (int j = 0; j < NUM_THREADS; j++) {
- moduleScopeThreadTable[j].start();
- requestScopeThreadTable[j].start();
- }
- for (int k = 0; k < NUM_THREADS; k++) {
- moduleScopeThreadTable[k].join();
- requestScopeThreadTable[k].join();
- }
- }
-
- private class ModuleScopeTestThread extends Thread {
-
- public void run() {
- StateVerifier moduleScopeService = node.getService(StateVerifier.class, "ModuleScopeComponent");
- for (int i = 1; i <= ITERATIONS; i++) {
- moduleScopeService.setState(i);
- if (!moduleScopeService.checkState(i)) {
- fail("The module scope service lost its state on iteration " + i);
- }
- }
- }
- }
-
- private class RequestScopeTestThread extends Thread {
-
- public void run() {
- StateVerifier requestScopeService = node.getService(StateVerifier.class, "RequestScopeComponent");
- for (int i = 1; i <= ITERATIONS; i++) {
- requestScopeService.setState(i);
- if (!requestScopeService.checkState(i)) {
- fail("The request scope service lost its state on iteration " + i);
- }
- }
- }
- }
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("scopes.composite");
- node = NodeFactory.newInstance().createNode("scopes.composite", new Contribution("c1", location));
- node.start();
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/services/pom.xml b/tags/java/sca/2.0-M1/itest/services/pom.xml
deleted file mode 100644
index b89dee99cb..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-services</artifactId>
- <name>Apache Tuscany SCA Services Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java b/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java
deleted file mode 100644
index 26e58dc530..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.services;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface AComponent {
- String foo();
-}
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java b/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java
deleted file mode 100644
index 627ff4976f..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.services;
-
-public class AComponentImpl implements AComponent {
-
- public String foo() {
- return "AComponent";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java b/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java
deleted file mode 100644
index d04bd1b985..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.services;
-
-public interface BComponent {
-
- String foo();
-}
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java b/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java
deleted file mode 100644
index 01df89a8fa..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.services;
-
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BComponent.class)
-public class BComponentImpl implements BComponent {
-
- public String foo() {
- return "BComponent";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java b/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java
deleted file mode 100644
index 07397e4502..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.services;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface CComponent {
- String foo();
-}
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java b/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java
deleted file mode 100644
index 8713e5ab22..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.services;
-
-public class CComponentImpl implements CComponent {
-
- public String foo() {
- return "CComponent";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java b/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java
deleted file mode 100644
index 842a85e000..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.services;
-
-public interface D1Component {
- String foo1();
-}
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java b/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java
deleted file mode 100644
index 8a3923b351..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.services;
-
-public interface DComponent {
- String foo();
-}
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java b/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java
deleted file mode 100644
index 59ffce8205..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.services;
-
-import org.oasisopen.sca.annotation.Service;
-
-@Service(interfaces = {DComponent.class, D1Component.class})
-public class DComponentImpl implements DComponent, D1Component {
-
- public String foo() {
- return "DComponent";
- }
-
- public String foo1() {
- return "DComponent";
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M1/itest/services/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 37ea8f677d..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://foo" xmlns:foo="http://foo">
- <deployable composite="foo:InnerServicesTest" />
-</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/itest/services/src/main/resources/ServicesTest.composite b/tags/java/sca/2.0-M1/itest/services/src/main/resources/ServicesTest.composite
deleted file mode 100644
index eda885f9ec..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/main/resources/ServicesTest.composite
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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: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/tags/java/sca/2.0-M1/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java b/tags/java/sca/2.0-M1/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java
deleted file mode 100644
index da779b2c54..0000000000
--- a/tags/java/sca/2.0-M1/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.services;
-
-import static org.junit.Assert.assertEquals;
-
-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;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-public class ServicesTestCase {
- private static Node node;
-
- @BeforeClass
- public static void init() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("ServicesTest.composite");
- node = NodeFactory.newInstance().createNode("ServicesTest.composite", new Contribution("c1", location));
- node.start();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- node.stop();
- }
-
- @Test
- public void testAService() {
- AComponent a1 = node.getService(AComponent.class, "AComponent1");
- assertEquals("AComponent", a1.foo());
-
- AComponent a2 = node.getService(AComponent.class, "AComponent2/AComponent");
- assertEquals("AComponent", a2.foo());
- }
-
- @Test
- public void testBService() {
- BComponent a1 = node.getService(BComponent.class, "BComponent1");
- assertEquals("BComponent", a1.foo());
-
- BComponent a2 = node.getService(BComponent.class, "BComponent2/BComponent");
- assertEquals("BComponent", a2.foo());
- }
-
- @Test
- public void testCService() {
- CComponent a1 = node.getService(CComponent.class, "CComponent1");
- assertEquals("CComponent", a1.foo());
-
- CComponent a2 = node.getService(CComponent.class, "CComponent2/CComponent");
- assertEquals("CComponent", a2.foo());
- }
-
- @Test
- public void testDService() {
- DComponent a1 = node.getService(DComponent.class, "DComponent1/DComponent");
- assertEquals("DComponent", a1.foo());
-
- D1Component a2 = node.getService(D1Component.class, "DComponent1/D1Component");
- assertEquals("DComponent", a2.foo1());
-
- try {
- node.getService(DComponent.class, "DComponent1");
- Assert.fail("The service name is required");
- } catch (ServiceRuntimeException e) {
- Assert.assertTrue("The service name is required", true);
- }
-
- DComponent a3 = node.getService(DComponent.class, "DComponent2/DComponent");
- assertEquals("DComponent", a3.foo());
-
- D1Component a4 = node.getService(D1Component.class, "DComponent2/D1Component");
- assertEquals("DComponent", a4.foo1());
-
- }
-
- public static void main(String[] args) throws Exception {
- ServicesTestCase.init();
- ServicesTestCase tester = new ServicesTestCase();
- tester.testAService();
- tester.testBService();
- tester.testCService();
- tester.testDService();
- ServicesTestCase.destroy();
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/wasAdmin.py b/tags/java/sca/2.0-M1/itest/wasAdmin.py
deleted file mode 100644
index 2be2b1eff7..0000000000
--- a/tags/java/sca/2.0-M1/itest/wasAdmin.py
+++ /dev/null
@@ -1,91 +0,0 @@
-"""
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-"""
-import sys
-
-def getCellName():
- """Return the name of the cell connected to"""
- return AdminControl.getCell()
-
-def getNodeName():
- """Return the name of the node connected to"""
- return AdminControl.getNode()
-
-def startApplicationOnServer(appName,serverName):
- """Start the named application on one server"""
- print "startApplicationOnServer: Entry. appname=%s servername=%s" % ( appName,serverName )
- cellName = getCellName()
- nodeName = getNodeName()
- # Get the application manager
- appManager = AdminControl.queryNames('cell=%s,node=%s,type=ApplicationManager,process=%s,*' %(cellName,nodeName,serverName))
- print "startApplicationOnServer: appManager=%s" % ( repr(appManager) )
- # start it
- rc = AdminControl.invoke(appManager, 'startApplication', appName)
- print "startApplicationOnServer: Exit. rc=%s" % ( repr(rc) )
-
-def stopApplicationOnServer(appName,serverName):
- """Stop the named application on one server"""
- print "stopApplicationOnServer: Entry. appname=%s servername=%s" % ( appName,serverName )
- cellName = getCellName()
- nodeName = getNodeName()
- # Get the application manager
- appManager = AdminControl.queryNames('cell=%s,node=%s,type=ApplicationManager,process=%s,*' %(cellName,nodeName,serverName))
- print "stopApplicationOnServer: appManager=%s" % ( repr(appManager) )
- # start it
- rc = AdminControl.invoke(appManager, 'stopApplication', appName)
- print "stopApplicationOnServer: Exit. rc=%s" % ( repr(rc) )
-
-def installApplicationOnServer( fileName, appName, contextRoot, serverName ):
- """Install given application on the named server using given context root"""
- print "installApplicationOnServer: fileName=%s appName=%s contextRoot=%s ServerName=%s" % ( fileName, appName,contextRoot,serverName )
- AdminApp.install(fileName,'[-appname ' + appName + ' -contextroot ' + contextRoot + ' -server ' + serverName + ' -usedefaultbindings ]')
- AdminConfig.save()
- """modify classloader model for application"""
- deploymentID = AdminConfig.getid('/Deployment:' + appName + '/')
- deploymentObject = AdminConfig.showAttribute(deploymentID, 'deployedObject')
- classldr = AdminConfig.showAttribute(deploymentObject, 'classloader')
- print AdminConfig.showall(classldr)
- AdminConfig.modify(classldr, [['mode', 'PARENT_LAST']])
- """Modify WAR class loader model"""
- AdminConfig.show(deploymentObject, 'warClassLoaderPolicy')
- AdminConfig.modify(deploymentObject, [['warClassLoaderPolicy', 'SINGLE']])
- AdminConfig.save()
-
-def uninstallApplicationOnServer( appName ):
- """Delete the named application from the cell"""
- AdminApp.uninstall( appName )
- AdminConfig.save()
-
-
-
-"""-----------------------------------------------------------
- Phyton script to interface with WAS Admin/Management Tools
------------------------------------------------------------"""
-
-if len(sys.argv) < 1:
- print "wasAdmin.py : need parameters : functionName [args]"
- sys.exit(0)
-if(sys.argv[0] == 'installApplicationOnServer'):
- installApplicationOnServer(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4])
-elif(sys.argv[0] == 'startApplicationOnServer'):
- startApplicationOnServer(sys.argv[1], sys.argv[2])
-elif(sys.argv[0] == 'uninstallApplicationOnServer'):
- uninstallApplicationOnServer(sys.argv[1])
-else:
- print "Exiting without doing anything"
-
diff --git a/tags/java/sca/2.0-M1/itest/wires/pom.xml b/tags/java/sca/2.0-M1/itest/wires/pom.xml
deleted file mode 100644
index 6ff4931748..0000000000
--- a/tags/java/sca/2.0-M1/itest/wires/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-wires</artifactId>
- <name>Apache Tuscany SCA Wires Basic Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java b/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java
deleted file mode 100644
index f5a4337254..0000000000
--- a/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * This is the client interface for the wires tests
- */
-@Remotable
-public interface WireClient {
-
- /**
- * This tests the wires.
- */
- void runTests();
-}
diff --git a/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java b/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java
deleted file mode 100644
index 82f0e26d58..0000000000
--- a/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import org.junit.Assert;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This is the client implementation for the wires tests
- */
-@Service(WireClient.class)
-public class WireClientImpl implements WireClient {
- /**
- * This is our injected reference to the WireService
- */
- @Reference
- protected WireService aWireService;
-
- /**
- * This tests the wire reference
- */
- public void runTests() {
- // Make sure the wire has injected a reference
- Assert.assertNotNull(aWireService);
-
- // Test the injected reference
- String msg = aWireService.sayHello("MCC");
-
- // Validate the response
- Assert.assertNotNull(msg);
- Assert.assertEquals("Hello MCC", msg);
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java b/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java
deleted file mode 100644
index 67df1e3a52..0000000000
--- a/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Sample Wire Service
- */
-@Remotable
-public interface WireService {
- /**
- * Returns "Hello " + aName
- *
- * @param aName The name to say hello
- * @return "Hello " + aName
- */
- String sayHello(String aName);
-}
diff --git a/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java b/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java
deleted file mode 100644
index f0308252ba..0000000000
--- a/tags/java/sca/2.0-M1/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * Sample WireService Implementation
- */
-@Service(WireService.class)
-public class WireServiceImpl implements WireService {
-
- /**
- * Returns "Hello " + aName
- *
- * @param aName The name to say hello
- * @return "Hello " + aName
- */
- public String sayHello(String aName) {
- return "Hello " + aName;
- }
-}
diff --git a/tags/java/sca/2.0-M1/itest/wires/src/main/resources/WireTest.composite b/tags/java/sca/2.0-M1/itest/wires/src/main/resources/WireTest.composite
deleted file mode 100644
index 8b764d0e7d..0000000000
--- a/tags/java/sca/2.0-M1/itest/wires/src/main/resources/WireTest.composite
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://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/tags/java/sca/2.0-M1/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java b/tags/java/sca/2.0-M1/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java
deleted file mode 100644
index 2a0095cabc..0000000000
--- a/tags/java/sca/2.0-M1/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest;
-
-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.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * This test case will attempt to use a wire
- */
-public class WireTestCase {
-
- /**
- * The Node we are using
- */
- private Node node;
-
- /**
- * The client the tests should use
- */
- private WireClient aWireClient;
-
- /**
- * Run the wire tests
- */
- @Test
- public void testWire() {
- aWireClient.runTests();
- }
-
- /**
- * Load the Wire composite and look up the client.
- */
-
- @Before
- public void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("WireTest.composite");
- node = NodeFactory.newInstance().createNode("WireTest.composite", new Contribution("c1", location));
- node.start();
- aWireClient = node.getService(WireClient.class, "WireClient");
- Assert.assertNotNull(aWireClient);
-
- aWireClient = node.getService(WireClient.class, "AnotherWireClient");
- Assert.assertNotNull(aWireClient);
- }
-
- /**
- * Shutdown the SCA node
- */
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/LICENSE b/tags/java/sca/2.0-M1/modules/assembly-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/assembly-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index 25cd7c4695..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,39 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.assembly.xml;uses:="org.apache.
- tuscany.sca.definitions,javax.xml.transform.dom,org.apache.tuscany.sc
- a.core,org.apache.tuscany.sca.policy,javax.xml.namespace,org.apache.t
- uscany.sca.contribution.java,javax.xml.stream,org.apache.tuscany.sca.
- contribution.resolver,org.apache.tuscany.sca.policy.util,org.apache.t
- uscany.sca.assembly,javax.xml.parsers,org.apache.tuscany.sca.contribu
- tion,org.apache.tuscany.sca.monitor,org.w3c.dom,org.apache.tuscany.sc
- a.interfacedef,org.apache.tuscany.sca.contribution.namespace,javax.xm
- l.xpath,javax.xml.transform,org.apache.tuscany.sca.contribution.proce
- ssor,org.apache.tuscany.sca.interfacedef.impl";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA XML Assembly Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397124328
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA XML Assembly Model
-Import-Package: javax.xml.namespace,javax.xml.parsers,javax.xml.stream
- ,javax.xml.transform,javax.xml.transform.dom,javax.xml.xpath,org.apac
- he.tuscany.sca.assembly;version="2.0.0",org.apache.tuscany.sca.assembly
- .xml;version="2.0.0",org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.java;version="2.0.0",org.apache.tus
- cany.sca.contribution.namespace;version="2.0.0",org.apache.tuscany.sca.
- contribution.processor;version="2.0.0",org.apache.tuscany.sca.contribut
- ion.resolver;version="2.0.0",org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0",org.apache.tuscany.s
- ca.interfacedef;version="2.0.0",org.apache.tuscany.sca.interfacedef.imp
- l;version="2.0.0",org.apache.tuscany.sca.monitor;version="2.0.0",org.apac
- he.tuscany.sca.policy;version="2.0.0",org.apache.tuscany.sca.policy.uti
- l;version="2.0.0",org.w3c.dom,org.xml.sa
- x;resolution:=optional,javax.xml
- .validation;resolution:=optional,org.apache.tuscany.sca.assembly.buil
- der;version="2.0.0";resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.assembly.xml
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/NOTICE b/tags/java/sca/2.0-M1/modules/assembly-xml/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/pom.xml b/tags/java/sca/2.0-M1/modules/assembly-xml/pom.xml
deleted file mode 100644
index afc8348b4c..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/pom.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-assembly-xml</artifactId>
- <name>Apache Tuscany SCA Assembly XML Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-java</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!--
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0-2</version>
- </dependency>
- -->
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- <version>1.0.1</version>
- <scope>compile</scope>
- </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>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions-xml</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xsd</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
deleted file mode 100644
index fa58232703..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
+++ /dev/null
@@ -1,939 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI;
-import static javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
-import static org.apache.tuscany.sca.assembly.xml.Constants.ELEMENT;
-import static org.apache.tuscany.sca.assembly.xml.Constants.MANY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.MULTIPLICITY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.MUST_SUPPLY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.NAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.ONE_N;
-import static org.apache.tuscany.sca.assembly.xml.Constants.ONE_ONE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SCA10_NS;
-import static org.apache.tuscany.sca.assembly.xml.Constants.TARGET;
-import static org.apache.tuscany.sca.assembly.xml.Constants.TYPE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.ZERO_N;
-import static org.apache.tuscany.sca.assembly.xml.Constants.ZERO_ONE;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.dom.DOMSource;
-
-import org.apache.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.assembly.AbstractProperty;
-import org.apache.tuscany.sca.assembly.AbstractReference;
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Base;
-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.ComponentType;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.Extensible;
-import org.apache.tuscany.sca.assembly.Extension;
-import org.apache.tuscany.sca.assembly.ExtensionFactory;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-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.processor.StAXAttributeProcessor;
-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.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.policy.util.PolicyValidationException;
-import org.apache.tuscany.sca.policy.util.PolicyValidationUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A base class with utility methods for the other artifact processors in this module.
- *
- * @version $Rev$ $Date$
- */
-abstract class BaseAssemblyProcessor extends BaseStAXArtifactProcessor {
-
- protected AssemblyFactory assemblyFactory;
- protected ExtensionFactory extensionFactory;
- protected PolicyFactory policyFactory;
- protected StAXArtifactProcessor<Object> extensionProcessor;
- protected PolicyAttachPointProcessor policyProcessor;
- private DocumentBuilderFactory documentBuilderFactory;
- private Monitor monitor;
-
- /**
- * Constructs a new BaseArtifactProcessor.
- * @param assemblyFactory
- * @param policyFactory
- */
- @SuppressWarnings("unchecked")
- protected BaseAssemblyProcessor(AssemblyFactory assemblyFactory,
- ExtensionFactory extensionFactory,
- PolicyFactory policyFactory,
- DocumentBuilderFactory documentBuilderFactory,
- StAXArtifactProcessor extensionProcessor,
- Monitor monitor) {
- this.assemblyFactory = assemblyFactory;
- this.extensionFactory = extensionFactory;
- this.policyFactory = policyFactory;
- this.documentBuilderFactory = documentBuilderFactory;
- this.extensionProcessor = (StAXArtifactProcessor<Object>)extensionProcessor;
- this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- this.monitor = monitor;
- }
-
- /**
- * @param modelFactories
- * @param staxProcessor
- * @param monitor
- */
- protected BaseAssemblyProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor staxProcessor,
- Monitor monitor) {
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.extensionFactory = modelFactories.getFactory(ExtensionFactory.class);
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.documentBuilderFactory = modelFactories.getFactory(DocumentBuilderFactory.class);
- this.extensionProcessor = (StAXArtifactProcessor<Object>)staxProcessor;
- this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- this.monitor = monitor;
- }
-
- /**
- * Marshals warnings into the monitor
- *
- * @param message
- * @param model
- * @param messageParameters
- */
- protected void warning(String message, Object model, String... messageParameters) {
- if (monitor != null){
- Problem problem = monitor.createProblem(this.getClass().getName(), "assembly-xml-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /**
- * Marshals errors into the monitor
- *
- * @param problems
- * @param message
- * @param model
- */
- protected void error(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "assembly-xml-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /**
- * Marshals exceptions into the monitor
- *
- * @param problems
- * @param message
- * @param model
- */
- protected void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "assembly-xml-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- /**
- * Start an element.
- * @param writer
- * @param name
- * @param attrs
- * @throws XMLStreamException
- */
- protected void writeStart(XMLStreamWriter writer, String name, XAttr... attrs) throws XMLStreamException {
- writeStart(writer, SCA10_NS, name, attrs);
- }
-
- /**
- * Start a document.
- * @param writer
- * @throws XMLStreamException
- */
- protected void writeStartDocument(XMLStreamWriter writer, String name, XAttr... attrs) throws XMLStreamException {
- writer.writeStartDocument();
- writer.setDefaultNamespace(SCA10_NS);
- writeStart(writer, SCA10_NS, name, attrs);
- writer.writeDefaultNamespace(SCA10_NS);
- }
-
- /**
- * Read list of reference targets
- * @param reference
- * @param reader
- */
- protected void readTargets(Reference reference, XMLStreamReader reader) {
- String value = reader.getAttributeValue(null, TARGET);
- ComponentService target = null;
- if (value != null) {
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- target = assemblyFactory.createComponentService();
- target.setUnresolved(true);
- target.setName(tokens.nextToken());
- reference.getTargets().add(target);
- }
- }
- }
-
- /**
- * Write a list of targets into an attribute
- * @param reference
- * @return
- */
- protected XAttr writeTargets(Reference reference) {
- List<String> targets = new ArrayList<String>();
- for (Service target : reference.getTargets()) {
- targets.add(target.getName());
- }
- return new XAttr(TARGET, targets);
- }
-
- /**
- * Read a multiplicity attribute.
- * @param reference
- * @param reader
- */
- protected void readMultiplicity(AbstractReference reference, XMLStreamReader reader) {
- String value = reader.getAttributeValue(null, MULTIPLICITY);
- if (ZERO_ONE.equals(value)) {
- reference.setMultiplicity(Multiplicity.ZERO_ONE);
- } else if (ONE_N.equals(value)) {
- reference.setMultiplicity(Multiplicity.ONE_N);
- } else if (ZERO_N.equals(value)) {
- reference.setMultiplicity(Multiplicity.ZERO_N);
- } else if (ONE_ONE.equals(value)) {
- reference.setMultiplicity(Multiplicity.ONE_ONE);
- }
- }
-
- protected XAttr writeMultiplicity(AbstractReference reference) {
- Multiplicity multiplicity = reference.getMultiplicity();
- if (multiplicity != null) {
- String value = null;
- if (Multiplicity.ZERO_ONE.equals(multiplicity)) {
- value = ZERO_ONE;
- } else if (Multiplicity.ONE_N.equals(multiplicity)) {
- value = ONE_N;
- } else if (Multiplicity.ZERO_N.equals(multiplicity)) {
- value = ZERO_N;
- } else if (Multiplicity.ONE_ONE.equals(multiplicity)) {
- value = ONE_ONE;
- return null;
- }
- return new XAttr(MULTIPLICITY, value);
- }
- return null;
- }
-
- /**
- * Returns the value of a constrainingType attribute.
- * @param reader
- * @return
- */
- protected ConstrainingType readConstrainingType(XMLStreamReader reader) {
- QName constrainingTypeName = getQName(reader, Constants.CONSTRAINING_TYPE);
- if (constrainingTypeName != null) {
- ConstrainingType constrainingType = assemblyFactory.createConstrainingType();
- constrainingType.setName(constrainingTypeName);
- constrainingType.setUnresolved(true);
- return constrainingType;
- } else {
- return null;
- }
- }
-
- /**
- * Reads an abstract property element.
- * @param property
- * @param reader
- * @throws XMLStreamException
- * @throws ContributionReadException
- */
- protected void readAbstractProperty(AbstractProperty property, XMLStreamReader reader) throws XMLStreamException,
- ContributionReadException {
-
- property.setName(getString(reader, NAME));
- property.setMany(getBoolean(reader, MANY));
- property.setMustSupply(getBoolean(reader, MUST_SUPPLY));
- property.setXSDElement(getQName(reader, ELEMENT));
- property.setXSDType(getQName(reader, TYPE));
- }
-
- /**
- * Resolve an implementation.
- * @param implementation
- * @param resolver
- * @return
- * @throws ContributionResolveException
- */
- protected Implementation resolveImplementation(Implementation implementation, ModelResolver resolver)
- throws ContributionResolveException, PolicyValidationException {
- if (implementation != null) {
- if (implementation.isUnresolved()) {
- implementation = resolver.resolveModel(Implementation.class, implementation);
-
- // Lazily resolve implementations
- if (implementation.isUnresolved()) {
- extensionProcessor.resolve(implementation, resolver);
- if (!implementation.isUnresolved()) {
- //resolve policies
- if ( implementation instanceof PolicySetAttachPoint ) {
- PolicySetAttachPoint policiedImpl = (PolicySetAttachPoint)implementation;
- resolveIntents(policiedImpl.getRequiredIntents(), resolver);
- PolicyValidationUtils.validateIntents(policiedImpl, policiedImpl.getType());
-
- resolvePolicySets(policiedImpl.getPolicySets(), resolver);
- PolicyValidationUtils.validatePolicySets(policiedImpl);
-
- if ( implementation instanceof OperationsConfigurator ) {
- OperationsConfigurator opsConfigurator = (OperationsConfigurator)implementation;
- for ( ConfiguredOperation implOp : opsConfigurator.getConfiguredOperations() ) {
- resolveIntents(implOp.getRequiredIntents(), resolver);
- PolicyValidationUtils.validateIntents(implOp, policiedImpl.getType());
-
- resolvePolicySets(implOp.getPolicySets(), resolver);
- PolicyValidationUtils.validatePolicySets(implOp,
- policiedImpl.getType(),
- policiedImpl.getApplicablePolicySets());
- }
- }
-
- for ( Service service : implementation.getServices() ) {
- resolveIntents(service.getRequiredIntents(), resolver);
- resolvePolicySets(service.getPolicySets(), resolver);
-
- for ( ConfiguredOperation svcOp : service.getConfiguredOperations() ) {
- resolveIntents(svcOp.getRequiredIntents(), resolver);
- resolvePolicySets(svcOp.getPolicySets(), resolver);
- }
- }
-
- for ( Reference reference : implementation.getReferences() ) {
- resolveIntents(reference.getRequiredIntents(), resolver);
- resolvePolicySets(reference.getPolicySets(), resolver);
- }
- }
-
- resolver.addModel(implementation);
- }
- }
- }
-
- if ( implementation instanceof IntentAttachPoint &&
- ((IntentAttachPoint)implementation).getType() != null &&
- ((IntentAttachPoint)implementation).getType().isUnresolved() ) {
- ((IntentAttachPoint)implementation).setType(
- resolver.resolveModel(IntentAttachPointType.class,
- ((IntentAttachPoint)implementation).getType()));
- }
- }
- return implementation;
- }
-
- /**
- * Resolve interface, callback interface and bindings on a list of contracts.
- * @param contracts the list of contracts
- * @param resolver the resolver to use to resolve models
- */
- protected <C extends Contract> void resolveContracts(List<C> contracts, ModelResolver resolver)
- throws ContributionResolveException {
- resolveContracts(null, contracts, resolver);
- }
-
-
- /**
- * Resolve interface, callback interface and bindings on a list of contracts.
- * @param parent element for the contracts
- * @param contracts the list of contracts
- * @param resolver the resolver to use to resolve models
- */
- protected <C extends Contract> void resolveContracts(Base parent, List<C> contracts, ModelResolver resolver)
- throws ContributionResolveException {
-
- String parentName = (parent instanceof Composite) ? ((Composite)parent).getName().toString() :
- (parent instanceof Component) ? ((Component)parent).getName() : "UNKNOWN";
-
- for (Contract contract : contracts) {
- try {
- //resolve the intents and policysets as they need to be copied over into the
- //child binding elements
- resolveIntents(contract.getRequiredIntents(), resolver);
- resolvePolicySets(contract.getPolicySets(), resolver);
- resolvePolicySets(contract.getApplicablePolicySets(), resolver);
-
- // Inherit the composite / component level applicable policy sets.
- if ( parent != null && parent instanceof PolicySetAttachPoint ) {
- addInheritedPolicySets(((PolicySetAttachPoint)parent).getApplicablePolicySets(), contract.getApplicablePolicySets());
- }
-
- for ( ConfiguredOperation confOp : contract.getConfiguredOperations() ) {
- resolveIntents(confOp.getRequiredIntents(), resolver);
- resolvePolicySets(confOp.getPolicySets(), resolver);
- resolvePolicySets(confOp.getApplicablePolicySets(), resolver);
-
- //inherit applicable policy sets from parent contract
- addInheritedPolicySets(contract.getApplicablePolicySets(), confOp.getApplicablePolicySets());
- }
-
- // Resolve the interface contract
- InterfaceContract interfaceContract = contract.getInterfaceContract();
- if (interfaceContract != null) {
- extensionProcessor.resolve(interfaceContract, resolver);
- }
-
- // Resolve bindings
- for (int i = 0, n = contract.getBindings().size(); i < n; i++) {
- Binding binding = contract.getBindings().get(i);
- extensionProcessor.resolve(binding, resolver);
-
- if (binding instanceof IntentAttachPoint) {
- IntentAttachPoint policiedBinding = (IntentAttachPoint)binding;
-
- if ( policiedBinding.getType() != null && policiedBinding.getType().isUnresolved() ) {
- IntentAttachPointType resolved =
- resolver.resolveModel(IntentAttachPointType.class,
- policiedBinding.getType());
- policiedBinding.setType(resolved);
- }
-
- resolveIntents(policiedBinding.getRequiredIntents(), resolver);
- PolicyValidationUtils.validateIntents(policiedBinding, policiedBinding.getType());
- }
-
- if (binding instanceof PolicySetAttachPoint) {
- PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
- resolvePolicySets(policiedBinding.getPolicySets(), resolver);
- //validate if attached policysets apply to the binding
- resolvePolicySets(policiedBinding.getApplicablePolicySets(), resolver);
- //inherit the applicable policysets from parent contract as whatever applies to that
- //applies to the binding as well
- addInheritedPolicySets(contract.getApplicablePolicySets(), policiedBinding.getApplicablePolicySets());
- PolicyValidationUtils.validatePolicySets(policiedBinding);
- }
-
- if (binding instanceof OperationsConfigurator) {
- OperationsConfigurator opConfigurator = (OperationsConfigurator)binding;
- for (ConfiguredOperation confOp : opConfigurator.getConfiguredOperations()) {
- resolveIntents(confOp.getRequiredIntents(), resolver);
- PolicyValidationUtils.validateIntents(confOp, ((PolicySetAttachPoint)binding).getType());
-
- resolvePolicySets(confOp.getPolicySets(), resolver);
- resolvePolicySets(confOp.getApplicablePolicySets(), resolver);
- //inherit the applicable policysets from parent binding as whatever applies to that
- //applies to the binding as well
- addInheritedPolicySets(((PolicySetAttachPoint)binding).getApplicablePolicySets(),
- confOp.getApplicablePolicySets());
- PolicyValidationUtils.validatePolicySets(confOp, ((PolicySetAttachPoint)binding).getType());
- }
- }
- }
-
- // Resolve callback bindings
- if (contract.getCallback() != null) {
- resolveIntents(contract.getCallback().getRequiredIntents(), resolver);
- resolvePolicySets(contract.getCallback().getPolicySets(), resolver);
- resolvePolicySets(contract.getCallback().getApplicablePolicySets(), resolver);
- //inherit the contract's policy intents and policysets
- addInheritedPolicySets(contract.getApplicablePolicySets(), contract.getCallback().getApplicablePolicySets());
-
- for (int i = 0, n = contract.getCallback().getBindings().size(); i < n; i++) {
- Binding binding = contract.getCallback().getBindings().get(i);
- extensionProcessor.resolve(binding, resolver);
-
- if (binding instanceof IntentAttachPoint) {
- IntentAttachPoint policiedBinding = (IntentAttachPoint)binding;
-
- if ( policiedBinding.getType().isUnresolved() ) {
- IntentAttachPointType resolved =
- resolver.resolveModel(IntentAttachPointType.class,
- policiedBinding.getType());
- policiedBinding.setType(resolved);
- }
-
- resolveIntents(policiedBinding.getRequiredIntents(), resolver);
- PolicyValidationUtils.validateIntents(policiedBinding, policiedBinding.getType());
- }
-
- if (binding instanceof PolicySetAttachPoint) {
- PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
- resolvePolicySets(policiedBinding.getPolicySets(), resolver);
- //validate if attached policysets apply to the binding
- resolvePolicySets(policiedBinding.getApplicablePolicySets(), resolver);
- //inherit the applicable policysets from parent contract as whatever applies to that
- //applies to the binding as well
- addInheritedPolicySets(contract.getApplicablePolicySets(), policiedBinding.getApplicablePolicySets());
- PolicyValidationUtils.validatePolicySets(policiedBinding);
- }
-
- if (binding instanceof OperationsConfigurator) {
- OperationsConfigurator opConfigurator = (OperationsConfigurator)binding;
- for (ConfiguredOperation confOp : opConfigurator.getConfiguredOperations()) {
- resolveIntents(confOp.getRequiredIntents(), resolver);
- PolicyValidationUtils.validateIntents(confOp, ((PolicySetAttachPoint)binding).getType());
-
- resolvePolicySets(confOp.getPolicySets(), resolver);
- resolvePolicySets(confOp.getApplicablePolicySets(), resolver);
- //inherit the applicable policysets from parent binding as whatever applies to that
- //applies to the binding as well
- addInheritedPolicySets(((PolicySetAttachPoint)binding).getApplicablePolicySets(),
- confOp.getApplicablePolicySets());
- PolicyValidationUtils.validatePolicySets(confOp, ((PolicySetAttachPoint)binding).getType());
- }
- }
- }
- }
- } catch ( PolicyValidationException e ) {
- error("PolicyServiceValidationException", contract, contract.getName(), parentName, e.getMessage());
- //throw new ContributionResolveException("PolicyValidation exceptions when processing service/reference '"
- //+ contract.getName() + "' in '" + parentName + "'");
- }
- }
- }
-
- /**
- * Resolve interface and callback interface on a list of abstract contracts.
- * @param contracts the list of contracts
- * @param resolver the resolver to use to resolve models
- */
- protected <C extends AbstractContract> void resolveAbstractContracts(List<C> contracts, ModelResolver resolver)
- throws ContributionResolveException {
- for (AbstractContract contract : contracts) {
-
- // Resolve the interface contract
- InterfaceContract interfaceContract = contract.getInterfaceContract();
- if (interfaceContract != null) {
- extensionProcessor.resolve(interfaceContract, resolver);
- }
- }
- }
-
- /**
- * Returns a constrainingType attribute.
- * @param componentType
- * @return
- */
- protected XAttr writeConstrainingType(ComponentType componentType) {
- ConstrainingType constrainingType = componentType.getConstrainingType();
- if (constrainingType != null)
- return new XAttr(Constants.CONSTRAINING_TYPE, constrainingType.getName());
- else
- return null;
- }
-
- /**
- * Read a property value into a DOM document.
- * @param element
- * @param type
- * @param reader
- * @return
- * @throws XMLStreamException
- * @throws ContributionReadException
- * @throws ParserConfigurationException
- */
- protected Document readPropertyValue(QName element, QName type, XMLStreamReader reader) throws XMLStreamException,
- ContributionReadException {
-
- Document document;
- try {
- if (documentBuilderFactory == null) {
- documentBuilderFactory = DocumentBuilderFactory.newInstance();
- documentBuilderFactory.setNamespaceAware(true);
- }
- document = documentBuilderFactory.newDocumentBuilder().newDocument();
- } catch (ParserConfigurationException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", documentBuilderFactory, ce);
- throw ce;
- }
-
- // root element has no namespace and local name "value"
- Element root = document.createElementNS(null, "value");
- if (type != null) {
- org.w3c.dom.Attr xsi = document.createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, "xmlns:xsi");
- xsi.setValue(W3C_XML_SCHEMA_INSTANCE_NS_URI);
- root.setAttributeNodeNS(xsi);
-
- String prefix = type.getPrefix();
- if (prefix == null || prefix.length() == 0) {
- prefix = "ns";
- }
-
- declareNamespace(root, prefix, type.getNamespaceURI());
-
- org.w3c.dom.Attr xsiType = document.createAttributeNS(W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi:type");
- xsiType.setValue(prefix + ":" + type.getLocalPart());
- root.setAttributeNodeNS(xsiType);
- }
- document.appendChild(root);
-
- loadElement(reader, root);
- return document;
- }
-
- /**
- * Create a DOM element
- * @param document
- * @param name
- * @return
- */
- private Element createElement(Document document, QName name) {
- String prefix = name.getPrefix();
- String qname =
- (prefix != null && prefix.length() > 0) ? prefix + ":" + name.getLocalPart() : name.getLocalPart();
- return document.createElementNS(name.getNamespaceURI(), qname);
- }
-
- /**
- * Declare a namespace.
- * @param element
- * @param prefix
- * @param ns
- */
- private void declareNamespace(Element element, String prefix, String ns) {
- if (ns == null) {
- ns = "";
- }
- if (prefix == null) {
- prefix = "";
- }
- String qname = null;
- if ("".equals(prefix)) {
- qname = "xmlns";
- } else {
- qname = "xmlns:" + prefix;
- }
- Node node = element;
- boolean declared = false;
- while (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
- NamedNodeMap attrs = node.getAttributes();
- if (attrs == null) {
- break;
- }
- Node attr = attrs.getNamedItem(qname);
- if (attr != null) {
- declared = ns.equals(attr.getNodeValue());
- break;
- }
- node = node.getParentNode();
- }
- if (!declared) {
- org.w3c.dom.Attr attr = element.getOwnerDocument().createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, qname);
- attr.setValue(ns);
- element.setAttributeNodeNS(attr);
- }
- }
-
- /**
- * Load a property value specification from an StAX stream into a DOM
- * Document. Only elements, text and attributes are processed; all comments
- * and other whitespace are ignored.
- *
- * @param reader the stream to read from
- * @param root the DOM node to load
- * @throws javax.xml.stream.XMLStreamException
- */
- private void loadElement(XMLStreamReader reader, Element root) throws XMLStreamException {
- Document document = root.getOwnerDocument();
- Node current = root;
- while (true) {
- switch (reader.next()) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- Element child = createElement(document, name);
-
- // push the new element and make it the current one
- current.appendChild(child);
- current = child;
-
- int count = reader.getNamespaceCount();
- for (int i = 0; i < count; i++) {
- String prefix = reader.getNamespacePrefix(i);
- String ns = reader.getNamespaceURI(i);
- declareNamespace(child, prefix, ns);
- }
-
- if (!"".equals(name.getNamespaceURI())) {
- declareNamespace(child, name.getPrefix(), name.getNamespaceURI());
- }
-
- // add the attributes for this element
- count = reader.getAttributeCount();
- for (int i = 0; i < count; i++) {
- String ns = reader.getAttributeNamespace(i);
- String prefix = reader.getAttributePrefix(i);
- String qname = reader.getAttributeLocalName(i);
- String value = reader.getAttributeValue(i);
- if (prefix != null && prefix.length() != 0) {
- qname = prefix + ":" + qname;
- }
- child.setAttributeNS(ns, qname, value);
- if (ns != null) {
- declareNamespace(child, prefix, ns);
- }
- }
-
- break;
- case XMLStreamConstants.CDATA:
- current.appendChild(document.createCDATASection(reader.getText()));
- break;
- case XMLStreamConstants.CHARACTERS:
- current.appendChild(document.createTextNode(reader.getText()));
- break;
- case XMLStreamConstants.END_ELEMENT:
- // if we are back at the root then we are done
- if (current == root) {
- return;
- }
-
- // pop the element off the stack
- current = current.getParentNode();
- }
- }
- }
-
- /**
- * Resolve policy intents attached to a specific SCA Artifact
- * @param policyIntents list of policy intents
- * @param resolver
- */
- protected void resolveIntents(List<Intent> policyIntents, ModelResolver resolver) {
- List<Intent> requiredIntents = new ArrayList<Intent>();
- Intent resolvedIntent = null;
- for (Intent intent : policyIntents) {
- resolvedIntent = resolver.resolveModel(Intent.class, intent);
- requiredIntents.add(resolvedIntent);
- }
- policyIntents.clear();
- policyIntents.addAll(requiredIntents);
- }
-
- /**
- * Resolve policy sets attached to a specific SCA Construct
- * @param policySets list of attached policy sets
- * @param resolver
- */
- protected void resolvePolicySets(List<PolicySet> policySets, ModelResolver resolver) {
- List<PolicySet> resolvedPolicySets = new ArrayList<PolicySet>();
- PolicySet resolvedPolicySet = null;
- for (PolicySet policySet : policySets) {
- if (policySet.isUnresolved()) {
- resolvedPolicySet = resolver.resolveModel(PolicySet.class, policySet);
- resolvedPolicySets.add(resolvedPolicySet);
- } else {
- resolvedPolicySets.add(policySet);
- }
- }
- policySets.clear();
- policySets.addAll(resolvedPolicySets);
- }
-
- /**
- * Write the value of a property
- * @param document
- * @param element
- * @param type
- * @param writer
- * @throws XMLStreamException
- */
- protected void writePropertyValue(Object propertyValue, QName element, QName type, XMLStreamWriter writer)
- throws XMLStreamException {
-
- if (propertyValue instanceof Document) {
- Document document = (Document)propertyValue;
- NodeList nodeList = document.getDocumentElement().getChildNodes();
-
- for (int item = 0; item < nodeList.getLength(); ++item) {
- Node node = nodeList.item(item);
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- XMLStreamReader reader =
- XMLInputFactory.newInstance().createXMLStreamReader(new DOMSource(node));
-
- while (reader.hasNext()) {
- switch (reader.next()) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- writer.writeStartElement(name.getPrefix(), name.getLocalPart(), name.getNamespaceURI());
-
- int namespaces = reader.getNamespaceCount();
- for (int i = 0; i < namespaces; i++) {
- String prefix = reader.getNamespacePrefix(i);
- String ns = reader.getNamespaceURI(i);
- writer.writeNamespace(prefix, ns);
- }
-
- if (!"".equals(name.getNamespaceURI())) {
- writer.writeNamespace(name.getPrefix(), name.getNamespaceURI());
- }
-
- // add the attributes for this element
- namespaces = reader.getAttributeCount();
- for (int i = 0; i < namespaces; i++) {
- String ns = reader.getAttributeNamespace(i);
- String prefix = reader.getAttributePrefix(i);
- String qname = reader.getAttributeLocalName(i);
- String value = reader.getAttributeValue(i);
-
- writer.writeAttribute(prefix, ns, qname, value);
- }
-
- break;
- case XMLStreamConstants.CDATA:
- writer.writeCData(reader.getText());
- break;
- case XMLStreamConstants.CHARACTERS:
- writer.writeCharacters(reader.getText());
- break;
- case XMLStreamConstants.END_ELEMENT:
- writer.writeEndElement();
- break;
- }
- }
- } else {
- writer.writeCharacters(node.getTextContent());
- }
- }
- }
- }
-
- protected void addInheritedIntents(List<Intent> sourceList, List<Intent> targetList) {
- if (sourceList != null) {
- targetList.addAll(sourceList);
- }
- }
-
- protected void addInheritedPolicySets(List<PolicySet> sourceList, List<PolicySet> targetList) {
- if (sourceList != null) {
- targetList.addAll(sourceList);
- }
- }
-
- /**
- *
- * @param reader
- * @param elementName
- * @param estensibleElement
- * @param extensionAttributeProcessor
- * @throws ContributionReadException
- * @throws XMLStreamException
- */
- protected void readExtendedAttributes(XMLStreamReader reader, QName elementName, Extensible estensibleElement, StAXAttributeProcessor extensionAttributeProcessor) throws ContributionReadException, XMLStreamException {
- for (int a = 0; a < reader.getAttributeCount(); a++) {
- QName attributeName = reader.getAttributeName(a);
- if( attributeName.getNamespaceURI() != null && attributeName.getNamespaceURI().length() > 0) {
- if( ! elementName.getNamespaceURI().equals(attributeName.getNamespaceURI()) ) {
- Object attributeValue = extensionAttributeProcessor.read(attributeName, reader);
- Extension attributeExtension;
- if (attributeValue instanceof Extension) {
- attributeExtension = (Extension) attributeValue;
- } else {
- attributeExtension = extensionFactory.createExtension(attributeName, attributeValue, true);
- }
- estensibleElement.getAttributeExtensions().add(attributeExtension);
- }
- }
- }
- }
-
-
- /**
- *
- * @param attributeModel
- * @param writer
- * @param extensibleElement
- * @param extensionAttributeProcessor
- * @throws ContributionWriteException
- * @throws XMLStreamException
- */
- protected void writeExtendedAttributes(XMLStreamWriter writer, Extensible extensibleElement, StAXAttributeProcessor extensionAttributeProcessor) throws ContributionWriteException, XMLStreamException {
- for(Extension extension : extensibleElement.getAttributeExtensions()) {
- if(extension.isAttribute()) {
- extensionAttributeProcessor.write(extension, writer);
- }
- }
- }
-
- /*protected void validatePolicySets(PolicySetAttachPoint policySetAttachPoint)
- throws ContributionResolveException {
- validatePolicySets(policySetAttachPoint, policySetAttachPoint.getApplicablePolicySets());
- }
-
-
- protected void validatePolicySets(PolicySetAttachPoint policySetAttachPoint,
- List<PolicySet> applicablePolicySets) throws ContributionResolveException {
- //Since the applicablePolicySets in a policySetAttachPoint 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
- IntentAttachPointType attachPointType = policySetAttachPoint.getType();
- for ( PolicySet definedPolicySet : policySetAttachPoint.getPolicySets() ) {
- if ( !definedPolicySet.isUnresolved() ) {
- if ( !applicablePolicySets.contains(definedPolicySet)) {
- throw new ContributionResolveException("Policy Set '" + definedPolicySet.getName()
- + "' does not apply to binding type "
- + attachPointType.getName());
- }
- } else {
- throw new ContributionResolveException("Policy Set '" + definedPolicySet.getName()
- + "' is not defined in this domain ");
-
-
- }
- }
- }*/
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java
deleted file mode 100644
index 969115cf4c..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A componentType processor.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentTypeDocumentProcessor extends BaseAssemblyProcessor implements URLArtifactProcessor<ComponentType> {
- private XMLInputFactory inputFactory;
-
- /**
- * Constructs a new componentType processor.
- * @param modelFactories
- * @param staxProcessor
- */
- public ComponentTypeDocumentProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor staxProcessor,
- Monitor monitor) {
- super(modelFactories, staxProcessor, monitor);
- this.inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class);
- }
-
- public ComponentType read(URL contributionURL, URI uri, URL url) throws ContributionReadException {
- InputStream urlStream = null;
- try {
-
- // Create a stream reader
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- urlStream = connection.getInputStream();
- XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
- reader.nextTag();
-
- // Reader the componentType model
- ComponentType componentType = (ComponentType)extensionProcessor.read(reader);
- if (componentType != null) {
- componentType.setURI(uri.toString());
- }
-
- // For debugging purposes, write it back to XML
-// if (componentType != null) {
-// try {
-// ByteArrayOutputStream bos = new ByteArrayOutputStream();
-// XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
-// outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
-// extensionProcessor.write(componentType, outputFactory.createXMLStreamWriter(bos));
-// Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(bos.toByteArray()));
-// OutputFormat format = new OutputFormat();
-// format.setIndenting(true);
-// format.setIndent(2);
-// XMLSerializer serializer = new XMLSerializer(System.out, format);
-// serializer.serialize(document);
-// } catch (Exception e) {
-// e.printStackTrace();
-// }
-// }
-
- return componentType;
-
- } catch (XMLStreamException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", inputFactory, ce);
- throw ce;
- } catch (IOException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", inputFactory, ce);
- throw ce;
- } finally {
- try {
- if (urlStream != null) {
- urlStream.close();
- urlStream = null;
- }
- } catch (IOException ioe) {
- //ignore
- }
- }
- }
-
- public void resolve(ComponentType componentType, ModelResolver resolver) throws ContributionResolveException {
- extensionProcessor.resolve(componentType, resolver);
- }
-
- public String getArtifactType() {
- return ".componentType";
- }
-
- public Class<ComponentType> getModelType() {
- return ComponentType.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeModelResolver.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeModelResolver.java
deleted file mode 100644
index 166bba8757..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeModelResolver.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-
-/**
- * A Model Resolver for ComponentType models.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentTypeModelResolver implements ModelResolver {
- private Contribution contribution;
- private Map<String, ComponentType> map = new HashMap<String, ComponentType>();
-
- public ComponentTypeModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- }
-
- public void addModel(Object resolved) {
- ComponentType componentType = (ComponentType)resolved;
- map.put(componentType.getURI(), componentType);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(((ComponentType)resolved).getURI());
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
-
- //get componentType artifact URI
- String uri = ((ComponentType)unresolved).getURI();
- if (uri == null) {
- return (T)unresolved;
- }
-
- //lookup the componentType
- ComponentType resolved = (ComponentType) map.get(uri);
- if (resolved != null) {
- return modelClass.cast(resolved);
- }
-
- //If not found, delegate the resolution to the imports (in this case based on the java imports)
- //compute the package name from the componentType URI
- if (unresolved instanceof ComponentType) {
- //FIXME The core assembly model now depends on java imports to
- // resolve componentTypes of all kinds, this is not right at all!!!
- int s = uri.lastIndexOf('/');
- if (s != -1) {
- String packageName = uri.substring(0, uri.lastIndexOf("/"));
- for (Import import_ : this.contribution.getImports()) {
- if (import_ instanceof JavaImport) {
- JavaImport javaImport = (JavaImport)import_;
- //check the import location against the computed package name from the componentType URI
- if (javaImport.getPackage().equals(packageName)) {
- // Delegate the resolution to the import resolver
- resolved = javaImport.getModelResolver().resolveModel(ComponentType.class, (ComponentType)unresolved);
- if (!resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- }
- }
- }
- }
-
- return (T)unresolved;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java
deleted file mode 100644
index a8c2d6a7e9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-import static org.apache.tuscany.sca.assembly.xml.Constants.CALLBACK;
-import static org.apache.tuscany.sca.assembly.xml.Constants.CALLBACK_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.COMPONENT_TYPE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.COMPONENT_TYPE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.ELEMENT;
-import static org.apache.tuscany.sca.assembly.xml.Constants.IMPLEMENTATION;
-import static org.apache.tuscany.sca.assembly.xml.Constants.MANY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.MUST_SUPPLY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.NAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.OPERATION_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.PROPERTY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.PROPERTY_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.REFERENCE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.REFERENCE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SERVICE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SERVICE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.TYPE;
-
-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.Callback;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.Extensible;
-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.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.FactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.w3c.dom.Document;
-
-/**
- * A componentType processor.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentTypeProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor<ComponentType> {
-
- /**
- * Constructs a new componentType processor.
- *
- * @param modelFactories
- * @param extensionProcessor
- * @param extensionAttributeProcessor
- * @param monitor
- */
- public ComponentTypeProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor extensionProcessor,
- StAXAttributeProcessor extensionAttributeProcessor,
- Monitor monitor) {
- super(modelFactories, extensionProcessor, monitor);
- }
-
- public ComponentType read(XMLStreamReader reader) throws ContributionReadException {
- ComponentType componentType = null;
- Service service = null;
- Reference reference = null;
- Contract contract = null;
- Property property = null;
- Callback callback = null;
- QName name = null;
-
- try {
- // Read the componentType document
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- name = reader.getName();
-
- if (Constants.COMPONENT_TYPE_QNAME.equals(name)) {
-
- // Read a <componentType>
- componentType = assemblyFactory.createComponentType();
- componentType.setConstrainingType(readConstrainingType(reader));
-
- } else if (Constants.SERVICE_QNAME.equals(name)) {
-
- // Read a <service>
- service = assemblyFactory.createService();
- contract = service;
- service.setName(getString(reader, Constants.NAME));
- componentType.getServices().add(service);
- policyProcessor.readPolicies(service, reader);
-
- } else if (Constants.REFERENCE_QNAME.equals(name)) {
-
- // Read a <reference>
- reference = assemblyFactory.createReference();
- contract = reference;
- reference.setName(getString(reader, Constants.NAME));
- reference.setWiredByImpl(getBoolean(reader, Constants.WIRED_BY_IMPL));
- readMultiplicity(reference, reader);
- readTargets(reference, reader);
- componentType.getReferences().add(reference);
- policyProcessor.readPolicies(reference, reader);
-
- } else if (Constants.PROPERTY_QNAME.equals(name)) {
-
- // Read a <property>
- property = assemblyFactory.createProperty();
- readAbstractProperty(property, reader);
- policyProcessor.readPolicies(property, reader);
-
- // Read the property value
- Document value = readPropertyValue(property.getXSDElement(), property.getXSDType(), reader);
- property.setValue(value);
-
- componentType.getProperties().add(property);
-
- } else if (Constants.IMPLEMENTATION_QNAME.equals(name)) {
-
- // Read an <implementation> element
- policyProcessor.readPolicies(componentType, reader);
-
- } else if (Constants.CALLBACK_QNAME.equals(name)) {
-
- // Read a <callback>
- callback = assemblyFactory.createCallback();
- contract.setCallback(callback);
- policyProcessor.readPolicies(callback, reader);
-
- } else if (OPERATION_QNAME.equals(name)) {
-
- // Read an <operation>
- Operation operation = new OperationImpl();
- operation.setName(getString(reader, NAME));
- operation.setUnresolved(true);
- if (callback != null) {
- policyProcessor.readPolicies(callback, operation, reader);
- } else {
- policyProcessor.readPolicies(contract, operation, reader);
- }
- } else {
-
- // Read an extension element
- Object extension = extensionProcessor.read(reader);
- if (extension != null) {
- if (extension instanceof InterfaceContract) {
-
- // <service><interface> and <reference><interface>
- contract.setInterfaceContract((InterfaceContract)extension);
-
- } else if (extension instanceof Binding) {
-
- // <service><binding> and <reference><binding>
- if (callback != null) {
- callback.getBindings().add((Binding)extension);
- } else {
- contract.getBindings().add((Binding)extension);
- }
- } else {
-
- // Add the extension element to the current element
- if (callback != null) {
- callback.getExtensions().add(extension);
- } else if (contract != null) {
- contract.getExtensions().add(extension);
- } else if (property != null) {
- property.getExtensions().add(extension);
- } else {
- if (componentType instanceof Extensible) {
- ((Extensible)componentType).getExtensions().add(extension);
- }
- }
- }
- }
- }
- break;
-
- case END_ELEMENT:
- name = reader.getName();
-
- // Clear current state when reading reaching end element
- if (SERVICE_QNAME.equals(name)) {
- service = null;
- contract = null;
- } else if (REFERENCE_QNAME.equals(name)) {
- reference = null;
- contract = null;
- } else if (PROPERTY_QNAME.equals(name)) {
- property = null;
- } else if (CALLBACK_QNAME.equals(name)) {
- callback = null;
- }
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- }
- catch (XMLStreamException e) {
- ContributionReadException ex = new ContributionReadException(e);
- error("XMLStreamException", reader, ex);
- }
-
- return componentType;
- }
-
- public void write(ComponentType componentType, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <componentType> element
- writeStartDocument(writer, COMPONENT_TYPE,
- writeConstrainingType(componentType));
-
- // Write <service> elements
- for (Service service : componentType.getServices()) {
- writeStart(writer, SERVICE, new XAttr(NAME, service.getName()),
- policyProcessor.writePolicies(service));
-
- if (service.getInterfaceContract() != null) {
- extensionProcessor.write(service.getInterfaceContract(), writer);
- }
-
- for (Binding binding: service.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
-
- if (service.getCallback() != null) {
- Callback callback = service.getCallback();
- writeStart(writer, CALLBACK, policyProcessor.writePolicies(callback));
-
- for (Binding binding: callback.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
- for (Object extension: callback.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- for (Object extension: service.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write <reference> elements
- for (Reference reference : componentType.getReferences()) {
-
- writeStart(writer, REFERENCE,
- new XAttr(NAME, reference.getName()),
- writeMultiplicity(reference),
- writeTargets(reference),
- policyProcessor.writePolicies(reference));
-
- extensionProcessor.write(reference.getInterfaceContract(), writer);
-
- for (Binding binding: reference.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
-
- if (reference.getCallback() != null) {
- Callback callback = reference.getCallback();
- writeStart(writer, CALLBACK,
- policyProcessor.writePolicies(callback));
-
- for (Binding binding: callback.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
- for (Object extension: callback.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- for (Object extension: reference.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write <property> elements
- for (Property property : componentType.getProperties()) {
- writeStart(writer,
- PROPERTY,
- new XAttr(NAME, property.getName()),
- new XAttr(MUST_SUPPLY, property.isMustSupply()),
- new XAttr(MANY, property.isMany()),
- new XAttr(TYPE, property.getXSDType()),
- new XAttr(ELEMENT, property.getXSDElement()),
- policyProcessor.writePolicies(property));
-
- // Write property value
- writePropertyValue(property.getValue(), property.getXSDElement(), property.getXSDType(), writer);
-
- // Write extensions
- for (Object extension : property.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write extension elements
- if (componentType instanceof Extensible) {
- for (Object extension: ((Extensible)componentType).getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
- }
-
- // Write <implementation> elements if the componentType has
- // any intents or policySets
- boolean writeImplementation = false;
- if (componentType instanceof IntentAttachPoint) {
- if (!((IntentAttachPoint)componentType).getRequiredIntents().isEmpty()) {
- writeImplementation = true;
- }
- }
- if (componentType instanceof PolicySetAttachPoint) {
- if (!((PolicySetAttachPoint)componentType).getPolicySets().isEmpty()) {
- writeImplementation = true;
- }
- }
- if (writeImplementation) {
- writeStart(writer, IMPLEMENTATION,
- policyProcessor.writePolicies(componentType));
- }
-
- writeEndDocument(writer);
- }
-
- public void resolve(ComponentType componentType, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve component type services and references
- resolveContracts(componentType.getServices(), resolver);
- resolveContracts(componentType.getReferences(), resolver);
- if ( componentType instanceof PolicySetAttachPoint ) {
- resolveIntents(((PolicySetAttachPoint)componentType).getRequiredIntents(), resolver);
- resolvePolicySets(((PolicySetAttachPoint)componentType).getPolicySets(), resolver);
- }
- }
-
- public QName getArtifactType() {
- return COMPONENT_TYPE_QNAME;
- }
-
- public Class<ComponentType> getModelType() {
- return ComponentType.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
deleted file mode 100644
index b6182e3950..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory;
-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.policy.PolicySet;
-import org.apache.tuscany.sca.policy.util.PolicyComputationUtils;
-
-/**
- * A composite processor.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeDocumentProcessor extends BaseAssemblyProcessor implements URLArtifactProcessor<Composite> {
- private XMLInputFactory inputFactory;
- private DocumentBuilderFactory documentBuilderFactory;
- private List scaDefnSink;
- private Collection<PolicySet> domainPolicySets = null;
- private int scaDefnsCount = 0;
-
- /**
- * Constructs a new composite processor.
- * @param modelFactories
- * @param staxProcessor
- */
- public CompositeDocumentProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor staxProcessor,
- Monitor monitor) {
- super(modelFactories, staxProcessor, monitor);
- this.inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class);
- this.documentBuilderFactory = modelFactories.getFactory(DocumentBuilderFactory.class);
- }
-
- public Composite read(URL contributionURL, URI uri, URL url) throws ContributionReadException {
- InputStream scdlStream = null;
- try {
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- scdlStream = connection.getInputStream();
- } catch (IOException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", url, ce);
- throw ce;
- }
- return read(uri, scdlStream);
- }
-
- public Composite read(URI uri, InputStream scdlStream) throws ContributionReadException {
- try {
-/*
- if (scaDefnSink != null ) {
- fillDomainPolicySets(scaDefnSink);
- }
-*/
-
- Composite composite = null;
-
- byte[] transformedArtifactContent;
- try {
- if ( domainPolicySets != null ) {
- transformedArtifactContent =
- PolicyComputationUtils.addApplicablePolicySets(scdlStream, domainPolicySets, documentBuilderFactory);
- scdlStream = new ByteArrayInputStream(transformedArtifactContent);
- }
- } catch ( IOException e ) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", scdlStream, ce);
- throw ce;
- } catch ( Exception e ) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", scdlStream, ce);
- //throw ce;
- }
-
- XMLStreamReader reader = inputFactory.createXMLStreamReader(scdlStream);
-
- reader.nextTag();
-
- // Read the composite model
- composite = (Composite)extensionProcessor.read(reader);
- if (composite != null) {
- composite.setURI(uri.toString());
- }
-
- // For debugging purposes, write it back to XML
-// if (composite != null) {
-// try {
-// ByteArrayOutputStream bos = new ByteArrayOutputStream();
-// XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
-// outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
-// extensionProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
-// Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(bos.toByteArray()));
-// OutputFormat format = new OutputFormat();
-// format.setIndenting(true);
-// format.setIndent(2);
-// XMLSerializer serializer = new XMLSerializer(System.out, format);
-// serializer.serialize(document);
-// } catch (Exception e) {
-// e.printStackTrace();
-// }
-// }
-
- return composite;
-
- } catch (XMLStreamException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", inputFactory, ce);
- throw ce;
- } finally {
- try {
- if (scdlStream != null) {
- scdlStream.close();
- scdlStream = null;
- }
- } catch (IOException ioe) {
- //ignore
- }
- }
- }
-
- public void resolve(Composite composite, ModelResolver resolver) throws ContributionResolveException {
- if (composite != null)
- extensionProcessor.resolve(composite, resolver);
- }
-
- public String getArtifactType() {
- return ".composite";
- }
-
- public Class<Composite> getModelType() {
- return Composite.class;
- }
-
- /*
- * TODO - remove - definitions information is now aggregated in the
- * systems definitions contribution and we need to add
- * applicable policy sets once all composites have been read
- private void fillDomainPolicySets(List scaDefnsSink) {
- Map<QName, PolicySet> domainPolicySetMap = null;
- if ( scaDefnsSink.size() > scaDefnsCount ) {
- //if ( !scaDefnsSink.isEmpty() ) {
- domainPolicySetMap = new Hashtable<QName, PolicySet>();
-
- if ( domainPolicySets != null ) {
- for ( PolicySet policySet : domainPolicySets ) {
- domainPolicySetMap.put(policySet.getName(), policySet);
- }
- }
-
- for ( Object object : scaDefnsSink ) {
- if ( object instanceof Definitions ) {
- for ( PolicySet policySet : ((Definitions)object).getPolicySets() ) {
- domainPolicySetMap.put( policySet.getName(), policySet);
- }
- }
- }
- domainPolicySets = domainPolicySetMap.values();
- //scaDefnsSink.clear();
- scaDefnsCount = scaDefnsSink.size();
- }
- }
- */
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java
deleted file mode 100644
index 62ed95cb01..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-
-/**
- * A Model Resolver for Composite models.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeModelResolver implements ModelResolver {
-
- private Contribution contribution;
- private Map<QName, Composite> map = new HashMap<QName, Composite>();
-
- public CompositeModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- }
-
- public void addModel(Object resolved) {
- Composite composite = (Composite)resolved;
- map.put(composite.getName(), composite);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(((Composite)resolved).getName());
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
-
- // Lookup a definition for the given namespace
- QName qname = ((Composite)unresolved).getName();
- Composite resolved = (Composite) map.get(qname);
- if (resolved != null) {
- return modelClass.cast(resolved);
- }
-
- // No definition found, delegate the resolution to the imports
- for (Import import_ : this.contribution.getImports()) {
- if (import_ instanceof NamespaceImport) {
- NamespaceImport namespaceImport = (NamespaceImport)import_;
- if (namespaceImport.getNamespace().equals(qname.getNamespaceURI())) {
-
- // Delegate the resolution to the import resolver
- resolved = namespaceImport.getModelResolver().resolveModel(Composite.class, (Composite)unresolved);
- if (!resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- }
- }
- return (T)unresolved;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
deleted file mode 100644
index 652d668577..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
+++ /dev/null
@@ -1,1248 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-import static org.apache.tuscany.sca.assembly.xml.Constants.AUTOWIRE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.CALLBACK;
-import static org.apache.tuscany.sca.assembly.xml.Constants.CALLBACK_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.COMPONENT;
-import static org.apache.tuscany.sca.assembly.xml.Constants.COMPONENT_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.COMPOSITE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.COMPOSITE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.ELEMENT;
-import static org.apache.tuscany.sca.assembly.xml.Constants.FILE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.IMPLEMENTATION_COMPOSITE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.IMPLEMENTATION_COMPOSITE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.INCLUDE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.INCLUDE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.LOCAL;
-import static org.apache.tuscany.sca.assembly.xml.Constants.MANY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.MUST_SUPPLY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.NAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.OPERATION_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.PROMOTE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.PROPERTY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.PROPERTY_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.REFERENCE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.REFERENCE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SCA10_NS;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SERVICE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SERVICE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SOURCE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.TARGET;
-import static org.apache.tuscany.sca.assembly.xml.Constants.TARGET_NAMESPACE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.TYPE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.URI;
-import static org.apache.tuscany.sca.assembly.xml.Constants.WIRE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.WIRED_BY_IMPL;
-import static org.apache.tuscany.sca.assembly.xml.Constants.WIRE_QNAME;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Callback;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.Wire;
-import org.apache.tuscany.sca.contribution.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.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.contribution.resolver.ResolverExtension;
-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.interfacedef.InterfaceContract;
-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.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.policy.util.PolicyComputationUtils;
-import org.apache.tuscany.sca.policy.util.PolicyValidationException;
-import org.apache.tuscany.sca.policy.util.PolicyValidationUtils;
-import org.w3c.dom.Document;
-
-/**
- * A composite processor.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor<Composite> {
- private XPathFactory xPathFactory;
- private IntentAttachPointTypeFactory intentAttachPointTypeFactory;
- private StAXAttributeProcessor<Object> extensionAttributeProcessor;
- private ContributionFactory contributionFactory;
-
-
- /**
- * Construct a new composite processor
- *
- * @param extensionPoints
- * @param extensionProcessor
- */
- public CompositeProcessor(ExtensionPointRegistry extensionPoints,
- StAXArtifactProcessor extensionProcessor,
- StAXAttributeProcessor extensionAttributeProcessor,
- Monitor monitor) {
-
- this(modelFactories(extensionPoints),
- extensionProcessor,
- extensionAttributeProcessor,
- monitor(extensionPoints));
-
- this.extensionAttributeProcessor = extensionAttributeProcessor;
- }
-
- /**
- * Constructs a new composite processor
- *
- * @param modelFactories
- * @param extensionProcessor
- * @param monitor
- */
- private CompositeProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor extensionProcessor,
- StAXAttributeProcessor extensionAttributeProcessor,
- Monitor monitor) {
-
- super(modelFactories, extensionProcessor, monitor);
- this.intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- this.xPathFactory = modelFactories.getFactory(XPathFactory.class);
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- this.extensionAttributeProcessor = extensionAttributeProcessor;
-
- }
-
- public Composite read(XMLStreamReader reader) throws ContributionReadException {
- Composite composite = null;
- Composite include = null;
- Component component = null;
- Property property = null;
- ComponentService componentService = null;
- ComponentReference componentReference = null;
- ComponentProperty componentProperty = null;
- CompositeService compositeService = null;
- CompositeReference compositeReference = null;
- Contract contract = null;
- Wire wire = null;
- Callback callback = null;
- QName name = null;
-
- try {
- // Read the composite document
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- name = reader.getName();
-
- if (COMPOSITE_QNAME.equals(name)) {
-
- // Read a <composite>
- composite = assemblyFactory.createComposite();
-
- composite.setName(new QName(getString(reader, TARGET_NAMESPACE), getString(reader, NAME)));
-
- if(!isSet(reader, TARGET_NAMESPACE)){
- // spec says that a composite must have a namespace
- warning("NoCompositeNamespace", composite, composite.getName().toString());
- }
-
- if(isSet(reader, AUTOWIRE)) {
- composite.setAutowire(getBoolean(reader, AUTOWIRE));
- }
-
- //handle extension attributes
- this.readExtendedAttributes(reader, name, composite, extensionAttributeProcessor);
-
- composite.setLocal(getBoolean(reader, LOCAL));
- composite.setConstrainingType(readConstrainingType(reader));
- policyProcessor.readPolicies(composite, reader);
-
- } else if (INCLUDE_QNAME.equals(name)) {
-
- // Read an <include>
- include = assemblyFactory.createComposite();
- include.setName(getQName(reader, NAME));
- include.setURI(getString(reader, URI));
- include.setUnresolved(true);
- composite.getIncludes().add(include);
-
- } else if (SERVICE_QNAME.equals(name)) {
- if (component != null) {
-
- // Read a <component><service>
- componentService = assemblyFactory.createComponentService();
- contract = componentService;
- componentService.setName(getString(reader, NAME));
-
- //handle extension attributes
- this.readExtendedAttributes(reader, name, componentService, extensionAttributeProcessor);
-
- component.getServices().add(componentService);
- policyProcessor.readPolicies(contract, reader);
- } else {
-
- // Read a <composite><service>
- compositeService = assemblyFactory.createCompositeService();
- contract = compositeService;
- compositeService.setName(getString(reader, NAME));
-
- String promoted = getString(reader, PROMOTE);
- if (promoted != null) {
- String promotedComponentName;
- String promotedServiceName;
- int s = promoted.indexOf('/');
- if (s == -1) {
- promotedComponentName = promoted;
- promotedServiceName = null;
- } else {
- promotedComponentName = promoted.substring(0, s);
- promotedServiceName = promoted.substring(s + 1);
- }
-
- Component promotedComponent = assemblyFactory.createComponent();
- promotedComponent.setUnresolved(true);
- promotedComponent.setName(promotedComponentName);
- compositeService.setPromotedComponent(promotedComponent);
-
- ComponentService promotedService = assemblyFactory.createComponentService();
- promotedService.setUnresolved(true);
- promotedService.setName(promotedServiceName);
- compositeService.setPromotedService(promotedService);
- }
-
- //handle extension attributes
- this.readExtendedAttributes(reader, name, compositeService, extensionAttributeProcessor);
-
- composite.getServices().add(compositeService);
- policyProcessor.readPolicies(contract, reader);
- }
-
- } else if (REFERENCE_QNAME.equals(name)) {
- if (component != null) {
- // Read a <component><reference>
- componentReference = assemblyFactory.createComponentReference();
- contract = componentReference;
- componentReference.setName(getString(reader, NAME));
- readMultiplicity(componentReference, reader);
- if (isSet(reader, AUTOWIRE)) {
- componentReference.setAutowire(getBoolean(reader, AUTOWIRE));
- }
- readTargets(componentReference, reader);
- componentReference.setWiredByImpl(getBoolean(reader, WIRED_BY_IMPL));
-
- //handle extension attributes
- this.readExtendedAttributes(reader, name, componentReference, extensionAttributeProcessor);
-
- component.getReferences().add(componentReference);
- policyProcessor.readPolicies(contract, reader);
- } else {
- // Read a <composite><reference>
- compositeReference = assemblyFactory.createCompositeReference();
- contract = compositeReference;
- compositeReference.setName(getString(reader, NAME));
- readMultiplicity(compositeReference, reader);
- readTargets(compositeReference, reader);
- String promote = reader.getAttributeValue(null, Constants.PROMOTE);
- if (promote != null) {
- for (StringTokenizer tokens = new StringTokenizer(promote); tokens.hasMoreTokens();) {
- ComponentReference promotedReference =
- assemblyFactory.createComponentReference();
- promotedReference.setUnresolved(true);
- promotedReference.setName(tokens.nextToken());
- compositeReference.getPromotedReferences().add(promotedReference);
- }
- }
- compositeReference.setWiredByImpl(getBoolean(reader, WIRED_BY_IMPL));
-
- //handle extension attributes
- this.readExtendedAttributes(reader, name, compositeReference, extensionAttributeProcessor);
-
- composite.getReferences().add(compositeReference);
- policyProcessor.readPolicies(contract, reader);
- }
-
- } else if (PROPERTY_QNAME.equals(name)) {
- if (component != null) {
-
- // Read a <component><property>
- componentProperty = assemblyFactory.createComponentProperty();
- property = componentProperty;
- String source = getString(reader, SOURCE);
- if(source!=null) {
- source = source.trim();
- }
- componentProperty.setSource(source);
- if (source != null) {
- // $<name>/...
- if (source.charAt(0) == '$') {
- int index = source.indexOf('/');
- if (index == -1) {
- // Tolerating $prop
- source = source + "/";
- index = source.length() - 1;
- }
- source = source.substring(index + 1);
- if ("".equals(source)) {
- source = ".";
- }
- }
- XPath xpath = xPathFactory.newXPath();
- xpath.setNamespaceContext(reader.getNamespaceContext());
- try {
- componentProperty.setSourceXPathExpression(xpath.compile(source));
- } catch (XPathExpressionException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", xpath, ce);
- //throw ce;
- }
- }
- componentProperty.setFile(getString(reader, FILE));
-
- //handle extension attributes
- this.readExtendedAttributes(reader, name, componentProperty, extensionAttributeProcessor);
-
- policyProcessor.readPolicies(property, reader);
- readAbstractProperty(componentProperty, reader);
-
- // Read the property value
- Document value = readPropertyValue(property.getXSDElement(), property.getXSDType(), reader);
- property.setValue(value);
-
- component.getProperties().add(componentProperty);
- } else {
-
- // Read a <composite><property>
- property = assemblyFactory.createProperty();
- policyProcessor.readPolicies(property, reader);
- readAbstractProperty(property, reader);
-
- // Read the property value
- Document value = readPropertyValue(property.getXSDElement(), property.getXSDType(), reader);
- property.setValue(value);
-
- composite.getProperties().add(property);
- }
-
- // TUSCANY-1949
- // If the property doesn't have a value, the END_ELEMENT event is read by the readPropertyValue
- if (reader.getEventType() == END_ELEMENT && PROPERTY_QNAME.equals(reader.getName())) {
- property = null;
- componentProperty = null;
- }
-
- } else if (COMPONENT_QNAME.equals(name)) {
-
- // Read a <component>
- component = assemblyFactory.createComponent();
- component.setName(getString(reader, NAME));
- if (isSet(reader, AUTOWIRE)) {
- component.setAutowire(getBoolean(reader, AUTOWIRE));
- }
- if (isSet(reader, URI)) {
- component.setURI(getString(reader, URI));
- }
-
- //handle extension attributes
- this.readExtendedAttributes(reader, name, component, extensionAttributeProcessor);
-
- component.setConstrainingType(readConstrainingType(reader));
- composite.getComponents().add(component);
- policyProcessor.readPolicies(component, reader);
-
- } else if (WIRE_QNAME.equals(name)) {
-
- // Read a <wire>
- wire = assemblyFactory.createWire();
- ComponentReference source = assemblyFactory.createComponentReference();
- source.setUnresolved(true);
- source.setName(getString(reader, SOURCE));
- wire.setSource(source);
-
- ComponentService target = assemblyFactory.createComponentService();
- target.setUnresolved(true);
- target.setName(getString(reader, TARGET));
- wire.setTarget(target);
-
- //handle extension attributes
- this.readExtendedAttributes(reader, name, wire, extensionAttributeProcessor);
-
- composite.getWires().add(wire);
- policyProcessor.readPolicies(wire, reader);
-
- } else if (CALLBACK_QNAME.equals(name)) {
-
- // Read a <callback>
- callback = assemblyFactory.createCallback();
- contract.setCallback(callback);
-
- //handle extension attributes
- this.readExtendedAttributes(reader, name, callback, extensionAttributeProcessor);
-
- policyProcessor.readPolicies(callback, reader);
-
- } else if (OPERATION_QNAME.equals(name)) {
-
- // Read an <operation>
- ConfiguredOperation operation = assemblyFactory.createConfiguredOperation();
- operation.setName(getString(reader, NAME));
- operation.setUnresolved(true);
- if (callback != null) {
- policyProcessor.readPolicies(operation, reader);
- } else {
- policyProcessor.readPolicies(operation, reader);
- }
-
- OperationsConfigurator opConfigurator = null;
- if ( compositeService != null ) {
- opConfigurator = compositeService;
- } else if ( componentService != null ) {
- opConfigurator = componentService;
- } else if ( compositeReference != null ) {
- opConfigurator = compositeReference;
- } else if ( componentReference != null ) {
- opConfigurator = componentReference;
- }
-
- opConfigurator.getConfiguredOperations().add(operation);
- } else if (IMPLEMENTATION_COMPOSITE_QNAME.equals(name)) {
-
- // Read an implementation.composite
- Composite implementation = assemblyFactory.createComposite();
- implementation.setName(getQName(reader, NAME));
- implementation.setUnresolved(true);
-
- //handle extension attributes
- this.readExtendedAttributes(reader, name, implementation, extensionAttributeProcessor);
-
- component.setImplementation(implementation);
- policyProcessor.readPolicies(implementation, reader);
- } else {
-
- // Read an extension element
- Object extension = extensionProcessor.read(reader);
- if (extension != null) {
- if (extension instanceof InterfaceContract) {
-
- // <service><interface> and
- // <reference><interface>
- if (contract != null) {
- contract.setInterfaceContract((InterfaceContract)extension);
- } else {
- if (name.getNamespaceURI().equals(SCA10_NS)) {
- error("UnexpectedInterfaceElement", extension);
- //throw new ContributionReadException("Unexpected <interface> element found. It should appear inside a <service> or <reference> element");
- } else {
- composite.getExtensions().add(extension);
- }
- }
- } else if (extension instanceof Binding) {
- if ( extension instanceof PolicySetAttachPoint ) {
- IntentAttachPointType bindingType = intentAttachPointTypeFactory.createBindingType();
- bindingType.setName(name);
- bindingType.setUnresolved(true);
- ((PolicySetAttachPoint)extension).setType(bindingType);
- }
- // <service><binding> and
- // <reference><binding>
- if (callback != null) {
- callback.getBindings().add((Binding)extension);
- } else {
- if (contract != null) {
- contract.getBindings().add((Binding)extension);
- } else {
- if (name.getNamespaceURI().equals(SCA10_NS)) {
- error("UnexpectedBindingElement", extension);
- //throw new ContributionReadException("Unexpected <binding> element found. It should appear inside a <service> or <reference> element");
- } else {
- composite.getExtensions().add(extension);
- }
- }
- }
-
- } else if (extension instanceof Implementation) {
- if ( extension instanceof PolicySetAttachPoint ) {
- IntentAttachPointType implType = intentAttachPointTypeFactory.createImplementationType();
- implType.setName(name);
- implType.setUnresolved(true);
- ((PolicySetAttachPoint)extension).setType(implType);
- }
- // <component><implementation>
- if (component != null) {
- component.setImplementation((Implementation)extension);
- } else {
- if (name.getNamespaceURI().equals(SCA10_NS)) {
- error("UnexpectedImplementationElement", extension);
- //throw new ContributionReadException("Unexpected <implementation> element found. It should appear inside a <component> element");
- } else {
- composite.getExtensions().add(extension);
- }
- }
- } else {
-
- // Add the extension element to the current
- // element
- if (callback != null) {
- callback.getExtensions().add(extension);
- } else if (contract != null) {
- contract.getExtensions().add(extension);
- } else if (property != null) {
- property.getExtensions().add(extension);
- } else if (component != null) {
- component.getExtensions().add(extension);
- } else {
- composite.getExtensions().add(extension);
- }
- }
- }
- }
- break;
-
- case XMLStreamConstants.CHARACTERS:
- break;
-
- case END_ELEMENT:
- name = reader.getName();
-
- // Clear current state when reading reaching end element
- if (SERVICE_QNAME.equals(name)) {
- componentService = null;
- compositeService = null;
- contract = null;
- } else if (INCLUDE_QNAME.equals(name)) {
- include = null;
- } else if (REFERENCE_QNAME.equals(name)) {
- componentReference = null;
- compositeReference = null;
- contract = null;
- } else if (PROPERTY_QNAME.equals(name)) {
- componentProperty = null;
- property = null;
- } else if (COMPONENT_QNAME.equals(name)) {
- component = null;
- } else if (WIRE_QNAME.equals(name)) {
- wire = null;
- } else if (CALLBACK_QNAME.equals(name)) {
- callback = null;
- }
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- }
- catch (XMLStreamException e) {
- ContributionReadException ex = new ContributionReadException(e);
- error("XMLStreamException", reader, ex);
- }
-
- return composite;
- }
-
- public void write(Composite composite, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <composite> element
- writeStartDocument(writer,
- COMPOSITE,
- writeConstrainingType(composite),
- new XAttr(TARGET_NAMESPACE, composite.getName().getNamespaceURI()),
- new XAttr(NAME, composite.getName().getLocalPart()),
- new XAttr(LOCAL, composite.isLocal() ? Boolean.TRUE : null),
- new XAttr(AUTOWIRE, composite.getAutowire()),
- policyProcessor.writePolicies(composite));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, composite, extensionAttributeProcessor);
-
- // Write <include> elements
- for (Composite include : composite.getIncludes()) {
- String uri = include.isUnresolved()? include.getURI() : null;
- writeStart(writer,
- INCLUDE,
- new XAttr(NAME, include.getName()),
- new XAttr(URI, uri));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, include, extensionAttributeProcessor);
-
- writeEnd(writer);
- }
-
- // Write <service> elements
- for (Service service : composite.getServices()) {
- CompositeService compositeService = (CompositeService)service;
- Component promotedComponent = compositeService.getPromotedComponent();
- ComponentService promotedService = compositeService.getPromotedService();
- String promote;
- if (promotedService != null) {
- if (promotedService.getName() != null) {
- promote = promotedComponent.getName() + '/' + promotedService.getName();
- } else {
- promote = promotedComponent.getName();
- }
- } else {
- promote = null;
- }
- writeStart(writer, SERVICE, new XAttr(NAME, service.getName()), new XAttr(PROMOTE, promote),
- policyProcessor.writePolicies(service));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, service, extensionAttributeProcessor);
-
-
- // Write service interface
- extensionProcessor.write(service.getInterfaceContract(), writer);
-
- // Write bindings
- for (Binding binding : service.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
-
- // Write <callback> element
- if (service.getCallback() != null) {
- Callback callback = service.getCallback();
- writeStart(writer, CALLBACK,
- policyProcessor.writePolicies(callback));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, callback, extensionAttributeProcessor);
-
- // Write callback bindings
- for (Binding binding : callback.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
-
- // Write extensions
- for (Object extension : callback.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write extensions
- for (Object extension : service.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write <component> elements
- for (Component component : composite.getComponents()) {
- writeStart(writer, COMPONENT, new XAttr(NAME, component.getName()),
- new XAttr(URI, component.getURI()),
- new XAttr(AUTOWIRE, component.getAutowire()),
- policyProcessor.writePolicies(component));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, component, extensionAttributeProcessor);
-
- // Write the component implementation
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- writeStart(writer, IMPLEMENTATION_COMPOSITE, new XAttr(NAME, ((Composite)implementation).getName()));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, (Composite)implementation, extensionAttributeProcessor);
-
- writeEnd(writer);
- } else {
- extensionProcessor.write(component.getImplementation(), writer);
- }
-
- for (Object extension : component.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- // Write <service> elements
- for (ComponentService service : component.getServices()) {
- writeStart(writer, SERVICE, new XAttr(NAME, service.getName()),
- policyProcessor.writePolicies(service));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, service, extensionAttributeProcessor);
-
- // Write service interface
- extensionProcessor.write(service.getInterfaceContract(), writer);
-
- // Write bindings
- for (Binding binding : service.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
-
- // Write <callback> element
- if (service.getCallback() != null) {
- Callback callback = service.getCallback();
- writeStart(writer, CALLBACK, policyProcessor.writePolicies(callback));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, callback, extensionAttributeProcessor);
-
- // Write bindings
- for (Binding binding : callback.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
-
- // Write extensions
- for (Object extension : callback.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write extensions
- for (Object extension : service.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write <reference> elements
- for (ComponentReference reference : component.getReferences()) {
- writeStart(writer, REFERENCE, new XAttr(NAME, reference.getName()),
- new XAttr(AUTOWIRE, reference.getAutowire()),
- writeMultiplicity(reference),
- writeTargets(reference),
- policyProcessor.writePolicies(reference));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, reference, extensionAttributeProcessor);
-
- // Write reference interface
- extensionProcessor.write(reference.getInterfaceContract(), writer);
-
- // Write bindings
- for (Binding binding : reference.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
-
- // Write callback
- if (reference.getCallback() != null) {
- Callback callback = reference.getCallback();
- writeStart(writer, CALLBACK, policyProcessor.writePolicies(callback));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, callback, extensionAttributeProcessor);
-
- // Write callback bindings
- for (Binding binding : callback.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
-
- // Write extensions
- for (Object extensions : callback.getExtensions()) {
- extensionProcessor.write(extensions, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write extensions
- for (Object extensions : reference.getExtensions()) {
- extensionProcessor.write(extensions, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write <property> elements
- for (ComponentProperty property : component.getProperties()) {
- writeStart(writer,
- PROPERTY,
- new XAttr(NAME, property.getName()),
- new XAttr(MUST_SUPPLY, property.isMustSupply()),
- new XAttr(MANY, property.isMany()),
- new XAttr(TYPE, property.getXSDType()),
- new XAttr(ELEMENT, property.getXSDElement()),
- new XAttr(SOURCE, property.getSource()),
- new XAttr(FILE, property.getFile()),
- policyProcessor.writePolicies(property));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, property, extensionAttributeProcessor);
-
- // Write property value
- writePropertyValue(property.getValue(), property.getXSDElement(), property.getXSDType(), writer);
-
- // Write extensions
- for (Object extension : property.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- writeEnd(writer);
- }
-
- // Write <reference> elements
- for (Reference reference : composite.getReferences()) {
- CompositeReference compositeReference = (CompositeReference)reference;
-
- // Write list of promoted references
- List<String> promote = new ArrayList<String>();
- for (ComponentReference promoted: compositeReference.getPromotedReferences()) {
- promote.add(promoted.getName());
- }
-
- // Write <reference> element
- writeStart(writer, REFERENCE, new XAttr(NAME, reference.getName()),
- new XAttr(PROMOTE, promote),
- writeMultiplicity(reference),
- policyProcessor.writePolicies(reference));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, reference, extensionAttributeProcessor);
-
- // Write reference interface
- extensionProcessor.write(reference.getInterfaceContract(), writer);
-
- // Write bindings
- for (Binding binding : reference.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
-
- // Write <callback> element
- if (reference.getCallback() != null) {
- Callback callback = reference.getCallback();
- writeStart(writer, CALLBACK);
-
- //write extended attributes
- this.writeExtendedAttributes(writer, callback, extensionAttributeProcessor);
-
- // Write callback bindings
- for (Binding binding : callback.getBindings()) {
- extensionProcessor.write(binding, writer);
- }
-
- // Write extensions
- for (Object extension : callback.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write extensions
- for (Object extension : reference.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write <property> elements
- for (Property property : composite.getProperties()) {
- writeStart(writer,
- PROPERTY,
- new XAttr(NAME, property.getName()),
- new XAttr(MUST_SUPPLY, property.isMustSupply()),
- new XAttr(MANY, property.isMany()),
- new XAttr(TYPE, property.getXSDType()),
- new XAttr(ELEMENT, property.getXSDElement()),
- policyProcessor.writePolicies(property));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, property, extensionAttributeProcessor);
-
- // Write property value
- writePropertyValue(property.getValue(), property.getXSDElement(), property.getXSDType(), writer);
-
- // Write extensions
- for (Object extension : property.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write <wire> elements
- for (Wire wire : composite.getWires()) {
- writeStart(writer, WIRE, new XAttr(SOURCE, wire.getSource().getName()), new XAttr(TARGET, wire
- .getTarget().getName()));
-
- //write extended attributes
- this.writeExtendedAttributes(writer, wire, extensionAttributeProcessor);
-
- // Write extensions
- for (Object extension : wire.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
- writeEnd(writer);
- }
-
- for (Object extension : composite.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEndDocument(writer);
- }
-
- public void resolve(Composite composite, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve constraining type
- ConstrainingType constrainingType = composite.getConstrainingType();
- if (constrainingType != null) {
- constrainingType = resolver.resolveModel(ConstrainingType.class, constrainingType);
- composite.setConstrainingType(constrainingType);
- }
-
- // Resolve includes in the composite
- for (int i = 0, n = composite.getIncludes().size(); i < n; i++) {
- Composite include = composite.getIncludes().get(i);
- if (include != null) {
- include = resolver.resolveModel(Composite.class, include);
- composite.getIncludes().set(i, include);
- }
- }
-
- // Resolve extensions
- for (Object extension : composite.getExtensions()) {
- if (extension != null) {
- extensionProcessor.resolve(extension, resolver);
- }
- }
-
- //resolve intents and policy sets
- List<Intent> compositeIntents = null;
- List<PolicySet> compositePolicySets = null;
- List<PolicySet> compositeApplicablePolicySets = null;
- resolveIntents(composite.getRequiredIntents(), resolver);
- resolvePolicySets(composite.getPolicySets(), resolver);
- resolvePolicySets(composite.getApplicablePolicySets(), resolver);
- compositeIntents = composite.getRequiredIntents();
- compositePolicySets = composite.getPolicySets();
- compositeApplicablePolicySets = composite.getApplicablePolicySets();
-
- //Resolve composite services and references
- resolveContracts(composite, composite.getServices(), resolver);
- resolveContracts(composite, composite.getReferences(), resolver);
-
- // Resolve component implementations, services and references
- for (Component component : composite.getComponents()) {
- constrainingType = component.getConstrainingType();
- if (constrainingType != null) {
- constrainingType = resolver.resolveModel(ConstrainingType.class, constrainingType);
- component.setConstrainingType(constrainingType);
- }
-
- //resolve intents and policy sets
- resolveIntents(component.getRequiredIntents(), resolver);
- resolvePolicySets(component.getPolicySets(), resolver);
- resolvePolicySets(component.getApplicablePolicySets(), resolver);
-
- //inherit composite intents and policysets
- PolicyComputationUtils.addDefaultPolicies(compositeIntents,
- compositePolicySets,
- component.getRequiredIntents(),
- component.getPolicySets());
-
- addInheritedPolicySets(compositeApplicablePolicySets, component.getApplicablePolicySets());
-
- //resolve component services and references
- resolveContracts(component, component.getServices(), resolver);
- resolveContracts(component, component.getReferences(), resolver);
-
- for (ComponentProperty componentProperty : component.getProperties()) {
- if (componentProperty.getFile() != null) {
- Artifact artifact = contributionFactory.createArtifact();
- artifact.setURI(componentProperty.getFile());
- artifact = resolver.resolveModel(Artifact.class, artifact);
- if (artifact.getLocation() != null) {
- componentProperty.setFile(artifact.getLocation());
- }
- }
- }
-
- //resolve component implementation
- Implementation implementation = component.getImplementation();
- if (implementation != null) {
- try {
- //resolve intents and policysets specified on this implementation
- //before copying them over to the component. Before that, from the component
- //copy over the applicablePolicySets alone as it might have to be
- //used to validate the policysets specified on the implementation
-
- resolveImplIntentsAndPolicySets(implementation,
- component.getApplicablePolicySets(),
- resolver);
-
- copyPoliciesToComponent(component, implementation, resolver, true);
-
- //now resolve the implementation so that even if there is a shared instance
- //for this that is resolved, the specified intents and policysets are safe in the
- //component and not lost
- implementation = resolveImplementation(implementation, resolver);
-
- //resolved implementation may contain intents and policysets specified at
- //componentType (either in the componentType side file or in annotations if its a
- //java implementation). This has to be consolidated in to the component.
- copyPoliciesToComponent(component, implementation, resolver, false);
-
- component.setImplementation(implementation);
- } catch ( PolicyValidationException e ) {
- error("PolicyImplValidationException", resolver, component.getName(), e.getMessage());
- //throw new ContributionResolveException("PolicyValidation exception when processing implementation of component '"
- //+ component.getName() + "' due to " + e.getMessage(), e);
- }
-
- }
-
- //add model resolver to component
- if (component instanceof ResolverExtension) {
- ((ResolverExtension)component).setModelResolver(resolver);
- }
- }
-
- // Add model resolver to promoted components
- for (Service service : composite.getServices()) {
- CompositeService compositeService = (CompositeService)service;
- Component promotedComponent = compositeService.getPromotedComponent();
- if (promotedComponent instanceof ResolverExtension) {
- ((ResolverExtension)promotedComponent).setModelResolver(resolver);
- }
- }
- }
-
- private void resolveImplIntentsAndPolicySets(Implementation implementation,
- List<PolicySet> inheritedApplicablePolicySets,
- ModelResolver resolver) throws ContributionResolveException,
- PolicyValidationException
- {
- if ( implementation instanceof PolicySetAttachPoint ) {
- PolicySetAttachPoint policiedImpl = (PolicySetAttachPoint)implementation;
-
- policiedImpl.getApplicablePolicySets().addAll(inheritedApplicablePolicySets);
-
- resolveIntents(policiedImpl.getRequiredIntents(), resolver);
- PolicyValidationUtils.validateIntents(policiedImpl, policiedImpl.getType());
-
- resolvePolicySets(policiedImpl.getPolicySets(), resolver);
- resolvePolicySets(policiedImpl.getApplicablePolicySets(), resolver);
-
- PolicyValidationUtils.validatePolicySets(policiedImpl);
-
- if ( implementation instanceof OperationsConfigurator ) {
- for ( ConfiguredOperation implConfOp : ((OperationsConfigurator)implementation).getConfiguredOperations() ) {
- resolveIntents(implConfOp.getRequiredIntents(), resolver);
- PolicyValidationUtils.validateIntents(implConfOp, policiedImpl.getType());
-
- resolvePolicySets(implConfOp.getPolicySets(), resolver);
- resolvePolicySets(implConfOp.getApplicablePolicySets(), resolver);
- //add the inherited applicablePolicysets
- addInheritedPolicySets(policiedImpl.getApplicablePolicySets(), implConfOp.getApplicablePolicySets());
-
- PolicyValidationUtils.validatePolicySets(implConfOp, policiedImpl.getType());
-
- PolicyComputationUtils.addDefaultPolicies(
- ((PolicySetAttachPoint)implementation).getRequiredIntents(),
- ((PolicySetAttachPoint)implementation).getPolicySets(),
- implConfOp.getRequiredIntents(),
- implConfOp.getPolicySets());
- }
- }
- }
- }
-
- private void copyPoliciesToComponent(Component component,
- Implementation implementation,
- ModelResolver resolver,
- boolean clearImplSettings) throws ContributionResolveException {
- if (implementation instanceof PolicySetAttachPoint) {
- // Add implementation policies into component, since implementation instances are
- // reused and it's likely that this implementation instance will not hold after its resolution.
- // On the first call to this method (clearImplSettings=true), we are moving policies from the
- // implementation XML element up to the component. In this case if there are mutually exclusive
- // policies we must clear the component policy so that the implementation policy "wins".
- // On the second call to this method (clearImplSettings=false), we are moving policies from the
- // componentType implementation up to the component. In this case if there are mutually
- // exclusive policies it is an error. This error will be detected later in the PolicyComputer.
- if (clearImplSettings) {
- for (Intent intent : ((PolicySetAttachPoint)implementation).getRequiredIntents()) {
- for (Intent excluded : intent.getExcludedIntents()) {
- if (component.getRequiredIntents().contains(excluded)) {
- component.getRequiredIntents().remove(excluded);
- }
- for (Iterator<PolicySet> i = component.getPolicySets().iterator(); i.hasNext(); ) {
- PolicySet cmpPolicySet = i.next();
- if (cmpPolicySet.getProvidedIntents().contains(excluded)) {
- i.remove();
- }
- }
- }
- }
- for (PolicySet policySet : ((PolicySetAttachPoint)implementation).getPolicySets()) {
- for (Intent intent : policySet.getProvidedIntents()) {
- for (Intent excluded : intent.getExcludedIntents()) {
- if (component.getRequiredIntents().contains(excluded)) {
- component.getRequiredIntents().remove(excluded);
- }
- for (Iterator<PolicySet> i = component.getPolicySets().iterator(); i.hasNext(); ) {
- PolicySet cmpPolicySet = i.next();
- if (cmpPolicySet.getProvidedIntents().contains(excluded)) {
- i.remove();
- }
- }
- }
- }
- }
- }
- component.getRequiredIntents().addAll(((PolicySetAttachPoint)implementation).getRequiredIntents());
- component.getPolicySets().addAll(((PolicySetAttachPoint)implementation).getPolicySets());
- component.getApplicablePolicySets().addAll(((PolicySetAttachPoint)implementation).getApplicablePolicySets());
-
- if ( implementation instanceof OperationsConfigurator ) {
- boolean notFound;
- List<ConfiguredOperation> opsFromImplementation = new ArrayList<ConfiguredOperation>();
- List<ConfiguredOperation> implConfOperations =
- new ArrayList<ConfiguredOperation>(((OperationsConfigurator)implementation).getConfiguredOperations());
- for ( ConfiguredOperation implConfOp : implConfOperations ) {
- notFound = true;
- for ( ConfiguredOperation compConfOp : ((OperationsConfigurator)component).getConfiguredOperations() ) {
- if ( implConfOp.getName().equals(compConfOp.getName()) ) {
- notFound = false;
-
- if (clearImplSettings) {
- for (Intent intent : implConfOp.getRequiredIntents()) {
- for (Intent excluded : intent.getExcludedIntents()) {
- if (compConfOp.getRequiredIntents().contains(excluded)) {
- compConfOp.getRequiredIntents().remove(excluded);
- }
- }
- }
- for (PolicySet policySet : implConfOp.getPolicySets()) {
- for (Intent intent : policySet.getProvidedIntents()) {
- for (Intent excluded : intent.getExcludedIntents()) {
- if (compConfOp.getRequiredIntents().contains(excluded)) {
- compConfOp.getRequiredIntents().remove(excluded);
- }
- for (Iterator<PolicySet> i = compConfOp.getPolicySets().iterator(); i.hasNext(); ) {
- PolicySet cmpPolicySet = i.next();
- if (cmpPolicySet.getProvidedIntents().contains(excluded)) {
- i.remove();
- }
- }
- }
- }
- }
- }
-
- addInheritedIntents(implConfOp.getRequiredIntents(), compConfOp.getRequiredIntents());
- addInheritedPolicySets(implConfOp.getPolicySets(), compConfOp.getPolicySets());
- addInheritedPolicySets(implConfOp.getApplicablePolicySets(), compConfOp.getApplicablePolicySets());
- }
- }
-
- if ( notFound ) {
- opsFromImplementation.add(implConfOp);
- }
-
- if ( clearImplSettings ) {
- ((OperationsConfigurator)implementation).getConfiguredOperations().remove(implConfOp);
- }
- }
- ((OperationsConfigurator)component).getConfiguredOperations().addAll(opsFromImplementation);
- }
-
- if ( clearImplSettings ) {
- ((PolicySetAttachPoint)implementation).getRequiredIntents().clear();
- ((PolicySetAttachPoint)implementation).getPolicySets().clear();
- }
- }
- }
-
-
- public QName getArtifactType() {
- return COMPOSITE_QNAME;
- }
-
- public Class<Composite> getModelType() {
- return Composite.class;
- }
-
- /**
- * Returns the model factory extension point to use.
- *
- * @param extensionPoints
- * @return
- */
- private static FactoryExtensionPoint modelFactories(ExtensionPointRegistry extensionPoints) {
- return extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- }
-
- /**
- * Returns the monitor to use.
- *
- * @param extensionPoints
- * @return
- */
- private static Monitor monitor(ExtensionPointRegistry extensionPoints) {
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- if (utilities != null) {
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- if (monitorFactory != null) {
- return monitorFactory.createMonitor();
- }
- }
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConfiguredOperationProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConfiguredOperationProcessor.java
deleted file mode 100644
index aed535cf0d..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConfiguredOperationProcessor.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static org.apache.tuscany.sca.assembly.xml.Constants.NAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.OPERATION;
-import static org.apache.tuscany.sca.assembly.xml.Constants.OPERATION_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SERVICE;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-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.policy.PolicyFactory;
-
-/**
- * Processor for dealing with 'operation' elements from composite definitions
- *
- * @version $Rev$ $Date$
- */
-public class ConfiguredOperationProcessor implements StAXArtifactProcessor<ConfiguredOperation> {
-
- private AssemblyFactory assemblyFactory;
- private PolicyAttachPointProcessor policyProcessor;
- private PolicyFactory policyFactory;
- private Monitor monitor;
-
- public ConfiguredOperationProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- this.monitor = monitor;
- }
-
- public ConfiguredOperation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- ConfiguredOperation configuredOp = assemblyFactory.createConfiguredOperation();
-
- //Read an <operation>
- configuredOp.setName(reader.getAttributeValue(null, NAME));
- configuredOp.setContractName(reader.getAttributeValue(null, SERVICE));
- configuredOp.setUnresolved(true);
-
- // Read policies
- policyProcessor.readPolicies(configuredOp, reader);
-
- //Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && OPERATION_QNAME.equals(reader.getName())) {
- break;
- }
- }
-
- return configuredOp;
- }
-
- public void write(ConfiguredOperation configuredOperation, XMLStreamWriter writer)
- throws ContributionWriteException, XMLStreamException {
-
- // Write an <operation>
- policyProcessor.writePolicyPrefixes(configuredOperation, writer);
- writer.writeStartElement(Constants.SCA10_NS, OPERATION);
- policyProcessor.writePolicyAttributes(configuredOperation, writer);
-
- writer.writeAttribute(NAME, configuredOperation.getName());
- if ( configuredOperation.getContractName() != null ) {
- writer.writeAttribute(SERVICE, configuredOperation.getContractName());
- }
- writer.writeEndElement();
- }
-
- public void resolve(ConfiguredOperation configuredOperation, ModelResolver resolver)
- throws ContributionResolveException {
- }
-
- public QName getArtifactType() {
- return OPERATION_QNAME;
- }
-
- public Class<ConfiguredOperation> getModelType() {
- return ConfiguredOperation.class;
- }
-
-}
-
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java
deleted file mode 100644
index 3bf5a1173b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import javax.xml.namespace.QName;
-
-/**
- * Constants used in SCA assembly XML files.
- *
- * @version $Rev$ $Date$
- */
-public interface Constants {
- String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
-
- String COMPONENT_TYPE = "componentType";
- QName COMPONENT_TYPE_QNAME = new QName(SCA10_NS, COMPONENT_TYPE);
-
- String SERVICE = "service";
- QName SERVICE_QNAME = new QName(SCA10_NS, SERVICE);
-
- String REFERENCE = "reference";
- QName REFERENCE_QNAME = new QName(SCA10_NS, REFERENCE);
-
- String PROPERTY = "property";
- QName PROPERTY_QNAME = new QName(SCA10_NS, PROPERTY);
-
- String CONSTRAINING_TYPE = "constrainingType";
- QName CONSTRAINING_TYPE_QNAME = new QName(SCA10_NS, CONSTRAINING_TYPE);
-
- String COMPOSITE = "composite";
- QName COMPOSITE_QNAME = new QName(SCA10_NS, COMPOSITE);
-
- String INCLUDE = "include";
- QName INCLUDE_QNAME = new QName(SCA10_NS, INCLUDE);
-
- String COMPONENT = "component";
- QName COMPONENT_QNAME = new QName(SCA10_NS, COMPONENT);
-
- String WIRE = "wire";
- QName WIRE_QNAME = new QName(SCA10_NS, WIRE);
-
- String OPERATION = "operation";
- QName OPERATION_QNAME = new QName(SCA10_NS, OPERATION);
-
- String CALLBACK = "callback";
- QName CALLBACK_QNAME = new QName(SCA10_NS, CALLBACK);
-
- String IMPLEMENTATION_COMPOSITE = "implementation.composite";
- QName IMPLEMENTATION_COMPOSITE_QNAME = new QName(SCA10_NS, IMPLEMENTATION_COMPOSITE);
-
- String IMPLEMENTATION = "implementation";
- QName IMPLEMENTATION_QNAME = new QName(SCA10_NS, IMPLEMENTATION);
-
- String BINDING_SCA = "binding.sca";
- QName BINDING_SCA_QNAME = new QName(Constants.SCA10_NS, BINDING_SCA);
-
- String NAME = "name";
- String TARGET_NAMESPACE = "targetNamespace";
- String LOCAL = "local";
- String AUTOWIRE = "autowire";
- 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/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java
deleted file mode 100644
index 401fa7123e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A contrainingType content handler.
- *
- * @version $Rev$ $Date$
- */
-public class ConstrainingTypeDocumentProcessor extends BaseAssemblyProcessor implements URLArtifactProcessor<ConstrainingType> {
- private XMLInputFactory inputFactory;
-
- /**
- * Constructs a new constrainingType processor.
- * @param modelFactories
- * @param staxProcessor
- */
- public ConstrainingTypeDocumentProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor staxProcessor,
- Monitor monitor) {
- super(modelFactories, staxProcessor, monitor);
- this.inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class);
- }
-
- public ConstrainingType read(URL contributionURL, URI uri, URL url) throws ContributionReadException {
- InputStream urlStream = null;
- try {
-
- // Create a stream reader
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- urlStream = connection.getInputStream();
- XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
- reader.nextTag();
-
- // Read the constrainingType model
- ConstrainingType constrainingType = (ConstrainingType)extensionProcessor.read(reader);
-
- // For debugging purposes, write it back to XML
-// if (constrainingType != null) {
-// try {
-// ByteArrayOutputStream bos = new ByteArrayOutputStream();
-// XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
-// outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
-// extensionProcessor.write(constrainingType, outputFactory.createXMLStreamWriter(bos));
-// Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(bos.toByteArray()));
-// OutputFormat format = new OutputFormat();
-// format.setIndenting(true);
-// format.setIndent(2);
-// XMLSerializer serializer = new XMLSerializer(System.out, format);
-// serializer.serialize(document);
-// } catch (Exception e) {
-// e.printStackTrace();
-// }
-// }
-
- return constrainingType;
-
- } catch (XMLStreamException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", inputFactory, ce);
- throw ce;
- } catch (IOException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", inputFactory, ce);
- throw ce;
- } finally {
- try {
- if (urlStream != null) {
- urlStream.close();
- urlStream = null;
- }
- } catch (IOException ioe) {
- //ignore
- }
- }
- }
-
- public void resolve(ConstrainingType constrainingType, ModelResolver resolver) throws ContributionResolveException {
- extensionProcessor.resolve(constrainingType, resolver);
- }
-
- public String getArtifactType() {
- return ".constrainingType";
- }
-
- public Class<ConstrainingType> getModelType() {
- return ConstrainingType.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeModelResolver.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeModelResolver.java
deleted file mode 100644
index d73ce5ab66..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeModelResolver.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-
-/**
- * A Model Resolver for ConstrainingType models.
- *
- * @version $Rev$ $Date$
- */
-public class ConstrainingTypeModelResolver implements ModelResolver {
-
- private Contribution contribution;
- private Map<QName, ConstrainingType> map = new HashMap<QName, ConstrainingType>();
-
- public ConstrainingTypeModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- }
-
- public void addModel(Object resolved) {
- ConstrainingType composite = (ConstrainingType)resolved;
- map.put(composite.getName(), composite);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(((ConstrainingType)resolved).getName());
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
-
- // Lookup a definition for the given namespace
- QName qname = ((ConstrainingType)unresolved).getName();
- ConstrainingType resolved = (ConstrainingType) map.get(qname);
- if (resolved != null) {
- return modelClass.cast(resolved);
- }
-
- // No definition found, delegate the resolution to the imports
- for (Import import_ : this.contribution.getImports()) {
- if (import_ instanceof NamespaceImport) {
- NamespaceImport namespaceImport = (NamespaceImport)import_;
- if (namespaceImport.getNamespace().equals(qname.getNamespaceURI())) {
-
- // Delegate the resolution to the import resolver
- resolved = namespaceImport.getModelResolver().resolveModel(ConstrainingType.class, (ConstrainingType)unresolved);
- if (!resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- }
- }
- return (T)unresolved;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java
deleted file mode 100644
index d6c1b278bb..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-import static org.apache.tuscany.sca.assembly.xml.Constants.CONSTRAINING_TYPE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.CONSTRAINING_TYPE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.ELEMENT;
-import static org.apache.tuscany.sca.assembly.xml.Constants.MANY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.MUST_SUPPLY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.NAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.OPERATION_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.PROPERTY;
-import static org.apache.tuscany.sca.assembly.xml.Constants.PROPERTY_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.REFERENCE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.REFERENCE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SERVICE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SERVICE_QNAME;
-import static org.apache.tuscany.sca.assembly.xml.Constants.TARGET_NAMESPACE;
-import static org.apache.tuscany.sca.assembly.xml.Constants.TYPE;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.assembly.AbstractProperty;
-import org.apache.tuscany.sca.assembly.AbstractReference;
-import org.apache.tuscany.sca.assembly.AbstractService;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-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.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.w3c.dom.Document;
-
-/**
- * A constrainingType processor.
- *
- * @version $Rev$ $Date$
- */
-public class ConstrainingTypeProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor<ConstrainingType> {
-
- /**
- * Constructs a new constrainingType processor.
- *
- * @param modelFactories
- * @param extensionProcessor
- */
- public ConstrainingTypeProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor extensionProcessor,
- Monitor monitor) {
- super(modelFactories, extensionProcessor, monitor);
- }
-
- public ConstrainingType read(XMLStreamReader reader) throws ContributionReadException {
- ConstrainingType constrainingType = null;
- AbstractService abstractService = null;
- AbstractReference abstractReference = null;
- AbstractProperty abstractProperty = null;
- AbstractContract abstractContract = null;
- QName name = null;
-
- try {
- // Read the constrainingType document
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
-
- case START_ELEMENT:
- name = reader.getName();
-
- // Read a <constrainingType>
- if (Constants.CONSTRAINING_TYPE_QNAME.equals(name)) {
- constrainingType = assemblyFactory.createConstrainingType();
- constrainingType.setName(new QName(getString(reader, TARGET_NAMESPACE), getString(reader, NAME)));
- policyProcessor.readPolicies(constrainingType, reader);
-
- } else if (Constants.SERVICE_QNAME.equals(name)) {
-
- // Read a <service>
- abstractService = assemblyFactory.createAbstractService();
- abstractContract = abstractService;
- abstractService.setName(getString(reader, Constants.NAME));
- constrainingType.getServices().add(abstractService);
- policyProcessor.readPolicies(abstractService, reader);
-
- } else if (Constants.REFERENCE_QNAME.equals(name)) {
-
- // Read a <reference>
- abstractReference = assemblyFactory.createAbstractReference();
- abstractContract = abstractReference;
- abstractReference.setName(getString(reader, Constants.NAME));
- readMultiplicity(abstractReference, reader);
- constrainingType.getReferences().add(abstractReference);
- policyProcessor.readPolicies(abstractReference, reader);
-
- } else if (Constants.PROPERTY_QNAME.equals(name)) {
-
- // Read a <property>
- abstractProperty = assemblyFactory.createAbstractProperty();
- readAbstractProperty(abstractProperty, reader);
-
- // Read the property value
- Document value = readPropertyValue(abstractProperty.getXSDElement(), abstractProperty.getXSDType(), reader);
- abstractProperty.setValue(value);
-
- constrainingType.getProperties().add(abstractProperty);
- policyProcessor.readPolicies(abstractProperty, reader);
-
- } else if (OPERATION_QNAME.equals(name)) {
-
- // Read an <operation>
- Operation operation = new OperationImpl();
- operation.setName(getString(reader, NAME));
- operation.setUnresolved(true);
- policyProcessor.readPolicies(abstractContract, operation, reader);
-
- } else {
-
- // Read an extension element
- Object extension = extensionProcessor.read(reader);
- if (extension instanceof InterfaceContract) {
-
- // <service><interface> and <reference><interface>
- abstractContract.setInterfaceContract((InterfaceContract)extension);
- } else {
-
- // Add the extension element to the current element
- if (abstractContract != null) {
- abstractContract.getExtensions().add(extension);
- } else {
- constrainingType.getExtensions().add(extension);
- }
-
- }
- }
- break;
-
- case END_ELEMENT:
- name = reader.getName();
-
- // Clear current state when reading reaching end element
- if (SERVICE_QNAME.equals(name)) {
- abstractService = null;
- abstractContract = null;
- } else if (REFERENCE_QNAME.equals(name)) {
- abstractReference = null;
- abstractContract = null;
- } else if (PROPERTY_QNAME.equals(name)) {
- abstractProperty = null;
- }
- break;
- }
- if (reader.hasNext()) {
- reader.next();
- }
- }
- }
- catch (XMLStreamException e) {
- ContributionReadException ex = new ContributionReadException(e);
- error("XMLStreamException", reader, ex);
- }
-
- return constrainingType;
- }
-
- public void write(ConstrainingType constrainingType, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <constrainingType> element
- writeStartDocument(writer, CONSTRAINING_TYPE,
- new XAttr(TARGET_NAMESPACE, constrainingType.getName().getNamespaceURI()),
- new XAttr(NAME, constrainingType.getName().getLocalPart()),
- policyProcessor.writePolicies(constrainingType));
-
- // Write <service> elements
- for (AbstractService service : constrainingType.getServices()) {
- writeStart(writer, SERVICE, new XAttr(NAME, service.getName()),
- policyProcessor.writePolicies(service));
-
- extensionProcessor.write(service.getInterfaceContract(), writer);
-
- for (Object extension: service.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write <reference> elements
- for (AbstractReference reference : constrainingType.getReferences()) {
- writeStart(writer, REFERENCE, new XAttr(NAME, reference.getName()),
- writeMultiplicity(reference),
- policyProcessor.writePolicies(reference));
-
- extensionProcessor.write(reference.getInterfaceContract(), writer);
-
- for (Object extension: reference.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write <property> elements
- for (AbstractProperty abstractProperty : constrainingType.getProperties()) {
- writeStart(writer,
- PROPERTY,
- new XAttr(NAME, abstractProperty.getName()),
- new XAttr(MUST_SUPPLY, abstractProperty.isMustSupply()),
- new XAttr(MANY, abstractProperty.isMany()),
- new XAttr(TYPE, abstractProperty.getXSDType()),
- new XAttr(ELEMENT, abstractProperty.getXSDElement()),
- policyProcessor.writePolicies(abstractProperty));
-
- // Write property value
- writePropertyValue(abstractProperty.getValue(), abstractProperty.getXSDElement(), abstractProperty.getXSDType(), writer);
-
- // Write extensions
- for (Object extension : abstractProperty.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEnd(writer);
- }
-
- // Write extension elements
- for (Object extension: constrainingType.getExtensions()) {
- extensionProcessor.write(extension, writer);
- }
-
- writeEndDocument(writer);
- }
-
- public void resolve(ConstrainingType constrainingType, ModelResolver resolver) throws ContributionResolveException {
- // Resolve component type services and references
- resolveAbstractContracts(constrainingType.getServices(), resolver);
- resolveAbstractContracts(constrainingType.getReferences(), resolver);
-
- resolveIntents(constrainingType.getRequiredIntents(), resolver);
- for ( AbstractService service : constrainingType.getServices() ) {
- resolveIntents(service.getRequiredIntents(), resolver);
- }
-
- for ( AbstractReference reference : constrainingType.getReferences() ) {
- resolveIntents(reference.getRequiredIntents(), resolver);
- }
- }
-
- public QName getArtifactType() {
- return CONSTRAINING_TYPE_QNAME;
- }
-
- public Class<ConstrainingType> getModelType() {
- return ConstrainingType.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java
deleted file mode 100644
index b29910e215..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-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.Base;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Implementation;
-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.policy.PolicySetAttachPoint;
-
-/**
- * Default Model Processor for beans.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultBeanModelProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor {
-
- private QName artifactType;
- private Class<Implementation> modelClass;
- private Object modelFactory;
- private Method factoryMethod;
- private Map<String, Method> setterMethods = new HashMap<String, Method>();
- private Map<String, Method> getterMethods = new HashMap<String, Method>();
-
- public DefaultBeanModelProcessor(FactoryExtensionPoint modeFactories,
- QName artifactType,
- Class<Implementation> modelClass,
- Object modelFactory,
- Monitor monitor) {
- super(modeFactories, null, monitor);
- this.artifactType = artifactType;
- this.modelClass = modelClass;
- this.modelFactory = modelFactory;
-
- // Introspect the factory class and bean model class
- if (modelFactory != null) {
-
- // Find the model create method
- for (Method method: modelFactory.getClass().getMethods()) {
- if (method.getName().startsWith("create") && method.getReturnType() == modelClass) {
- factoryMethod = method;
- break;
- }
- }
- }
-
- // Index the bean's setter methods
- for (Method method: modelClass.getMethods()) {
- Method getter;
- String name = method.getName();
- if (name.startsWith("set") && name.length() > 3) {
-
- // Get the corresponding getter method
- try {
- getter = modelClass.getMethod("get" + name.substring(3));
- } catch (Exception e) {
- getter = null;
- continue;
- }
-
- // Get the property name
- name = name.substring(3);
- if (name.length() > 1) {
- if (!name.toUpperCase().equals(name)) {
- name = name.substring(0, 1).toLowerCase() + name.substring(1);
- }
- }
- } else {
- continue;
- }
-
- // Map an uppercase property name to a lowercase attribute name
- if (name.toUpperCase().equals(name)) {
- name = name.toLowerCase();
- }
-
- // Trim trailing _ from property names
- if (name.endsWith("_")) {
- name = name.substring(0, name.length()-1);
- }
- setterMethods.put(name, method);
- getterMethods.put(name, getter);
- }
- }
-
- public Object read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Read an element
- try {
-
- // Create a new instance of the model
- Object model;
- if (modelFactory != null) {
- // Invoke the factory create method
- model = factoryMethod.invoke(modelFactory);
- } else {
- // Invoke the model bean class default constructor
- model = modelClass.newInstance();
- }
-
- // Initialize the bean properties with the attributes found in the
- // XML element
- for (int i = 0, n = reader.getAttributeCount(); i < n; i++) {
- String attributeName = reader.getAttributeLocalName(i);
- Method setter = setterMethods.get(attributeName);
- if (setter != null) {
- String value = reader.getAttributeValue(i);
- setter.invoke(model, value);
- }
- }
-
- // Read policies
- policyProcessor.readPolicies(model, reader);
-
- // FIXME read extension elements
-
- // By default mark the model object unresolved
- if (model instanceof Base) {
- ((Base)model).setUnresolved(true);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && artifactType.equals(reader.getName())) {
- break;
- }
- }
- return model;
-
- } catch (Exception e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", reader, ce);
- throw ce;
- }
- }
-
- public void write(Object bean, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- try {
- // Write the bean properties as attributes
- List<XAttr> attrs = new ArrayList<XAttr>();
- for (Map.Entry<String, Method> entry: getterMethods.entrySet()) {
- if (entry.getValue().getReturnType() == String.class) {
- String value = (String)entry.getValue().invoke(bean);
- attrs.add(new XAttr(entry.getKey(), value));
- }
- }
-
- // Write element
- writeStart(writer, artifactType.getNamespaceURI(), artifactType.getLocalPart(),
- policyProcessor.writePolicies(bean), new XAttr(null, attrs));
-
- writeEnd(writer);
-
- } catch (Exception e) {
- ContributionWriteException ce = new ContributionWriteException(e);
- error("ContributionWriteException", writer, ce);
- throw ce;
- }
- }
-
- public void resolve(Object bean, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve and merge the component type associated with an
- // implementation model
- if (bean instanceof Implementation) {
- Implementation implementation = (Implementation)bean;
- String uri = implementation.getURI();
- if (uri != null) {
- int d = uri.lastIndexOf('.');
- if (d != -1) {
- uri = uri.substring(0, d) + ".componentType";
-
- // Resolve the component type
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setURI(uri);
- componentType.setUnresolved(true);
-
- componentType = resolver.resolveModel(ComponentType.class, componentType);
- if (componentType != null && !componentType.isUnresolved()) {
-
- // We found a component type, merge it into the implementation model
- implementation.getServices().addAll(componentType.getServices());
- implementation.getReferences().addAll(componentType.getReferences());
- implementation.getProperties().addAll(componentType.getProperties());
- implementation.setConstrainingType(componentType.getConstrainingType());
-
- if (implementation instanceof PolicySetAttachPoint &&
- componentType instanceof PolicySetAttachPoint ) {
- PolicySetAttachPoint policiedImpl = (PolicySetAttachPoint)implementation;
- PolicySetAttachPoint policiedCompType = (PolicySetAttachPoint)componentType;
-
- if ( policiedImpl.getPolicySets() != null) {
- policiedImpl.getPolicySets().addAll(policiedCompType.getPolicySets());
- }
- if (policiedImpl.getRequiredIntents() != null) {
- policiedImpl.getRequiredIntents().addAll(policiedCompType.getRequiredIntents());
- }
- }
- }
- }
- }
- }
-
- // Mark the model resolved
- if (bean instanceof Base) {
- ((Base)bean).setUnresolved(false);
- }
- }
-
- public QName getArtifactType() {
- return artifactType;
- }
-
- public Class<?> getModelType() {
- return modelClass;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicyAttachPointProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicyAttachPointProcessor.java
deleted file mode 100644
index 359f87c615..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicyAttachPointProcessor.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static org.apache.tuscany.sca.assembly.xml.Constants.APPLICABLE_POLICY_SETS;
-import static org.apache.tuscany.sca.assembly.xml.Constants.POLICY_SETS;
-import static org.apache.tuscany.sca.assembly.xml.Constants.REQUIRES;
-import static org.apache.tuscany.sca.assembly.xml.Constants.SCA10_TUSCANY_NS;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * A Policy Attach Point processor.
- *
- * @version $Rev$ $Date$
- */
-public class PolicyAttachPointProcessor extends BaseStAXArtifactProcessor {
-
- private PolicyFactory policyFactory;
-
- public PolicyAttachPointProcessor(PolicyFactory policyFactory) {
- this.policyFactory = policyFactory;
- }
-
- /**
- * Read policy intents associated with an operation.
- * @param attachPoint
- * @param operation
- * @param reader
- */
- private void readIntents(Object attachPoint, Operation operation, XMLStreamReader reader) {
- if (!(attachPoint instanceof IntentAttachPoint))
- return;
- IntentAttachPoint intentAttachPoint = (IntentAttachPoint)attachPoint;
- String value = reader.getAttributeValue(null, REQUIRES);
- if (value != null) {
- List<Intent> requiredIntents = intentAttachPoint.getRequiredIntents();
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- QName qname = getQNameValue(reader, tokens.nextToken());
- Intent intent = policyFactory.createIntent();
- intent.setName(qname);
- if (operation != null) {
- //FIXME Don't we need to handle intent specification
- // on an operation basis?
- //intent.getOperations().add(operation);
- }
- requiredIntents.add(intent);
- }
- }
- }
-
- /**
- * Reads policy intents and policy sets associated with an operation.
- * @param attachPoint
- * @param operation
- * @param reader
- */
- public void readPolicies(Object attachPoint, Operation operation, XMLStreamReader reader) {
- readIntents(attachPoint, operation, reader);
- readPolicySets(attachPoint, operation, reader);
- }
-
- /**
- * Reads policy intents and policy sets.
- * @param attachPoint
- * @param reader
- */
- public void readPolicies(Object attachPoint, XMLStreamReader reader) {
- readPolicies(attachPoint, null, reader);
- }
-
- /**
- * Reads policy sets associated with an operation.
- * @param attachPoint
- * @param operation
- * @param reader
- */
- private void readPolicySets(Object attachPoint, Operation operation, XMLStreamReader reader) {
- if (!(attachPoint instanceof PolicySetAttachPoint)) {
- return;
- }
- PolicySetAttachPoint policySetAttachPoint = (PolicySetAttachPoint)attachPoint;
- String value = reader.getAttributeValue(null, POLICY_SETS);
- if (value != null) {
- List<PolicySet> policySets = policySetAttachPoint.getPolicySets();
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- QName qname = getQNameValue(reader, tokens.nextToken());
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(qname);
- if (operation != null) {
- //FIXME Don't we need to handle policySet specification
- // on an operation basis?
- //policySet.getOperations().add(operation);
- }
- policySets.add(policySet);
- }
- }
-
- value = reader.getAttributeValue(SCA10_TUSCANY_NS, APPLICABLE_POLICY_SETS);
- if (value != null) {
- List<PolicySet> applicablePolicySets = policySetAttachPoint.getApplicablePolicySets();
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- QName qname = getQNameValue(reader, tokens.nextToken());
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(qname);
- if (operation != null) {
- //FIXME Don't we need to handle policySet specification
- // on an operation basis?
- //policySet.getOperations().add(operation);
- }
- applicablePolicySets.add(policySet);
- }
- }
- }
-
- /**
- * Write policies
- * @param attachPoint
- * @return
- */
- XAttr writePolicies(Object attachPoint) throws XMLStreamException {
- return writePolicies(attachPoint, (Operation)null);
- }
-
- /**
- * Write policies
- * @param attachPoint
- * @return
- */
- public void writePolicyAttributes(Object attachPoint, XMLStreamWriter writer) throws XMLStreamException {
- writePolicyAttributes(attachPoint, (Operation)null, writer);
- }
-
- /**
- * Write policies
- * @param attachPoint
- * @return
- */
- public void writePolicyPrefixes(Object attachPoint, XMLStreamWriter writer) throws XMLStreamException {
- writePolicyPrefixes(attachPoint, (Operation)null, writer);
- }
-
- /**
- * Write policies associated with an operation
- * @param attachPoint
- * @param operation
- * @return
- */
- XAttr writePolicies(Object attachPoint, Operation operation) {
- List<XAttr> attrs =new ArrayList<XAttr>();
- attrs.add(writeIntents(attachPoint, operation));
- attrs.add(writePolicySets(attachPoint, operation));
- return new XAttr(null, attrs);
- }
-
- /**
- * Write policies
- * @param attachPoint
- * @return
- */
- public void writePolicyAttributes(Object attachPoint, Operation operation, XMLStreamWriter writer) throws XMLStreamException {
- XAttr attr = writePolicies(attachPoint, operation);
- attr.write(writer);
- }
-
- /**
- * Write policies
- * @param attachPoint
- * @return
- */
- public void writePolicyPrefixes(Object attachPoint, Operation operation, XMLStreamWriter writer) throws XMLStreamException {
- XAttr attr = writePolicies(attachPoint, operation);
- attr.writePrefix(writer);
- }
-
- /**
- * Write policy intents associated with an operation.
- * @param attachPoint
- * @param operation
- */
- private XAttr writeIntents(Object attachPoint, Operation operation) {
- if (!(attachPoint instanceof IntentAttachPoint)) {
- return null;
- }
- IntentAttachPoint intentAttachPoint = (IntentAttachPoint)attachPoint;
- List<QName> qnames = new ArrayList<QName>();
- for (Intent intent: intentAttachPoint.getRequiredIntents()) {
- qnames.add(intent.getName());
- }
- return new XAttr(Constants.REQUIRES, qnames);
- }
-
- /**
- * Write policy sets associated with an operation.
- * @param attachPoint
- * @param operation
- */
- private XAttr writePolicySets(Object attachPoint, Operation operation) {
- if (!(attachPoint instanceof PolicySetAttachPoint)) {
- return null;
- }
- PolicySetAttachPoint policySetAttachPoint = (PolicySetAttachPoint)attachPoint;
- List<QName> qnames = new ArrayList<QName>();
- for (PolicySet policySet: policySetAttachPoint.getPolicySets()) {
- qnames.add(policySet.getName());
- }
- return new XAttr(Constants.POLICY_SETS, qnames);
- }
-
- public void resolvePolicies(Object attachPoint, ModelResolver resolver) {
- if ( attachPoint instanceof PolicySetAttachPoint ) {
- PolicySetAttachPoint policySetAttachPoint = (PolicySetAttachPoint)attachPoint;
-
- List<Intent> requiredIntents = new ArrayList<Intent>();
- Intent resolvedIntent = null;
-
- if ( policySetAttachPoint.getRequiredIntents() != null && policySetAttachPoint.getRequiredIntents().size() > 0 ) {
- for ( Intent intent : policySetAttachPoint.getRequiredIntents() ) {
- resolvedIntent = resolver.resolveModel(Intent.class, intent);
- requiredIntents.add(resolvedIntent);
- }
- policySetAttachPoint.getRequiredIntents().clear();
- policySetAttachPoint.getRequiredIntents().addAll(requiredIntents);
- }
-
- if ( policySetAttachPoint.getPolicySets() != null && policySetAttachPoint.getPolicySets().size() > 0 ) {
- List<PolicySet> resolvedPolicySets = new ArrayList<PolicySet>();
- PolicySet resolvedPolicySet = null;
- for ( PolicySet policySet : policySetAttachPoint.getPolicySets() ) {
- resolvedPolicySet = resolver.resolveModel(PolicySet.class, policySet);
- resolvedPolicySets.add(resolvedPolicySet);
- }
- policySetAttachPoint.getPolicySets().clear();
- policySetAttachPoint.getPolicySets().addAll(resolvedPolicySets);
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 7a190dea9c..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#componentType,model=org.apache.tuscany.sca.assembly.ComponentType
-org.apache.tuscany.sca.assembly.xml.ConstrainingTypeProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#constrainingType,model=org.apache.tuscany.sca.assembly.ConstrainingType
-org.apache.tuscany.sca.assembly.xml.CompositeProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#composite,model=org.apache.tuscany.sca.assembly.Composite
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
deleted file mode 100644
index 403c049b48..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.assembly.xml.ComponentTypeDocumentProcessor;type=.componentType,model=org.apache.tuscany.sca.assembly.ComponentType
-org.apache.tuscany.sca.assembly.xml.ConstrainingTypeDocumentProcessor;type=.constrainingType,model=org.apache.tuscany.sca.assembly.ConstrainingType
-org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor;type=.composite,model=org.apache.tuscany.sca.assembly.Composite
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
deleted file mode 100644
index ecc34942f1..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT 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.tuscany.sca.assembly.xml.CompositeModelResolver;model=org.apache.tuscany.sca.assembly.Composite
-org.apache.tuscany.sca.assembly.xml.ConstrainingTypeModelResolver;model=org.apache.tuscany.sca.assembly.ConstrainingType
-org.apache.tuscany.sca.assembly.xml.ComponentTypeModelResolver;model=org.apache.tuscany.sca.assembly.ComponentType
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties b/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties
deleted file mode 100644
index 8cc5e5a5ec..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-NoCompositeNamespace = No namespace found: Composite = {0}
-UnexpectedInterfaceElement = Unexpected <interface> element found. It should appear inside a <service> or <reference> element.
-UnexpectedBindingElement = Unexpected <binding> element found. It should appear inside a <service> or <reference> element.
-UnexpectedImplementationElement = Unexpected <implementation> element found. It should appear inside a <component> element.
-PolicyImplValidationException = PolicyValidation exception when processing implementation of component {0} due to {1}.
-PolicyServiceValidationException = PolicyValidation exceptions when processing service/reference {0} in {1}. Error is {2}
-ContributionReadException = ContributionReadException occured due to : {0}
-ContributionWriteException = ContributionWriteException occured due to : {0}
-XMLStreamException = XMLStreamException occured due to : {0}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java
deleted file mode 100644
index 62318946a2..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-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.assembly.Composite;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
-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.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.junit.BeforeClass;
-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) $
- */
-public class BuildPolicyTestCase {
- private static URLArtifactProcessor<Object> documentProcessor;
- private static URLArtifactProcessor<Definitions> policyDefinitionsProcessor;
- private static ModelResolver resolver;
- private static CompositeBuilder compositeBuilder;
- private static Composite composite;
- private static Monitor monitor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- SCABindingFactory scaBindingFactory = new TestSCABindingFactoryImpl();
- modelFactories.addFactory(scaBindingFactory);
- compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
-
- List<Definitions> policyDefinitions = new ArrayList<Definitions>();
- resolver = new DefaultModelResolver();
-
- MonitorFactory monitorFactory = new DefaultMonitorFactory();
- monitor = monitorFactory.createMonitor();
-
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
-
- URLArtifactProcessorExtensionPoint documentProcessors = new DefaultURLArtifactProcessorExtensionPoint(extensionPoints);
- documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
- policyDefinitionsProcessor = documentProcessors.getProcessor(Definitions.class);
-
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessors.addArtifactProcessor(new TestPolicyProcessor());
-
- URL url = BuildPolicyTestCase.class.getResource("CalculatorComponent.constrainingType");
- URI uri = URI.create("CalculatorComponent.constrainingType");
- ConstrainingType constrainingType = (ConstrainingType)documentProcessor.read(null, uri, url);
- assertNotNull(constrainingType);
- resolver.addModel(constrainingType);
-
- url = BuildPolicyTestCase.class.getResource("TestAllPolicyCalculator.composite");
- uri = URI.create("TestAllCalculator.constrainingType");
- composite = (Composite)documentProcessor.read(null, uri, url);
- assertNotNull(composite);
-
- url = BuildPolicyTestCase.class.getResource("another_test_definitions.xml");
- uri = URI.create("another_test_definitions.xml");
- Definitions definitions = (Definitions)policyDefinitionsProcessor.read(null, uri, url);
- assertNotNull(definitions);
- policyDefinitions.add(definitions);
-
- documentProcessor.resolve(definitions, resolver);
- documentProcessor.resolve(composite, resolver);
-
- compositeBuilder.build(composite, null, monitor);
- }
-
- @Test
- public void testPolicyIntentInheritance() throws Exception {
- String namespaceUri = "http://test";
-
- IntentAttachPoint policiedComposite = (IntentAttachPoint)composite;
- assertEquals(policiedComposite.getRequiredIntents().size(), 1);
- assertEquals(policiedComposite.getRequiredIntents().get(0).getName(), new QName(namespaceUri, "tuscanyIntent_1"));
-
- //1 defined for composite, 2 defined for the service, 1 defined and 3 inherited for the promoted service (4)
- assertEquals(composite.getServices().get(0).getRequiredIntents().size(), 7);
- //1 from the operation defined in this service and 2 from the operation defined in the promoted service
- assertEquals(composite.getServices().get(0).getConfiguredOperations().get(0).getRequiredIntents().size(), 5);
- assertEquals(composite.getServices().get(0).getRequiredIntents().get(3).getName(), new QName(namespaceUri, "tuscanyIntent_3"));
- //bindings will have only 2 intents since duplications will be cut out
- assertEquals(((IntentAttachPoint)composite.getServices().get(0).getBindings().get(0)).getRequiredIntents().size(), 3);
- assertEquals(((OperationsConfigurator)composite.getServices().get(0).getBindings().get(0)).getConfiguredOperations().size(), 1);
- assertEquals(((OperationsConfigurator)composite.getServices().get(0).getBindings().get(0)).getConfiguredOperations().get(0).getRequiredIntents().size(), 5);
-
- assertEquals(composite.getReferences().get(0).getRequiredIntents().size(), 5);
- assertEquals(composite.getReferences().get(0).getConfiguredOperations().size(), 1);
- assertEquals(composite.getReferences().get(0).getConfiguredOperations().get(0).getRequiredIntents().size(), 4);
- assertEquals(composite.getReferences().get(0).getRequiredIntents().get(1).getName(), new QName(namespaceUri, "tuscanyIntent_1"));
- assertEquals(((IntentAttachPoint)composite.getReferences().get(0).getBindings().get(0)).getRequiredIntents().size(), 3);
-
- assertEquals(composite.getComponents().get(0).getRequiredIntents().size(), 3);
- assertEquals(composite.getComponents().get(0).getRequiredIntents().get(2).getName(), new QName(namespaceUri, "tuscanyIntent_1"));
- assertEquals(composite.getComponents().get(0).getServices().get(0).getRequiredIntents().size(), 4);
- assertEquals(composite.getComponents().get(0).getServices().get(0).getCallback().getRequiredIntents().size(), 4);
- assertEquals(composite.getComponents().get(0).getServices().get(0).getConfiguredOperations().get(0).getRequiredIntents().size(), 5);
- assertEquals(composite.getComponents().get(0).getReferences().get(0).getRequiredIntents().size(), 5);
- assertEquals(composite.getComponents().get(0).getReferences().get(0).getConfiguredOperations().get(0).getRequiredIntents().size(), 5);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/MultiplicityReadWriteTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/MultiplicityReadWriteTestCase.java
deleted file mode 100644
index 4e74c55949..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/MultiplicityReadWriteTestCase.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test writing SCA XML assemblies.
- *
- * TUSCANY-2662
- *
- * @version $Rev$ $Date$
- */
-public class MultiplicityReadWriteTestCase {
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private ExtensibleStAXArtifactProcessor staxProcessor;
-
-
- @Before
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- }
-
-
- @Test
- public void testReadWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("Multiplicity.composite");
- Composite composite = staxProcessor.read(is, Composite.class);
-
- verifyComposite(composite);
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, bos);
- bos.close();
-
- ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
- composite = staxProcessor.read(bis, Composite.class);
-
- verifyComposite(composite);
-
- }
-
-
- private void verifyComposite(Composite composite) {
- assertEquals(composite.getComponents().get(0).getReferences().get(0).getMultiplicity(), Multiplicity.ZERO_N);
- assertEquals(composite.getReferences().get(0).getMultiplicity(), Multiplicity.ONE_N);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadAllTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadAllTestCase.java
deleted file mode 100644
index 98e1cf31ef..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadAllTestCase.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-
-import org.apache.tuscany.sca.assembly.Callback;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.Property;
-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.policy.PolicySetAttachPoint;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Test reading SCA XML assemblies.
- *
- * @version $Rev$ $Date$
- */
-public class ReadAllTestCase {
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static XMLInputFactory inputFactory;
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- inputFactory = XMLInputFactory.newInstance();
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
- }
-
- @Test
- public void testReadComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite");
- Composite composite = (Composite)staxProcessor.read(inputFactory.createXMLStreamReader(is));
- assertNotNull(composite);
- assertEquals(composite.getName(), new QName("http://calc", "TestAllCalculator"));
- assertEquals(composite.getConstrainingType().getName(), new QName("http://calc", "CalculatorComponent"));
- assertTrue(composite.isLocal());
- assertFalse(composite.getAutowire() == Boolean.TRUE);
- assertEquals(((PolicySetAttachPoint)composite).getRequiredIntents().get(0).getName(), new QName("http://test",
- "confidentiality"));
- assertEquals(((PolicySetAttachPoint)composite).getPolicySets().get(0).getName(), new QName("http://test", "SecureReliablePolicy"));
-
- Composite include = composite.getIncludes().get(0);
- assertEquals(include.getName(), new QName("http://calc", "TestAllDivide"));
-
- CompositeService calcCompositeService = (CompositeService)composite.getServices().get(0);
- assertEquals(calcCompositeService.getName(), "CalculatorService");
- assertTrue(calcCompositeService.getPromotedService().isUnresolved());
- assertEquals(calcCompositeService.getPromotedService().getName(),
- "CalculatorService");
- assertEquals(calcCompositeService.getRequiredIntents().get(0).getName(),
- new QName("http://test", "confidentiality"));
- assertEquals(calcCompositeService.getPolicySets().get(0).getName(), new QName("http://test", "SecureReliablePolicy"));
- // TODO test operations
- Callback calcServiceCallback = calcCompositeService.getCallback();
- assertNotNull(calcServiceCallback);
- assertEquals(calcServiceCallback.getRequiredIntents().get(0).getName(),
- new QName("http://test", "confidentiality"));
- assertEquals(calcServiceCallback.getPolicySets().get(0).getName(), new QName("http://test", "SecureReliablePolicy"));
- // TODO test operations
-
- Component calcComponent = composite.getComponents().get(0);
- assertEquals(calcComponent.getName(), "CalculatorServiceComponent");
- assertEquals(calcComponent.getAutowire(), Boolean.FALSE);
- assertEquals(calcComponent.getConstrainingType().getName(), new QName("http://calc",
- "CalculatorComponent"));
- assertEquals(calcComponent.getRequiredIntents().get(0).getName(), new QName("http://test",
- "confidentiality"));
- assertEquals(calcComponent.getPolicySets().get(0).getName(), new QName("http://test", "SecureReliablePolicy"));
-
- ComponentService calcComponentService = calcComponent.getServices().get(0);
- assertEquals(calcComponentService.getName(), "CalculatorService");
- assertEquals(calcComponentService.getRequiredIntents().get(0).getName(),
- new QName("http://test", "confidentiality"));
- assertEquals(calcComponentService.getPolicySets().get(0).getName(), new QName("http://test", "SecureReliablePolicy"));
- // TODO test operations
-
- ComponentReference calcComponentReference = calcComponent.getReferences().get(0);
- assertEquals(calcComponentReference.getName(), "addService");
- assertEquals(calcComponentReference.getAutowire(), Boolean.FALSE);
- assertEquals(calcComponentReference.isWiredByImpl(), false);
- assertEquals(calcComponentReference.getRequiredIntents().get(0).getName(),
- new QName("http://test", "confidentiality"));
- assertEquals(calcComponentReference.getPolicySets().get(0).getName(), new QName("http://test", "SecureReliablePolicy"));
- // TODO test operations
-
- Property property = calcComponent.getProperties().get(0);
- assertEquals(property.getName(), "round");
- Document doc = (Document) property.getValue();
- Element element = doc.getDocumentElement();
- String value = element.getTextContent();
- assertEquals(value, "true");
- assertEquals(property.getXSDType(), new QName("http://www.w3.org/2001/XMLSchema", "boolean"));
- assertEquals(property.isMany(), false);
-
- CompositeReference calcCompositeReference = (CompositeReference)composite.getReferences().get(0);
- assertEquals(calcCompositeReference.getName(), "MultiplyService");
- assertTrue(calcCompositeReference.getPromotedReferences().get(0).isUnresolved());
- assertEquals(calcCompositeReference.getPromotedReferences().get(0).getName(),
- "CalculatorServiceComponent/multiplyService");
- assertEquals(calcCompositeReference.getRequiredIntents().get(0).getName(),
- new QName("http://test", "confidentiality"));
- assertEquals(calcCompositeReference.getPolicySets().get(0).getName(), new QName("http://test", "SecureReliablePolicy"));
- // TODO test operations
- Callback calcCallback = calcCompositeReference.getCallback();
- assertEquals(calcCompositeReference.getRequiredIntents().get(0).getName(),
- new QName("http://test", "confidentiality"));
- assertEquals(calcCompositeReference.getPolicySets().get(0).getName(), new QName("http://test", "SecureReliablePolicy"));
- assertNotNull(calcCallback);
- // TODO test operations
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java
deleted file mode 100644
index 03d99ff934..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 java.net.URI;
-import java.net.URL;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.ValidatorHandler;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.contribution.processor.DefaultValidatingXMLInputFactory;
-import org.apache.tuscany.sca.contribution.processor.DefaultValidationSchemaExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-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.processor.ValidationSchemaExtensionPoint;
-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.core.DefaultFactoryExtensionPoint;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/**
- * Test reading SCA XML assembly documents.
- *
- * @version $Rev$ $Date$
- */
-public class ReadDocumentTestCase {
-
- private static URLArtifactProcessor<Object> documentProcessor;
- private static ModelResolver resolver;
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
-
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- inputFactory = XMLInputFactory.newInstance();
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- resolver = new DefaultModelResolver();
- }
-
- @Test
- public void testValidateAssembly() throws Exception {
-
- SchemaFactory schemaFactory;
- try {
- schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- } catch (Error e) {
- // Some old JDKs don't support XMLSchema validation
- return;
- } catch (Exception e) {
- // Some old JDKs don't support XMLSchema validation
- return;
- }
- Schema schema = schemaFactory.newSchema(getClass().getClassLoader().getResource("tuscany-sca.xsd"));
- ValidatorHandler handler = schema.newValidatorHandler();
-
- SAXParserFactory parserFactory = SAXParserFactory.newInstance();
- URL url = getClass().getResource("Calculator.composite");
- XMLReader reader = parserFactory.newSAXParser().getXMLReader();
- reader.setFeature("http://xml.org/sax/features/namespaces", true);
- reader.setContentHandler(handler);
- reader.parse(new InputSource(url.openStream()));
-
- }
-
- @Test
- public void testValidateImplementation() throws Exception {
-
- SchemaFactory schemaFactory;
- try {
- schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- } catch (Error e) {
- // Some old JDKs don't support XMLSchema validation
- return;
- } catch (Exception e) {
- // Some old JDKs don't support XMLSchema validation
- return;
- }
- Schema schema = schemaFactory.newSchema(getClass().getClassLoader().getResource("tuscany-sca.xsd"));
- ValidatorHandler handler = schema.newValidatorHandler();
-
- SAXParserFactory parserFactory = SAXParserFactory.newInstance();
- URL url = getClass().getResource("JavaScriptReference.composite");
- XMLReader reader = parserFactory.newSAXParser().getXMLReader();
- reader.setFeature("http://xml.org/sax/features/namespaces", true);
- reader.setContentHandler(handler);
- reader.parse(new InputSource(url.openStream()));
- }
-
- @Test
- public void testReadImplementation() throws Exception {
-
- ValidationSchemaExtensionPoint schemas = new DefaultValidationSchemaExtensionPoint();
- schemas.addSchema(getClass().getClassLoader().getResource("tuscany-sca.xsd").toString());
- XMLInputFactory validatingInputFactory = new DefaultValidatingXMLInputFactory(inputFactory, schemas, null);
- DefaultFactoryExtensionPoint factories = new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry());
- factories.addFactory(validatingInputFactory);
-
- CompositeDocumentProcessor compositeDocumentProcessor = new CompositeDocumentProcessor(factories , staxProcessor, null);
-
- URL url = getClass().getResource("JavaScriptReference.composite");
- URI uri = URI.create("JavaScriptReference.composite");
- Composite composite = (Composite)compositeDocumentProcessor.read(null, uri, url);
- assertNotNull(composite);
- }
-
- @Test
- public void testValidateBinding() throws Exception {
-
- SchemaFactory schemaFactory;
- try {
- schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- } catch (Error e) {
- // Some old JDKs don't support XMLSchema validation
- return;
- } catch (Exception e) {
- // Some old JDKs don't support XMLSchema validation
- return;
- }
- Schema schema = schemaFactory.newSchema(getClass().getClassLoader().getResource("tuscany-sca.xsd"));
- ValidatorHandler handler = schema.newValidatorHandler();
-
- SAXParserFactory parserFactory = SAXParserFactory.newInstance();
- URL url = getClass().getResource("RMIBindingTest.composite");
- XMLReader reader = parserFactory.newSAXParser().getXMLReader();
- reader.setFeature("http://xml.org/sax/features/namespaces", true);
- reader.setContentHandler(handler);
- reader.parse(new InputSource(url.openStream()));
- }
-
- @Test
- public void testReadBinding() throws Exception {
-
- ValidationSchemaExtensionPoint schemas = new DefaultValidationSchemaExtensionPoint();
- schemas.addSchema(getClass().getClassLoader().getResource("tuscany-sca.xsd").toString());
- XMLInputFactory validatingInputFactory = new DefaultValidatingXMLInputFactory(inputFactory, schemas, null);
- DefaultFactoryExtensionPoint factories = new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry());
- factories.addFactory(validatingInputFactory);
- CompositeDocumentProcessor compositeDocumentProcessor = new CompositeDocumentProcessor(factories , staxProcessor, null);
-
- URL url = getClass().getResource("RMIBindingTest.composite");
- URI uri = URI.create("RMIBindingTest.composite");
- Composite composite = (Composite)compositeDocumentProcessor.read(null, uri, url);
- assertNotNull(composite);
- }
-
- @Test
- public void testResolveConstrainingType() throws Exception {
-
- URL url = getClass().getResource("CalculatorComponent.constrainingType");
- URI uri = URI.create("CalculatorComponent.constrainingType");
- ConstrainingType constrainingType = (ConstrainingType)documentProcessor.read(null, uri, url);
- assertNotNull(constrainingType);
- resolver.addModel(constrainingType);
-
- url = getClass().getResource("TestAllCalculator.composite");
- uri = URI.create("TestAllCalculator.constrainingType");
- Composite composite = (Composite)documentProcessor.read(null, uri, url);
- assertNotNull(composite);
-
- documentProcessor.resolve(composite, resolver);
-
- assertEquals(composite.getConstrainingType(), constrainingType);
- assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType);
- }
-
- @Test
- public void testResolveComposite() throws Exception {
- URL url = getClass().getResource("Calculator.composite");
- URI uri = URI.create("Calculator.composite");
- Composite nestedComposite = (Composite)documentProcessor.read(null, uri, url);
- assertNotNull(nestedComposite);
- resolver.addModel(nestedComposite);
-
- url = getClass().getResource("TestAllCalculator.composite");
- uri = URI.create("TestAllCalculator.composite");
- Composite composite = (Composite)documentProcessor.read(null, uri, url);
-
- documentProcessor.resolve(composite, resolver);
-
- assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadTestCase.java
deleted file mode 100644
index beeb6feaea..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadTestCase.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-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.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test reading SCA XML assemblies.
- *
- * @version $Rev$ $Date$
- */
-public class ReadTestCase {
-
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance(), null);
- }
-
-
- @Test
- public void testReadComponentType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- assertNotNull(staxProcessor.read(reader));
- is.close();
- }
-
- @Test
- public void testReadConstrainingType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- assertNotNull(staxProcessor.read(reader));
- is.close();
-
- }
-
- @Test
- public void testReadComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("Calculator.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- assertNotNull(staxProcessor.read(reader));
- is.close();
-
- }
-
- @Test
- public void testReadCompositeAndWireIt() throws Exception {
- InputStream is = getClass().getResourceAsStream("Calculator.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- assertNotNull(staxProcessor.read(reader));
- is.close();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java
deleted file mode 100644
index 2b1a8fecf7..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.ByteArrayOutputStream;
-import java.io.StringReader;
-
-import javax.xml.namespace.QName;
-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.StAXAttributeProcessor;
-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.Test;
-
-/**
- * Test reading SCA XML assemblies.
- *
- * @version $Rev$ $Date$
- */
-public class ReadWriteAnyAttributeTestCase {
-
- private static final QName EXTENDED_ATTRIBUTE = new QName("http://test", "customAttribute");
-
- private static final String XML = "<?xml version='1.0' encoding='UTF-8'?>"+
- "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" " +
- "xmlns:ns1=\"http://www.osoa.org/xmlns/sca/1.0\" " +
- "targetNamespace=\"http://calc\" " +
- "name=\"Calculator\">"+
- "<component name=\"AddServiceComponent\" xmlns:test=\"http://test\" test:customAttribute=\"customValue\">"+
- "<implementation.java class=\"calculator.AddServiceImpl\" />"+
- "</component>"+
- "</composite>";
-
- private XMLInputFactory inputFactory;
- private ExtensibleStAXArtifactProcessor staxProcessor;
-
-
- /**
- * Initialize the test environment
- * This takes care to register attribute processors when provided
- *
- * @param attributeProcessor
- * @throws Exception
- */
- private void init(StAXAttributeProcessor<?> attributeProcessor) throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-
- if(attributeProcessor != null) {
- StAXAttributeProcessorExtensionPoint staxAttributeProcessors = extensionPoints.getExtensionPoint(StAXAttributeProcessorExtensionPoint.class);
- staxAttributeProcessors.addArtifactProcessor(attributeProcessor);
- }
-
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance(), null);
- }
-
- /**
- * Read and Write a composite that has a extended attribute
- * and a particular attribute processor
- * @throws Exception
- */
- @Test
- public void testReadWriteCompositeWithAttributeProcessor() throws Exception {
- init(new TestAttributeProcessor());
-
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(XML));
- Composite composite = (Composite) staxProcessor.read(reader);
- assertNotNull(composite);
- reader.close();
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, bos);
-
- // used for debug comparison
- // System.out.println(XML);
- // System.out.println(bos.toString());
-
- assertEquals(XML, bos.toString());
- }
-
- /**
- * Read and Write a composite that has a extended attribute
- * but no particular processor for it
- * @throws Exception
- */
- @Test
- public void testDefaultReadWriteComposite() throws Exception {
- init(null);
-
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(XML));
- Composite composite = (Composite) staxProcessor.read(reader);
- assertNotNull(composite);
- reader.close();
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, bos);
-
- // used for debug comparison
- // System.out.println(XML);
- // System.out.println(bos.toString());
-
- assertEquals(XML, bos.toString());
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyElementTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyElementTestCase.java
deleted file mode 100644
index 37a142d2f4..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyElementTestCase.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 java.io.ByteArrayOutputStream;
-import java.io.StringReader;
-
-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.ValidatingXMLInputFactory;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class ReadWriteAnyElementTestCase {
- private static final String XML_RECURSIVE_EXTENDED_ELEMENT =
- "<?xml version='1.0' encoding='UTF-8'?>" +
- "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns1=\"http://www.osoa.org/xmlns/sca/1.0\" targetNamespace=\"http://temp\" name=\"RecursiveExtendedElement\">" +
- "<unknownElement>" +
- "<subUnknownElement1 attribute=\"anyAttribute\" />" +
- "<subUnknownElement2 />" +
- "</unknownElement>" +
- "</composite>";
-
- private static final String XML_UNKNOWN_IMPL =
- "<?xml version='1.0' encoding='UTF-8'?>" +
- "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns1=\"http://www.osoa.org/xmlns/sca/1.0\" targetNamespace=\"http://temp\" name=\"aaaa\" autowire=\"false\">" +
- "<component name=\"unknownImpl\">" +
- "<implementation.unknown class=\"raymond\" />" +
- "<service name=\"service\">" +
- "<binding.ws />" +
- "</service>" +
- "</component>" +
- "</composite>";
-
- private static final String XML_UNKNOWN_IMPL_WITH_INVALID_ATTRIBUTE =
- "<?xml version='1.0' encoding='UTF-8'?>" +
- "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns1=\"http://www.osoa.org/xmlns/sca/1.0\" targetNamespace=\"http://temp\" name=\"aaaa\" autowire=\"false\">" +
- "<component name=\"unknownImpl\">" +
- "<implementation.unknown class=\"raymond\" />" +
- "<service name=\"service\" requires=\"\">" +
- "<binding.ws />" +
- "</service>" +
- "</component>" +
- "</composite>";
-
-
- private XMLInputFactory inputFactory;
- private ExtensibleStAXArtifactProcessor staxProcessor;
-
- @Before
- public void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class);
-
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, XMLOutputFactory.newInstance(), null);
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
- @Test
- public void testReadWriteExtendedRecursiveElement() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(XML_RECURSIVE_EXTENDED_ELEMENT));
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
- reader.close();
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, bos);
-
- // used for debug comparison
- // System.out.println(XML_RECURSIVE_EXTENDED_ELEMENT);
- // System.out.println(bos.toString());
-
- assertEquals(XML_RECURSIVE_EXTENDED_ELEMENT, bos.toString());
- bos.close();
- }
-
- @Test
- public void testReadWriteUnknwonImpl() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(XML_UNKNOWN_IMPL));
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
- reader.close();
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, bos);
-
- // used for debug comparison
- // System.out.println(XML_UNKNOWN_IMPL);
- // System.out.println(bos.toString());
-
- assertEquals(XML_UNKNOWN_IMPL, bos.toString());
- bos.close();
- }
-
- // @Test
- @Ignore()
- public void testReadWriteInvalidAttribute() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(XML_UNKNOWN_IMPL_WITH_INVALID_ATTRIBUTE));
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
- reader.close();
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, bos);
-
- // used for debug comparison
- // System.out.println(XML_UNKNOWN_IMPL);
- // System.out.println(bos.toString());
-
- assertEquals(XML_UNKNOWN_IMPL, bos.toString());
- bos.close();
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java
deleted file mode 100644
index 6127e6cc91..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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://www.osoa.org/xmlns/sca/1.0\" xmlns:ns1=\"http://www.osoa.org/xmlns/sca/1.0\" 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/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java
deleted file mode 100644
index cc5421cd84..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-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 org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
-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.definitions.Definitions;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.junit.BeforeClass;
-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) $
- */
-public class ResolvePolicyTestCase {
-
- private static URLArtifactProcessor<Object> documentProcessor;
- private static ModelResolver resolver;
- private static URLArtifactProcessor<Definitions> policyDefinitionsProcessor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- resolver = new DefaultModelResolver();
-
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
- policyDefinitionsProcessor = documentProcessors.getProcessor(Definitions.class);
-
- // Create StAX processors
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessors.addArtifactProcessor(new TestPolicyProcessor());
- }
-
- @Test
- public void testResolveConstrainingType() throws Exception {
-
- URL url = getClass().getResource("CalculatorComponent.constrainingType");
- URI uri = URI.create("CalculatorComponent.constrainingType");
- ConstrainingType constrainingType = (ConstrainingType)documentProcessor.read(null, uri, url);
- assertNotNull(constrainingType);
- resolver.addModel(constrainingType);
-
- url = getClass().getResource("TestAllCalculator.composite");
- uri = URI.create("TestAllCalculator.constrainingType");
- Composite composite = (Composite)documentProcessor.read(null, uri, url);
- assertNotNull(composite);
-
- url = getClass().getResource("test_definitions.xml");
- uri = URI.create("test_definitions.xml");
- Definitions scaDefns = (Definitions)policyDefinitionsProcessor.read(null, uri, url);
- assertNotNull(scaDefns);
-
- preResolvePolicyTests(composite);
- documentProcessor.resolve(scaDefns, resolver);
- documentProcessor.resolve(composite, resolver);
- postResolvePolicyTests(composite);
-
- assertEquals(composite.getConstrainingType(), constrainingType);
- assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType);
- }
-
- private void preResolvePolicyTests(Composite composite) {
- assertNull(((PolicySetAttachPoint)composite).getRequiredIntents().get(0).getDescription());
- assertTrue(((PolicySetAttachPoint)composite).getPolicySets().get(0).getProvidedIntents().isEmpty());
-
- assertNull(composite.getServices().get(0).getRequiredIntents().get(0).getDescription());
- assertTrue(composite.getServices().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNull(composite.getServices().get(0).getCallback().getRequiredIntents().get(0).getDescription());
- assertTrue(composite.getServices().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().isEmpty());
-
- assertNull(composite.getComponents().get(0).getRequiredIntents().get(0).getDescription());
- assertTrue(composite.getComponents().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNull(composite.getComponents().get(0).getServices().get(0).getRequiredIntents().get(0).getDescription());
- assertTrue(composite.getComponents().get(0).getServices().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNull(composite.getComponents().get(0).getReferences().get(0).getRequiredIntents().get(0).getDescription());
- assertTrue(composite.getComponents().get(0).getReferences().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
-
- assertNull(composite.getReferences().get(0).getRequiredIntents().get(0).getDescription());
- assertTrue(composite.getReferences().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNull(composite.getReferences().get(0).getCallback().getRequiredIntents().get(0).getDescription());
- assertTrue(composite.getReferences().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().isEmpty());
- }
-
- private void postResolvePolicyTests(Composite composite) {
- assertNotNull(((PolicySetAttachPoint)composite).getRequiredIntents().get(0).getDescription());
- assertFalse(((PolicySetAttachPoint)composite).getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNotNull(((PolicySetAttachPoint)composite).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
-
- assertNotNull(composite.getServices().get(0).getRequiredIntents().get(0).getDescription());
- assertFalse(composite.getServices().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNotNull(composite.getServices().get(0).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
- assertNotNull(composite.getServices().get(0).getCallback().getRequiredIntents().get(0).getDescription());
- assertFalse(composite.getServices().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNotNull(composite.getServices().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
-
- assertNotNull(composite.getComponents().get(0).getRequiredIntents().get(0).getDescription());
- assertFalse(composite.getComponents().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNotNull(composite.getComponents().get(0).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
- assertNotNull(composite.getComponents().get(0).getServices().get(0).getRequiredIntents().get(0).getDescription());
- assertFalse(composite.getComponents().get(0).getServices().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNotNull(composite.getComponents().get(0).getServices().get(0).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
- assertNotNull(composite.getComponents().get(0).getReferences().get(0).getRequiredIntents().get(0).getDescription());
- assertFalse(composite.getComponents().get(0).getReferences().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNotNull(composite.getComponents().get(0).getReferences().get(0).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
-
- assertNotNull(composite.getReferences().get(0).getRequiredIntents().get(0).getDescription());
- assertFalse(composite.getReferences().get(0).getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNotNull(composite.getReferences().get(0).getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
- assertNotNull(composite.getReferences().get(0).getCallback().getRequiredIntents().get(0).getDescription());
- assertFalse(composite.getReferences().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().isEmpty());
- assertNotNull(composite.getReferences().get(0).getCallback().getPolicySets().get(0).getProvidedIntents().get(1).getDescription());
-
-
- }
-
- @Test
- public void testResolveComposite() throws Exception {
- URL url = getClass().getResource("Calculator.composite");
- URI uri = URI.create("Calculator.composite");
- Composite nestedComposite = (Composite)documentProcessor.read(null, uri, url);
- assertNotNull(nestedComposite);
- resolver.addModel(nestedComposite);
-
- url = getClass().getResource("TestAllCalculator.composite");
- uri = URI.create("TestAllCalculator.composite");
- Composite composite = (Composite)documentProcessor.read(null, uri, url);
-
- documentProcessor.resolve(composite, resolver);
-
- assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolveTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolveTestCase.java
deleted file mode 100644
index cc8a88f3d5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolveTestCase.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static org.junit.Assert.assertEquals;
-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.Composite;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-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.junit.BeforeClass;
-import org.junit.Test;
-
-
-/**
- * Test resolving SCA XML assemblies.
- *
- * @version $Rev$ $Date$
- */
-public class ResolveTestCase {
-
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessorExtensionPoint staxProcessors;
- private static ModelResolver resolver;
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- resolver = new DefaultModelResolver();
- }
-
- @Test
- public void testResolveConstrainingType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
- StAXArtifactProcessor<ConstrainingType> constrainingTypeReader = staxProcessors.getProcessor(ConstrainingType.class);
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- ConstrainingType constrainingType = constrainingTypeReader.read(reader);
- is.close();
- assertNotNull(constrainingType);
- resolver.addModel(constrainingType);
-
- is = getClass().getResourceAsStream("TestAllCalculator.composite");
- StAXArtifactProcessor<Composite> compositeReader = staxProcessors.getProcessor(Composite.class);
- reader = inputFactory.createXMLStreamReader(is);
- Composite composite = compositeReader.read(reader);
- is.close();
- assertNotNull(composite);
-
- compositeReader.resolve(composite, resolver);
-
- assertEquals(composite.getConstrainingType(), constrainingType);
- assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType);
- }
-
- @Test
- public void testResolveComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("Calculator.composite");
- StAXArtifactProcessor<Composite> compositeReader = staxProcessors.getProcessor(Composite.class);
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite nestedComposite = compositeReader.read(reader);
- is.close();
- assertNotNull(nestedComposite);
- resolver.addModel(nestedComposite);
-
- is = getClass().getResourceAsStream("TestAllCalculator.composite");
- reader = inputFactory.createXMLStreamReader(is);
- Composite composite = compositeReader.read(reader);
- is.close();
-
- compositeReader.resolve(composite, resolver);
-
- assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestAttributeProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestAttributeProcessor.java
deleted file mode 100644
index 1a100c25b1..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestAttributeProcessor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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.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.StAXAttributeProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * A Policy Processor used for testing.
- *
- * @version $Rev$ $Date$
- */
-public class TestAttributeProcessor extends BaseStAXArtifactProcessor implements StAXAttributeProcessor<String> {
- private static final QName ATTRIBUTE = new QName("http://test", "customAttribute");
-
- public QName getArtifactType() {
- return ATTRIBUTE;
- }
-
- public String read(QName attributeName, XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- return reader.getAttributeValue(attributeName.getNamespaceURI(), attributeName.getLocalPart());
- }
-
- public void write(String value, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- writer.setPrefix(ATTRIBUTE.getPrefix(), ATTRIBUTE.getNamespaceURI());
- writer.writeAttribute(ATTRIBUTE.getLocalPart(), value);
- }
-
- public Class<String> getModelType() {
- return String.class;
- }
-
- public void resolve(String arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestPolicyProcessor.java
deleted file mode 100644
index d01e304aad..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestPolicyProcessor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.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.Policy;
-
-/**
- * A Policy Processor used for testing.
- *
- * @version $Rev$ $Date$
- */
-public class TestPolicyProcessor implements StAXArtifactProcessor<Policy> {
-
- public QName getArtifactType() {
- return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
- }
-
- public Policy read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
- return new MockPolicyImplOne();
- }
-
- public void write(Policy arg0, XMLStreamWriter arg1) throws ContributionWriteException,
- XMLStreamException {
- }
-
- public Class<Policy> getModelType() {
- return Policy.class;
- }
-
- public void resolve(Policy arg0, ModelResolver arg1) throws ContributionResolveException {
- }
-
-
- public class MockPolicyImplOne implements Policy {
- public QName getSchemaName() {
- 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/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingFactoryImpl.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingFactoryImpl.java
deleted file mode 100644
index c423df6f7d..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingFactoryImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-
-/**
- * A factory for the SCA binding model.
- *
- * @version $Rev$ $Date$
- */
-public class TestSCABindingFactoryImpl implements SCABindingFactory {
- public SCABinding createSCABinding() {
- return new TestSCABindingImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingImpl.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingImpl.java
deleted file mode 100644
index af25109de1..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingImpl.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-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.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * A test cheel for the SCA binding.
- *
- * @version $Rev$ $Date$
- */
-public class TestSCABindingImpl implements SCABinding, OptimizableBinding, PolicySetAttachPoint, OperationsConfigurator {
- private String name;
- private String uri;
- private List<Object> extensions = new ArrayList<Object>();
-
- private Component targetComponent;
- private ComponentService targetComponentService;
- private Binding targetBinding;
-
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private IntentAttachPointType bindingType = new TestSCABindingType();
- private List<ConfiguredOperation> configuredOperations = new ArrayList<ConfiguredOperation>();
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- /**
- * Constructs a new SCA binding.
- */
- protected TestSCABindingImpl() {
- }
-
- public String getName() {
- return name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public List<Object> getExtensions() {
- return extensions;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-
- /**
- * @see java.lang.Object#clone()
- */
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- /**
- * @return the targetComponent
- */
- public Component getTargetComponent() {
- return targetComponent;
- }
-
- /**
- * @param targetComponent the targetComponent to set
- */
- public void setTargetComponent(Component targetComponent) {
- this.targetComponent = targetComponent;
- }
-
- /**
- * @return the targetComponentService
- */
- public ComponentService getTargetComponentService() {
- return targetComponentService;
- }
-
- /**
- * @param targetComponentService the targetComponentService to set
- */
- public void setTargetComponentService(ComponentService targetComponentService) {
- this.targetComponentService = targetComponentService;
- }
-
- /**
- * @return the targetBinding
- */
- public Binding getTargetBinding() {
- return targetBinding;
- }
-
- /**
- * @param targetBinding the targetBinding to set
- */
- public void setTargetBinding(Binding targetBinding) {
- this.targetBinding = targetBinding;
- }
-
- public List<PolicySet> getPolicySets() {
- // TODO Auto-generated method stub
- return policySets;
- }
-
- public List<Intent> getRequiredIntents() {
- // TODO Auto-generated method stub
- return requiredIntents;
- }
-
- public IntentAttachPointType getType() {
- // TODO Auto-generated method stub
- return bindingType;
- }
-
- public void setType(IntentAttachPointType type) {
- this.bindingType = type;
- }
-
- private class TestSCABindingType implements IntentAttachPointType {
- private QName name = new QName("http://www.osoa.org/xmlns/sca/1.0","binding");
-
- public List<Intent> getAlwaysProvidedIntents() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<Intent> getMayProvideIntents() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public QName getName() {
- return name;
- }
-
- public boolean isUnresolved() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public void setName(QName type) {
- // TODO Auto-generated method stub
-
- }
-
- public void setUnresolved(boolean unresolved) {
- // TODO Auto-generated method stub
-
- }
-
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
- public List<ConfiguredOperation> getConfiguredOperations() {
- return configuredOperations;
- }
-
- public void setConfiguredOperations(List<ConfiguredOperation> configuredOperations) {
- this.configuredOperations = configuredOperations;
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WireTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WireTestCase.java
deleted file mode 100644
index 5235df5037..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WireTestCase.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-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.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.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test the wiring of SCA XML assemblies.
- *
- * @version $Rev$ $Date$
- */
-public class WireTestCase {
-
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static ModelResolver resolver;
- private static URLArtifactProcessor<Definitions> policyDefinitionsProcessor;
- private static CompositeBuilder compositeBuilder;
- private static Monitor monitor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
- resolver = new DefaultModelResolver();
-
- MonitorFactory monitorFactory = new DefaultMonitorFactory();
- monitor = monitorFactory.createMonitor();
-
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- SCABindingFactory scaBindingFactory = new TestSCABindingFactoryImpl();
- modelFactories.addFactory(scaBindingFactory);
- compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
-
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
-
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- policyDefinitionsProcessor = documentProcessors.getProcessor(Definitions.class);
- }
-
- @Test
- public void testResolveConstrainingType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- ConstrainingType constrainingType = (ConstrainingType)staxProcessor.read(reader);
- is.close();
- assertNotNull(constrainingType);
- resolver.addModel(constrainingType);
-
- is = getClass().getResourceAsStream("TestAllCalculator.composite");
- reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
- is.close();
- assertNotNull(composite);
-
- URL url = getClass().getResource("test_definitions.xml");
- URI uri = URI.create("test_definitions.xml");
- Definitions scaDefns = (Definitions)policyDefinitionsProcessor.read(null, uri, url);
- assertNotNull(scaDefns);
-
- policyDefinitionsProcessor.resolve(scaDefns, resolver);
-
- staxProcessor.resolve(composite, resolver);
- compositeBuilder.build(composite, null, monitor);
-
- assertEquals(composite.getConstrainingType(), constrainingType);
- assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType);
- }
-
- @Test
- public void testResolveComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("Calculator.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite nestedComposite = (Composite)staxProcessor.read(reader);
- is.close();
- assertNotNull(nestedComposite);
- resolver.addModel(nestedComposite);
-
- is = getClass().getResourceAsStream("TestAllCalculator.composite");
- reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
- is.close();
-
- URL url = getClass().getResource("test_definitions.xml");
- URI uri = URI.create("test_definitions.xml");
- Definitions scaDefns = (Definitions)policyDefinitionsProcessor.read(null, uri, url);
- assertNotNull(scaDefns);
-
- policyDefinitionsProcessor.resolve(scaDefns, resolver);
-
- staxProcessor.resolve(composite, resolver);
- compositeBuilder.build(composite, null, monitor);
-
- assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteAllTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteAllTestCase.java
deleted file mode 100644
index df760c1d1f..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteAllTestCase.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-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.assembly.SCABindingFactory;
-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.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.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test writing SCA XML assemblies.
- *
- * @version $Rev$ $Date$
- */
-public class WriteAllTestCase {
- private static XMLInputFactory inputFactory;
- private static XMLOutputFactory outputFactory;
- private static ExtensibleStAXArtifactProcessor staxProcessor;
- private static ModelResolver resolver;
- private static CompositeBuilder compositeBuilder;
- private static URLArtifactProcessor<Definitions> policyDefinitionsProcessor;
- private static Monitor monitor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- resolver = new DefaultModelResolver();
-
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- SCABindingFactory scaBindingFactory = new TestSCABindingFactoryImpl();
- modelFactories.addFactory(scaBindingFactory);
- compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
-
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
-
- MonitorFactory monitorFactory = new DefaultMonitorFactory();
- monitor = monitorFactory.createMonitor();
-
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- policyDefinitionsProcessor = documentProcessors.getProcessor(Definitions.class);
- }
-
- @Test
- public void testReadWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite");
- Composite composite = staxProcessor.read(is, Composite.class);
-
- verifyComposite(composite);
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, bos);
- bos.close();
-
- ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
- composite = staxProcessor.read(bis, Composite.class);
-
- verifyComposite(composite);
-
- }
-
- @Test
- public void testReadWireWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite");
- Composite composite = staxProcessor.read(is, Composite.class);
-
- URL url = getClass().getResource("test_definitions.xml");
- URI uri = URI.create("test_definitions.xml");
- Definitions scaDefns = (Definitions)policyDefinitionsProcessor.read(null, uri, url);
- assertNotNull(scaDefns);
- policyDefinitionsProcessor.resolve(scaDefns, resolver);
-
- staxProcessor.resolve(composite, resolver);
- compositeBuilder.build(composite, null, monitor);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, bos);
- }
-
- @Test
- public void testReadWriteComponentType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
- ComponentType componentType = staxProcessor.read(is, ComponentType.class);
- staxProcessor.resolve(componentType, resolver);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(componentType, bos);
- }
-
- @Test
- public void testReadWriteConstrainingType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
- ConstrainingType constrainingType = staxProcessor.read(is, ConstrainingType.class);
- staxProcessor.resolve(constrainingType, resolver);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(constrainingType, bos);
- }
-
- private void verifyComposite(Composite composite) {
- assertEquals(composite.getProperties().get(0).getName(),"prop1");
- assertEquals(composite.getProperties().get(0).isMany(), true);
- assertEquals(composite.getProperties().get(1).getName(),"prop2");
- assertEquals(composite.getProperties().get(1).isMustSupply(), true);
- assertEquals(composite.getProperties().get(0).getXSDType(), new QName("http://foo", "MyComplexType"));
- assertEquals(composite.getProperties().get(1).getXSDElement(), new QName("http://www.osoa.org/xmlns/sca/1.0", "MyComplexPropertyValue1"));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteNamespacesTestCase.java b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteNamespacesTestCase.java
deleted file mode 100644
index dedd0d0660..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteNamespacesTestCase.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-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.Component;
-import org.apache.tuscany.sca.assembly.Composite;
-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.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test writing SCA XML assemblies.
- *
- * @version $Rev$ $Date$
- */
-public class WriteNamespacesTestCase {
- private static StAXArtifactProcessor<Composite> compositeProcessor;
- private static XMLOutputFactory outputFactory;
- private static XMLInputFactory inputFactory;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
- //outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
- inputFactory = modelFactories.getFactory(XMLInputFactory.class);
-
- StAXArtifactProcessorExtensionPoint artifactProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- compositeProcessor = artifactProcessors.getProcessor(Composite.class);
- }
-
- @Test
- public void testReadWriteComposite() throws Exception {
-
- // Read
- InputStream is = getClass().getResourceAsStream("NestedCalculator.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = compositeProcessor.read(reader);
- Component component = composite.getComponents().get(0);
- Composite implementation = (Composite)component.getImplementation();
- QName qname = implementation.getName();
-
- // Write
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(bos);
- compositeProcessor.write(composite, writer);
- System.out.println(bos);
-
- // Read again
- is = new ByteArrayInputStream(bos.toByteArray());
- reader = inputFactory.createXMLStreamReader(is);
- composite = compositeProcessor.read(reader);
-
- // Compare
- component = composite.getComponents().get(0);
- implementation = (Composite)component.getImplementation();
-
- assertEquals(qname, implementation.getName());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Calculator.composite b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Calculator.composite
deleted file mode 100644
index 602d42a06a..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Calculator.composite
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:x="http://x"
- xmlns:calc="http://calc"
- targetNamespace="http://calc"
- name="Calculator">
-
- <service name="CalculatorService" promote="CalculatorServiceComponent">
- <interface.java interface="calculator.CalculatorService"/>
- </service>
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" multiplicity="0..1" 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>
-
- <x:unknownElement uknAttr="attribute1">
- <y:subUnknownElement1 xmlns:y="http://y" uknAttr1="attribute2"/>
- <x:subUnknownElement2 />
- </x:unknownElement>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorComponent.constrainingType b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorComponent.constrainingType
deleted file mode 100644
index d6ec9b0ff0..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorComponent.constrainingType
+++ /dev/null
@@ -1,34 +0,0 @@
-<?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.
--->
-<constrainingType xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:calc="http://calc"
- targetNamespace="http://calc"
- name="CalculatorComponent">
-
- <service name="CalculatorService">
- <interface.java class="calculator.CalculatorService" />
- </service>
-
- <reference name="divideService" multiplicity="1..1">
- <interface.java class="calculator.DivideService" />
- </reference>
-
-</constrainingType>
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorImpl.componentType b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorImpl.componentType
deleted file mode 100644
index 299eb8c197..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorImpl.componentType
+++ /dev/null
@@ -1,31 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
- <service name="CalculatorService">
- <interface.java interface="calculator.CalculatorService" />
- </service>
-
- <reference name="divideService">
- <interface.java interface="calculator.DivideService" />
- </reference>
-
-</componentType>
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/JavaScriptReference.composite b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/JavaScriptReference.composite
deleted file mode 100644
index a313dd1e6d..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/JavaScriptReference.composite
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- name="JavaScriptReference">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.helloworld.HelloWorldProxy"/>
- </component>
-
- <component name="ReferenceComponent">
- <tuscany:implementation.script script="org/apache/tuscany/sca/implementation/script/itests/references/reference.js"/>
- <reference name="ref" target="TargetComponent" />
- </component>
-
- <component name="TargetComponent">
- <implementation.java class="org.apache.tuscany.sca.implementation.script.itests.references.HelloWorldTarget"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Multiplicity.composite b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Multiplicity.composite
deleted file mode 100644
index a221c23eec..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Multiplicity.composite
+++ /dev/null
@@ -1,30 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0" name="composite1" targetNamespace="http://temp">
- <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/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/NestedCalculator.composite b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/NestedCalculator.composite
deleted file mode 100644
index 2719ee9162..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/NestedCalculator.composite
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:calc="http://calc"
- targetNamespace="http://calc"
- name="Calculator">
-
- <component name="CalculatorServiceComponent">
- <implementation.composite xmlns:n="http://inner" name="n:InnerCalculator"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/RMIBindingTest.composite b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/RMIBindingTest.composite
deleted file mode 100644
index 2a0bcf0f76..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/RMIBindingTest.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- name="HelloWorldRmiComposite">
-
- <service name="HelloWorldRmiService" promote="HelloWorldServiceComponent">
- <interface.java interface="helloworld.HelloWorldService"/>
- <tuscany:binding.rmi uri="rmi://localhost:8099/HelloWorldRemoteService" />
- </service>
-
- <component name="HelloWorldServiceComponent">
- <implementation.java class="helloworld.HelloWorldImpl"/>
- </component>
-
- <component name="HelloWorldRmiServiceComponent">
- <implementation.java class="helloworld.HelloWorldRmiImpl"/>
- <reference name="extService"></reference>
- </component>
-
- <reference name="HelloWorldRmiReference" promote="HelloWorldRmiServiceComponent/extService">
- <interface.java interface="helloworld.HelloWorldService"/>
- <tuscany:binding.rmi uri="rmi://localhost:8099/HelloWorldRemoteService" />
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllCalculator.composite b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllCalculator.composite
deleted file mode 100644
index 5091ff700b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllCalculator.composite
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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" constrainingType="tns:CalculatorComponent" local="true" name="TestAllCalculator" policySets="sns:SecureReliablePolicy"
- requires="cns:confidentiality" targetNamespace="http://calc" xmlns:tns="http://calc"
- xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osoa.org/xmlns/sca/1.0 http://www.osoa.org/xmlns/sca/1.0 "
- xmlns:ext="http://extension"
- xmlns:cns="http://test" xmlns:sns="http://test">
-
- <include name="tns:TestAllDivide"/>
- <ext:testExtension/>
-
- <service name="CalculatorService" promote="CalculatorServiceComponent/CalculatorService" requires="cns:confidentiality"
- policySets="sns:SecureReliablePolicy">
- <ext:testExtension/>
- <interface.java interface="calculator.CalculatorService" callbackInterface="calculator.CalculatorCallback" />
- <operation name="add" policySets="sns:SecureReliablePolicy" requires="cns:confidentiality" />
-
- <binding.ws name="CalculatorWS" policySets="sns:SecureReliablePolicy" port="" requires="cns:confidentiality" uri="http://calc/ws">
- <operation name="add" policySets="sns:SecureReliablePolicy" requires="cns:confidentiality" />
- </binding.ws>
-
- <callback policySets="sns:SecureReliablePolicy" requires="cns:confidentiality">
- <ext:testExtension/>
- <binding.ws name="CalculatorCallbackWS" policySets="" port="" requires="" uri="http://calc/callback/ws">
- <operation name="addCallback" policySets="sns:SecureReliablePolicy" requires="cns:confidentiality" />
- </binding.ws>
- </callback>
- </service>
-
- <component name="CalculatorServiceComponent" autowire="false" constrainingType="tns:CalculatorComponent"
- policySets="sns:SecureReliablePolicy" requires="cns:confidentiality">
- <ext:testExtension/>
- <service name="CalculatorService" policySets="sns:SecureReliablePolicy" requires="cns:confidentiality">
- <interface.java interface="calculator.CalculatorService" callbackInterface="calculator.CalculatorCallback" />
- </service>
-
- <reference name="addService" target="AddServiceComponent/AddService" autowire="false" multiplicity="1..1"
- policySets="sns:SecureReliablePolicy" requires="cns:confidentiality" wiredByImpl="false">
- <ext:testExtension/>
- <interface.java interface="calculator.AddService" callbackInterface="calculator.AddCallback" />
- </reference>
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" />
- <reference name="divideService" target="DivideServiceComponent" />
-
- <property name="round" type="xsd:boolean" many="false">true</property>
-
- <implementation.java class="calculator.CalculatorServiceImpl" policySets="" requires="" />
- </component>
-
- <component name="AddServiceComponent">
- <service name="AddService">
- <interface.java interface="calculator.AddService" />
- </service>
- <implementation.java class="calculator.AddServiceImpl" />
- </component>
-
- <component name="NestedCompositeComponent">
- <service name="CalculatorService">
- <interface.java interface="calculator.CalculatorService" />
- </service>
- <implementation.composite name="tns:Calculator" />
- </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>
-
- <reference name="MultiplyService" promote="CalculatorServiceComponent/multiplyService" policySets="sns:SecureReliablePolicy"
- requires="cns:confidentiality">
- <interface.java interface="calculator.MultiplyService" callbackInterface="calculator.MultiplyCallback" />
- <operation name="multiply" policySets="sns:SecureReliablePolicy" requires="cns:confidentiality" />
-
- <binding.ws name="MultiplyWS" port="" policySets="sns:SecureReliablePolicy" requires="cns:confidentiality" uri="http://calc/ws">
- <operation name="multiply" policySets="sns:SecureReliablePolicy" requires="cns:confidentiality" />
- </binding.ws>
-
- <callback policySets="sns:SecureReliablePolicy" requires="cns:confidentiality">
- <binding.ws name="MultiplyCallbackWS" port="" uri="http://calc/callback/ws" policySets="sns:SecureReliablePolicy"
- requires="cns:confidentiality">
- <operation name="multiplyCallback" policySets="sns:SecureReliablePolicy" requires="cns:confidentiality" />
- </binding.ws>
- </callback>
- </reference>
-
- <property name="prop1" xmlns:foo="http://foo" many="true" type="foo:MyComplexType">
- <ext:testExtension/>
- <MyComplexPropertyValue1 xsi:type="foo:MyComplexType" attr="bar">
- <foo:a>AValue</foo:a>
- <bar:b xmlns:bar="http://bar">InterestingURI</bar:b>
- </MyComplexPropertyValue1>
- <MyComplexPropertyValue2 xsi:type="foo:MyComplexType" attr="zing">
- <foo:a>BValue</foo:a>
- <bar:b xmlns:bar="http://bar">BoringURI</bar:b>
- </MyComplexPropertyValue2>
- </property>
-
- <property name="prop2" xmlns:foo="http://foo" mustSupply="true" element="MyComplexPropertyValue1"/>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllDivide.composite b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllDivide.composite
deleted file mode 100644
index d59e69209d..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllDivide.composite
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- constrainingType="tns:Calculator"
- local="true"
- name="TestAllDivide"
- policySets="" requires=""
- targetNamespace="http://calc"
- xmlns:tns="http://calc"
- xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osoa.org/xmlns/sca/1.0 http://www.osoa.org/xmlns/sca/1.0 ">
-
- <include name="tns:CompleteDivide"/>
-
- <service name="DivideService" policySets="" promote="CalculatorDivideComponent/DivideService" requires="">
- <interface.java interface="calculator.DivideService" callbackInterface="calculator.DivideCallback"/>
- <operation name="divide" policySets="" requires=""/>
-
- <binding.ws name="CalculatorWS" policySets="" port="" requires="" uri="http://calc/ws">
- <operation name="divide" policySets="" requires=""/>
- </binding.ws>
-
- <callback policySets="" requires="">
- <binding.ws name="CalculatorCallbackWS" policySets="" port="" requires="" uri="http://calc/callback/ws">
- <operation name="divideCallback" policySets="" requires=""/>
- </binding.ws>
- </callback>
- </service>
-
- <component name="CalculatorDivideComponent" autowire="false" constrainingType="tns:CalculatorServiceComponent" policySets="" requires="">
- <service name="DivideService" policySets="" requires="">
- <interface.java interface="calculator.DivideService" callbackInterface="calculator.DivideCallback"/>
- </service>
- <implementation.java class="calculator.DivideImpl" policySets="" requires=""/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllPolicyCalculator.composite b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllPolicyCalculator.composite
deleted file mode 100644
index 7bc7ccdb83..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllPolicyCalculator.composite
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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" constrainingType="tns:CalculatorComponent" local="true" name="TestAllCalculator"
- requires="cns:tuscanyIntent_1" targetNamespace="http://calc" xmlns:tns="http://calc"
- xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osoa.org/xmlns/sca/1.0 http://www.osoa.org/xmlns/sca/1.0 "
- xmlns:ext="http://extension"
- xmlns:cns="http://test" xmlns:sns="http://test">
-
- <include name="tns:TestAllDivide"/>
- <ext:testExtension/>
-
- <service name="CalculatorService" promote="CalculatorServiceComponent/CalculatorService" requires="cns:tuscanyIntent_2 cns:tuscanyIntent_1">
- <ext:testExtension/>
- <interface.java interface="calculator.CalculatorService" callbackInterface="calculator.CalculatorCallback" />
- <operation name="add" requires="cns:tuscanyIntent_6"/>
-
- <binding.ws name="CalculatorWS" port="" requires="cns:tuscanyIntent_3" uri="http://calc/ws">
- </binding.ws>
-
- <callback requires="cns:tuscanyIntent_4">
- <ext:testExtension/>
- <binding.ws name="CalculatorCallbackWS" policySets="" port="" requires="cns:tuscanyIntent_5" uri="http://calc/callback/ws">
- </binding.ws>
- </callback>
- </service>
-
- <component name="CalculatorServiceComponent" autowire="false" constrainingType="tns:CalculatorComponent"
- requires="cns:tuscanyIntent_2 cns:tuscanyIntent_3">
- <ext:testExtension/>
- <service name="CalculatorService" requires="cns:tuscanyIntent_3">
- <interface.java interface="calculator.CalculatorService" callbackInterface="calculator.CalculatorCallback" />
- <operation name="add" requires="cns:tuscanyIntent_6 cns:tuscanyIntent_7"/>
- <binding.ws name="CalculatorCallbackWS" policySets="" port="" requires="cns:tuscanyIntent_4" uri="http://calc/callback/ws">
- </binding.ws>
- <callback>
- </callback>
- </service>
-
- <reference name="addService" target="AddServiceComponent/AddService" autowire="false" multiplicity="1..1"
- requires="cns:tuscanyIntent_3 cns:tuscanyIntent_2.qualified" wiredByImpl="false">
- <ext:testExtension/>
- <interface.java interface="calculator.AddService" callbackInterface="calculator.AddCallback" />
- <operation name="add" requires="cns:tuscanyIntent_8 cns:tuscanyIntent_9"/>
- <binding.ws name="addServiceWSRef" policySets="" port="" requires="cns:tuscanyIntent_4" uri="http://calc/callback/ws">
- </binding.ws>
- </reference>
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" />
- <reference name="divideService" target="DivideServiceComponent" />
-
- <property name="round" type="xsd:boolean" many="false">true</property>
-
- <implementation.java class="calculator.CalculatorServiceImpl" policySets="" requires="cns:tuscanyIntent_4" />
- </component>
-
- <component name="AddServiceComponent">
- <service name="AddService">
- <interface.java interface="calculator.AddService" />
- </service>
- <implementation.java class="calculator.AddServiceImpl" />
- </component>
-
- <component name="NestedCompositeComponent">
- <service name="CalculatorService">
- <interface.java interface="calculator.CalculatorService" />
- </service>
- <implementation.composite name="tns:Calculator" />
- </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>
-
- <reference name="MultiplyService" promote="CalculatorServiceComponent/multiplyService"
- requires="cns:tuscanyIntent_2">
- <interface.java interface="calculator.MultiplyService" callbackInterface="calculator.MultiplyCallback" />
- <operation name="multiply" requires="cns:tuscanyIntent_6"/>
-
- <binding.ws name="MultiplyWS" port="" requires="cns:tuscanyIntent_3" uri="http://calc/ws">
- </binding.ws>
-
- <callback policySets="sns:SecureReliablePolicy" requires="cns:tuscanyIntent_3">
- <binding.ws name="MultiplyCallbackWS" port="" uri="http://calc/callback/ws"
- requires="cns:tuscanyIntent_4">
- </binding.ws>
- </callback>
- </reference>
-
- <property name="prop1" xmlns:foo="http://foo">
- <ext:testExtension/>
- <MyComplexPropertyValue1 xsi:type="foo:MyComplexType" attr="bar">
- <foo:a>AValue</foo:a>
- <bar:b xmlns:bar="http://bar">InterestingURI</bar:b>
- </MyComplexPropertyValue1>
- <MyComplexPropertyValue2 xsi:type="foo:MyComplexType" attr="zing">
- <foo:a>BValue</foo:a>
- <bar:b xmlns:bar="http://bar">BoringURI</bar:b>
- </MyComplexPropertyValue2>
- </property>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/another_test_definitions.xml b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/another_test_definitions.xml
deleted file mode 100644
index bcc8c54dc8..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/another_test_definitions.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
-<!-- simple intent -->
- <sca:intent name="tuscanyIntent_1"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_2"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- </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>
- <!-- qualified intents -->
- <sca:intent name="tuscanyIntent_1.qualified" />
- <sca:intent name="tuscanyIntent_2.qualified" />
-</sca:definitions> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/local.composite b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/local.composite
deleted file mode 100644
index 3bda9ac31c..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/local.composite
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:calc="http://localcalc"
- xmlns:test="http://testlocal"
- targetNamespace="http://localcalc"
- name="LocalCalculator"
- local="true">
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/test_definitions.xml b/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/test_definitions.xml
deleted file mode 100644
index b79cb6b7b7..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/test_definitions.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
- <!-- qualified intents -->
- <sca:intent name="confidentiality.transport" />
- <sca:intent name="confidentiality.message" />
- <sca:intent name="confidentiality.message.whole" />
- <sca:intent name="confidentiality.message.body" />
-
- <!-- POLICY SETS -->
- <sca:policySet name="SecureReliablePolicy"
- provides="confidentiality.transport integrity"
- appliesTo="//sca:binding.ws | //sca:binding.sca"
- xmlns="http://test"
- 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>
- </sca:policySet>
-
- <sca:policySet name="SecureMessagingPolicies"
- provides="confidentiality"
- appliesTo="//sca:binding.ws"
- xmlns="http://test"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <sca:intentMap provides="confidentiality" default="transport">
- <sca:qualifier name="transport">
- <wsp:Policy>
- <!-- policy expression and policy subject for "transport" alternative -->
- </wsp:Policy>
- <wsp:Policy>...</wsp:Policy>
- </sca:qualifier>
- <sca:qualifier name="message">
- <wsp:Policy>
- <!-- policy expression and policy subject for "message" alternative" -->
- </wsp:Policy>
- </sca:qualifier>
- </sca:intentMap>
-</sca:policySet>
-
-<sca:policySet name="SecurityPolicy" provides="confidentiality"
- xmlns="http://test"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" >
- <sca:intentMap provides="confidentiality" default="message">
- <sca:qualifier name="message">
- <sca:intentMap provides="message" default="whole">
- <sca:qualifier name="body">
- <wsp:Policy>
- <!-- policy attachment for body encryption -->
- </wsp:Policy>
- </sca:qualifier>
- <sca:qualifier name="whole">
- <wsp:Policy>
- <!-- policy attachment for whole message encryption -->
- </wsp:Policy>
- </sca:qualifier>
- </sca:intentMap>
- </sca:qualifier>
- <sca:qualifier name="transport">
- <wsp:Policy>
- <!-- policy attachment for transport encryption -->
- </wsp:Policy>
- </sca:qualifier>
- </sca:intentMap>
-</sca:policySet>
-
-<sca:policySet name="BasicAuthMsgProtSecurity"
- provides="authentication confidentiality"
- appliesTo="//sca:binding.ws"
- xmlns="http://test">
- <sca:policySetReference name="AuthenticationPolicies"/>
- <sca:policySetReference name="ConfidentialityPolicies"/>
-</sca:policySet>
-
-<sca:policySet name="AuthenticationPolicies"
- provides="authentication"
- appliesTo="//sca:binding.ws"
- xmlns="http://test"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "basic
- authentication" -->
- </wsp:PolicyAttachment>
-</sca:policySet>
-
-<sca:policySet name="ConfidentialityPolicies"
- provides="confidentiality"
- bindings="binding.ws"
- xmlns="http://test"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <sca:intentMap provides="confidentiality" default="transport">
- <sca:qualifier name="transport">
- <wsp:Policy>
- <!-- policy expression and policy subject for "transport"
- alternative -->
- </wsp:Policy>
- <wsp:Policy>...</wsp:Policy>
- </sca:qualifier>
- <sca:qualifier name="message">
- <wsp:Policy>
- <!-- policy expression and policy subject for "message"
- alternative" -->...
- </wsp:Policy>
- </sca:qualifier>
- </sca:intentMap>
-</sca:policySet>
-
-<!-- profile intent -->
- <sca:intent name="reliableMessageProtection"
- constrains="sca:binding"
- requires="messageProtection">
- <sca:description>
- Protect messages from unauthorized reading or modification
- </sca:description>
- </sca:intent>
-
- <sca:intent name="messageProtection"
- constrains="sca:binding"
- requires="confidentiality integrity">
- <sca:description>
- Protect messages from unauthorized reading or modification
- </sca:description>
- </sca:intent>
-
-<!-- simple intent -->
- <sca:intent name="confidentiality"
- constrains="sca:binding">
- <sca:description>
- Communitcation thro this binding must prevent
- unauthorized users from reading the messages.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="integrity"
- constrains="sca:binding">
- <sca:description>
- Communitcation thro this binding must prevent
- unauthorized modification of the messages.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="authentication"
- constrains="sca:binding">
- <sca:description>
- Communitcation thro this binding required
- Authentication.
- </sca:description>
- </sca:intent>
-
-</sca:definitions> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/LICENSE b/tags/java/sca/2.0-M1/modules/assembly-xsd/LICENSE
deleted file mode 100644
index 646cd58e09..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/LICENSE
+++ /dev/null
@@ -1,281 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
-===============================================================================
-
-Apache Tuscany SCA for Java Subcomponents
-=========================================:
-
-The Tuscany SCA for Java release includes a number of subcomponents with
-separate copyright notices and license terms. Your use of the source
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses.
-
-===============================================================================
-
-This module includes XSD files under the following SCA Collaboration license:
-
-License for the Service Component Architecture JavaDoc, Interface Definition files and XSD files.
-
-Permission to copy, make derivative works of, and distribute the Service Component Architecture
-JavaDoc, Interface Definition Files and XSD files in any medium without fee or royalty as part
-of a compliant implementation of the Service Component Architecture Specification is hereby granted.
-The Service Components Architecture Specification may be found at the following location:
-
- http://www.osoa.org/download/attachments/35/SCA_AssemblyModel_V100.pdf
-
-THE SERVICE COMPONENT ARCHITECTURE SPECIFICATION AND THE JAVADOC, INTERFACE DEFINITION FILES AND XSD FILES
-ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
-SPECIFICATION OR THE JAVADOC, INTERFACE DEFINITION FILES AND XSD FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
-INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
-INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
-SERVICE COMPONENT ARCHITECTURE SPECIFICATION OR THE JAVADOC, INTERFACE DEFINTION FILES OR XSD FILES.
-
-The name and trademarks of the Authors may NOT be used in any manner, including advertising or
-publicity pertaining to the Service Component Architecture Specification or its contents without specific,
-written prior permission. Title to copyright in the Service Component Architecture Specification and the
-JavaDoc, Interface Definition Files and XSD Files will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-===============================================================================
-
-This module includes XSD files under the following W3C(r) Software License:
-
-W3C(r) SOFTWARE NOTICE AND LICENSE
-http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-
-This work (and included software, documentation such as READMEs, or other related items)
-is being provided by the copyright holders under the following license. By obtaining,
-using and/or copying this work, you (the licensee) agree that you have read, understood,
-and will comply with the following terms and conditions.
-
-Permission to copy, modify, and distribute this software and its documentation, with or
-without modification, for any purpose and without fee or royalty is hereby granted, provided
-that you include the following on ALL copies of the software and documentation or portions
-thereof, including modifications:
-
- 1. The full text of this NOTICE in a location viewable to users of the redistributed or
- derivative work.
- 2. Any pre-existing intellectual property disclaimers, notices, or terms and conditions.
- If none exist, the W3C Software Short Notice should be included (hypertext is preferred,
- text is permitted) within the body of any redistributed or derivative code.
- 3. Notice of any changes or modifications to the files, including the date changes were
- made. (We recommend you provide URIs to the location from which the code is derived.)
-
-THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO
-REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES
-OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
-DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER
-RIGHTS.
-
-COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL
-DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
-
-The name and trademarks of copyright holders may NOT be used in advertising or publicity
-pertaining to the software without specific, written prior permission. Title to copyright
-in this software and any associated documentation will at all times remain with copyright
-holders.
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/assembly-xsd/META-INF/MANIFEST.MF
deleted file mode 100644
index 7d6d0951f4..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Assembly Model XML Schemas
-Bnd-LastModified: 1225397088359
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-ManifestVersion: 2
-Bundle-Description: Apache Tuscany SCA Assembly Model XML Schemas
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-DocURL: http://www.apache.org/
-Bundle-SymbolicName: org.apache.tuscany.sca.assembly.xsd
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/NOTICE b/tags/java/sca/2.0-M1/modules/assembly-xsd/NOTICE
deleted file mode 100644
index 91c3b75575..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/NOTICE
+++ /dev/null
@@ -1,23 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software under the SCA Collaboration license
-(see the LICENSE file contained in this distribution), with the following
-copyright:
-
-(c) Copyright SCA Collaboration 2006, 2007
-
-This product also includes software under the W3C(r) Software License
-(see the LICENSE file contained in this distribution), with the following
-copyright:
-
-Copyright (c) 2004 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(r) 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
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/pom.xml b/tags/java/sca/2.0-M1/modules/assembly-xsd/pom.xml
deleted file mode 100644
index 0041132886..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/pom.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-assembly-xsd</artifactId>
- <name>Apache Tuscany SCA Assembly Model XSD Files</name>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
deleted file mode 100644
index 69b2701e30..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-tuscany-sca.xsd \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-all.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-all.xsd
deleted file mode 100644
index 63e83884e0..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-all.xsd
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
-
- <include schemaLocation="sca.xsd"/>
-
- <include schemaLocation="sca-binding-ejb.xsd"/>
-
- <include schemaLocation="sca-implementation-bpel.xsd"/>
- <include schemaLocation="sca-implementation-spring.xsd"/>
- <include schemaLocation="sca-implementation-ejb.xsd"/>
- <include schemaLocation="sca-implementation-jee.xsd"/>
- <include schemaLocation="sca-implementation-web.xsd"/>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-ejb.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-ejb.xsd
deleted file mode 100644
index 26bedfcce5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-ejb.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="binding.ejb" type="sca:EJBSessionBeanBinding"
- substitutionGroup="sca:binding" />
-
- <simpleType name="BeanType">
- <restriction base="string">
- <enumeration value="stateless"/>
- <enumeration value="stateful"/>
- </restriction>
- </simpleType>
-
- <simpleType name="VersionValue">
- <restriction base="string">
- <enumeration value="EJB2"/>
- <enumeration value="EJB3"/>
- </restriction>
- </simpleType>
-
-
- <complexType name="EJBSessionBeanBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="homeInterface" type="NCName" use="optional"/>
- <attribute name="ejb-link-name" type="NCName" use="optional"/>
- <attribute name="session-type" type="sca:BeanType" use="optional" default="stateless"/>
- <attribute name="ejb-version" type="sca:VersionValue" use="optional" default="EJB2"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-jms.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-jms.xsd
deleted file mode 100644
index 93718aaa35..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-jms.xsd
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <complexType name="JMSBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <element name="destination" type="sca:Destination" minOccurs="0"/>
- <element name="connectionFactory" type="sca:ConnectionFactory"
- minOccurs="0"/>
- <element name="activationSpec" type="sca:ActivationSpec"
- minOccurs="0"/>
- <element name="response" type="sca:Response" minOccurs="0"/>
- <element name="headers" type="sca:Headers" minOccurs="0"/>
- <element name="resourceAdapter" type="sca:ResourceAdapter"
- minOccurs="0"/>
- <element name="operationProperties" type="sca:OperationProperties"
- minOccurs="0" maxOccurs="unbounded"/>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="correlationScheme"
- default="RequestMsgIDToCorrelID">
- <simpleType>
- <restriction base="string">
- <enumeration value="RequestMsgIDToCorrelID"/>
- <enumeration value="RequestCorrelIDToCorrelID"/>
- <enumeration value="None"/>
- </restriction>
- </simpleType>
- </attribute>
-
- <attribute name="initialContextFactory" type="anyURI"/>
- <attribute name="jndiURL" type="anyURI"/>
- <attribute name="requestConnection" type="QName"/>
- <attribute name="responseConnection" type="QName"/>
- <attribute name="operationProperties" type="QName"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-
- <simpleType name="CreateResource">
- <restriction base="string">
- <enumeration value="always"/>
- <enumeration value="never"/>
- <enumeration value="ifnotexist"/>
- </restriction>
- </simpleType>
-
- <complexType name="Destination">
- <sequence>
- <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="anyURI" use="required"/>
- <attribute name="type" use="optional" default="queue">
- <simpleType>
- <restriction base="string">
- <enumeration value="queue"/>
- <enumeration value="topic"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="create" type="sca:CreateResource"
- use="optional" default="ifnotexist"/>
- </complexType>
-
- <complexType name="ConnectionFactory">
- <sequence> <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="anyURI" use="required"/>
- <attribute name="create" type="sca:CreateResource"
- use="optional" default="ifnotexist"/>
- </complexType>
-
- <complexType name="ActivationSpec">
- <sequence>
- <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="anyURI" use="required"/>
- <attribute name="create" type="sca:CreateResource"
- use="optional" default="ifnotexist"/>
- </complexType>
-
- <complexType name="Response">
- <sequence>
- <element name="destination" type="sca:Destination" minOccurs="0"/>
- <element name="connectionFactory" type="sca:ConnectionFactory"
- minOccurs="0"/>
- <element name="activationSpec" type="sca:ActivationSpec" minOccurs="0"/>
- </sequence>
- </complexType>
-
- <complexType name="Headers">
- <sequence>
- <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="JMSType" type="string"/>
- <attribute name="JMSCorrelationID" type="string"/>
- <attribute name="JMSDeliveryMode" type="string"/>
- <attribute name="JMSTimeToLive" type="int"/>
- <attribute name="JMSPriority" type="string"/>
- </complexType>
-
- <complexType name="SubscriptionHeaders">
- <attribute name="JMSSelector" type="string"/>
- </complexType>
-
- <complexType name="ResourceAdapter">
- <sequence>
- <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="string" use="required"/>
- </complexType>
-
- <complexType name="OperationProperties">
- <sequence>
- <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- <element name="headers" type="sca:Headers"/>
- </sequence>
- <attribute name="name" type="string" use="required"/>
- <attribute name="nativeOperation" type="string"/>
- </complexType>
-
- <element name="binding.jms" type="sca:JMSBinding"
- substitutionGroup="sca:binding"/>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-sca.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-sca.xsd
deleted file mode 100644
index 02703402ef..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-sca.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="binding.sca" type="sca:SCABinding"
- substitutionGroup="sca:binding"/>
- <complexType name="SCABinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-webservice.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-webservice.xsd
deleted file mode 100644
index 2dd44f8e06..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-binding-webservice.xsd
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- xmlns:wsa="http://www.w3.org/2004/12/addressing"
- elementFormDefault="qualified">
-
- <import namespace="http://www.w3.org/2004/08/wsdl-instance"
- schemaLocation="wsdli.xsd" />
- <!-- import namespace="http://www.w3.org/2005/08/addressing"
- schemaLocation="ws-addr.xsd" /-->
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="binding.ws" type="sca:WebServiceBinding"
- substitutionGroup="sca:binding"/>
- <complexType name="WebServiceBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <!-- element ref="wsa:EndpointReference" minOccurs="0"
- maxOccurs="unbounded"/-->
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="wsdlElement" type="anyURI" use="optional"/>
- <attribute ref="wsdli:wsdlLocation" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-contributions.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-contributions.xsd
deleted file mode 100644
index caf5d8010f..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-contributions.xsd
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="contribution" type="sca:ContributionType"/>
- <complexType name="ContributionType">
- <sequence>
- <element name="deployable" type="sca:DeployableType" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="sca:import" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="sca:export" minOccurs="0" maxOccurs="unbounded"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <complexType name="DeployableType">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="composite" type="QName" use="required"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <element name="import" type="sca:ImportType"/>
- <complexType name="ImportType">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="namespace" type="string" use="required"/>
- <attribute name="location" type="anyURI" use="required"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <element name="export" type="sca:ExportType"/>
- <complexType name="ExportType">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="namespace" type="string" use="required"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <element name="import.resource" type="sca:ImportResourceType" substitutionGroup="sca:import"/>
- <complexType name="ImportResourceType">
- <complexContent>
- <extension base="sca:ImportType">
- <attribute name="uri" type="anyURI" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="export.resource" type="sca:ExportResourceType" substitutionGroup="sca:export"/>
- <complexType name="ExportResourceType">
- <complexContent>
- <extension base="sca:ExportType">
- <attribute name="uri" type="anyURI" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-core.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-core.xsd
deleted file mode 100644
index f03d0eab01..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-core.xsd
+++ /dev/null
@@ -1,348 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <element name="componentType" type="sca:ComponentType"/>
- <complexType name="ComponentType">
- <sequence>
- <choice minOccurs="0" maxOccurs="1">
- <element ref="sca:implementation"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="service" type="sca:ComponentService" />
- <element name="reference" type="sca:ComponentReference"/>
- <element name="property" type="sca:Property"/>
- </choice>
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- -->
- </sequence>
- <attribute name="constrainingType" type="QName" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="composite" type="sca:Composite"/>
- <complexType name="Composite">
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="include" type="sca:Include"/>
- <element name="service" type="sca:Service"/>
- <element name="property" type="sca:Property"/>
- <element name="component" type="sca:Component"/>
- <element name="reference" type="sca:Reference"/>
- <element name="wire" type="sca:Wire"/>
- <!-- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> -->
- </choice>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="targetNamespace" type="anyURI" use="optional"/>
- <attribute name="local" type="boolean" use="optional" default="false"/>
- <attribute name="autowire" type="boolean" use="optional" default="false"/>
- <attribute name="constrainingType" type="QName" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Service">
- <sequence>
- <element ref="sca:interface" minOccurs="0" maxOccurs="1" />
- <element name="operation" type="sca:Operation" minOccurs="0"
- maxOccurs="unbounded" />
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding" />
- <any namespace="##other" processContents="lax"/>
- </choice>
- <element ref="sca:callback" minOccurs="0" maxOccurs="1" />
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required" />
- <attribute name="promote" type="anyURI" use="required" />
- <attribute name="requires" type="sca:listOfQNames" use="optional" />
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax" />
- </complexType>
-
- <element name="interface" type="sca:Interface" abstract="true" />
- <complexType name="Interface" abstract="true"/>
-
- <complexType name="Reference">
- <sequence>
- <element ref="sca:interface" minOccurs="0" maxOccurs="1" />
- <element name="operation" type="sca:Operation" minOccurs="0"
- maxOccurs="unbounded" />
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding" />
- <any namespace="##other" processContents="lax" />
- </choice>
- <element ref="sca:callback" minOccurs="0" maxOccurs="1" />
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required" />
- <attribute name="target" type="sca:listOfAnyURIs" use="optional"/>
- <attribute name="wiredByImpl" type="boolean" use="optional" default="false"/>
- <attribute name="multiplicity" type="sca:Multiplicity"
- use="optional" default="1..1" />
- <attribute name="promote" type="sca:listOfAnyURIs" use="required" />
- <attribute name="requires" type="sca:listOfQNames" use="optional" />
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax" />
- </complexType>
-
- <complexType name="SCAPropertyBase" mixed="true">
- <!-- mixed="true" to handle simple type -->
- <sequence>
- <any namespace="##any" processContents="lax" minOccurs="0"
- maxOccurs="1" />
- <!-- NOT an extension point; This xsd:any exists to accept
- the element-based or complex type property
- i.e. no element-based extension point under "sca:property" -->
- </sequence>
- </complexType>
-
- <!-- complex type for sca:property declaration -->
- <complexType name="Property" mixed="true">
- <complexContent>
- <extension base="sca:SCAPropertyBase">
- <!-- extension defines the place to hold default value -->
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="type" type="QName" use="optional"/>
- <attribute name="element" type="QName" use="optional"/>
- <attribute name="many" type="boolean" default="false"
- use="optional"/>
- <attribute name="mustSupply" type="boolean" default="false"
- use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- <!-- an extension point ; attribute-based only -->
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="PropertyValue" mixed="true">
- <complexContent>
- <extension base="sca:SCAPropertyBase">
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="type" type="QName" use="optional"/>
- <attribute name="element" type="QName" use="optional"/>
- <attribute name="many" type="boolean" default="false"
- use="optional"/>
- <attribute name="source" type="string" use="optional"/>
- <attribute name="file" type="anyURI" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- <!-- an extension point ; attribute-based only -->
- </extension>
- </complexContent>
- </complexType>
-
- <element name="binding" type="sca:Binding" abstract="true"/>
- <complexType name="Binding" abstract="true">
- <sequence>
- <element name="operation" type="sca:Operation" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="uri" type="anyURI" use="optional"/>
- <attribute name="name" type="QName" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- </complexType>
-
- <element name="bindingType" type="sca:BindingType"/>
- <complexType name="BindingType">
- <sequence minOccurs="0" maxOccurs="unbounded">
- <any namespace="##other" processContents="lax" />
- </sequence>
- <attribute name="type" type="QName" use="required"/>
- <attribute name="alwaysProvides" type="sca:listOfQNames" use="optional"/>
- <attribute name="mayProvide" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="callback" type="sca:Callback"/>
- <complexType name="Callback">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Component">
- <sequence>
- <choice minOccurs="0" maxOccurs="1">
- <element ref="sca:implementation"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="service" type="sca:ComponentService"/>
- <element name="reference" type="sca:ComponentReference"/>
- <element name="property" type="sca:PropertyValue" />
- </choice>
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="autowire" type="boolean" use="optional" default="false"/>
- <attribute name="constrainingType" type="QName" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="ComponentService">
- <sequence>
- <element ref="sca:interface" minOccurs="0" maxOccurs="1"/>
- <element name="operation" type="sca:Operation" minOccurs="0"
- maxOccurs="unbounded" />
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding" />
- <any namespace="##other" processContents="lax"/>
- </choice>
- <element ref="sca:callback" minOccurs="0" maxOccurs="1"/>
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="requires" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="ComponentReference">
- <sequence>
- <element ref="sca:interface" minOccurs="0" maxOccurs="1" />
- <element name="operation" type="sca:Operation" minOccurs="0"
- maxOccurs="unbounded" />
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding" />
- <any namespace="##other" processContents="lax" />
- </choice>
- <element ref="sca:callback" minOccurs="0" maxOccurs="1" />
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required" />
- <attribute name="target" type="sca:listOfAnyURIs" use="optional"/>
- <attribute name="multiplicity" type="sca:Multiplicity"
- use="optional" default="1..1" />
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- <anyAttribute namespace="##any" processContents="lax" />
- </complexType>
-
- <element name="implementation" type="sca:Implementation"
- abstract="true" />
- <complexType name="Implementation" abstract="true">
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- </complexType>
-
- <element name="implementationType" type="sca:ImplementationType"/>
- <complexType name="ImplementationType">
- <sequence minOccurs="0" maxOccurs="unbounded">
- <any namespace="##other" processContents="lax" />
- </sequence>
- <attribute name="type" type="QName" use="required"/>
- <attribute name="alwaysProvides" type="sca:listOfQNames" use="optional"/>
- <attribute name="mayProvide" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Wire">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="source" type="anyURI" use="required"/>
- <attribute name="target" type="anyURI" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="include" type="sca:Include"/>
- <complexType name="Include">
- <attribute name="name" type="QName"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Operation">
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="constrainingType" type="sca:ConstrainingType"/>
- <complexType name="ConstrainingType">
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="service" type="sca:ComponentService"/>
- <element name="reference" type="sca:ComponentReference"/>
- <element name="property" type="sca:Property" />
- </choice>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="targetNamespace" type="anyURI"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
-
- <simpleType name="Multiplicity">
- <restriction base="string">
- <enumeration value="0..1"/>
- <enumeration value="1..1"/>
- <enumeration value="0..n"/>
- <enumeration value="1..n"/>
- </restriction>
- </simpleType>
-
- <simpleType name="OverrideOptions">
- <restriction base="string">
- <enumeration value="no"/>
- <enumeration value="may"/>
- <enumeration value="must"/>
- </restriction>
- </simpleType>
-
- <!-- Global attribute definition for @requires to permit use of intents
- within WSDL documents -->
- <attribute name="requires" type="sca:listOfQNames"/>
-
- <!-- Global attribute defintion for @endsConversation to mark operations
- as ending a conversation -->
- <attribute name="endsConversation" type="boolean" default="false"/>
-
- <simpleType name="listOfQNames">
- <list itemType="QName"/>
- </simpleType>
-
- <simpleType name="listOfAnyURIs">
- <list itemType="anyURI"/>
- </simpleType>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-definitions.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-definitions.xsd
deleted file mode 100644
index 0249882a92..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-definitions.xsd
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
- <include schemaLocation="sca-policy.xsd"/>
-
- <element name="definitions">
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:intent"/>
- <element ref="sca:policySet"/>
- <element ref="sca:binding"/>
- <element ref="sca:bindingType"/>
- <element ref="sca:implementationType"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </choice>
- <attribute name="targetNamespace" type="anyURI" use="optional"/>
- </complexType>
- </element>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-bpel.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-bpel.xsd
deleted file mode 100644
index 87b443fb36..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-bpel.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<xsd:schema xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <xsd:include schemaLocation="sca-core.xsd" />
-
- <xsd:element name="implementation.bpel" type="BpelImplementation"
- substitutionGroup="implementation" />
-
- <xsd:complexType name="BpelImplementation">
- <xsd:complexContent>
- <xsd:extension base="Implementation">
- <xsd:sequence>
- <xsd:any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="process" type="xsd:QName" use="required" />
- <xsd:anyAttribute namespace="##any" processContents="lax" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="interface.partnerLinkType" type="BpelPartnerLinkType"
- substitutionGroup="interface" />
-
- <xsd:complexType name="BpelPartnerLinkType">
- <xsd:complexContent>
- <xsd:extension base="Interface">
- <xsd:sequence>
- <xsd:any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="type" type="xsd:QName" use="required" />
- <xsd:attribute name="serviceRole" type="xsd:NCName" use="optional" />
- <xsd:anyAttribute namespace="##any" processContents="lax" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-</xsd:schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-composite.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-composite.xsd
deleted file mode 100644
index 99669bc672..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-composite.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
- <element name="implementation.composite" type="sca:SCAImplementation"
- substitutionGroup="sca:implementation"/>
- <complexType name="SCAImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="QName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-cpp.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-cpp.xsd
deleted file mode 100644
index 6f1cf14a4b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-cpp.xsd
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sdo="commonj.sdo/XML"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.cpp" type="sca:CPPImplementation" substitutionGroup="sca:implementation" />
- <complexType name="CPPImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <element name="method" type="sca:CPPImplementationMethod" minOccurs="0" maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="library" type="NCName" use="required"/>
- <attribute name="header" type="NCName" use="required"/>
- <attribute name="path" type="NCName" use="optional"/>
- <attribute name="class" type="Name" use="optional"/>
- <attribute name="scope" type="sca:CPPImplementationScope" use="optional"/>
- <attribute name="eagerInit" type="boolean" use="optional"/>
- <attribute name="allowsPassByReference" type="boolean" use="optional"/>
- <attribute name="conversationMaxAge" type="string" use="optional"/>
- <attribute name="conversationMaxIdle" type="string" use="optional"/>
- <attribute name="conversationSinglePrincipal" type="boolean" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-
- <simpleType name="CPPImplementationScope">
- <restriction base="string">
- <enumeration value="stateless"/>
- <enumeration value="composite"/>
- <enumeration value="request"/>
- <enumeration value="converstion"/>
- </restriction>
- </simpleType>
-
- <complexType name="CPPImplementationMethod">
- <complexContent>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="allowsPassByReference" type="boolean" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexContent>
- </complexType>
-
-</schema>
-
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-ejb.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-ejb.xsd
deleted file mode 100644
index a7e781b18f..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-ejb.xsd
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.ejb" type="sca:EJBImplementation"
- substitutionGroup="sca:implementation"/>
- <complexType name="EJBImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <!-- we might want to make this refer to the JEE ejb-link type -->
- <attribute name="ejb-link" type="token" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-java.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-java.xsd
deleted file mode 100644
index f9d8171b8e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-java.xsd
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.java" type="sca:JavaImplementation"
- substitutionGroup="sca:implementation"/>
- <complexType name="JavaImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="class" type="NCName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-jee.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-jee.xsd
deleted file mode 100644
index 83e6bb75bf..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-jee.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.jee" type="sca:JEEImplementation" substitutionGroup="sca:implementation" />
- <complexType name="JEEImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="archive" type="string" use="required" />
- <anyAttribute namespace="##any" processContents="lax" />
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-spring.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-spring.xsd
deleted file mode 100644
index 1cf9fb3ea9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-spring.xsd
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.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> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-web.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-web.xsd
deleted file mode 100644
index a1adf10fd9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-implementation-web.xsd
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.web" type="sca:WebImplementation"
- substitutionGroup="sca:implementation"/>
- <complexType name="WebImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="web-uri" type="string" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-cpp.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-cpp.xsd
deleted file mode 100644
index 44f14e5ed5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-cpp.xsd
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.commonj.org/xmlns/sca/1.0/"
- xmlns:sca="http://www.commonj.org/xmlns/sca/1.0/"
- xmlns:sdo="commonj.sdo/XML"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="interface.cpp" type="sca:CPPInterface" substitutionGroup="sca:interface"/>
-
- <complexType name="CPPInterface">
- <complexContent>
- <extension base="sca:Interface">
- <sequence>
- <element name="method" type="sca:CPPMethod" minOccurs="0" maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="header" type="NCName" use="required"/>
- <attribute name="class" type="Name" use="required"/>
- <attribute name="callbackHeader" type="NCName" use="optional"/>
- <attribute name="callbackClass" type="Name" use="optional"/>
- <attribute name="remotable" type="boolean" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="CPPMethod">
- <complexContent>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="oneWay" type="boolean" use="optional"/>
- <attribute name="endConversation" type="boolean" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexContent>
- </complexType>
-
-</schema>
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-java.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-java.xsd
deleted file mode 100644
index 81f939bdb4..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-java.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="interface.java" type="sca:JavaInterface" substitutionGroup="sca:interface"/>
- <complexType name="JavaInterface">
- <complexContent>
- <extension base="sca:Interface">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="interface" type="NCName" use="required"/>
- <attribute name="callbackInterface" type="NCName" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-wsdl.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-wsdl.xsd
deleted file mode 100644
index c1fdfd8f3c..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-interface-wsdl.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="interface.wsdl" type="sca:WSDLPortType" substitutionGroup="sca:interface"/>
- <complexType name="WSDLPortType">
- <complexContent>
- <extension base="sca:Interface">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="interface" type="anyURI" use="required"/>
- <attribute name="callbackInterface" type="anyURI" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-policy.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-policy.xsd
deleted file mode 100644
index 2c4875f36c..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca-policy.xsd
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="intent" type="sca:Intent"/>
- <complexType name="Intent">
- <sequence>
- <element name="description" type="string" minOccurs="0" maxOccurs="1" />
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="QName" use="required"/>
- <attribute name="constrains" type="sca:listOfQNames" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="excludes" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="policySet" type="sca:PolicySet"/>
- <complexType name="PolicySet">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="policySetReference" type="sca:PolicySetReference"/>
- <element name="intentMap" type="sca:IntentMap"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <attribute name="name" type="QName" use="required"/>
- <attribute name="provides" type="sca:listOfQNames" use="optional"/>
- <attribute name="appliesTo" type="string" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="PolicySetReference">
- <attribute name="name" type="QName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="IntentMap">
- <choice minOccurs="1" maxOccurs="unbounded">
- <element name="qualifier" type="sca:Qualifier"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <attribute name="provides" type="QName" use="required"/>
- <attribute name="default" type="string" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Qualifier">
- <choice minOccurs="1" maxOccurs="unbounded">
- <element name="intentMap" type="sca:IntentMap"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <attribute name="name" type="string" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="allow" type="sca:Allow"/>
- <complexType name="Allow">
- <attribute name="roles" type="string" use="required"/>
- </complexType>
-
- <element name="permitAll" type="sca:PermitAll"/>
- <complexType name="PermitAll"/>
-
- <element name="denyAll" type="sca:DenyAll"/>
- <complexType name="DenyAll"/>
-
- <element name="runAs" type="sca:RunAs"/>
- <complexType name="RunAs">
- <attribute name="role" type="string" use="required"/>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca.xsd
deleted file mode 100644
index e4471a4f51..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/sca.xsd
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <include schemaLocation="sca-interface-java.xsd"/>
- <include schemaLocation="sca-interface-wsdl.xsd"/>
-
- <include schemaLocation="sca-implementation-java.xsd"/>
- <include schemaLocation="sca-implementation-composite.xsd"/>
-
- <include schemaLocation="sca-binding-webservice.xsd"/>
- <include schemaLocation="sca-binding-jms.xsd"/>
- <include schemaLocation="sca-binding-sca.xsd"/>
-
- <include schemaLocation="sca-contributions.xsd"/>
-
- <include schemaLocation="sca-contributions.xsd"/>
-
- <include schemaLocation="sca-definitions.xsd"/>
- <include schemaLocation="sca-policy.xsd"/>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-atom.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-atom.xsd
deleted file mode 100644
index d400810835..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-atom.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.atom" type="t:AtomBinding"/>
-
- <complexType name="AtomBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="title" type="string" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-corba.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-corba.xsd
deleted file mode 100644
index 0baa364f42..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-corba.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.corba" type="t:CorbaBinding"/>
-
- <complexType name="CorbaBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="host" type="string" use="required"/>
- <attribute name="port" type="string" use="optional"/>
- <attribute name="id" type="string" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-dwr.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-dwr.xsd
deleted file mode 100644
index 788571de7b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-dwr.xsd
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.dwr" type="t:DWRBinding"/>
-
- <complexType name="DWRBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-gdata.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-gdata.xsd
deleted file mode 100644
index 2096a014aa..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-gdata.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.gdata" type="t:GDataBinding"/>
-
- <complexType name="GDataBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="serviceType" type="string" use="required"/>
- <attribute name="username" type="string" use="optional"/>
- <attribute name="password" type="string" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-http.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-http.xsd
deleted file mode 100644
index bd36a8f52f..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-http.xsd
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.http" type="t:HTTPBinding"/>
-
- <complexType name="HTTPBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jms.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jms.xsd
deleted file mode 100644
index b998427ecb..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jms.xsd
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-binding-jms.xsd"/>
-
- <complexType name="WireFormatJMSTextXMLType"/>
- <element name="wireFormat.jmsTextXML" type="t:WireFormatJMSTextXMLType"/>
-
- <complexType name="WireFormatJMSTextType"/>
- <element name="wireFormat.jmsText" type="t:WireFormatJMSTextType"/>
-
- <complexType name="WireFormatJMSBytesType"/>
- <element name="wireFormat.jmsBytes" type="t:WireFormatJMSBytesType"/>
-
- <complexType name="WireFormatJMSObjectType"/>
- <element name="wireFormat.jmsObject" type="t:WireFormatJMSObjectType"/>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jsonrpc.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jsonrpc.xsd
deleted file mode 100644
index bacfdda781..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-jsonrpc.xsd
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.jsonrpc" type="t:JSONRPCBinding"/>
-
- <complexType name="JSONRPCBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-notification.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-notification.xsd
deleted file mode 100644
index 6d5468b2f9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-notification.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.notification" type="t:NotificationBinding"/>
-
- <complexType name="NotificationBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="ntm" type="anyURI" use="optional"/>
- <attribute name="notificationType" type="anyURI" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-rmi.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-rmi.xsd
deleted file mode 100644
index 26be6feae5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-rmi.xsd
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.rmi" type="t:RMIBinding"/>
-
- <complexType name="RMIBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-rss.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-rss.xsd
deleted file mode 100644
index 5af65aced2..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-binding-rss.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.rss" type="t:RSSBinding"/>
-
- <complexType name="RSSBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="title" type="string" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-data-helper.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-data-helper.xsd
deleted file mode 100644
index 4331da0439..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-data-helper.xsd
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://data.tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:data="http://data.tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <complexType name="ConnectionProperties">
- <attribute name="driverClass" type="string" />
- <attribute name="databaseURL" type="string" />
- <attribute name="userName" type="string" default="" />
- <attribute name="password" type="string" default="" />
- <attribute name="loginTimeout" type="int" default="0" />
- </complexType>
-
- <complexType name="ConnectionInfo">
- <sequence>
- <element maxOccurs="1" minOccurs="0"
- name="ConnectionProperties" type="data:ConnectionProperties" />
- </sequence>
- <attribute name="dataSource" type="string" />
- <attribute name="managedtx" type="boolean"
- default="true" />
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-das.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-das.xsd
deleted file mode 100644
index 1f6f9abb16..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-das.xsd
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:data="http://data.tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
- <import namespace="http://data.tuscany.apache.org/xmlns/sca/1.0" schemaLocation="tuscany-sca-data-helper.xsd"/>
-
- <element name="implementation.das" type="t:DASImplementation"/>
-
- <complexType name="DASImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- <element maxOccurs="1" minOccurs="0" name="ConnectionInfo"
- type="data:ConnectionInfo"/>
- </sequence>
- <attribute name="config" type="NCName" use="required"/>
- <attribute name="dataAccessType" type="NCName" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-data-xml.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-data-xml.xsd
deleted file mode 100644
index 4a06bdd36a..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-data-xml.xsd
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:data="http://data.tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
- <import namespace="http://data.tuscany.apache.org/xmlns/sca/1.0" schemaLocation="tuscany-sca-data-helper.xsd"/>
-
- <element name="implementation.data" type="t:DATAImplementation"/>
-
- <complexType name="DATAImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- <element maxOccurs="1" minOccurs="0" name="ConnectionInfo"
- type="data:ConnectionInfo"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-node.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-node.xsd
deleted file mode 100644
index 1b5c8aece2..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-node.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.node" type="t:NodeImplementation"/>
-
- <complexType name="NodeImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="uri" type="string" use="required"/>
- <attribute name="composite" type="QName" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-notification.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-notification.xsd
deleted file mode 100644
index f8d437310e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-notification.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.notification" type="t:NotificationImplementation"/>
-
- <complexType name="NotificationImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-osgi.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-osgi.xsd
deleted file mode 100644
index f8ece54a07..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-osgi.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.osgi" type="t:OSGiImplementation"/>
-
- <!-- TODO Declare the proper attributes and elements -->
- <complexType name="OSGiImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##any" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-resource.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-resource.xsd
deleted file mode 100644
index dd596821ea..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-resource.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.resource" type="t:ResourceImplementation"/>
-
- <complexType name="ResourceImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="location" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-script.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-script.xsd
deleted file mode 100644
index e1723d65f0..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-script.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.script" type="t:ScriptImplementation"/>
-
- <complexType name="ScriptImplementation">
- <complexContent mixed="true">
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="script" type="anyURI" use="optional"/>
- <attribute name="language" type="NCName" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-widget.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-widget.xsd
deleted file mode 100644
index 0c0998595f..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-widget.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.widget" type="t:WidgetImplementation"/>
-
- <complexType name="WidgetImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="location" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-xquery.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-xquery.xsd
deleted file mode 100644
index cdabb697aa..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca-implementation-xquery.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.xquery" type="t:XQueryImplementation"/>
-
- <complexType name="XQueryImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="location" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca.xsd
deleted file mode 100644
index 213ba7da5e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/tuscany-sca.xsd
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0">
-
- <import namespace="http://www.w3.org/2004/08/wsdl-instance" schemaLocation="wsdli.xsd"/>
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-all.xsd"/>
- <import namespace="http://data.tuscany.apache.org/xmlns/sca/1.0" schemaLocation="tuscany-sca-data-helper.xsd"/>
-
- <include schemaLocation="tuscany-sca-binding-atom.xsd"/>
- <include schemaLocation="tuscany-sca-binding-corba.xsd"/>
- <include schemaLocation="tuscany-sca-binding-dwr.xsd"/>
- <include schemaLocation="tuscany-sca-binding-gdata.xsd"/>
- <include schemaLocation="tuscany-sca-binding-http.xsd"/>
- <include schemaLocation="tuscany-sca-binding-jsonrpc.xsd"/>
- <include schemaLocation="tuscany-sca-binding-jms.xsd"/>
- <include schemaLocation="tuscany-sca-binding-notification.xsd"/>
- <include schemaLocation="tuscany-sca-binding-rmi.xsd"/>
- <include schemaLocation="tuscany-sca-binding-rss.xsd"/>
-
- <!--
- <include schemaLocation="tuscany-sca-implementation-das.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-data-xml.xsd"/>
- -->
- <include schemaLocation="tuscany-sca-implementation-node.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-notification.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-osgi.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-resource.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-script.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-widget.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-xquery.xsd"/>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/wsdli.xsd b/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/wsdli.xsd
deleted file mode 100644
index 79af5e9363..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly-xsd/src/main/resources/wsdli.xsd
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"-->
-<!-- $Id: wsdl-instance.xsd,v 1.1 2004/08/03 16:02:04 hugo Exp $ -->
-<!--
- W3C XML Schema defined in the Web Services Description (WSDL)
- Version 2.0 specification
- http://www.w3.org/TR/wsdl20
-
- Copyright (c) 2004 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(r) 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
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance" targetNamespace="http://www.w3.org/2004/08/wsdl-instance" elementFormDefault="qualified" finalDefault="" blockDefault="" attributeFormDefault="unqualified">
-
- <xs:attribute name="wsdlLocation">
- <xs:annotation>
- <xs:documentation>
- This attribute can be used to provide some hints on where
- additional WSDL information for a given namespace can be
- found in order to help with QName resolution
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:list itemType="xs:anyURI"/>
- </xs:simpleType>
- </xs:attribute>
-
-</xs:schema>
diff --git a/tags/java/sca/2.0-M1/modules/assembly/LICENSE b/tags/java/sca/2.0-M1/modules/assembly/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/assembly/META-INF/MANIFEST.MF
deleted file mode 100644
index 06b5451177..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,44 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.assembly;uses:="javax.xml.xpath
- ,org.apache.tuscany.sca.assembly.impl,org.apache.tuscany.sca.policy,o
- rg.apache.tuscany.sca.interfacedef,javax.xml.namespace";version="2.0.0"
- ,org.apache.tuscany.sca.assembly.impl;uses:="javax.xml.xpath,org.apac
- he.tuscany.sca.assembly,org.apache.tuscany.sca.policy,org.apache.tusc
- any.sca.interfacedef,javax.xml.namespace";version="2.0.0",org.apache.tu
- scany.sca.assembly.builder;uses:="org.apache.tuscany.sca.assembly,org
- .apache.tuscany.sca.definitions,org.apache.tuscany.sca.core,org.apach
- e.tuscany.sca.monitor,org.apache.tuscany.sca.interfacedef,org.apache.
- tuscany.sca.extensibility";version="2.0.0"
-Private-Package: org.apache.tuscany.sca.assembly.builder.impl;version=
- "2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Assembly Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397097203
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Assembly Model
-Import-Package: javax.xml.namespace,
- javax.xml.parsers,
- javax.xml.transform,
- javax.xml.transform.dom,
- javax.xml.transform.sax,
- javax.xml.xpath,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.builder;version="2.0.0",
- org.apache.tuscany.sca.assembly.impl;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0",
- org.apache.tuscany.sca.extensibility;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.policy.util;version="2.0.0",
- org.w3c.dom,
- org.xml.sax
-Bundle-SymbolicName: org.apache.tuscany.sca.assembly
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly/NOTICE b/tags/java/sca/2.0-M1/modules/assembly/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly/pom.xml b/tags/java/sca/2.0-M1/modules/assembly/pom.xml
deleted file mode 100644
index 48912c5427..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-assembly</artifactId>
- <name>Apache Tuscany SCA Assembly Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-monitor</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java
deleted file mode 100644
index b8487d95c5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-
-/**
- * Interface contracts define one or more business functions. These business
- * functions are provided by services and are used by references.
- *
- * @version $Rev$ $Date$
- */
-public interface AbstractContract extends Base, Extensible, IntentAttachPoint, OperationsConfigurator {
-
- /**
- * Returns the name of the contract.
- *
- * @return the name of the contract
- */
- String getName();
-
- /**
- * Sets the name of the contract.
- *
- * @param name the name of the contract
- */
- void setName(String name);
-
- /**
- * Returns the interface contract defining the interface and callback
- * interface for the contract.
- *
- * @return the interface contract
- */
- InterfaceContract getInterfaceContract();
-
- /**
- * Sets the interface contract defining the interface and callback
- * interface for the contract.
- *
- * @param interfaceContract the interface contract
- */
- void setInterfaceContract(InterfaceContract interfaceContract);
-
- /**
- * Returns true if this contract is a reference or service created internally
- * to handle a callback interface of another contract, false otherwise.
- *
- * @return true for a callback contract, false otherwise
- */
- boolean isCallback();
-
- /**
- * Sets a flag indicating whether this is a callback contract.
- *
- * @param isCallback true for a callback contract, false otherwise
- */
- void setIsCallback(boolean isCallback);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java
deleted file mode 100644
index 05f0e60981..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-
-/**
- * A property allows for the configuration of an implementation with externally
- * set data values. An implementation can have zero or more properties. Each
- * property has a data type, which may be either simple or complex. An
- * implementation may also define a default value for a property.
- *
- * @version $Rev$ $Date$
- */
-public interface AbstractProperty extends Base, Extensible, IntentAttachPoint {
-
- /**
- * Returns the property name.
- *
- * @return the property name
- */
- String getName();
-
- /**
- * Sets the property name.
- *
- * @param name the property name
- */
- void setName(String name);
-
- /**
- * Returns the default value of the property.
- *
- * @return the default value of this property
- */
- Object getValue();
-
- /**
- * Sets the default value of the property.
- *
- * @param defaultValue the default value of this property
- */
- void setValue(Object defaultValue);
-
- /**
- * Returns true if the property allows multiple values.
- *
- * @return true if the property allows multiple values
- */
- boolean isMany();
-
- /**
- * Sets whether or not the property allows multiple values.
- *
- * @param many true if the property should allow multiple values
- */
- void setMany(boolean many);
-
- /**
- * Returns true if a value must be supplied for the property.
- *
- * @return true is a value must be supplied for the property
- */
- boolean isMustSupply();
-
- /**
- * Sets whether a value must be supplied for the property.
- *
- * @param mustSupply set to true to require that a value be supplied for
- * uses of this property
- */
- void setMustSupply(boolean mustSupply);
-
- /**
- * Returns the data type of this property. This is the qualified name of an
- * XML schema type.
- *
- * @return the type of this property
- */
- QName getXSDType();
-
- /**
- * Sets the data type of this property. This is the qualified name of an XML
- * schema type.
- *
- * @param type the type of this property
- */
- void setXSDType(QName type);
-
- /**
- * Returns the element defining the data type of this property. This is the
- * qualified name of an XML schema element.
- *
- * @return the element defining the type of this property
- */
- QName getXSDElement();
-
- /**
- * Sets the element defining the data type of this property. This is the
- * qualified name of an XML schema element.
- *
- * @param element the element defining the type of this property
- */
- void setXSDElement(QName element);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java
deleted file mode 100644
index a9ef26bbb9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-/**
- * Represents a reference contract.
- *
- * @version $Rev$ $Date$
- */
-public interface AbstractReference extends AbstractContract {
-
- /**
- * Returns the multiplicity allowed for wires connected to this reference.
- *
- * @return the multiplicity allowed for wires connected to this reference
- */
- Multiplicity getMultiplicity();
-
- /**
- * Sets the multiplicity allowed for wires connected to this reference.
- *
- * @param multiplicity the multiplicity allowed for wires connected to this
- * reference
- */
- void setMultiplicity(Multiplicity multiplicity);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java
deleted file mode 100644
index 9ae511c07b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-/**
- * Represents a service contract.
- *
- * @version $Rev$ $Date$
- */
-public interface AbstractService extends AbstractContract {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java
deleted file mode 100644
index 8a4fc6dfda..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-
-/**
- * A factory for the assembly model
- *
- * @version $Rev$ $Date$
- */
-public interface AssemblyFactory {
-
- /**
- * Create a new abstract property.
- *
- * @return a new abstract property
- */
- AbstractProperty createAbstractProperty();
-
- /**
- * Create a new abstract reference.
- *
- * @return a new abstract reference
- */
- AbstractReference createAbstractReference();
-
- /**
- * Create a new abstract service.
- *
- * @return a new abstract service
- */
- AbstractService createAbstractService();
-
- /**
- * Create a new callback.
- *
- * @return
- */
- Callback createCallback();
-
- /**
- * Create a new component.
- *
- * @return a new component
- */
- Component createComponent();
-
- /**
- * Create a new component property.
- *
- * @return a new component property
- */
- ComponentProperty createComponentProperty();
-
- /**
- * Create a new component reference.
- *
- * @return a new component reference
- */
- ComponentReference createComponentReference();
-
- /**
- * Create a new component service.
- *
- * @return a new component service
- */
- ComponentService createComponentService();
-
- /**
- * Create a new component type
- *
- * @return a new component type
- */
- ComponentType createComponentType();
-
- /**
- * Create a new composite.
- *
- * @return a new composite
- */
- Composite createComposite();
-
- /**
- * Create a new composite reference.
- *
- * @return a new composite reference
- */
- CompositeReference createCompositeReference();
-
- /**
- * Create a new composite service.
- *
- * @return a new composite service
- */
- CompositeService createCompositeService();
-
- /**
- * Create a new constraining type.
- *
- * @return a new constraining type
- */
- ConstrainingType createConstrainingType();
-
- /**
- * Create a new property.
- *
- * @return a new property
- */
- Property createProperty();
-
- /**
- * Create a new reference.
- *
- * @return a new reference
- */
- Reference createReference();
-
- /**
- * Create a new service.
- *
- * @return a new service
- */
- Service createService();
-
- /**
- * Create a new wire.
- *
- * @return a new wire
- */
- Wire createWire();
-
- /**
- * Create a new configured operation.
- *
- * @return a new ConfiguredOperation
- */
- ConfiguredOperation createConfiguredOperation();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java
deleted file mode 100644
index 76511d351d..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-
-/**
- * Base interface for all assembly model objects.
- *
- * @version $Rev$ $Date$
- */
-public interface Base {
-
- /**
- * Returns true if the model element is unresolved.
- *
- * @return true if the model element is unresolved.
- */
- boolean isUnresolved();
-
- /**
- * Sets whether the model element is unresolved.
- *
- * @param unresolved whether the model element is unresolved
- */
- void setUnresolved(boolean unresolved);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java
deleted file mode 100644
index f8b7d4d236..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-
-/**
- * Represents a binding.
- *
- * @version $Rev$ $Date$
- */
-public interface Binding extends Base, Cloneable {
-
- /**
- * Returns the binding URI.
- *
- * @return the binding URI
- */
- String getURI();
-
- /**
- * Sets the binding URI.
- *
- * @param uri the binding URI
- */
- void setURI(String uri);
-
- /**
- * Returns the binding name.
- *
- * @return the binding name
- */
- String getName();
-
- /**
- * Sets the binding name.
- *
- * @param name the binding name
- */
- void setName(String name);
-
- /**
- * Clone the binding
- *
- * @return
- */
- Object clone() throws CloneNotSupportedException;
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/BindingRRB.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/BindingRRB.java
deleted file mode 100644
index b0bfdec6d7..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/BindingRRB.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-
-/**
- * TODO RRB experiment.
- * Represents a binding implemented using Request/Response binding chains
- * Used to test the RRB idea hence no integrated into the Binding interface, yet
- *
- * @version $Rev$ $Date$
- */
-public interface BindingRRB extends Binding {
-
- WireFormat getRequestWireFormat();
-
- void setRequestWireFormat(WireFormat wireFormat);
-
- WireFormat getResponseWireFormat();
-
- void setResponseWireFormat(WireFormat wireFormat);
-
- OperationSelector getOperationSelector();
-
- void setOperationSelector(OperationSelector operationSelector);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java
deleted file mode 100644
index f49a653aa9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * Represents a callback object describing the bindings to use for callbacks.
- *
- * @version $Rev$ $Date$
- */
-public interface Callback extends Base, Extensible, IntentAttachPoint, PolicySetAttachPoint, OperationsConfigurator {
-
- /**
- * Returns the bindings supported for callbacks.
- *
- * @return the bindings supported for callbacks
- */
- List<Binding> getBindings();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java
deleted file mode 100644
index 8e1943224c..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * Represents a component. A component is a configured instance of an
- * implementation.
- *
- * @version $Rev$ $Date$
- */
-public interface Component extends Base, Extensible, PolicySetAttachPoint, Cloneable {
-
- /**
- * Returns the URI of the component.
- *
- * @return the URI of the component
- */
- String getURI();
-
- /**
- * Sets the URI of the component.
- *
- * @param uri the URI of the component
- */
- void setURI(String uri);
-
- /**
- * Returns the name of the component.
- *
- * @return the name of the component
- */
- String getName();
-
- /**
- * Sets the name of the component.
- *
- * @param name the name of the component
- */
- void setName(String name);
-
- /**
- * Returns the component implementation.
- *
- * @return the component implementation
- */
- Implementation getImplementation();
-
- /**
- * Sets the component implementation
- *
- * @param implementation the component implementation
- */
- void setImplementation(Implementation implementation);
-
- /**
- * Returns a list of references used by the component.
- *
- * @return a list of references used by the component
- */
- List<ComponentReference> getReferences();
-
- /**
- * Returns a list of services exposed by the component.
- *
- * @return a list of services exposed by the component
- */
- List<ComponentService> getServices();
-
- /**
- * Returns a list of properties for the component.
- *
- * @return a list of properties
- */
- List<ComponentProperty> getProperties();
-
- /**
- * Returns a constraining type defining the shape of the component.
- *
- * @return a constraining type
- */
- ConstrainingType getConstrainingType();
-
- /**
- * Sets a constraining type defining the shape of the component.
- *
- * @param constrainingType the constraining type
- */
- void setConstrainingType(ConstrainingType constrainingType);
-
- /**
- * Return the Boolean value of autowire
- * @return null/TRUE/FALSE
- */
- Boolean getAutowire();
-
- /**
- * Sets whether component references should be autowired.
- *
- * @param autowire whether component references should be autowired
- */
- void setAutowire(Boolean autowire);
-
-
- /**
- * Returns a clone of the component.
- *
- * @return a clone of the component
- * @throws CloneNotSupportedException
- */
- Object clone() throws CloneNotSupportedException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java
deleted file mode 100644
index 13d19b1757..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import javax.xml.xpath.XPathExpression;
-
-/**
- * Represents a configured property of a component.
- *
- * @version $Rev$ $Date$
- */
-public interface ComponentProperty extends Property {
-
- /**
- * Returns the property defined by the component implementation.
- *
- * @return the property defined by the component implementation
- */
- Property getProperty();
-
- /**
- * Sets the property defined by this component implementation.
- *
- * @param property the property defined by this component implementation
- */
- void setProperty(Property property);
-
- /**
- * Returns an XPath expression referencing a property of the enclosing
- * composite.
- *
- * @return an XPath expression referencing a property of the enclosing
- * composite
- */
- String getSource();
-
- /**
- * Sets an XPath expression referencing a property of the enclosing
- * composite.
- *
- * @param source an XPath expression referencing a property of the enclosing
- * composite
- */
- void setSource(String source);
-
- /**
- * Get the XPath expression for the source attribute
- * @return the XPath expression for the source attribute
- */
- XPathExpression getSourceXPathExpression();
-
- /**
- * Set the XPath expression for the source attribute
- * @param sourceXPathExpression the XPath expression for the source attribute
- */
- void setSourceXPathExpression(XPathExpression sourceXPathExpression);
-
- /**
- * Returns a URI to a file containing the property value.
- *
- * @return a URI to a file containing the property value
- */
- String getFile();
-
- /**
- * Sets a URI to a file containing the property value.
- *
- * @param file a URI to a file containing the property value
- */
- void setFile(String file);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java
deleted file mode 100644
index ce40bc089b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-
-
-/**
- * An instance of a reference associated with a particular component.
- *
- * @version $Rev$ $Date$
- */
-public interface ComponentReference extends Reference {
-
- /**
- * Returns the reference defined by the implementation for this reference.
- *
- * @return the implementation reference
- */
- Reference getReference();
-
- /**
- * Sets the reference defined by the implementation for this reference.
- *
- * @param reference the implementation reference
- */
- void setReference(Reference reference);
-
- /**
- * Return the Boolean value of autowire
- * @return null/TRUE/FALSE
- */
- Boolean getAutowire();
-
- /**
- * Sets whether component references should be autowired.
- *
- * @param autowire whether component references should be autowired
- */
- void setAutowire(Boolean autowire);
-
-
- /**
- * Returns the callback service created internally as a target endpoint
- * for callbacks to this reference.
- *
- * @return the callback service
- */
- ComponentService getCallbackService();
-
- /**
- * Sets the callback service created internally as a target endpoint
- * for callbacks to this reference.
- *
- * @param callbackService the callback service
- */
- void setCallbackService(ComponentService callbackService);
-
- /**
- * Returns the endpoints implied by this reference.
- *
- * @return the endpoints implied by this reference
- */
- List<Endpoint> getEndpoints();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java
deleted file mode 100644
index 65945692f1..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-
-/**
- * An addressable instance of a service associated with a particular component.
- *
- * @version $Rev$ $Date$
- */
-public interface ComponentService extends Service {
-
- /**
- * Returns the service defined by the implementation for this service.
- *
- * @return
- */
- Service getService();
-
- /**
- * Sets the service defined by the implementation for this service.
- *
- * @param service
- */
- void setService(Service service);
-
- /**
- * Returns the callback reference created internally as a source endpoint
- * for callbacks from this service.
- *
- * @return the callback reference
- */
- ComponentReference getCallbackReference();
-
- /**
- * Sets the callback reference created internally as a source endpoint
- * for callbacks from this service.
- *
- * @param callbackReference the callback reference
- */
- void setCallbackReference(ComponentReference callbackReference);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java
deleted file mode 100644
index e1ea65ea39..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-/**
- * Describes an implementation and represents its configurable aspects.
- *
- * @version $Rev$ $Date$
- */
-public interface ComponentType extends Base {
-
- /**
- * Returns the URI of this component type.
- * @return the URI of the component type
- */
- String getURI();
-
- /**
- * Sets the URI of this component type.
- * @param uri the URI of the component type
- */
- void setURI(String uri);
-
- /**
- * Returns a list of services that are offered.
- *
- * @return a list of services that are offered
- */
- List<Service> getServices();
-
- /**
- * Returns the list of reference types that are used.
- *
- * @return the list of reference types that are used
- */
- List<Reference> getReferences();
-
- /**
- * Returns the list of properties that can be set.
- *
- * @return the list of properties that can be set
- */
- List<Property> getProperties();
-
- /**
- * Returns a constraining type defining the shape of the implementation.
- *
- * @return a constraining type
- */
- ConstrainingType getConstrainingType();
-
- /**
- * Sets a constraining type defining the shape of the implementation.
- *
- * @param constrainingType the constraining type to set
- */
- void setConstrainingType(ConstrainingType constrainingType);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java
deleted file mode 100644
index 2c7b7c6b9e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-
-/**
- * Represents a composite.
- *
- * @version $Rev$ $Date$
- */
-public interface Composite extends Implementation, Extensible, Cloneable, PolicySetAttachPoint {
-
- /**
- * Returns the name of the composite.
- *
- * @return the name of the composite
- */
- QName getName();
-
- /**
- * Sets the name of the composite.
- *
- * @param name the name of the composite
- */
- void setName(QName name);
-
- /**
- * Returns a list of composites included in this composite.
- *
- * @return a list of composites included in this composite.
- */
- List<Composite> getIncludes();
-
- /**
- * Returns a list of components contained in this composite.
- *
- * @return a list of components contained in this composite
- */
- List<Component> getComponents();
-
- /**
- * Returns a list of wires contained in this composite.
- *
- * @return a list of wires contained in this composite
- */
- List<Wire> getWires();
-
- /**
- * Returns true if all the components within the composite must run in the
- * same process.
- *
- * @return true if all the components within the composite must run in the
- * same process
- */
- boolean isLocal();
-
- /**
- * Sets whether all the components within the composite must run in the same
- * process.
- *
- * @param local whether all the components within the composite must run in
- * the same process
- */
- void setLocal(boolean local);
-
- /**
- * Return the Boolean value of autowire
- * @return null/TRUE/FALSE
- */
- Boolean getAutowire();
-
- /**
- * Sets whether component references should be autowired.
- *
- * @param autowire whether component references should be autowired
- */
- void setAutowire(Boolean autowire);
-
-
- /**
- * Returns a clone of the component type.
- *
- * @return a clone of the component type
- * @throws CloneNotSupportedException
- */
- Object clone() throws CloneNotSupportedException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java
deleted file mode 100644
index d3fa80ba74..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-/**
- * Represents composite reference.
- *
- * @version $Rev$ $Date$
- */
-public interface CompositeReference extends Reference {
-
- /**
- * Returns the promoted composite references.
- *
- * @return the promoted composite references
- */
- List<ComponentReference> getPromotedReferences();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java
deleted file mode 100644
index 7143f571f9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-/**
- * Represents a composite service.
- *
- * @version $Rev$ $Date$
- */
-public interface CompositeService extends Service {
-
- /**
- * Returns the promoted component.
- *
- * @return the promoted component.
- */
- Component getPromotedComponent();
-
- /**
- * Sets the promoted component
- *
- * @param promotedComponent the promoted component.
- */
- void setPromotedComponent(Component promotedComponent);
-
- /**
- * Returns the promoted component service .
- *
- * @return the promoted component service.
- */
- ComponentService getPromotedService();
-
- /**
- * Sets the promoted component service
- *
- * @param promotedService the promoted component service.
- */
- void setPromotedService(ComponentService promotedService);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConfiguredOperation.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConfiguredOperation.java
deleted file mode 100644
index 8832597343..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConfiguredOperation.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * Represents an Operation. Typically Operation elements are used when there is a
- * need to apply certain facets such as intents and policysets only to a specific
- * operation provided by a service or reference.
- *
- * @version $Rev$ $Date$
- */
-public interface ConfiguredOperation extends Base, PolicySetAttachPoint {
- /**
- * Returns the name of the operation.
- *
- * @return the name of the operation
- */
- String getName();
-
- /**
- * Sets the name of the operation.
- *
- * @param name the name of the operation
- */
- void setName(String name);
-
- /**
- * Returns the name of the service or reference to which this operation belongs.
- * This method is particularly useful when operation elements are specified under implementation
- * elements and it is necessary to identify which of the various services provided by the
- * implementation is referred to by the operation element in question
- *
- * @return the name of the contract to which this operation belongs
- */
- String getContractName();
-
- /**
- * Sets the name of the service or reference to which this operation belongs.
- *
- * @param contractName the name of the contract to which this operation belongs
- */
- void setContractName(String contractName);
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConstrainingType.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConstrainingType.java
deleted file mode 100644
index 9890bfed68..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConstrainingType.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-
-/**
- * A constrainingType provides the "shape" for a component and its
- * implementation. Any component configuration that points to a constrainingType
- * is constrained by this shape. The constrainingType specifies the services,
- * references and properties that must be implemented.
- *
- * @version $Rev$ $Date$
- */
-public interface ConstrainingType extends Base, Extensible, IntentAttachPoint {
-
- /**
- * Returns the name of the constrainingType.
- *
- * @return the name of the constrainingType
- */
- QName getName();
-
- /**
- * Sets the name of the constrainingType.
- *
- * @param name the name of the constrainingType
- */
- void setName(QName name);
-
- /**
- * Returns a list of services that are offered.
- *
- * @return a list of services that are offered
- */
- List<AbstractService> getServices();
-
- /**
- * Returns the list of references that are used.
- *
- * @return the list of references that are used
- */
- List<AbstractReference> getReferences();
-
- /**
- * Returns the list of properties that can be set.
- *
- * @return the list of properties that can be set
- */
- List<AbstractProperty> getProperties();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java
deleted file mode 100644
index f9a62774e6..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * Represents a contract. A contract can be either a service or a reference.
- *
- * @version $Rev$ $Date$
- */
-public interface Contract extends AbstractContract, PolicySetAttachPoint, Cloneable {
-
- /**
- * Returns the bindings supported by this contract.
- *
- * @return the bindings supported by this contract
- */
- List<Binding> getBindings();
-
- /**
- * Returns a binding of the specified type or null if there is no such
- * binding configured on this contract.
- *
- * @param <B> the binding type
- * @param bindingClass the binding type class
- * @return the binding or null if there is no binding of the specified type
- */
- <B> B getBinding(Class<B> bindingClass);
-
- /**
- * Returns a callback binding of the specified type or null if there is no such
- * callback binding configured on this contract.
- *
- * @param <B> the callback binding type
- * @param bindingClass the callback binding type class
- * @return the callback binding or null if there is no callback binding of the specified type
- */
- <B> B getCallbackBinding(Class<B> bindingClass);
-
- /**
- * Returns a callback definition of the bindings to use for callbacks.
- *
- * @return a definition of the bindings to use for callbacks
- */
- Callback getCallback();
-
- /**
- * Sets a callback definition of the bindings to use for callbacks
- *
- * @param callback a definition of the bindings to use for callbacks
- */
- void setCallback(Callback callback);
-
- /**
- * Returns a clone of the contract.
- *
- * @return a clone of the reference
- * @throws CloneNotSupportedException
- */
- Object clone() throws CloneNotSupportedException;
-
- /**
- * Returns the interface contract given a binding. Important in the case where
- * a reference with multiplicity > 1 has been promoted and has it's list of
- * resolved bindings extended by a promoting reference. Here the binding
- * from the promoting reference may need the interface contract from the
- * promoting reference and not the promoted reference.
- * TODO - remove this wrinkle with better endpoint support.
- *
- * @param binding the binding for which the interface contract is required
- * @return the interface contract
- */
- InterfaceContract getInterfaceContract(Binding binding);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java
deleted file mode 100644
index 5dd256e3c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly;
-
-import org.apache.tuscany.sca.assembly.impl.AssemblyFactoryImpl;
-
-/**
- * A factory for the assembly model.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultAssemblyFactory extends AssemblyFactoryImpl implements AssemblyFactory {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java
deleted file mode 100644
index 6b0c076ee5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly;
-
-
-import org.apache.tuscany.sca.assembly.impl.EndpointFactoryImpl;
-
-/**
- * A default factory for the Endpoint model.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultEndpointFactory extends EndpointFactoryImpl {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultExtensionFactory.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultExtensionFactory.java
deleted file mode 100644
index 2ed02e214b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultExtensionFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.impl.ExtensionImpl;
-
-public class DefaultExtensionFactory implements ExtensionFactory {
-
- public Extension createExtension() {
- return new ExtensionImpl();
- }
-
- public Extension createExtension(QName name, Object value, boolean isAttribute) {
- return new ExtensionImpl(name, value, isAttribute);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
deleted file mode 100644
index ee63497fbe..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-
-/**
- * Represents an endpoint (primarily a combination of a target service name and a set of
- * candidate bindings)
- *
- * @version $Rev$ $Date$
- */
-public interface Endpoint extends Base, Cloneable {
-
- /**
- * Get the name of the target service that this endpoint refers to
- *
- * @return target service name
- */
- String getTargetName();
-
- /**
- * Set the name of the target service that this endpoint refers to
- *
- * @param targetName
- */
- void setTargetName(String targetName);
-
- /**
- * Get the source component model object
- *
- * @return source component
- */
- Component getSourceComponent();
-
- /**
- * Set the source component model object
- *
- * @param component the source component for the endpoint
- */
- void setSourceComponent(Component component);
-
- /**
- * Get the source component reference model object
- *
- * @return reference the source component reference for the endpoint
- */
- ComponentReference getSourceComponentReference();
-
- /**
- * Set the source component reference model object
- *
- * @param reference
- */
- void setSourceComponentReference(ComponentReference reference);
-
- /**
- * Get the resolved source binding
- *
- * @return binding the resolved source binding
- */
- Binding getSourceBinding();
-
- /**
- * Set the resolved source binding
- *
- * @param binding the resolved source binding
- */
- void setSourceBinding(Binding binding);
-
- /**
- * Get the resolved source callback binding
- *
- * @return binding the resolved source callback binding
- */
- Binding getSourceCallbackBinding();
-
- /**
- * Set the resolved source callback binding
- *
- * @param binding the resolved source callback binding
- */
- void setSourceCallbackBinding(Binding binding);
-
- /**
- * Get the list of candidate bindings that could be used to
- * communication with the target service
- *
- * @return list of candidate bindings
- */
- List<Binding> getCandidateBindings();
-
-
- /**
- * Get the target component model object
- *
- * @return target component
- */
- Component getTargetComponent();
-
- /**
- * Set the target component model object
- *
- * @param component target component
- */
- void setTargetComponent(Component component);
-
- /**
- * Get the target component service model object
- *
- * @return target component service
- */
- ComponentService getTargetComponentService();
-
- /**
- * Set the target component service model object
- *
- * @param service
- */
- void setTargetComponentService(ComponentService service);
-
- /**
- * Get the resolved target binding
- *
- * @return target binding
- */
- Binding getTargetBinding();
-
- /**
- * Set the resolved target binding
- *
- * @param binding target binding
- */
- void setTargetBinding(Binding binding);
-
- /**
- * Returns the interface contract defining the interface
- *
- * @return the interface contract
- */
- InterfaceContract getInterfaceContract();
-
- /**
- * Sets the interface contract defining the interface
- *
- * @param interfaceContract the interface contract
- */
- void setInterfaceContract(InterfaceContract interfaceContract);
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java
deleted file mode 100644
index 93e6c4d630..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-
-
-/**
- * A factory for the endpoint model
- *
- * @version $Rev$ $Date$
- */
-public interface EndpointFactory {
-
- /**
- * Create a new endpoint model object
- *
- * @return a new endpoint
- */
- Endpoint createEndpoint();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extensible.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extensible.java
deleted file mode 100644
index 593b7de88b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extensible.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-/**
- * Base interface for extensible assembly model objects.
- *
- * @version $Rev$ $Date$
- */
-public interface Extensible {
-
- /**
- * Returns a list of extension objects contained in this model object.
- *
- * @return a list of extension objects container in this model object
- */
- List<Object> getExtensions();
-
- /**
- * Returns a list of attribute extensions contained in this model object
- *
- * @return a list of attribute extensions contained in this model object
- */
- List<Extension> getAttributeExtensions();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extension.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extension.java
deleted file mode 100644
index 499c97c278..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Extension.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import javax.xml.namespace.QName;
-
-/**
- * Base interface for storing contents of extensible assembly model objects.
- *
- * @version $Rev$ $Date$
- */
-public interface Extension {
-
- /**
- * Return QName for the extension
- * @return the extension QName
- */
- QName getQName();
-
- /**
- * Set QName for the extension
- * @param qName the extension QName
- */
- void setQName(QName qName);
-
- /**
- * Return the original extension value
- * @return the extension value
- */
- Object getValue();
-
- /**
- * Set the original extension value
- * @param value the extension value
- */
- void setValue(Object value);
-
- /**
- * Return whether or not the extension is an attribute
- * @return
- */
- boolean isAttribute();
-
- /**
- * Set whether or not the extension is an attribute
- * @param value
- */
- void setIsAttribute(boolean isAttribute);
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ExtensionFactory.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ExtensionFactory.java
deleted file mode 100644
index 214cf59748..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ExtensionFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import javax.xml.namespace.QName;
-
-public interface ExtensionFactory {
-
- Extension createExtension();
-
- Extension createExtension(QName qName, Object value, boolean isAttribute);
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java
deleted file mode 100644
index 720a6801a2..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-/**
- * Represents a component implementation.
- *
- * @version $Rev$ $Date$
- */
-public interface Implementation extends ComponentType {
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java
deleted file mode 100644
index 5d15ce9938..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-/**
- * Enumeration for multiplicity. Defines the number of wires that can connect a
- * reference to target services.
- *
- * @version $Rev$ $Date$
- */
-public enum Multiplicity {
-
- /**
- * Zero or one wire can have the reference as a source.
- */
- ZERO_ONE,
-
- /**
- * The default setting, one wire can have the reference as a source.
- */
- ONE_ONE,
-
- /**
- * Zero or more wires can have the reference as a source.
- */
- ZERO_N,
-
- /**
- * One or more wires can have the reference as a source.
- */
- ONE_N
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationSelector.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationSelector.java
deleted file mode 100644
index 6770e87ee1..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationSelector.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-
-/**
- * Represents an operationSelector
- *
- * @version $Rev$ $Date$
- */
-public interface OperationSelector extends Base, Cloneable {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationsConfigurator.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationsConfigurator.java
deleted file mode 100644
index 947fcd4c7c..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OperationsConfigurator.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-/**
- * Interface to be implemented by SCA artifacts that support configuration of 'operation' child
- * elements for policies etc.
- *
- * @version $Rev$ $Date$
- */
-
-public interface OperationsConfigurator {
- List<ConfiguredOperation> getConfiguredOperations();
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OptimizableBinding.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OptimizableBinding.java
deleted file mode 100644
index 98ff92f15b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/OptimizableBinding.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-/**
- * Represent a reference binding that supports optimized SCA local wiring between component
- * references and services
- *
- * @version $Rev$ $Date$
- *
- */
-public interface OptimizableBinding extends Binding, Cloneable {
-
- /**
- * @param component
- */
- void setTargetComponent(Component component);
-
- /**
- * @param service
- */
- void setTargetComponentService(ComponentService service);
-
- /**
- * @param binding
- */
- void setTargetBinding(Binding binding);
-
- /**
- * @return
- */
- Binding getTargetBinding();
-
- /**
- * @return
- */
- Component getTargetComponent();
-
- /**
- * @return
- */
- ComponentService getTargetComponentService();
-
- /**
- * Clone the binding
- * @return
- */
- Object clone() throws CloneNotSupportedException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java
deleted file mode 100644
index 683920da58..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * A property allows for the configuration of an implementation with externally
- * set data values. An implementation can have zero or more properties. Each
- * property has a data type, which may be either simple or complex. An
- * implementation may also define a default value for a property.
- *
- * @version $Rev$ $Date$
- */
-public interface Property extends AbstractProperty, PolicySetAttachPoint, Cloneable {
-
- /**
- * Returns a clone of the property.
- *
- * @return a clone of the property
- * @throws CloneNotSupportedException
- */
- Object clone() throws CloneNotSupportedException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java
deleted file mode 100644
index 2eb1bf21b0..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import java.util.List;
-
-/**
- * Represents a reference. References within an implementation represent links
- * to services that the implementation uses that must be provided by other
- * components.
- *
- * @version $Rev$ $Date$
- */
-public interface Reference extends AbstractReference, Contract {
-
- /**
- * Returns a boolean value, "false" by default, which indicates that the
- * implementation wires this reference dynamically.
- *
- * @return true if the implementation wires this reference dynamically
- */
- boolean isWiredByImpl();
-
- /**
- * Sets a boolean value, "false" by default, which indicates that the
- * implementation wires this reference dynamically.
- *
- * @param wiredByImpl whether the implementation wires this reference
- * dynamically
- */
- void setWiredByImpl(boolean wiredByImpl);
-
- /**
- * Returns a boolean value, "false" by default, which indicates whether
- * the configuration of this reference is a promotion override for
- * another more deeply nested reference.
- *
- * @return true if the reference is a promotion override
- */
- boolean isPromotionOverride();
-
- /**
- * Sets a boolean value, "false" by default, which indicates whether
- * the configuration of this reference is a promotion override for
- * another more deeply nested reference.
- *
- * @param promotionOverride whether the reference is a promotion override
- */
- void setPromotionOverride(boolean promotionOverride);
-
- /**
- * Returns the targets of this reference.
- *
- * @return the targets of this reference.
- */
- List<ComponentService> getTargets();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java
deleted file mode 100644
index 2cf04277cd..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-/**
- * Represents an SCA binding.
- *
- * @version $Rev$ $Date$
- */
-public interface SCABinding extends Binding {
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java
deleted file mode 100644
index 0abfd13d10..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-
-/**
- * A factory for the SCA binding model
- *
- * @version $Rev$ $Date$
- */
-public interface SCABindingFactory {
-
- /**
- * Create a new SCA binding.
- *
- * @return a new SCA binding
- */
- SCABinding createSCABinding();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java
deleted file mode 100644
index 020870cd34..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-/**
- * Represents a service. Services are used to publish services provided by
- * implementations, so that they are addressable by other components.
- *
- * @version $Rev$ $Date$
- */
-public interface Service extends AbstractService, Contract {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java
deleted file mode 100644
index ee65e5746e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * Represents a wire.
- *
- * @version $Rev$ $Date$
- */
-public interface Wire extends Base, Extensible, IntentAttachPoint, PolicySetAttachPoint, Cloneable {
-
- /**
- * Returns the source of the wire.
- *
- * @return the source of the wire
- */
- ComponentReference getSource();
-
- /**
- * Sets the source of the wire.
- *
- * @param source the source of the wire
- */
- void setSource(ComponentReference source);
-
- /**
- * Returns the target of the wire.
- *
- * @return the target of the wire
- */
- ComponentService getTarget();
-
- /**
- * Sets the target of the wire.
- *
- * @param target the target of the wire
- */
- void setTarget(ComponentService target);
-
- /**
- * Returns a clone of the wire.
- *
- * @return a clone of the wire
- * @throws CloneNotSupportedException
- */
- Object clone() throws CloneNotSupportedException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/WireFormat.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/WireFormat.java
deleted file mode 100644
index d8c530585e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/WireFormat.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-
-/**
- * Represents a wireFormat.
- *
- * @version $Rev$ $Date$
- */
-public interface WireFormat extends Base, Cloneable {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/AutomaticBinding.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/AutomaticBinding.java
deleted file mode 100644
index 97708f9ef5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/AutomaticBinding.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.builder;
-
-/**
- * Represent a binding that has been added automatically to the model rather
- * than being specified by the user through the composite file
- *
- * @version $Rev$ $Date$
- *
- */
-public interface AutomaticBinding extends Cloneable {
-
- /**
- * @param isAutomatic
- */
- void setIsAutomatic(boolean isAutomatic);
-
- /**
- * @return isAutomatic
- */
- boolean getIsAutomatic();
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilder.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilder.java
deleted file mode 100644
index 7bac630d5b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilder.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder;
-
-import org.apache.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A builder that handles any build-time configuration needed by bindings.
- *
- * @version $Rev$ $Date$
- */
-public interface BindingBuilder {
-
- /**
- * Configure a binding.
- *
- * @param component The component for the binding's service or reference
- * @param contract The binding's service or reference
- */
- void build(Component component, AbstractContract contract, Binding binding, Monitor monitor);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilderExtension.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilderExtension.java
deleted file mode 100644
index 37ad8af0b3..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/BindingBuilderExtension.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder;
-
-/**
- * An extension that can be implemented by bindings to provide a binding builder.
- *
- * @version $Rev$ $Date$
- */
-public interface BindingBuilderExtension {
-
- /**
- * Returns the binding builder.
- *
- * @return the binding builder
- */
- BindingBuilder getBuilder();
-
- /**
- * Sets the binding builder.
- *
- * @param builder the binding builder
- */
- void setBuilder(BindingBuilder builder);
-
-}
-
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/ComponentPreProcessor.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/ComponentPreProcessor.java
deleted file mode 100644
index d2fae4d24a..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/ComponentPreProcessor.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder;
-
-import org.apache.tuscany.sca.assembly.Component;
-
-/**
- * Interface for Component Pre Processors.
- *
- * @version $Rev$ $Date$
- */
-public interface ComponentPreProcessor {
-
- void preProcess(Component component);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java
deleted file mode 100644
index 8a18f74b2b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A builder that handles the configuration of the components inside a
- * composite and the wiring of component references to component services.
- *
- * @version $Rev$ $Date$
- */
-public interface CompositeBuilder {
-
- /**
- * Returns the ID of the builder.
- *
- * @return
- */
- String getID();
-
- /**
- * Build a composite.
- *
- * @param composite
- * @param definitions
- * @param monitor
- * @throws CompositeBuilderException
- */
- void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java
deleted file mode 100644
index 5a2015f55e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder;
-
-/**
- * Reports a composite builder exception.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeBuilderException extends Exception {
- private static final long serialVersionUID = -8916323176803443856L;
-
- public CompositeBuilderException() {
- }
-
- public CompositeBuilderException(String message) {
- super(message);
- }
-
- public CompositeBuilderException(Throwable cause) {
- super(cause);
- }
-
- public CompositeBuilderException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderExtensionPoint.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderExtensionPoint.java
deleted file mode 100644
index a2d6b34db5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderExtensionPoint.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder;
-
-/**
- * An extension point for Composite builders.
- *
- * @version $Rev: $ $Date: $
- */
-public interface CompositeBuilderExtensionPoint {
-
- /**
- * Adds a composite builder.
- *
- * @param compositeBuilder
- */
- void addCompositeBuilder(CompositeBuilder compositeBuilder);
-
- /**
- * Removes a composite builder.
- *
- * @param compositeBuilder
- */
- void removeCompositeBuilder(CompositeBuilder compositeBuilder);
-
- /**
- * Returns the composite builder with the given id.
- *
- * @param id
- * @return
- */
- CompositeBuilder getCompositeBuilder(String id);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultCompositeBuilderExtensionPoint.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultCompositeBuilderExtensionPoint.java
deleted file mode 100644
index 8197bf2552..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultCompositeBuilderExtensionPoint.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.lang.reflect.Constructor;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.assembly.Composite;
-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.definitions.Definitions;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * Default implementation of a provider factory extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultCompositeBuilderExtensionPoint implements CompositeBuilderExtensionPoint {
-
- private ExtensionPointRegistry registry;
- private final Map<String, CompositeBuilder> builders = new HashMap<String, CompositeBuilder>();
- private boolean loaded;
-
- public DefaultCompositeBuilderExtensionPoint(ExtensionPointRegistry registry) {
- this.registry = registry;
- }
-
- public void addCompositeBuilder(CompositeBuilder builder) {
- builders.put(builder.getID(), builder);
- }
-
- public void removeCompositeBuilder(CompositeBuilder builder) {
- builders.remove(builder.getID());
- }
-
- public CompositeBuilder getCompositeBuilder(String id) {
- loadBuilders();
- return builders.get(id);
- }
-
- /**
- * Load builders declared under META-INF/services.
- */
- private void loadBuilders() {
- if (loaded)
- return;
-
- FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
-
- UtilityExtensionPoint utils = registry.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utils.getUtility(InterfaceContractMapper.class);
-
- // Get the provider factory service declarations
- Set<ServiceDeclaration> builderDeclarations;
- ServiceDiscovery serviceDiscovery = ServiceDiscovery.getInstance();
- try {
- builderDeclarations = serviceDiscovery.getServiceDeclarations(CompositeBuilder.class.getName());
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
-
- for (ServiceDeclaration builderDeclaration : builderDeclarations) {
- Map<String, String> attributes = builderDeclaration.getAttributes();
- String id = attributes.get("id");
-
- CompositeBuilder builder = new LazyCompositeBuilder(id, builderDeclaration, this, factories, mapper);
- builders.put(id, builder);
- }
- }
-
- /**
- * A wrapper around a composite builder allowing lazy
- * loading and initialization of implementation providers.
- */
- private static class LazyCompositeBuilder implements CompositeBuilder {
-
- private FactoryExtensionPoint factories;
- private InterfaceContractMapper mapper;
- private String id;
- private ServiceDeclaration builderDeclaration;
- private CompositeBuilder builder;
- private CompositeBuilderExtensionPoint builders;
-
- private LazyCompositeBuilder(String id, ServiceDeclaration factoryDeclaration,
- CompositeBuilderExtensionPoint builders, FactoryExtensionPoint factories, InterfaceContractMapper mapper) {
- this.id = id;
- this.builderDeclaration = factoryDeclaration;
- this.builders = builders;
- this.factories = factories;
- this.mapper = mapper;
- }
-
- public String getID() {
- return id;
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- getBuilder().build(composite, definitions, monitor);
- }
-
- private CompositeBuilder getBuilder() {
- if (builder == null) {
- try {
- Class<CompositeBuilder> builderClass = (Class<CompositeBuilder>)builderDeclaration.loadClass();
- try {
- Constructor<CompositeBuilder> constructor = builderClass.getConstructor(FactoryExtensionPoint.class, InterfaceContractMapper.class);
- builder = constructor.newInstance(factories, mapper);
- } catch (NoSuchMethodException e) {
- Constructor<CompositeBuilder> constructor = builderClass.getConstructor(CompositeBuilderExtensionPoint.class, FactoryExtensionPoint.class, InterfaceContractMapper.class);
- builder = constructor.newInstance(builders, factories, mapper);
- }
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return builder;
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java
deleted file mode 100644
index 30b929c43c..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder;
-
-import org.apache.tuscany.sca.assembly.builder.impl.EndpointBuilderImpl;
-
-/**
- * A default builder.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultEndpointBuilder extends EndpointBuilderImpl {
- public DefaultEndpointBuilder (){
- super();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java
deleted file mode 100644
index 20a17e1bd0..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.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);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java
deleted file mode 100644
index e98be49551..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A builder that handles the configuration of reference endpoints
- * It collects together the logic so that it can be used at build time
- * or later on during late binding scenarios
- *
- * @version $Rev$ $Date$
- */
-public interface EndpointBuilder {
-
- /**
- * Build an endpoint.
- *
- * @param endpoint
- * @param monitor
- */
- void build(Endpoint endpoint, Monitor monitor);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseBuilderImpl.java
deleted file mode 100644
index 77094da6dd..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseBuilderImpl.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.AutomaticBinding;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-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.IntentAttachPoint;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-
-/**
- * Base class for Builder implementations
- *
- * @version $Rev$ $Date$
- */
-public abstract class BaseBuilderImpl implements CompositeBuilder {
- protected static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- protected static final String BINDING_SCA = "binding.sca";
- protected static final QName BINDING_SCA_QNAME = new QName(SCA10_NS, BINDING_SCA);
-
- protected AssemblyFactory assemblyFactory;
- protected SCABindingFactory scaBindingFactory;
- protected InterfaceContractMapper interfaceContractMapper;
- protected DocumentBuilderFactory documentBuilderFactory;
- protected TransformerFactory transformerFactory;
-
-
- protected BaseBuilderImpl(AssemblyFactory assemblyFactory,
- SCABindingFactory scaBindingFactory,
- DocumentBuilderFactory documentBuilderFactory,
- TransformerFactory transformerFactory,
- InterfaceContractMapper interfaceContractMapper) {
- this.assemblyFactory = assemblyFactory;
- this.scaBindingFactory = scaBindingFactory;
- this.documentBuilderFactory = documentBuilderFactory;
- this.transformerFactory = transformerFactory;
- this.interfaceContractMapper = interfaceContractMapper;
- }
-
- /**
- * Report a warning.
- *
- * @param monitor
- * @param problems
- * @param message
- * @param model
- */
- protected void warning(Monitor monitor, String message, Object model, String... messageParameters) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "assembly-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /**
- * Report a error.
- *
- * @param monitor
- * @param problems
- * @param message
- * @param model
- */
- protected void error(Monitor monitor, String message, Object model, String... messageParameters) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "assembly-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /**
- * Report a exception.
- *
- * @param problems
- * @param message
- * @param model
- */
- protected void error(Monitor monitor, String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = null;
- problem = monitor.createProblem(this.getClass().getName(), "assembly-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- /**
- * Index components, services and references inside a composite.
- * @param composite
- * @param components
- * @param componentServices
- * @param componentReferences
- */
- protected void indexComponentsServicesAndReferences(Composite composite,
- Map<String, Component> components,
- Map<String, ComponentService> componentServices,
- Map<String, ComponentReference> componentReferences) {
-
- for (Component component : composite.getComponents()) {
-
- // Index components by name
- components.put(component.getName(), component);
-
- ComponentService nonCallbackService = null;
- int nonCallbackServices = 0;
- for (ComponentService componentService : component.getServices()) {
-
- // Index component services by component name / service name
- String uri = component.getName() + '/' + componentService.getName();
- componentServices.put(uri, componentService);
-
- boolean promotedService = false;
- if (componentService.getName() != null && componentService.getName().indexOf("$promoted$") > -1) {
- promotedService = true;
- }
-
- // count how many non-callback, non-promoted services there are
- // if there is only one the component name also acts as the service name
- if ((!componentService.isCallback()) && (!promotedService)) {
-
- // Check how many non callback non-promoted services we have
- if (nonCallbackServices == 0) {
- nonCallbackService = componentService;
- }
- nonCallbackServices++;
- }
-
- }
-
- if (nonCallbackServices == 1) {
- // If we have a single non callback service, index it by
- // component name as well
- componentServices.put(component.getName(), nonCallbackService);
- }
-
- // Index references by component name / reference name
- for (ComponentReference componentReference : component.getReferences()) {
- String uri = component.getName() + '/' + componentReference.getName();
- componentReferences.put(uri, componentReference);
- }
- }
- }
-
- protected void indexComponentPropertiesServicesAndReferences(
- Component component,
- Map<String, ComponentService> componentServices,
- Map<String, ComponentReference> componentReferences,
- Map<String, ComponentProperty> componentProperties, Monitor monitor) {
- for (ComponentService componentService : component.getServices()) {
- if (componentServices.containsKey(componentService.getName())) {
- warning(monitor, "DuplicateComponentServiceName", component,
- component.getName(), componentService.getName());
- } else {
- componentServices.put(componentService.getName(),
- componentService);
- }
- }
- for (ComponentReference componentReference : component.getReferences()) {
- if (componentReferences.containsKey(componentReference.getName())) {
- warning(monitor, "DuplicateComponentReferenceName", component,
- component.getName(), componentReference.getName());
- } else {
- componentReferences.put(componentReference.getName(),
- componentReference);
- }
- }
- for (ComponentProperty componentProperty : component.getProperties()) {
- if (componentProperties.containsKey(componentProperty.getName())) {
- warning(monitor, "DuplicateComponentPropertyName", component,
- component.getName(), componentProperty.getName());
- } else {
- componentProperties.put(componentProperty.getName(),
- componentProperty);
- }
- }
-
- }
-
- protected void indexImplementationPropertiesServicesAndReferences(
- Component component, Map<String, Service> services,
- Map<String, Reference> references,
- Map<String, Property> properties, Monitor monitor) {
- // First check that the component has a resolved implementation
- Implementation implementation = component.getImplementation();
- if (implementation == null) {
- // A component must have an implementation
- warning(monitor, "NoComponentImplementation", component, component
- .getName());
-
- } else if (implementation.isUnresolved()) {
-
- // The implementation must be fully resolved
- warning(monitor, "UnresolvedComponentImplementation", component,
- component.getName(), implementation.getURI());
-
- } else {
-
- // Index properties, services and references, also check for
- // duplicates
- for (Property property : implementation.getProperties()) {
- if (properties.containsKey(property.getName())) {
- warning(monitor, "DuplicateImplementationPropertyName",
- component, component.getName(), property.getName());
- } else {
- properties.put(property.getName(), property);
- }
- }
- for (Service service : implementation.getServices()) {
- if (services.containsKey(service.getName())) {
- warning(monitor, "DuplicateImplementationServiceName",
- component, component.getName(), service.getName());
- } else {
- services.put(service.getName(), service);
- }
- }
- for (Reference reference : implementation.getReferences()) {
- if (references.containsKey(reference.getName())) {
- warning(monitor, "DuplicateImplementationReferenceName",
- component, component.getName(), reference.getName());
- } else {
- references.put(reference.getName(), reference);
- }
- }
- }
-
- }
-
- /**
- * Reconcile component properties and the properties defined by the
- * component type.
- *
- * @param component
- * @param properties
- * @param componentProperties
- * @param problems
- */
- protected void reconcileProperties(Component component,
- Map<String, Property> properties,
- Map<String, ComponentProperty> componentProperties,
- Monitor monitor) {
-
- // Connect component properties to their properties
- for (ComponentProperty componentProperty : component.getProperties()) {
- Property property = properties.get(componentProperty.getName());
- if (property != null) {
- componentProperty.setProperty(property);
- } else {
- warning(monitor, "PropertyNotFound", component, component.getName(), componentProperty.getName());
- }
- }
-
- // Create component properties for all properties
- if (component.getImplementation() != null) {
- for (Property property : component.getImplementation().getProperties()) {
- if (!componentProperties.containsKey(property.getName())) {
- ComponentProperty componentProperty = assemblyFactory.createComponentProperty();
- componentProperty.setName(property.getName());
- componentProperty.setMany(property.isMany());
- componentProperty.setXSDElement(property.getXSDElement());
- componentProperty.setXSDType(property.getXSDType());
- componentProperty.setProperty(property);
- component.getProperties().add(componentProperty);
- }
- }
- }
-
- // Reconcile component properties and their properties
- for (ComponentProperty componentProperty : component.getProperties()) {
- Property property = componentProperty.getProperty();
- if (property != null) {
-
- // Check that a component property does not override the
- // mustSupply attribute
- if (!property.isMustSupply() && componentProperty.isMustSupply()) {
- warning(monitor, "PropertyMustSupplyIncompatible", component, component.getName(), componentProperty.getName());
- }
-
- // Default to the mustSupply attribute specified on the property
- if (!componentProperty.isMustSupply())
- componentProperty.setMustSupply(property.isMustSupply());
-
- // Default to the value specified on the property
- if (componentProperty.getValue() == null) {
- componentProperty.setValue(property.getValue());
- }
-
- // Override the property value for the composite
- if(component.getImplementation() instanceof Composite) {
- property.setValue(componentProperty.getValue());
- }
-
- // Check that a value is supplied
- if (componentProperty.getValue() == null && property.isMustSupply()) {
- warning(monitor, "PropertyMustSupplyNull", component, component.getName(), componentProperty.getName());
- }
-
- // Check that a a component property does not override the
- // many attribute
- if (!property.isMany() && componentProperty.isMany()) {
-
- warning(monitor, "PropertyOverrideManyAttribute", component, component.getName(), componentProperty.getName());
- }
-
- // Default to the many attribute defined on the property
- componentProperty.setMany(property.isMany());
-
- // Default to the type and element defined on the property
- if (componentProperty.getXSDType() == null) {
- componentProperty.setXSDType(property.getXSDType());
- }
- if (componentProperty.getXSDElement() == null) {
- componentProperty.setXSDElement(property.getXSDElement());
- }
-
- // Check that a type or element are specified
- if (componentProperty.getXSDElement() == null && componentProperty.getXSDType() == null) {
- warning(monitor, "NoTypeForComponentProperty", component, component.getName(), componentProperty.getName());
- }
- }
- }
- }
-
- /**
- * Reconcile component references with the references defined on the
- * component type.
- *
- * @param component
- * @param references
- * @param componentReferences
- * @param monitor
- */
- protected void reconcileReferences(Component component,
- Map<String, Reference> references,
- Map<String, ComponentReference> componentReferences,
- Monitor monitor) {
-
- // Connect each component reference to the corresponding reference
- for (ComponentReference componentReference : component.getReferences()) {
- if (componentReference.getReference() != null || componentReference.isCallback()) {
- continue;
- }
- Reference reference = references.get(componentReference.getName());
- if (reference != null) {
- componentReference.setReference(reference);
- } else {
- if (!componentReference.getName().startsWith("$self$.")) {
- error(monitor, "ReferenceNotFound", component, component.getName(), componentReference.getName());
- }
- }
- }
-
- // Create a component reference for each reference
- if (component.getImplementation() != null) {
- for (Reference reference : component.getImplementation().getReferences()) {
- if (!componentReferences.containsKey(reference.getName())) {
- ComponentReference componentReference =
- assemblyFactory.createComponentReference();
- componentReference.setIsCallback(reference.isCallback());
- componentReference.setName(reference.getName());
- componentReference.setReference(reference);
- component.getReferences().add(componentReference);
- }
- }
- }
-
- // Reconcile each component reference with its reference
- for (ComponentReference componentReference : component.getReferences()) {
- Reference reference = componentReference.getReference();
- if (reference != null) {
- // Reconcile multiplicity
- if (componentReference.getMultiplicity() != null) {
- if (!ReferenceConfigurationUtil.isValidMultiplicityOverride(reference.getMultiplicity(),
- componentReference
- .getMultiplicity())) {
- warning(monitor, "ReferenceIncompatibleMultiplicity", component, component.getName(), componentReference.getName());
- }
- } else {
- componentReference.setMultiplicity(reference.getMultiplicity());
- }
-
- // Reconcile interface
- InterfaceContract interfaceContract = reference.getInterfaceContract();
- if (componentReference.getInterfaceContract() != null) {
- if (interfaceContract != null && !componentReference.getInterfaceContract().equals(reference
- .getInterfaceContract())) {
- if (!interfaceContractMapper.isCompatible(componentReference.getInterfaceContract(),
- interfaceContract)) {
- warning(monitor, "ReferenceIncompatibleComponentInterface", component, component.getName(), componentReference.getName());
- }
- }
- } else {
- componentReference.setInterfaceContract(interfaceContract);
- }
-
- // Reconcile bindings
- if (componentReference.getBindings().isEmpty()) {
- componentReference.getBindings().addAll(reference.getBindings());
- }
-
- // Reconcile callback bindings
- if (componentReference.getCallback() == null) {
- componentReference.setCallback(reference.getCallback());
- if (componentReference.getCallback() == null) {
- // Create an empty callback to avoid null check
- componentReference.setCallback(assemblyFactory.createCallback());
- }
-
- } else if (componentReference.getCallback().getBindings().isEmpty() && reference
- .getCallback() != null) {
- componentReference.getCallback().getBindings().addAll(reference.getCallback()
- .getBindings());
- }
-
- // Propagate autowire setting from the component
- if (componentReference.getAutowire() == null) {
- componentReference.setAutowire(component.getAutowire());
- }
-
- // Reconcile targets
- if (componentReference.getTargets().isEmpty()) {
- componentReference.getTargets().addAll(reference.getTargets());
- }
- }
- }
- }
-
- /**
- * Reconcile component services and services defined on the component type.
- *
- * @param component
- * @param services
- * @param componentServices
- * @param monitor
- */
- protected void reconcileServices(Component component,
- Map<String, Service> services,
- Map<String, ComponentService> componentServices,
- Monitor monitor) {
-
- // Connect each component service to the corresponding service
- for (ComponentService componentService : component.getServices()) {
- if (componentService.getService() != null || componentService.isCallback()) {
- continue;
- }
- Service service = services.get(componentService.getName());
- if (service != null) {
- componentService.setService(service);
- } else {
- warning(monitor, "ServiceNotFoundForComponentService", component, component.getName(), componentService.getName());
- }
- }
-
- // Create a component service for each service
- if (component.getImplementation() != null) {
- for (Service service : component.getImplementation().getServices()) {
- if (!componentServices.containsKey(service.getName())) {
- ComponentService componentService = assemblyFactory.createComponentService();
- componentService.setIsCallback(service.isCallback());
- String name = service.getName();
- componentService.setName(name);
- componentService.setService(service);
- component.getServices().add(componentService);
- componentServices.put(name, componentService);
- }
- }
- }
-
- //Reconcile each component service with its service
- for (ComponentService componentService : component.getServices()) {
- Service service = componentService.getService();
- if (service != null) {
- // Reconcile interface
- InterfaceContract interfaceContract = service.getInterfaceContract();
- if (componentService.getInterfaceContract() != null) {
- if (interfaceContract != null && !componentService.getInterfaceContract().equals(interfaceContract)) {
- if (!interfaceContractMapper.isCompatible(componentService.getInterfaceContract(),
- interfaceContract)) {
- warning(monitor, "ServiceIncompatibleComponentInterface", component, component.getName(), componentService.getName());
- }
- }
- } else {
- componentService.setInterfaceContract(interfaceContract);
- }
-
- // Reconcile bindings
- if (componentService.getBindings().isEmpty()) {
- componentService.getBindings().addAll(service.getBindings());
- }
-
- // Reconcile callback bindings
- if (componentService.getCallback() == null) {
- componentService.setCallback(service.getCallback());
- if (componentService.getCallback() == null) {
- // Create an empty callback to avoid null check
- componentService.setCallback(assemblyFactory.createCallback());
- }
- } else if (componentService.getCallback().getBindings().isEmpty() && service
- .getCallback() != null) {
- componentService.getCallback().getBindings().addAll(service.getCallback()
- .getBindings());
- }
- }
- }
- }
-
- protected SCABinding createSCABinding(Definitions definitions) {
- SCABinding scaBinding = scaBindingFactory.createSCABinding();
-
- // mark the bindings that are added automatically so that they can
- // be disregarded for overriding purposes
- if (scaBinding instanceof AutomaticBinding){
- ((AutomaticBinding)scaBinding).setIsAutomatic(true);
- }
-
- if ( definitions != null ) {
- for ( IntentAttachPointType attachPointType : definitions.getBindingTypes() ) {
- if ( attachPointType.getName().equals(BINDING_SCA_QNAME)) {
- ((IntentAttachPoint)scaBinding).setType(attachPointType);
- }
- }
- }
-
- return scaBinding;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentConfigurationBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentConfigurationBuilderImpl.java
deleted file mode 100644
index 64747978a5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentConfigurationBuilderImpl.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.net.URI;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.ComponentPreProcessor;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that handles the configuration of components.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentConfigurationBuilderImpl extends BaseBuilderImpl implements CompositeBuilder {
-
- @Deprecated
- public ComponentConfigurationBuilderImpl(AssemblyFactory assemblyFactory,
- SCABindingFactory scaBindingFactory,
- InterfaceContractMapper interfaceContractMapper) {
- super(assemblyFactory, scaBindingFactory,
- null, null,
- interfaceContractMapper);
- }
-
- public ComponentConfigurationBuilderImpl(AssemblyFactory assemblyFactory,
- SCABindingFactory scaBindingFactory,
- DocumentBuilderFactory documentBuilderFactory,
- TransformerFactory transformerFactory,
- InterfaceContractMapper interfaceContractMapper) {
- super(assemblyFactory, scaBindingFactory,
- documentBuilderFactory, transformerFactory,
- interfaceContractMapper);
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.ComponentConfigurationBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- configureComponents(composite, definitions, monitor);
- }
-
- /**
- * Configure components in the composite.
- *
- * @param composite
- * @param monitor
- */
- protected void configureComponents(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- configureComponents(composite, null, definitions, monitor);
- configureSourcedProperties(composite, null);
- }
-
- /**
- * Configure components in the composite.
- *
- * @param composite
- * @param uri
- * @param problems
- */
- private void configureComponents(Composite composite, String uri, Definitions definitions, Monitor monitor) {
- String parentURI = uri;
-
- // Process nested composites recursively
- for (Component component : composite.getComponents()) {
-
- // Initialize component URI
- String componentURI;
- if (parentURI == null) {
- componentURI = component.getName();
- } else {
- componentURI = URI.create(parentURI + '/').resolve(component.getName()).toString();
- }
- component.setURI(componentURI);
-
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
-
- // Process nested composite
- configureComponents((Composite)implementation, componentURI, definitions, monitor);
- }
- }
-
- // Initialize service bindings
- List<Service> compositeServices = composite.getServices();
- for (Service service : compositeServices) {
- // Set default binding names
-
- // Create default SCA binding
- if (service.getBindings().isEmpty()) {
- SCABinding scaBinding = createSCABinding(definitions);
- service.getBindings().add(scaBinding);
- }
- }
-
- // Initialize reference bindings
- for (Reference reference : composite.getReferences()) {
- // Create default SCA binding
- if (reference.getBindings().isEmpty()) {
- SCABinding scaBinding = createSCABinding(definitions);
- reference.getBindings().add(scaBinding);
- }
- }
-
- // Initialize all component services and references
- Map<String, Component> components = new HashMap<String, Component>();
- for (Component component : composite.getComponents()) {
-
- // Index all components and check for duplicates
- if (components.containsKey(component.getName())) {
- error(monitor, "DuplicateComponentName", component, composite.getName().toString(), component.getName());
- } else {
- components.put(component.getName(), component);
- }
-
- // Propagate the autowire flag from the composite to components
- if (component.getAutowire() == null) {
- component.setAutowire(composite.getAutowire());
- }
-
- if (component.getImplementation() instanceof ComponentPreProcessor) {
- ((ComponentPreProcessor)component.getImplementation()).preProcess(component);
- }
-
- // Index properties, services and references
- Map<String, Service> services = new HashMap<String, Service>();
- Map<String, Reference> references = new HashMap<String, Reference>();
- Map<String, Property> properties = new HashMap<String, Property>();
- indexImplementationPropertiesServicesAndReferences(component,
- services,
- references,
- properties,
- monitor);
-
- // Index component services, references and properties
- // Also check for duplicates
- Map<String, ComponentService> componentServices = new HashMap<String, ComponentService>();
- Map<String, ComponentReference> componentReferences = new HashMap<String, ComponentReference>();
- Map<String, ComponentProperty> componentProperties = new HashMap<String, ComponentProperty>();
- indexComponentPropertiesServicesAndReferences(component,
- componentServices,
- componentReferences,
- componentProperties,
- monitor);
-
- // Reconcile component services/references/properties and
- // implementation services/references and create component
- // services/references/properties for the services/references
- // declared by the implementation
- reconcileServices(component, services, componentServices, monitor);
- reconcileReferences(component, references, componentReferences, monitor);
- reconcileProperties(component, properties, componentProperties, monitor);
-
- // Configure or create callback services for component's references
- // with callbacks
- configureCallbackServices(component, componentServices);
-
- // Configure or create callback references for component's services
- // with callbacks
- configureCallbackReferences(component, componentReferences);
-
- // Initialize service bindings
- for (ComponentService componentService : component.getServices()) {
-
- // Create default SCA binding
- if (componentService.getBindings().isEmpty()) {
- SCABinding scaBinding = createSCABinding(definitions);
- componentService.getBindings().add(scaBinding);
- }
- }
-
- // Initialize reference bindings
- for (ComponentReference componentReference : component.getReferences()) {
-
- // Create default SCA binding
- if (componentReference.getBindings().isEmpty()) {
- SCABinding scaBinding = createSCABinding(definitions);
- componentReference.getBindings().add(scaBinding);
- }
- }
- }
- }
-
- /**
- * For all the references with callbacks, create a corresponding callback
- * service.
- *
- * @param component
- */
- private void configureCallbackServices(Component component,
- Map<String, ComponentService> componentServices) {
- for (ComponentReference reference : component.getReferences()) {
- if (reference.getInterfaceContract() != null && // can be null in
- // unit tests
- reference.getInterfaceContract().getCallbackInterface() != null) {
- ComponentService service =
- componentServices.get(reference.getName());
- if (service == null) {
- service = createCallbackService(component, reference);
- }
- if (reference.getCallback() != null) {
- if (service.getBindings().isEmpty()) {
- service.getBindings().addAll(reference.getCallback().getBindings());
- }
- }
- reference.setCallbackService(service);
- }
- }
- }
-
- /**
- * Create a callback service for a component reference
- *
- * @param component
- * @param reference
- */
- private ComponentService createCallbackService(Component component, ComponentReference reference) {
- ComponentService componentService = assemblyFactory.createComponentService();
- componentService.setIsCallback(true);
- componentService.setName(reference.getName());
- try {
- InterfaceContract contract =
- (InterfaceContract)reference.getInterfaceContract().clone();
- contract.setInterface(contract.getCallbackInterface());
- contract.setCallbackInterface(null);
- componentService.setInterfaceContract(contract);
- } catch (CloneNotSupportedException e) {
- // will not happen
- }
- Reference implReference = reference.getReference();
- if (implReference != null) {
- Service implService = assemblyFactory.createService();
- implService.setName(implReference.getName());
- try {
- InterfaceContract implContract =
- (InterfaceContract)implReference.getInterfaceContract().clone();
- implContract.setInterface(implContract.getCallbackInterface());
- implContract.setCallbackInterface(null);
- implService.setInterfaceContract(implContract);
- } catch (CloneNotSupportedException e) {
- // will not happen
- }
- componentService.setService(implService);
- }
- component.getServices().add(componentService);
- return componentService;
- }
-
- /**
- * For all the services with callbacks, create a corresponding callback
- * reference.
- *
- * @param component
- */
- private void configureCallbackReferences(Component component,
- Map<String, ComponentReference> componentReferences) {
- for (ComponentService service : component.getServices()) {
- if (service.getInterfaceContract() != null && // can be null in
- // unit tests
- service.getInterfaceContract().getCallbackInterface() != null) {
- ComponentReference reference =
- componentReferences.get(service.getName());
- if (reference == null) {
- reference = createCallbackReference(component, service);
- }
- if (service.getCallback() != null) {
- if (reference.getBindings().isEmpty()) {
- reference.getBindings().addAll(service.getCallback().getBindings());
- }
- }
- service.setCallbackReference(reference);
- }
- }
- }
-
- /**
- * Create a callback reference for a component service
- *
- * @param component
- * @param service
- */
- private ComponentReference createCallbackReference(Component component, ComponentService service) {
- ComponentReference componentReference = assemblyFactory.createComponentReference();
- componentReference.setIsCallback(true);
- componentReference.setName(service.getName());
- try {
- InterfaceContract contract = (InterfaceContract)service.getInterfaceContract().clone();
- contract.setInterface(contract.getCallbackInterface());
- contract.setCallbackInterface(null);
- componentReference.setInterfaceContract(contract);
- } catch (CloneNotSupportedException e) {
- // will not happen
- }
- Service implService = service.getService();
- if (implService != null) {
- Reference implReference = assemblyFactory.createReference();
- implReference.setName(implService.getName());
- try {
- InterfaceContract implContract =
- (InterfaceContract)implService.getInterfaceContract().clone();
- implContract.setInterface(implContract.getCallbackInterface());
- implContract.setCallbackInterface(null);
- implReference.setInterfaceContract(implContract);
- } catch (CloneNotSupportedException e) {
- // will not happen
- }
- componentReference.setReference(implReference);
- }
- component.getReferences().add(componentReference);
- return componentReference;
- }
-
- /**
- * @param composite
- */
- private void configureSourcedProperties(Composite composite, List<ComponentProperty> propertySettings) {
- // Resolve properties
- Map<String, Property> compositeProperties = new HashMap<String, Property>();
- ComponentProperty componentProperty = null;
- for (Property p : composite.getProperties()) {
- componentProperty = getComponentPropertyByName(p.getName(), propertySettings);
- if (componentProperty != null) {
- compositeProperties.put(p.getName(), componentProperty);
- } else {
- compositeProperties.put(p.getName(), p);
- }
- }
-
- for (Component component : composite.getComponents()) {
- try {
- PropertyConfigurationUtil.sourceComponentProperties(compositeProperties, component,
- documentBuilderFactory, transformerFactory);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- Implementation impl = component.getImplementation();
- if (impl instanceof Composite) {
- configureSourcedProperties((Composite)impl, component.getProperties());
- }
- }
- }
-
- private ComponentProperty getComponentPropertyByName(String propertyName, List<ComponentProperty> properties) {
- if (properties != null) {
- for (ComponentProperty aProperty : properties) {
- if (aProperty.getName().equals(propertyName)) {
- return aProperty;
- }
- }
- }
- return null;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java
deleted file mode 100644
index 734b373f11..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-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.Composite;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.builder.BindingBuilderExtension;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that performs any additional building steps that
- * component reference bindings may need. Used for WSDL generation.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentReferenceBindingBuilderImpl implements CompositeBuilder {
-
- public ComponentReferenceBindingBuilderImpl() {
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- buildReferenceBindings(composite, monitor);
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.ComponentReferenceBindingBuilder";
- }
-
- private void buildReferenceBindings(Composite composite, Monitor monitor) {
-
- // find all the component reference bindings (starting at top level)
- for (Component component : composite.getComponents()) {
- for (ComponentReference componentReference : component.getReferences()) {
- for (Binding binding : componentReference.getBindings()) {
- if (binding instanceof BindingBuilderExtension) {
- ((BindingBuilderExtension)binding).getBuilder().build(component, componentReference, binding, monitor);
- }
- }
- }
- }
-
- // build bindings recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- buildReferenceBindings((Composite)implementation, monitor);
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferencePromotionWireBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferencePromotionWireBuilderImpl.java
deleted file mode 100644
index 4ceb4bb079..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferencePromotionWireBuilderImpl.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.EndpointFactory;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that handles the creation of promoted composite services.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentReferencePromotionWireBuilderImpl implements CompositeBuilder {
- private AssemblyFactory assemblyFactory;
- private EndpointFactory endpointFactory;
-
- public ComponentReferencePromotionWireBuilderImpl(AssemblyFactory assemblyFactory, EndpointFactory endpointFactory) {
- this.assemblyFactory = assemblyFactory;
- this.endpointFactory = endpointFactory;
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- wireCompositeReferences(composite, monitor);
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.ComponentReferencePromotionWireBuilder";
- }
-
- /**
- * Wire composite references in nested composites.
- *
- * @param composite
- * @param problems
- */
- private void wireCompositeReferences(Composite composite, Monitor monitor) {
-
- // Process nested composites recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- wireCompositeReferences((Composite)implementation, monitor);
- }
- }
-
- // Process component references declared on components in this composite
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- for (ComponentReference componentReference : component.getReferences()) {
- Reference implReference = componentReference.getReference();
- if (implReference != null && implReference instanceof CompositeReference) {
-
- // If the component reference is wired, it is a promotion override
- if (!componentReference.getEndpoints().isEmpty()) {
- componentReference.setPromotionOverride(true);
- }
-
- // If the component reference is a promotion override, override the
- // configuration of the promoted reference
- if (componentReference.isPromotionOverride()) {
- CompositeReference compositeReference = (CompositeReference)implReference;
- List<ComponentReference> promotedReferences =
- ReferenceConfigurationUtil.getPromotedComponentReferences(compositeReference);
- for (ComponentReference promotedReference : promotedReferences) {
- ReferenceConfigurationUtil.reconcileReferenceBindings(
- componentReference, promotedReference, assemblyFactory, endpointFactory, monitor);
- if (componentReference.getInterfaceContract() != null && // can be null in unit tests
- componentReference.getInterfaceContract().getCallbackInterface() != null) {
- SCABinding scaCallbackBinding = promotedReference.getCallbackBinding(SCABinding.class);
- if (promotedReference.getCallback() != null) {
- promotedReference.getCallback().getBindings().clear();
- } else {
- promotedReference.setCallback(assemblyFactory.createCallback());
- }
- if (scaCallbackBinding != null) {
- promotedReference.getCallback().getBindings().add(scaCallbackBinding);
- }
- if (componentReference.getCallback() != null) {
- promotedReference.getCallback().getBindings().addAll(componentReference
- .getCallback().getBindings());
- }
- }
-
- // Wire the promoted reference to the actual non-composite component services
- if (promotedReference.getMultiplicity() == Multiplicity.ONE_ONE) {
- // promotedReference.getTargets().clear();
- }
- for (ComponentService target : componentReference.getTargets()) {
- if (target.getService() instanceof CompositeService) {
-
- // Wire to the actual component service
- // promoted by a composite service
- CompositeService compositeService = (CompositeService)target.getService();
- // Find the promoted component service
- ComponentService componentService =
- ServiceConfigurationUtil.getPromotedComponentService(compositeService);
- if (componentService != null) {
- promotedReference.getTargets().add(componentService);
- }
- } else {
-
- // Wire to a non-composite target service
- promotedReference.getTargets().add(target);
- }
- }
- }
- }
- }
- }
- } else {
- for (ComponentReference componentReference : component.getReferences()) {
-
- // Wire the component reference to the actual
- // non-composite component services
- List<ComponentService> targets = componentReference.getTargets();
- for (int i = 0, n = targets.size(); i < n; i++) {
- ComponentService target = targets.get(i);
- if (target.getService() instanceof CompositeService) {
-
- // Wire to the actual component service
- // promoted by a composite service
- CompositeService compositeService = (CompositeService)target.getService();
- ComponentService componentService = compositeService.getPromotedService();
- if (componentService != null) {
- targets.set(i, componentService);
- }
- }
- }
- }
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
deleted file mode 100644
index 4e2bb11975..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
+++ /dev/null
@@ -1,832 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointFactory;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Wire;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.assembly.builder.DefaultEndpointBuilder;
-import org.apache.tuscany.sca.assembly.builder.EndpointBuilder;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that wires component references.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentReferenceWireBuilderImpl extends BaseBuilderImpl implements CompositeBuilder {
-
- protected EndpointFactory endpointFactory;
- private EndpointBuilder endpointBuilder;
-
- public ComponentReferenceWireBuilderImpl(AssemblyFactory assemblyFactory, EndpointFactory endpointFactory, InterfaceContractMapper interfaceContractMapper) {
- super(assemblyFactory, null, null, null, interfaceContractMapper);
- this.endpointFactory = endpointFactory;
- this.endpointBuilder = new DefaultEndpointBuilder();
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.ComponentReferenceWireBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- wireComponentReferences(composite, monitor);
- }
-
- /**
- * Wire component references to component services and connect promoted
- * services/references to component services/references inside a composite.
- *
- * @param composite
- */
- protected void wireComponentReferences(Composite composite, Monitor monitor) {
-
- // Wire nested composites recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- wireComponentReferences((Composite)implementation, monitor);
- }
- }
-
- // Index components, services and references
- Map<String, Component> components = new HashMap<String, Component>();
- Map<String, ComponentService> componentServices = new HashMap<String, ComponentService>();
- Map<String, ComponentReference> componentReferences = new HashMap<String, ComponentReference>();
- indexComponentsServicesAndReferences(composite, components, componentServices, componentReferences);
-
- // Connect composite services and references to the component
- // services and references that they promote
- //connectCompositeServices(composite, components, componentServices);
- //connectCompositeReferences(composite, componentReferences);
-
- // Compute the policies before connecting component references
- //computePolicies(composite);
-
- // Connect component references as described in wires
- connectWires(composite, componentServices, componentReferences, monitor);
-
- // Connect component references to their targets
- connectComponentReferences(composite, components, componentServices, componentReferences, monitor);
-
- // Validate that references are wired or promoted, according
- // to their multiplicity
- for (ComponentReference componentReference : componentReferences.values()) {
- if (!ReferenceConfigurationUtil.validateMultiplicityAndTargets(componentReference.getMultiplicity(), componentReference
- .getTargets(), componentReference.getBindings())) {
- if (componentReference.getTargets().isEmpty()) {
-
- // No warning if the reference is promoted out of the current composite
- boolean promoted = false;
- for (Reference reference : composite.getReferences()) {
- CompositeReference compositeReference = (CompositeReference)reference;
- if (compositeReference.getPromotedReferences().contains(componentReference)) {
- promoted = true;
- break;
- }
- }
- if (!promoted && !componentReference.isCallback()) {
- warning(monitor, "ReferenceWithoutTargets", composite, composite.getName().toString(), componentReference.getName());
- }
- } else {
- warning(monitor, "TooManyReferenceTargets", composite, componentReference.getName());
- }
- }
- }
-
- // Finally clear the original reference target lists as we now have
- // bindings to represent the targets
- for (ComponentReference componentReference : componentReferences.values()) {
- componentReference.getTargets().clear();
- }
- }
-
- /**
- * Resolve wires and connect the sources to their targets
- *
- * @param composite
- * @param componentServices
- * @param componentReferences
- * @param problems
- */
- private void connectWires(Composite composite,
- Map<String, ComponentService> componentServices,
- Map<String, ComponentReference> componentReferences,
- Monitor monitor) {
-
- // For each wire, resolve the source reference, the target service, and
- // add it to the list of targets of the reference
- List<Wire> wires = composite.getWires();
- for (int i = 0, n = wires.size(); i < n; i++) {
- Wire wire = wires.get(i);
-
- ComponentReference resolvedReference;
- ComponentService resolvedService;
-
- // Resolve the source reference
- ComponentReference source = wire.getSource();
- if (source != null && source.isUnresolved()) {
- resolvedReference = componentReferences.get(source.getName());
- if (resolvedReference != null) {
- wire.setSource(resolvedReference);
- } else {
- warning(monitor, "WireSourceNotFound", composite, source.getName());
- }
- } else {
- resolvedReference = wire.getSource();
- }
-
- // Resolve the target service
- ComponentService target = wire.getTarget();
- if (target != null && target.isUnresolved()) {
- resolvedService = componentServices.get(target.getName());
- if (resolvedService != null) {
- wire.setTarget(target);
- } else {
- warning(monitor, "WireTargetNotFound", composite, source.getName());
- }
- } else {
- resolvedService = wire.getTarget();
- }
-
- // Add the target service to the list of targets of the
- // reference
- if (resolvedReference != null && resolvedService != null) {
- // Check that the target component service provides
- // a superset of
- // the component reference interface
- if (resolvedReference.getInterfaceContract() == null || interfaceContractMapper
- .isCompatible(resolvedReference.getInterfaceContract(), resolvedService.getInterfaceContract())) {
-
- //resolvedReference.getTargets().add(resolvedService);
- resolvedReference.getTargets().add(wire.getTarget());
- } else {
- warning(monitor, "WireIncompatibleInterface", composite, source.getName(), target.getName());
- }
- }
- }
-
- // Clear the list of wires
- composite.getWires().clear();
- }
-
- private List<Endpoint> createComponentReferenceTargets(Composite composite,
- Map<String, Component> components,
- Map<String, ComponentService> componentServices,
- ComponentReference componentReference, Monitor monitor) {
-
- List<Endpoint> endpoints = new ArrayList<Endpoint>();
-
- if (componentReference.getAutowire() == Boolean.TRUE
- && componentReference.getTargets().isEmpty()) {
-
- // Find suitable targets in the current composite for an
- // autowired reference
- Multiplicity multiplicity = componentReference.getMultiplicity();
- for (Component targetComponent : composite.getComponents()) {
- // prevent autowire connecting to self
- boolean skipSelf = false;
- for (ComponentReference targetComponentReference : targetComponent
- .getReferences()) {
- if (componentReference == targetComponentReference) {
- skipSelf = true;
- }
- }
-
- if (!skipSelf) {
- for (ComponentService targetComponentService : targetComponent
- .getServices()) {
- if (componentReference.getInterfaceContract() == null
- || interfaceContractMapper.isCompatible(
- componentReference
- .getInterfaceContract(),
- targetComponentService
- .getInterfaceContract())) {
-
- Endpoint endpoint = endpointFactory
- .createEndpoint();
- endpoint.setTargetName(targetComponent.getName());
- endpoint.setSourceComponent(null); // TODO - fixed
- // up at start
- endpoint
- .setSourceComponentReference(componentReference);
- endpoint.setInterfaceContract(componentReference
- .getInterfaceContract());
- endpoint.setTargetComponent(targetComponent);
- endpoint
- .setTargetComponentService(targetComponentService);
- endpoint.getCandidateBindings().addAll(
- componentReference.getBindings());
- endpoints.add(endpoint);
-
- if (multiplicity == Multiplicity.ZERO_ONE
- || multiplicity == Multiplicity.ONE_ONE) {
- break;
- }
- }
- }
- }
- }
-
- if (multiplicity == Multiplicity.ONE_N
- || multiplicity == Multiplicity.ONE_ONE) {
- if (endpoints.size() == 0) {
- warning(monitor, "NoComponentReferenceTarget",
- componentReference, componentReference.getName());
- }
- }
-
- } else if (!componentReference.getTargets().isEmpty()) {
-
- // Check if the component reference does not mix the use of
- // endpoints specified via
- // binding elements with target endpoints specified via the target
- // attribute
- for (Binding binding : componentReference.getBindings()) {
- if (binding.getURI() != null) {
- warning(monitor, "ReferenceEndPointMixWithTarget",
- composite, componentReference.getName());
- }
- }
-
- // Resolve targets specified on the component reference
- for (ComponentService componentService : componentReference
- .getTargets()) {
-
- // Resolve the target component and service
- String name = componentService.getName();
- ComponentService targetComponentService = componentServices
- .get(name);
- Component targetComponent;
- int s = name.indexOf('/');
- if (s == -1) {
- targetComponent = components.get(name);
- } else {
- targetComponent = components.get(name.substring(0, s));
- }
-
- if (targetComponentService != null) {
-
- // Check that the target component service provides
- // a superset of the component reference interface
- if (componentReference.getInterfaceContract() == null
- || interfaceContractMapper.isCompatible(
- componentReference.getInterfaceContract(),
- targetComponentService
- .getInterfaceContract())) {
-
- Endpoint endpoint = endpointFactory.createEndpoint();
- endpoint.setTargetName(targetComponent.getName());
- endpoint.setSourceComponent(null); // TODO - fixed up at
- // start
- endpoint
- .setSourceComponentReference(componentReference);
- endpoint.setInterfaceContract(componentReference
- .getInterfaceContract());
- endpoint.setTargetComponent(targetComponent);
- endpoint
- .setTargetComponentService(targetComponentService);
- endpoint.getCandidateBindings().addAll(
- componentReference.getBindings());
- endpoints.add(endpoint);
-
- // mark the reference target as resolved. Used later
- // when we are looking to
- // see if an sca binding is associated with a resolved
- // target or not
- componentService.setUnresolved(false);
- } else {
- warning(monitor, "ReferenceIncompatibleInterface",
- composite, composite.getName().toString(),
- componentReference.getName(), componentService
- .getName());
- }
- } else {
- // add all the reference bindings into the target so that
- // they
- // can be used for comparison when the target is resolved at
- // runtime
- componentService.getBindings().addAll(
- componentReference.getBindings());
-
- Endpoint endpoint = endpointFactory.createEndpoint();
- endpoint.setTargetName(name);
- endpoint.setSourceComponent(null); // TODO - fixed up at
- // start
- endpoint.setSourceComponentReference(componentReference);
- endpoint.setInterfaceContract(componentReference
- .getInterfaceContract());
- endpoint.getCandidateBindings().addAll(
- componentReference.getBindings());
- endpoints.add(endpoint);
-
- // The bindings will be cloned back into the reference when
- // the
- // target is finally resolved.
- warning(monitor, "ComponentReferenceTargetNotFound",
- composite, composite.getName().toString(),
- componentService.getName());
- }
- }
- } else if ((componentReference.getReference() != null)
- && (!componentReference.getReference().getTargets().isEmpty())) {
-
- // Resolve targets from the corresponding reference in the
- // componentType
- for (ComponentService componentService : componentReference
- .getReference().getTargets()) {
-
- // Resolve the target component and service
- String name = componentService.getName();
- ComponentService targetComponentService = componentServices
- .get(name);
- Component targetComponent;
- int s = name.indexOf('/');
- if (s == -1) {
- targetComponent = components.get(name);
- } else {
- targetComponent = components.get(name.substring(0, s));
- }
-
- if (targetComponentService != null) {
-
- // Check that the target component service provides
- // a superset of
- // the component reference interface
- if (componentReference.getInterfaceContract() == null
- || interfaceContractMapper.isCompatible(
- componentReference.getInterfaceContract(),
- targetComponentService
- .getInterfaceContract())) {
-
- Endpoint endpoint = endpointFactory.createEndpoint();
- endpoint.setTargetName(targetComponent.getName());
- endpoint.setSourceComponent(null); // TODO - fixed up at
- // start
- endpoint
- .setSourceComponentReference(componentReference);
- endpoint.setInterfaceContract(componentReference
- .getInterfaceContract());
- endpoint.setTargetComponent(targetComponent);
- endpoint
- .setTargetComponentService(targetComponentService);
- endpoint.getCandidateBindings().addAll(
- componentReference.getBindings());
- endpoints.add(endpoint);
-
- // mark the reference target as resolved. Used later
- // when we are looking to
- // see if an sca binding is associated with a resolved
- // target or not
- componentService.setUnresolved(false);
- } else {
- warning(monitor, "ComponentIncompatibleInterface",
- composite, componentReference.getName(),
- componentService.getName());
- }
- } else {
- // add all the reference bindings into the target so that
- // they
- // can be used for comparison when the target is resolved at
- // runtime
- componentService.getBindings().addAll(
- componentReference.getBindings());
-
- // The bindings will be cloned back into the reference when
- // the
- // target is finally resolved.
-
- Endpoint endpoint = endpointFactory.createEndpoint();
- endpoint.setTargetName(name);
- endpoint.setSourceComponent(null); // TODO - fixed up at
- // start
- endpoint.setSourceComponentReference(componentReference);
- endpoint.setInterfaceContract(componentReference
- .getInterfaceContract());
- endpoint.getCandidateBindings().addAll(
- componentReference.getBindings());
- endpoints.add(endpoint);
-
- warning(monitor, "ComponentReferenceTargetNotFound",
- composite, composite.getName().toString(),
- componentService.getName());
- }
- }
- } else if (componentReference.getAutowire() == Boolean.TRUE) {
-
- // Find suitable targets in the current composite for an
- // autowired reference
- Multiplicity multiplicity = componentReference.getMultiplicity();
- for (Component targetComponent : composite.getComponents()) {
- // prevent autowire connecting to self
- boolean skipSelf = false;
- for (ComponentReference targetComponentReference : targetComponent
- .getReferences()) {
- if (componentReference == targetComponentReference) {
- skipSelf = true;
- }
- }
-
- if (!skipSelf) {
- for (ComponentService targetComponentService : targetComponent
- .getServices()) {
- if (componentReference.getInterfaceContract() == null
- || interfaceContractMapper.isCompatible(
- componentReference
- .getInterfaceContract(),
- targetComponentService
- .getInterfaceContract())) {
-
- Endpoint endpoint = endpointFactory
- .createEndpoint();
- endpoint.setTargetName(targetComponent.getName());
- endpoint.setSourceComponent(null); // TODO - fixed
- // up at start
- endpoint
- .setSourceComponentReference(componentReference);
- endpoint.setInterfaceContract(componentReference
- .getInterfaceContract());
- endpoint.setTargetComponent(targetComponent);
- endpoint
- .setTargetComponentService(targetComponentService);
- endpoint.getCandidateBindings().addAll(
- componentReference.getBindings());
- endpoints.add(endpoint);
-
- if (multiplicity == Multiplicity.ZERO_ONE
- || multiplicity == Multiplicity.ONE_ONE) {
- break;
- }
- }
- }
- }
- }
-
- if (multiplicity == Multiplicity.ONE_N
- || multiplicity == Multiplicity.ONE_ONE) {
- if (endpoints.size() == 0) {
- warning(monitor, "NoComponentReferenceTarget",
- componentReference, componentReference.getName());
- }
- }
- }
-
- // if no endpoints have found so far retrieve any target names that are
- // in binding URIs
- if (endpoints.isEmpty()) {
- for (Binding binding : componentReference.getBindings()) {
-
- String uri = binding.getURI();
-
- // user hasn't put a uri on the binding so it's not a target
- // name
- if (uri == null) {
- continue;
- }
-
- // user might have put a local target name in the uri so get
- // the path part and see if it refers to a target we know about
- // - if it does the reference binding will be matched with a
- // service binding
- // - if it doesn't it is assumed to be an external reference
- Component targetComponent = null;
- ComponentService targetComponentService = null;
- String path = null;
-
- try {
- path = URI.create(uri).getPath();
- } catch (Exception ex) {
- // just assume that no target is identified if
- // a URI related exception is thrown
- }
-
- if (path != null) {
- if (path.startsWith("/")) {
- path = path.substring(1);
- }
-
- // Resolve the target component and service
- targetComponentService = componentServices.get(path);
- int s = path.indexOf('/');
- if (s == -1) {
- targetComponent = components.get(path);
- } else {
- targetComponent = components.get(path.substring(0, s));
- }
- }
-
- // if the path of the binding URI matches a component in the
- // composite then configure an endpoint with this component as
- // the target
- // if not then the binding URI will be assumed to reference an
- // external service
- if (targetComponentService != null) {
-
- // Check that the target component service provides
- // a superset of the component reference interface
- if (componentReference.getInterfaceContract() == null
- || interfaceContractMapper.isCompatible(
- componentReference.getInterfaceContract(),
- targetComponentService
- .getInterfaceContract())) {
-
- Endpoint endpoint = endpointFactory.createEndpoint();
- endpoint.setTargetName(targetComponent.getName());
- endpoint.setSourceComponent(null); // TODO - fixed up at
- // start
- endpoint
- .setSourceComponentReference(componentReference);
- endpoint.setInterfaceContract(componentReference
- .getInterfaceContract());
- endpoint.setTargetComponent(targetComponent);
- endpoint
- .setTargetComponentService(targetComponentService);
- endpoint.getCandidateBindings().add(binding);
- endpoints.add(endpoint);
- } else {
- warning(monitor, "ReferenceIncompatibleInterface",
- composite, composite.getName().toString(),
- componentReference.getName(), uri);
- }
- } else {
-
- // create endpoints for manually configured bindings
- Endpoint endpoint = endpointFactory.createEndpoint();
- endpoint.setTargetName(uri);
- endpoint.setSourceComponent(null); // TODO - fixed up at
- // start
- endpoint.setSourceComponentReference(componentReference);
- endpoint.setInterfaceContract(componentReference
- .getInterfaceContract());
- endpoint.setSourceBinding(binding);
- endpoints.add(endpoint);
- }
- }
- }
-
- return endpoints;
- }
-
- /**
- * Connect references to their targets.
- *
- * @param composite
- * @param componentServices
- * @param componentReferences
- * @param problems
- */
- private void connectComponentReferences(Composite composite,
- Map<String, Component> components,
- Map<String, ComponentService> componentServices,
- Map<String, ComponentReference> componentReferences,
- Monitor monitor){
-
- for (ComponentReference componentReference : componentReferences.values()) {
-
- List<Endpoint> endpoints = createComponentReferenceTargets(composite,
- components,
- componentServices,
- componentReference,
- monitor);
-
- componentReference.getEndpoints().addAll(endpoints);
-
- // the result of calculating the endpoints is either that bindings have been
- // configured manually using a URI or that targets have been provided and the
- // endpoint remains unresolved. So all endpoints should be either resved or uresolved.
- boolean endpointsRequireAutomaticResolution = false;
- for(Endpoint endpoint : endpoints){
- endpointsRequireAutomaticResolution = endpoint.isUnresolved();
- }
-
- // build each endpoint
- if (endpointsRequireAutomaticResolution) {
-
- for(Endpoint endpoint : endpoints){
- endpointBuilder.build(endpoint, monitor);
- }
-
- // TODO - The following step ensures that the reference binding list remains
- // as the record of resolved targets for now. This needs fixing so
- // that the endpoint takes on this responsibility.
- componentReference.getBindings().clear();
-
- if (componentReference.getCallback() != null){
- componentReference.getCallback().getBindings().clear();
- }
-
- for(Endpoint endpoint : endpoints){
- if (endpoint.isUnresolved() == false){
- componentReference.getBindings().add(endpoint.getSourceBinding());
-
- if (componentReference.getCallback() != null){
- componentReference.getCallback().getBindings().add(endpoint.getSourceCallbackBinding());
- }
- }
- }
-
- } else {
- // do nothing as no targets have been specified so the bindings
- // in the reference binding list are assumed to be manually configured
- }
-
-
-/*
- // Select the reference bindings matching the target service bindings
- List<Binding> selectedBindings = new ArrayList<Binding>();
- List<Binding> selectedCallbackBindings = null;
-
- // Handle callback
- boolean bidirectional = false;
-
- if (componentReference.getInterfaceContract() != null && componentReference.getInterfaceContract().getCallbackInterface() != null) {
- bidirectional = true;
- selectedCallbackBindings = new ArrayList<Binding>();
- }
-
- for (Target target : targets) {
-
- Component targetComponent = target.getComponent();
- ComponentService targetComponentService = target.getService();
- if (targetComponentService.getService() instanceof CompositeService) {
- CompositeService compositeService = (CompositeService) targetComponentService.getService();
- // Find the promoted component service
- targetComponentService = ServiceConfigurationUtil.getPromotedComponentService(compositeService);
- }
-
- try {
- PolicyConfigurationUtil.determineApplicableBindingPolicySets(componentReference, targetComponentService);
- } catch ( Exception e ) {
- warning("Policy related exception: " + e, e);
- //throw new RuntimeException(e);
- }
-
- // Match the binding against the bindings of the target service
- Binding selected = BindingConfigurationUtil.resolveBindings(componentReference, targetComponent, targetComponentService);
- if (selected == null) {
- warning("NoMatchingBinding", componentReference, componentReference.getName(), targetComponentService.getName());
- } else {
- selectedBindings.add(selected);
- }
- if (bidirectional) {
- Binding selectedCallback = BindingConfigurationUtil.resolveCallbackBindings(componentReference, targetComponent, targetComponentService);
- if (selectedCallback != null) {
- selectedCallbackBindings.add(selectedCallback);
- }
- }
- }
-*/
-
- // Need to tidy up the reference binding list and add in the bindings that
- // have been selected above. The situation so far...
- // Wired reference (1 or more targets are specified)
- // Binding.uri = null - remove as it's left over from target resolution
- // the binding will have been moved to the target from where
- // it will be resolved later
- // Binding.uri != null - the selected and resolved reference binding
- // Unwired reference (0 targets)
- // Binding.uri = null - Either a callback reference or the reference is yet to be wired
- // by the implementation so leave the binding where it is
- // Binding.uri != null - from the composite file so leave it
-/*
- if ((componentReference.getTargets().size() > 0) ||
- (!targets.isEmpty())) {
-
- // Add all the effective bindings
- componentReference.getBindings().clear();
- componentReference.getBindings().addAll(selectedBindings);
- if (bidirectional) {
- componentReference.getCallback().getBindings().clear();
- componentReference.getCallback().getBindings().addAll(selectedCallbackBindings);
- }
-
- // add in sca bindings to represent all unresolved targets. The sca binding
- // will try to resolve the target at a later date.
- for (ComponentService service : componentReference.getTargets()) {
- if (service.isUnresolved()) {
- SCABinding scaBinding = null;
-
- // find the sca binding amongst the candidate binding list. We want to
- // find this one and clone it as it may have been configured with
- // policies
- for (Binding binding : service.getBindings()) {
-
- if (binding instanceof SCABinding) {
- try {
- scaBinding = (SCABinding)((OptimizableBinding)binding).clone();
- } catch (CloneNotSupportedException ex){
- // we know it is supported on the SCA binding
- }
- break;
- }
- }
-
- if (scaBinding != null) {
- // configure the cloned SCA binding for this reference target
- scaBinding.setName(service.getName());
-
- // this service object holds the list of candidate bindings which
- // can be used for later matching
- ((OptimizableBinding)scaBinding).setTargetComponentService(service);
- componentReference.getBindings().add(scaBinding);
- } else {
- // not sure we need to raise a warning here as a warning will already been
- // thrown previously to indicate the reason why there is no sca binding
- // warning("NoSCABindingAvailableForUnresolvedService", componentReference, componentReference.getName(), service.getName());
- }
- }
- }
- }
-
-*/
- // Connect the optimizable bindings to their target component and
- // service
-/*
- for (Binding binding : componentReference.getBindings()) {
- if (!(binding instanceof OptimizableBinding)) {
- continue;
- }
- OptimizableBinding optimizableBinding = (OptimizableBinding)binding;
- if (optimizableBinding.getTargetComponentService() != null) {
- continue;
- }
- String uri = optimizableBinding.getURI();
- if (uri == null) {
- continue;
- }
- uri = URI.create(uri).getPath();
- if (uri.startsWith("/")) {
- uri = uri.substring(1);
- }
-
- // Resolve the target component and service
- ComponentService targetComponentService = componentServices.get(uri);
- Component targetComponent;
- int s = uri.indexOf('/');
- if (s == -1) {
- targetComponent = components.get(uri);
- } else {
- targetComponent = components.get(uri.substring(0, s));
- }
-
- if (targetComponentService != null) {
-
- // Check that the target component service provides
- // a superset of the component reference interface
- if (componentReference.getInterfaceContract() == null ||
- interfaceContractMapper.isCompatible(componentReference.getInterfaceContract(), targetComponentService.getInterfaceContract())) {
-
- } else {
- warning("ReferenceIncompatibleInterface",
- composite,
- composite.getName().toString(),
- componentReference.getName(),
- uri);
- }
- optimizableBinding.setTargetComponent(targetComponent);
- optimizableBinding.setTargetComponentService(targetComponentService);
- optimizableBinding.setTargetBinding(targetComponentService.getBinding(optimizableBinding.getClass()));
- }
- }
-*/
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java
deleted file mode 100644
index c725ea8947..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-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.Implementation;
-import org.apache.tuscany.sca.assembly.builder.BindingBuilder;
-import org.apache.tuscany.sca.assembly.builder.BindingBuilderExtension;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that performs any additional building steps that
- * component service bindings may need. Used for WSDL generation.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentServiceBindingBuilderImpl implements CompositeBuilder {
-
- public ComponentServiceBindingBuilderImpl() {
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.ComponentServiceBindingBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- buildServiceBindings(composite, monitor);
- }
-
- private void buildServiceBindings(Composite composite, Monitor monitor) {
-
- // build bindings recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- buildServiceBindings((Composite)implementation, monitor);
- }
- }
-
- // find all the component service bindings
- for (Component component : composite.getComponents()) {
- for (ComponentService componentService : component.getServices()) {
- for (Binding binding : componentService.getBindings()) {
- if (binding instanceof BindingBuilderExtension) {
- BindingBuilder builder = ((BindingBuilderExtension)binding).getBuilder();
- if (builder != null) {
- builder.build(component, componentService, binding, monitor);
- }
- }
- }
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServicePromotionBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServicePromotionBuilderImpl.java
deleted file mode 100644
index b9646acb20..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServicePromotionBuilderImpl.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-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.CompositeService;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that handles the creation of promoted services.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentServicePromotionBuilderImpl implements CompositeBuilder {
- private AssemblyFactory assemblyFactory;
-
- public ComponentServicePromotionBuilderImpl(AssemblyFactory assemblyFactory) {
- this.assemblyFactory = assemblyFactory;
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.ComponentServicePromotionBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
-
- // Process nested composites recursively
- configureNestedCompositeServices(composite);
- }
-
- private void configureNestedCompositeServices(Composite composite) {
-
- // Process nested composites recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
-
- // First process nested composites
- configureNestedCompositeServices((Composite)implementation);
-
- // Process the component services declared on components in this composite
- for (ComponentService componentService : component.getServices()) {
- Service implService = componentService.getService();
- if (implService != null && implService instanceof CompositeService) {
- CompositeService compositeService = (CompositeService)implService;
-
- // Get the innermost promoted service
- ComponentService promotedService =
- ServiceConfigurationUtil.getPromotedComponentService(compositeService);
- if (promotedService != null) {
- Component promotedComponent = ServiceConfigurationUtil.getPromotedComponent(compositeService);
-
- // Create a new component service to represent this
- // component service on the promoted component
- ComponentService newComponentService = assemblyFactory.createComponentService();
- newComponentService.setName("$promoted$" + component.getName() + "$slash$" + componentService.getName());
- promotedComponent.getServices().add(newComponentService);
- newComponentService.setService(promotedService.getService());
- newComponentService.getBindings().addAll(componentService.getBindings());
- newComponentService.setInterfaceContract(componentService.getInterfaceContract());
-
- if (componentService.getInterfaceContract() != null &&
- componentService.getInterfaceContract().getCallbackInterface() != null) {
- newComponentService.setCallback(assemblyFactory.createCallback());
- newComponentService.getCallback().getBindings()
- .addAll(componentService.getCallback().getBindings());
- }
-
- // Change the composite service to now promote the
- // newly created component service directly
- compositeService.setPromotedComponent(promotedComponent);
- compositeService.setPromotedService(newComponentService);
- }
- }
- }
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingConfigurationBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingConfigurationBuilderImpl.java
deleted file mode 100644
index d31a38c70b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingConfigurationBuilderImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that performs any additional building steps that
- * composite service bindings may need. Used for WSDL generation.
- *
- * TODO - What is this actually used for? I can't find any references in the
- * code base
- *
- * @version $Rev$ $Date$
- */
-public class CompositeBindingConfigurationBuilderImpl extends CompositeBindingURIBuilderImpl implements CompositeBuilder {
-
- public CompositeBindingConfigurationBuilderImpl(FactoryExtensionPoint factories, InterfaceContractMapper mapper) {
- super(factories.getFactory(AssemblyFactory.class),
- factories.getFactory(SCABindingFactory.class),
- null, null,
- mapper);
- }
-
- public CompositeBindingConfigurationBuilderImpl(AssemblyFactory assemblyFactory,
- SCABindingFactory scaBindingFactory,
- InterfaceContractMapper interfaceContractMapper) {
- super(assemblyFactory,
- scaBindingFactory,
- null, null,
- interfaceContractMapper);
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositeServiceBindingBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- List<Binding> defaultBindings = null;
- for (Object x: composite.getExtensions()) {
- if (x instanceof List) {
- defaultBindings = (List<Binding>)x;
- }
- }
- configureBindingURIs(composite, definitions, defaultBindings, monitor);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingURIBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingURIBuilderImpl.java
deleted file mode 100644
index 6b9d5d9c46..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingURIBuilderImpl.java
+++ /dev/null
@@ -1,536 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that handles the configuration of binding URIs.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeBindingURIBuilderImpl extends BaseBuilderImpl implements CompositeBuilder {
-
- @Deprecated
- public CompositeBindingURIBuilderImpl(AssemblyFactory assemblyFactory,
- SCABindingFactory scaBindingFactory,
- InterfaceContractMapper interfaceContractMapper) {
- super(assemblyFactory, scaBindingFactory,
- null, null,
- interfaceContractMapper);
- }
-
- public CompositeBindingURIBuilderImpl(AssemblyFactory assemblyFactory,
- SCABindingFactory scaBindingFactory,
- DocumentBuilderFactory documentBuilderFactory,
- TransformerFactory transformerFactory,
- InterfaceContractMapper interfaceContractMapper) {
- super(assemblyFactory, scaBindingFactory,
- documentBuilderFactory, transformerFactory, interfaceContractMapper);
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositeBindingURIBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- configureBindingURIsAndNames(composite, definitions, monitor);
- }
-
- /**
- * Called by CompositeBindingURIBuilderImpl
- *
- * @param composite the composite to be configured
- */
- protected void configureBindingURIsAndNames(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- configureBindingURIs(composite, null, definitions, null, monitor);
- configureBindingNames(composite, monitor);
- }
-
- /**
- * Fully resolve the binding URIs based on available information. This includes information
- * from the ".composite" files, from resources associated with the binding, e.g. WSDL files,
- * from any associated policies and from the default information for each binding type.
- *
- * @param composite the composite to be configured
- * @param defaultBindings list of default binding configurations
- */
- protected void configureBindingURIs(Composite composite,
- Definitions definitions, List<Binding> defaultBindings,
- Monitor monitor) throws CompositeBuilderException {
- configureBindingURIs(composite, null, definitions, defaultBindings, monitor);
- }
-
- /**
- * Fully resolve the binding URIs based on available information. This includes information
- * from the ".composite" files, from resources associated with the binding, e.g. WSDL files,
- * from any associated policies and from the default information for each binding type.
- *
- * NOTE: This method repeats some of the processing performed by the configureComponents()
- * method above. The duplication is needed because NodeConfigurationServiceImpl
- * calls this method without previously calling configureComponents(). In the
- * normal builder sequence used by CompositeBuilderImpl, both of these methods
- * are called.
- *
- * TODO: Share the URL calculation algorithm with the configureComponents() method above
- * although keeping the configureComponents() methods signature as is because when
- * a composite is actually build in a node the node default information is currently
- * available
- *
- * @param composite the composite to be configured
- * @param uri the path to the composite provided through any nested composite component implementations
- * @param defaultBindings list of default binding configurations
- */
- private void configureBindingURIs(Composite composite, String uri,
- Definitions definitions, List<Binding> defaultBindings,
- Monitor monitor) throws CompositeBuilderException {
-
- String parentComponentURI = uri;
-
- // Process nested composites recursively
- for (Component component : composite.getComponents()) {
-
- // Initialize component URI
- String componentURI;
- if (parentComponentURI == null) {
- componentURI = component.getName();
- } else {
- componentURI = URI.create(parentComponentURI + '/').resolve(component.getName()).toString();
- }
- component.setURI(componentURI);
-
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
-
- // Process nested composite
- configureBindingURIs((Composite)implementation, componentURI, definitions, defaultBindings, monitor);
- }
- }
-
- // Initialize composite service binding URIs
- List<Service> compositeServices = composite.getServices();
- for (Service service : compositeServices) {
- // Set default binding names
-
- // Create default SCA binding
- if (service.getBindings().isEmpty()) {
- SCABinding scaBinding = createSCABinding(definitions);
- service.getBindings().add(scaBinding);
- }
-
- // Initialize binding names and URIs
- for (Binding binding : service.getBindings()) {
- constructBindingName(service, binding, monitor);
- constructBindingURI(parentComponentURI, composite, service, binding, defaultBindings, monitor);
- }
- }
-
- // Initialize component service binding URIs
- for (Component component : composite.getComponents()) {
-
- // Index properties, services and references
- Map<String, Service> services = new HashMap<String, Service>();
- Map<String, Reference> references = new HashMap<String, Reference>();
- Map<String, Property> properties = new HashMap<String, Property>();
- indexImplementationPropertiesServicesAndReferences(component,
- services,
- references,
- properties,
- monitor);
-
- // Index component services, references and properties
- // Also check for duplicates
- Map<String, ComponentService> componentServices =
- new HashMap<String, ComponentService>();
- Map<String, ComponentReference> componentReferences =
- new HashMap<String, ComponentReference>();
- Map<String, ComponentProperty> componentProperties =
- new HashMap<String, ComponentProperty>();
- indexComponentPropertiesServicesAndReferences(component,
- componentServices,
- componentReferences,
- componentProperties,
- monitor);
-
- // Reconcile component services/references/properties and
- // implementation services/references and create component
- // services/references/properties for the services/references
- // declared by the implementation
- reconcileServices(component, services, componentServices, monitor);
- reconcileReferences(component, references, componentReferences, monitor);
- reconcileProperties(component, properties, componentProperties, monitor);
-
- for (ComponentService service : component.getServices()) {
-
- // Create default SCA binding
- if (service.getBindings().isEmpty()) {
- SCABinding scaBinding = createSCABinding(definitions);
- service.getBindings().add(scaBinding);
- }
-
- // Initialize binding names and URIs
- for (Binding binding : service.getBindings()) {
-
- constructBindingName(service, binding, monitor);
- constructBindingURI(component, service, binding, defaultBindings, monitor);
- }
- }
- }
- }
-
- /**
- * Add default names for callback bindings and reference bindings. Needs to be
- * separate from configureBindingURIs() because configureBindingURIs() is called
- * by NodeConfigurationServiceImpl as well as by CompositeBuilderImpl.
- */
- private void configureBindingNames(Composite composite, Monitor monitor) {
-
- // Process nested composites recursively
- for (Component component : composite.getComponents()) {
-
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
-
- // Process nested composite
- configureBindingNames((Composite)implementation, monitor);
- }
- }
-
- // Initialize composite service callback binding names
- for (Service service : composite.getServices()) {
-
- if (service.getCallback() != null) {
- for (Binding binding : service.getCallback().getBindings()) {
- constructBindingName(service, binding, monitor);
- }
- }
- }
-
- // Initialize composite reference binding names
- for (Reference reference : composite.getReferences()) {
-
- for (Binding binding : reference.getBindings()) {
- constructBindingName(reference, binding, monitor);
- }
-
- if (reference.getCallback() != null) {
- for (Binding binding : reference.getCallback().getBindings()) {
- constructBindingName(reference, binding, monitor);
- }
- }
- }
-
- // Initialize component service and reference binding names
- for (Component component : composite.getComponents()) {
-
- // Initialize component service callback binding names
- for (ComponentService service : component.getServices()) {
-
- if (service.getCallback() != null) {
- for (Binding binding : service.getCallback().getBindings()) {
- constructBindingName(service, binding, monitor);
- }
- }
- }
-
- // Initialize component reference binding names
- for (ComponentReference reference : component.getReferences()) {
-
- // Initialize binding names
- for (Binding binding : reference.getBindings()) {
- constructBindingName(reference, binding, monitor);
- }
-
- if (reference.getCallback() != null) {
- for (Binding binding : reference.getCallback().getBindings()) {
- constructBindingName(reference, binding, monitor);
- }
- }
- }
- }
- }
-
- /**
- * If a binding name is not provided by the user, construct it based on the service
- * or reference name
- *
- * @param contract the service or reference
- * @param binding
- */
- private void constructBindingName(Contract contract, Binding binding, Monitor monitor) {
-
- // set the default binding name if one is required
- // if there is no name on the binding then set it to the service or reference name
- if (binding.getName() == null){
- binding.setName(contract.getName());
- }
-
- // Check that multiple bindings do not have the same name
- for (Binding otherBinding : contract.getBindings()) {
- if (otherBinding == binding) {
- // Skip the current binding
- continue;
- }
- if (binding.getClass() != otherBinding.getClass()) {
- // Look for a binding of the same type
- continue;
- }
- if (binding.getName().equals(otherBinding.getName())) {
- warning(monitor, contract instanceof Service ? "MultipleBindingsForService" : "MultipleBindingsForReference",
- binding, contract.getName(), binding.getName());
- }
- }
- }
-
- /**
- * URI construction for composite bindings based on Assembly Specification section 1.7.2, This method
- * assumes that the component URI part of the binding URI is formed from the part to the
- * composite in question and just calls the generic constructBindingURI method with this
- * information
- *
- * @param parentComponentURI
- * @param composite
- * @param service
- * @param binding
- * @param defaultBindings
- */
- private void constructBindingURI(String parentComponentURI, Composite composite, Service service,
- Binding binding, List<Binding> defaultBindings, Monitor monitor)
- throws CompositeBuilderException{
- // This is a composite service so there is no component to provide a component URI
- // The path to this composite (through nested composites) is used.
- boolean includeBindingName = composite.getServices().size() != 1;
- constructBindingURI(parentComponentURI, service, binding, includeBindingName, defaultBindings, monitor);
- }
-
- /**
- * URI construction for component bindings based on Assembly Specification section 1.7.2. This method
- * calculates the component URI part based on component information before calling the generic
- * constructBindingURI method
- *
- * @param component the component that holds the service
- * @param service the service that holds the binding
- * @param binding the binding for which the URI is being constructed
- * @param defaultBindings the list of default binding configurations
- */
- private void constructBindingURI(Component component, Service service,
- Binding binding, List<Binding> defaultBindings, Monitor monitor)
- throws CompositeBuilderException{
- boolean includeBindingName = component.getServices().size() != 1;
- constructBindingURI(component.getURI(), service, binding, includeBindingName, defaultBindings, monitor);
- }
-
- /**
- * Generic URI construction for bindings based on Assembly Specification section 1.7.2
- *
- * @param componentURIString the string version of the URI part that comes from the component name
- * @param service the service in question
- * @param binding the binding for which the URI is being constructed
- * @param includeBindingName when set true the serviceBindingURI part should be used
- * @param defaultBindings the list of default binding configurations
- * @throws CompositeBuilderException
- */
- private void constructBindingURI(String componentURIString, Service service, Binding binding,
- boolean includeBindingName, List<Binding> defaultBindings, Monitor monitor)
- throws CompositeBuilderException{
-
- try {
- // calculate the service binding URI
- URI bindingURI;
- if (binding.getURI() != null){
- bindingURI = new URI(binding.getURI());
-
- // if the user has provided an absolute binding URI then use it
- if (bindingURI.isAbsolute()){
- binding.setURI(bindingURI.toString());
- return;
- }
- } else {
- bindingURI = null;
- }
-
- // Get the service binding name
- URI bindingName;
- if (binding.getName() != null) {
- bindingName = new URI(binding.getName());
- } else {
- bindingName = new URI("");
- }
-
- // calculate the component URI
- URI componentURI;
- if (componentURIString != null) {
- componentURI = new URI(addSlashToPath(componentURIString));
- } else {
- componentURI = null;
- }
-
- // if the user has provided an absolute component URI then use it
- if (componentURI != null && componentURI.isAbsolute()){
- binding.setURI(constructBindingURI(null, componentURI, bindingURI, includeBindingName, bindingName));
- return;
- }
-
- // calculate the base URI
- URI baseURI = null;
- if (defaultBindings != null) {
- for (Binding defaultBinding : defaultBindings){
- if (binding.getClass() == defaultBinding.getClass()){
- baseURI = new URI(addSlashToPath(defaultBinding.getURI()));
- break;
- }
- }
- }
-
- binding.setURI(constructBindingURI(baseURI, componentURI, bindingURI, includeBindingName, bindingName));
- } catch (URISyntaxException ex) {
- error(monitor, "URLSyntaxException", binding, componentURIString, service.getName(), binding.getName());
- }
- }
-
- /**
- * Use to ensure that URI paths end in "/" as here we want to maintain the
- * last path element of an base URI when other URI are resolved against it. This is
- * not the default behaviour of URI resolution as defined in RFC 2369
- *
- * @param path the path string to which the "/" is to be added
- * @return the resulting path with a "/" added if it not already there
- */
- private static String addSlashToPath(String path){
- if (path.endsWith("/") || path.endsWith("#")){
- return path;
- } else {
- return path + "/";
- }
- }
-
- /**
- * Concatenate binding URI parts together based on Assembly Specification section 1.7.2
- *
- * @param baseURI the base of the binding URI
- * @param componentURI the middle part of the binding URI derived from the component name
- * @param bindingURI the end part of the binding URI
- * @param includeBindingName when set true the binding name part should be used
- * @param bindingName the binding name
- * @return the resulting URI as a string
- */
- private static String constructBindingURI(URI baseURI, URI componentURI, URI bindingURI, boolean includeBindingName, URI bindingName){
- String uriString;
-
- if (baseURI == null) {
- if (componentURI == null){
- if (bindingURI != null ) {
- uriString = bindingURI.toString();
- } else {
- uriString = bindingName.toString();
- }
- } else {
- if (bindingURI != null ) {
- uriString = componentURI.resolve(bindingURI).toString();
- } else {
- if (includeBindingName) {
- uriString = componentURI.resolve(bindingName).toString();
- } else {
- uriString = componentURI.toString();
- }
- }
- }
- } else {
- if (componentURI == null) {
- if (bindingURI != null ) {
- uriString = basedURI(baseURI, bindingURI).toString();
- } else {
- if (includeBindingName) {
- uriString = basedURI(baseURI, bindingName).toString();
- } else {
- uriString = baseURI.toString();
- }
- }
- } else {
- if (bindingURI != null ) {
- uriString = basedURI(baseURI, componentURI.resolve(bindingURI)).toString();
- } else {
- if (includeBindingName) {
- uriString = basedURI(baseURI, componentURI.resolve(bindingName)).toString();
- } else {
- uriString = basedURI(baseURI, componentURI).toString();
- }
- }
- }
- }
-
- // tidy up by removing any trailing "/"
- if (uriString.endsWith("/")){
- uriString = uriString.substring(0, uriString.length()-1);
- }
-
- URI uri = URI.create(uriString);
- if (!uri.isAbsolute()) {
- uri = URI.create("/").resolve(uri);
- }
- return uri.toString();
- }
-
- /**
- * Combine a URI with a base URI.
- *
- * @param baseURI
- * @param uri
- * @return
- */
- private static URI basedURI(URI baseURI, URI uri) {
- if (uri.getScheme() != null) {
- return uri;
- }
- String str = uri.toString();
- if (str.startsWith("/")) {
- str = str.substring(1);
- }
- return URI.create(baseURI.toString() + str).normalize();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
deleted file mode 100644
index 9846edc127..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.logging.Logger;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.DefaultEndpointFactory;
-import org.apache.tuscany.sca.assembly.EndpointFactory;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-
-/**
- * A builder that handles the configuration of the components inside a composite
- * and the wiring of component references to component services.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeBuilderImpl implements CompositeBuilder {
- private static final Logger logger = Logger.getLogger(CompositeBuilderImpl.class.getName());
- private CompositeBuilder compositeIncludeBuilder;
- private CompositeBuilder componentReferenceWireBuilder;
- private CompositeBuilder componentReferencePromotionWireBuilder;
- private CompositeBuilder compositeReferenceWireBuilder;
- private CompositeBuilder compositeCloneBuilder;
- private CompositeBuilder componentConfigurationBuilder;
- private CompositeBuilder compositeServiceConfigurationBuilder;
- private CompositeBuilder compositeReferenceConfigurationBuilder;
- private CompositeBuilder compositeBindingURIBuilder;
- private CompositeBuilder componentServicePromotionBuilder;
- private CompositeBuilder compositeServicePromotionBuilder;
- private CompositeBuilder compositePromotionBuilder;
- private CompositeBuilder compositePolicyBuilder;
- private CompositeBuilder componentServiceBindingBuilder;
- private CompositeBuilder componentReferenceBindingBuilder;
-
- public CompositeBuilderImpl(FactoryExtensionPoint factories, InterfaceContractMapper mapper) {
- this(factories.getFactory(AssemblyFactory.class),
- factories.getFactory(EndpointFactory.class),
- factories.getFactory(SCABindingFactory.class),
- factories.getFactory(IntentAttachPointTypeFactory.class),
- factories.getFactory(DocumentBuilderFactory.class),
- factories.getFactory(TransformerFactory.class),
- mapper);
- }
-
- /**
- * Constructs a new composite builder.
- *
- * @param assemblyFactory
- * @param scaBindingFactory
- * @param endpointFactory
- * @param intentAttachPointTypeFactory
- * @param interfaceContractMapper
- * @param policyDefinitions
- * @param monitor
- */
- @Deprecated
- public CompositeBuilderImpl(AssemblyFactory assemblyFactory,
- EndpointFactory endpointFactory,
- SCABindingFactory scaBindingFactory,
- IntentAttachPointTypeFactory intentAttachPointTypeFactory,
- InterfaceContractMapper interfaceContractMapper) {
- this(assemblyFactory, endpointFactory, scaBindingFactory, intentAttachPointTypeFactory,
- null, null, interfaceContractMapper);
- }
-
- /**
- * Constructs a new composite builder.
- *
- * @param assemblyFactory
- * @param scaBindingFactory
- * @param endpointFactory
- * @param intentAttachPointTypeFactory
- * @param interfaceContractMapper
- * @param policyDefinitions
- * @param monitor
- */
- @Deprecated
- public CompositeBuilderImpl(AssemblyFactory assemblyFactory,
- SCABindingFactory scaBindingFactory,
- IntentAttachPointTypeFactory intentAttachPointTypeFactory,
- InterfaceContractMapper interfaceContractMapper) {
- this(assemblyFactory, null, scaBindingFactory, intentAttachPointTypeFactory,
- null, null, interfaceContractMapper);
- }
-
- /**
- * Constructs a new composite builder.
- *
- * @param assemblyFactory
- * @param scaBindingFactory
- * @param intentAttachPointTypeFactory
- * @param documentBuilderFactory
- * @param transformerFactory
- * @param interfaceContractMapper
- * @param monitor
- */
- public CompositeBuilderImpl(AssemblyFactory assemblyFactory,
- SCABindingFactory scaBindingFactory,
- IntentAttachPointTypeFactory intentAttachPointTypeFactory,
- DocumentBuilderFactory documentBuilderFactory,
- TransformerFactory transformerFactory,
- InterfaceContractMapper interfaceContractMapper) {
- this(assemblyFactory, null, scaBindingFactory, intentAttachPointTypeFactory,
- documentBuilderFactory, transformerFactory, interfaceContractMapper);
- }
-
- /**
- * Constructs a new composite builder.
- *
- * @param assemblyFactory
- * @param scaBindingFactory
- * @param endpointFactory
- * @param intentAttachPointTypeFactory
- * @param interfaceContractMapper
- * @param policyDefinitions
- * @param monitor
- */
- public CompositeBuilderImpl(AssemblyFactory assemblyFactory,
- EndpointFactory endpointFactory,
- SCABindingFactory scaBindingFactory,
- IntentAttachPointTypeFactory intentAttachPointTypeFactory,
- DocumentBuilderFactory documentBuilderFactory,
- TransformerFactory transformerFactory,
- InterfaceContractMapper interfaceContractMapper) {
-
- if (endpointFactory == null){
- endpointFactory = new DefaultEndpointFactory();
- }
-
- compositeIncludeBuilder = new CompositeIncludeBuilderImpl();
- componentReferenceWireBuilder = new ComponentReferenceWireBuilderImpl(assemblyFactory, endpointFactory, interfaceContractMapper);
- componentReferencePromotionWireBuilder = new ComponentReferencePromotionWireBuilderImpl(assemblyFactory, endpointFactory);
- compositeReferenceWireBuilder = new CompositeReferenceWireBuilderImpl(assemblyFactory, endpointFactory);
- compositeCloneBuilder = new CompositeCloneBuilderImpl();
- componentConfigurationBuilder = new ComponentConfigurationBuilderImpl(assemblyFactory, scaBindingFactory, documentBuilderFactory, transformerFactory, interfaceContractMapper);
- compositeServiceConfigurationBuilder = new CompositeServiceConfigurationBuilderImpl(assemblyFactory);
- compositeReferenceConfigurationBuilder = new CompositeReferenceConfigurationBuilderImpl(assemblyFactory);
- compositeBindingURIBuilder = new CompositeBindingURIBuilderImpl(assemblyFactory, scaBindingFactory, documentBuilderFactory, transformerFactory, interfaceContractMapper);
- componentServicePromotionBuilder = new ComponentServicePromotionBuilderImpl(assemblyFactory);
- compositeServicePromotionBuilder = new CompositeServicePromotionBuilderImpl(assemblyFactory);
- compositePromotionBuilder = new CompositePromotionBuilderImpl(assemblyFactory, endpointFactory, interfaceContractMapper);
- compositePolicyBuilder = new CompositePolicyBuilderImpl(assemblyFactory, endpointFactory, interfaceContractMapper);
- componentServiceBindingBuilder = new ComponentServiceBindingBuilderImpl();
- componentReferenceBindingBuilder = new ComponentReferenceBindingBuilderImpl();
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositeBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
-
- // Collect and fuse includes
- compositeIncludeBuilder.build(composite, definitions, monitor);
-
- // Expand nested composites
- compositeCloneBuilder.build(composite, definitions, monitor);
-
- // Configure all components
- componentConfigurationBuilder.build(composite, definitions, monitor);
-
- // Connect composite services/references to promoted services/references
- compositePromotionBuilder.build(composite, definitions, monitor);
-
- // Compute the policies across the model hierarchy
- compositePolicyBuilder.build(composite, definitions, monitor);
-
- // Configure composite services
- compositeServiceConfigurationBuilder.build(composite, definitions, monitor);
-
- // Configure composite references
- compositeReferenceConfigurationBuilder.build(composite, definitions, monitor);
-
- // Configure binding URIs
- compositeBindingURIBuilder.build(composite, definitions, monitor);
-
- // Create promoted component services
- componentServicePromotionBuilder.build(composite, definitions, monitor);
-
- // Create promoted composite services
- compositeServicePromotionBuilder.build(composite, definitions, monitor);
-
- // Build component service binding-related information
- componentServiceBindingBuilder.build(composite, definitions, monitor);
-
- // Wire the components
- componentReferenceWireBuilder.build(composite, definitions, monitor);
-
- // Wire the promoted component references
- componentReferencePromotionWireBuilder.build(composite, definitions, monitor);
-
- // Wire the composite references
- compositeReferenceWireBuilder.build(composite, definitions, monitor);
-
- // Build component reference binding-related information
- componentReferenceBindingBuilder.build(composite, definitions, monitor);
-
- // Fuse nested composites
- //FIXME do this later
- //cloneBuilder.fuseCompositeImplementations(composite);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeCloneBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeCloneBuilderImpl.java
deleted file mode 100644
index 21e5192ae8..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeCloneBuilderImpl.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that clones nested composites.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeCloneBuilderImpl implements CompositeBuilder {
-
- public CompositeCloneBuilderImpl() {
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- expandCompositeImplementations(composite);
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositeCloneBuilder";
- }
-
- /**
- * Expand composite component implementations.
- *
- * @param composite
- * @param problems
- */
- private void expandCompositeImplementations(Composite composite) {
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
-
- Composite compositeImplementation = (Composite)implementation;
- Composite clone;
- try {
- clone = (Composite)compositeImplementation.clone();
- } catch (CloneNotSupportedException e) {
- throw new RuntimeException(e);
- }
- component.setImplementation(clone);
- expandCompositeImplementations(clone);
- }
- }
- }
-
- /**
- * Collect all nested composite implementations in a graph of composites.
- *
- * @param composite
- * @param nested
- */
- private void collectNestedComposites(Composite composite, List<Composite> nested) {
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- Composite nestedComposite = (Composite)implementation;
- nested.add(nestedComposite);
- collectNestedComposites(nestedComposite, nested);
- }
- }
- }
-
- /**
- * Fuse nested composites into a top level composite.
- *
- * @param composite
- */
- private void fuseCompositeImplementations(Composite composite) {
-
- // First collect all nested composites
- List<Composite> nested = new ArrayList<Composite>();
- collectNestedComposites(composite, nested);
-
- // Then add all the non-composite components they contain
- for (Composite nestedComposite : nested) {
- for (Component component: nestedComposite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (!(implementation instanceof Composite)) {
- composite.getComponents().add(component);
- }
- }
- }
-
- // Clear the initial list of composite components
- for (Iterator<Component> i = composite.getComponents().iterator(); i.hasNext();) {
- Component component = i.next();
- if (component.getImplementation() instanceof Composite) {
- i.remove();
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeIncludeBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeIncludeBuilderImpl.java
deleted file mode 100644
index 730c002468..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeIncludeBuilderImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Implementation of a CompositeBuilder.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeIncludeBuilderImpl implements CompositeBuilder {
-
- public CompositeIncludeBuilderImpl(FactoryExtensionPoint factories, InterfaceContractMapper mapper) {
- }
-
- public CompositeIncludeBuilderImpl() {
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositeIncludeBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- fuseIncludes(composite, monitor);
- }
-
- private void warning(Monitor monitor, String message, Object model, String... messageParameters) {
- if (monitor != null){
- Problem problem = monitor.createProblem(this.getClass().getName(), "assembly-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /**
- * Collect all includes in a graph of includes.
- *
- * @param composite
- * @param includes
- */
- private void collectIncludes(Composite composite, List<Composite> includes,
- Set<Composite> visited, Monitor monitor) {
- for (Composite include : composite.getIncludes()) {
- if (visited.contains(include)) {
- warning(monitor, "CompositeAlreadyIncluded", composite, include.getName().toString());
- continue;
- }
-
- includes.add(include);
- visited.add(include);
- collectIncludes(include, includes, visited, monitor);
- }
- }
-
- /**
- * Copy a list of includes into a composite.
- *
- * @param composite
- */
- private void fuseIncludes(Composite composite, Monitor monitor) {
-
- // First collect all includes
- List<Composite> includes = new ArrayList<Composite>();
- Set<Composite> visited = new HashSet<Composite>();
- visited.add(composite);
- collectIncludes(composite, includes, visited, monitor);
-
- // Then clone them
- for (Composite include : includes) {
- Composite clone;
- try {
- clone = (Composite)include.clone();
- } catch (CloneNotSupportedException e) {
- throw new RuntimeException(e);
- }
- composite.getComponents().addAll(clone.getComponents());
- composite.getServices().addAll(clone.getServices());
- composite.getReferences().addAll(clone.getReferences());
- composite.getProperties().addAll(clone.getProperties());
- composite.getWires().addAll(clone.getWires());
- composite.getPolicySets().addAll(clone.getPolicySets());
- composite.getRequiredIntents().addAll(clone.getRequiredIntents());
- }
-
- // Clear the list of includes
- composite.getIncludes().clear();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositePolicyBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositePolicyBuilderImpl.java
deleted file mode 100644
index 76cd8256e2..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositePolicyBuilderImpl.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.EndpointFactory;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.policy.util.PolicyComputationUtils;
-
-/**
- * A composite builder that computes policy sets based on attached intents and policy sets.
- * Useful if you want to build the model without making any runtime decisions such as
- * reference/services matching
- *
- * @version $Rev$ $Date$
- */
-public class CompositePolicyBuilderImpl extends BaseBuilderImpl implements CompositeBuilder {
-
- public CompositePolicyBuilderImpl(AssemblyFactory assemblyFactory, EndpointFactory endpointFactory, InterfaceContractMapper interfaceContractMapper) {
- super(assemblyFactory, null, null, null, interfaceContractMapper);
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositePolicyBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- computePolicies(composite, monitor);
- }
-
- protected void computePolicies(Composite composite, Monitor monitor) {
-
- // compute policies recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- computePolicies((Composite)implementation, monitor);
- }
- }
-
- for (Component component : composite.getComponents()) {
-
- // Inherit default policies from the component to component-level contracts.
- // This must be done BEFORE computing implementation policies because the
- // implementation policy computer removes from the component any
- // intents and policy sets that don't apply to implementations.
- PolicyConfigurationUtil.inheritDefaultPolicies(component, component.getServices());
- PolicyConfigurationUtil.inheritDefaultPolicies(component, component.getReferences());
-
- Implementation implemenation = component.getImplementation();
- try {
- PolicyConfigurationUtil.computeImplementationIntentsAndPolicySets(implemenation, component);
- } catch ( Exception e ) {
- error(monitor, "PolicyRelatedException", implemenation, e);
- //throw new RuntimeException(e);
- }
-
- for (ComponentService componentService : component.getServices()) {
- Service service = componentService.getService();
- if (service != null) {
- // reconcile intents and policysets from componentType
- PolicyComputationUtils.addInheritedIntents(service.getRequiredIntents(), componentService.getRequiredIntents());
- PolicyComputationUtils.addInheritedPolicySets(service.getPolicySets(), componentService.getPolicySets(), true);
-
- //reconcile intents and policysets for operations
- boolean notFound;
- List<ConfiguredOperation> opsFromComponentType = new ArrayList<ConfiguredOperation>();
- for ( ConfiguredOperation ctsConfOp : service.getConfiguredOperations() ) {
- notFound = true;
- for ( ConfiguredOperation csConfOp : componentService.getConfiguredOperations() ) {
- if ( csConfOp.getName().equals(ctsConfOp.getName()) ) {
- PolicyComputationUtils.addInheritedIntents(ctsConfOp.getRequiredIntents(), csConfOp.getRequiredIntents());
- PolicyComputationUtils.addInheritedPolicySets(ctsConfOp.getPolicySets(), csConfOp.getPolicySets(), true);
- notFound = false;
- }
- }
-
- if ( notFound ) {
- opsFromComponentType.add(ctsConfOp);
- }
- }
- componentService.getConfiguredOperations().addAll(opsFromComponentType);
- }
-
- try {
- //compute the intents for operations under service element
- PolicyConfigurationUtil.computeIntentsForOperations(componentService);
- //compute intents and policyset for each binding
- //addInheritedOpConfOnBindings(componentService);
- PolicyConfigurationUtil.computeBindingIntentsAndPolicySets(componentService);
- PolicyConfigurationUtil.determineApplicableBindingPolicySets(componentService, null);
-
- } catch ( Exception e ) {
- error(monitor, "PolicyRelatedException", componentService, e);
- //throw new RuntimeException(e);
- }
- }
-
- for (ComponentReference componentReference : component.getReferences()) {
- Reference reference = componentReference.getReference();
- if (reference != null) {
- // reconcile intents and policysets
- PolicyComputationUtils.addInheritedIntents(reference.getRequiredIntents(), componentReference.getRequiredIntents());
- PolicyComputationUtils.addInheritedPolicySets(reference.getPolicySets(), componentReference.getPolicySets(), true);
- }
-
-
- try {
- //compute the intents for operations under reference element
- PolicyConfigurationUtil.computeIntentsForOperations(componentReference);
- //compute intents and policyset for each binding
- //addInheritedOpConfOnBindings(componentReference);
- PolicyConfigurationUtil.computeBindingIntentsAndPolicySets(componentReference);
- PolicyConfigurationUtil.determineApplicableBindingPolicySets(componentReference, null);
-
-
- if ( componentReference.getCallback() != null ) {
- PolicyComputationUtils.addInheritedIntents(componentReference.getRequiredIntents(),
- componentReference.getCallback().getRequiredIntents());
- PolicyComputationUtils.addInheritedPolicySets(componentReference.getPolicySets(),
- componentReference.getCallback().getPolicySets(),
- false);
- }
- } catch ( Exception e ) {
- error(monitor, "PolicyRelatedException", componentReference, e);
- //throw new RuntimeException(e);
- }
- }
- }
-
- PolicyConfigurationUtil.inheritDefaultPolicies(composite, composite.getServices());
- PolicyConfigurationUtil.inheritDefaultPolicies(composite, composite.getReferences());
-
- //compute policies for composite service bindings
- for (Service service : composite.getServices()) {
- addPoliciesFromPromotedService((CompositeService)service);
- try {
- //compute the intents for operations under service element
- PolicyConfigurationUtil.computeIntentsForOperations(service);
- //add or merge service operations to the binding
- //addInheritedOpConfOnBindings(service);
- PolicyConfigurationUtil.computeBindingIntentsAndPolicySets(service);
- PolicyConfigurationUtil.determineApplicableBindingPolicySets(service, null);
- } catch ( Exception e ) {
- error(monitor, "PolicyRelatedException", service, e);
- //throw new RuntimeException(e);
- }
-
- }
-
- for (Reference reference : composite.getReferences()) {
- CompositeReference compReference = (CompositeReference)reference;
- addPoliciesFromPromotedReference(compReference);
- try {
- //compute the intents for operations under service element
- PolicyConfigurationUtil.computeIntentsForOperations(reference);
- //addInheritedOpConfOnBindings(reference);
-
- if (compReference.getCallback() != null) {
- PolicyComputationUtils.addInheritedIntents(compReference.getRequiredIntents(),
- compReference.getCallback().getRequiredIntents());
- PolicyComputationUtils.addInheritedPolicySets(compReference.getPolicySets(),
- compReference.getCallback().getPolicySets(),
- false);
- }
-
- PolicyConfigurationUtil.computeBindingIntentsAndPolicySets(reference);
- PolicyConfigurationUtil.determineApplicableBindingPolicySets(reference, null);
- } catch ( Exception e ) {
- error(monitor, "PolicyRelatedException", reference, e);
- //throw new RuntimeException(e);
- }
- }
- }
-
- private void addPoliciesFromPromotedService(CompositeService compositeService) {
- //inherit intents and policies from promoted service
- PolicyComputationUtils.addInheritedIntents(compositeService.getPromotedService().getRequiredIntents(),
- compositeService.getRequiredIntents());
- PolicyComputationUtils.addInheritedPolicySets(compositeService.getPromotedService().getPolicySets(),
- compositeService.getPolicySets(), true);
- addInheritedOperationConfigurations(compositeService.getPromotedService(), compositeService);
- }
-
- private void addPoliciesFromPromotedReference(CompositeReference compositeReference) {
- for ( Reference promotedReference : compositeReference.getPromotedReferences() ) {
- PolicyComputationUtils.addInheritedIntents(promotedReference.getRequiredIntents(),
- compositeReference.getRequiredIntents());
-
- PolicyComputationUtils.addInheritedPolicySets(promotedReference.getPolicySets(),
- compositeReference.getPolicySets(), true);
- addInheritedOperationConfigurations(promotedReference, compositeReference);
- }
- }
-
- private void addInheritedOperationConfigurations(
- OperationsConfigurator source, OperationsConfigurator target) {
- boolean found = false;
-
- List<ConfiguredOperation> additionalOperations = new ArrayList<ConfiguredOperation>();
- for (ConfiguredOperation sourceConfOp : source
- .getConfiguredOperations()) {
- for (ConfiguredOperation targetConfOp : target
- .getConfiguredOperations()) {
- if (sourceConfOp.getName().equals(targetConfOp.getName())) {
- PolicyComputationUtils.addInheritedIntents(sourceConfOp
- .getRequiredIntents(), targetConfOp
- .getRequiredIntents());
- PolicyComputationUtils.addInheritedPolicySets(sourceConfOp
- .getPolicySets(), targetConfOp.getPolicySets(),
- true);
- found = true;
- break;
- }
- }
-
- if (!found) {
- additionalOperations.add(sourceConfOp);
- }
- }
-
- if (!additionalOperations.isEmpty()) {
- target.getConfiguredOperations().addAll(additionalOperations);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositePromotionBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositePromotionBuilderImpl.java
deleted file mode 100644
index abacc06067..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositePromotionBuilderImpl.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.EndpointFactory;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that makes the connections between composite services and references
- * and the services and references that they promote
- *
- * @version $Rev$ $Date$
- */
-public class CompositePromotionBuilderImpl extends BaseBuilderImpl implements CompositeBuilder {
-
- public CompositePromotionBuilderImpl(AssemblyFactory assemblyFactory, EndpointFactory endpointFactory, InterfaceContractMapper interfaceContractMapper) {
- super(assemblyFactory, null, null, null, interfaceContractMapper);
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositePromotionBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- connectCompositeReferencesAndServices(composite, monitor);
- }
-
- /**
- * Connect composite references and services to the reference and services that they promote.
- *
- * @param composite
- * @param componentServices
- * @param problems
- */
- protected void connectCompositeReferencesAndServices(Composite composite, Monitor monitor){
- // Wire nested composites recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- connectCompositeReferencesAndServices((Composite)implementation, monitor);
- }
- }
-
- // Index components, services and references
- Map<String, Component> components = new HashMap<String, Component>();
- Map<String, ComponentService> componentServices = new HashMap<String, ComponentService>();
- Map<String, ComponentReference> componentReferences = new HashMap<String, ComponentReference>();
- indexComponentsServicesAndReferences(composite, components, componentServices, componentReferences);
-
- // Connect composite services and references to the component
- // services and references that they promote
- connectCompositeServices(composite, components, componentServices, monitor);
- connectCompositeReferences(composite, componentReferences, monitor);
- }
-
- /**
- * Connect composite services to the component services that they promote.
- *
- * @param composite
- * @param componentServices
- * @param problems
- */
- private void connectCompositeServices(Composite composite,
- Map<String, Component> components,
- Map<String, ComponentService> componentServices,
- Monitor monitor) {
-
- // Propagate interfaces from inner composite components' services to
- // their component services
- for (Component component : composite.getComponents()) {
- if (component.getImplementation() instanceof Composite) {
- for (ComponentService componentService : component.getServices()) {
- Service service = componentService.getService();
- if (service != null) {
- if (componentService.getInterfaceContract() == null) {
- componentService.setInterfaceContract(service.getInterfaceContract());
- }
- }
- }
- }
- }
-
- // Connect composite services to the component services that they
- // promote
- for (Service service : composite.getServices()) {
- CompositeService compositeService = (CompositeService)service;
- ComponentService componentService = compositeService.getPromotedService();
- if (componentService != null && componentService.isUnresolved()) {
-
- String promotedComponentName = compositeService.getPromotedComponent().getName();
- String promotedServiceName;
- if (componentService.getName() != null) {
- promotedServiceName = promotedComponentName + '/' + componentService.getName();
- } else {
- promotedServiceName = promotedComponentName;
- }
- ComponentService promotedService = componentServices.get(promotedServiceName);
- if (promotedService != null) {
-
- // Point to the resolved component
- Component promotedComponent = components.get(promotedComponentName);
- compositeService.setPromotedComponent(promotedComponent);
-
- // Point to the resolved component service
- compositeService.setPromotedService(promotedService);
-
- // Use the interface contract from the component service if
- // none is specified on the composite service
- InterfaceContract compositeServiceInterfaceContract = compositeService.getInterfaceContract();
- InterfaceContract promotedServiceInterfaceContract = promotedService.getInterfaceContract();
- if (compositeServiceInterfaceContract == null) {
- compositeService.setInterfaceContract(promotedServiceInterfaceContract);
- } else if (promotedServiceInterfaceContract != null) {
- // Check the compositeServiceInterfaceContract and promotedServiceInterfaceContract
- boolean isCompatible = interfaceContractMapper.isCompatible(compositeServiceInterfaceContract, promotedServiceInterfaceContract);
- if(!isCompatible){
- warning(monitor, "ServiceInterfaceNotSubSet", compositeService, promotedServiceName);
- }
- }
-
- } else {
- warning(monitor, "PromotedServiceNotFound", composite, composite.getName().toString(), promotedServiceName);
- }
- }
- }
-
- }
-
- /**
- * Resolves promoted references.
- *
- * @param composite
- * @param componentReferences
- * @param problems
- */
- private void connectCompositeReferences(Composite composite,
- Map<String, ComponentReference> componentReferences, Monitor monitor) {
-
- // Propagate interfaces from inner composite components' references to
- // their component references
- for (Component component : composite.getComponents()) {
- if (component.getImplementation() instanceof Composite) {
- for (ComponentReference componentReference : component.getReferences()) {
- Reference reference = componentReference.getReference();
- if (reference != null) {
- if (componentReference.getInterfaceContract() == null) {
- componentReference.setInterfaceContract(reference.getInterfaceContract());
- }
- }
- }
- }
- }
-
- // Connect composite references to the component references
- // that they promote
- for (Reference reference : composite.getReferences()) {
- CompositeReference compositeReference = (CompositeReference)reference;
- List<ComponentReference> promotedReferences = compositeReference.getPromotedReferences();
- for (int i = 0, n = promotedReferences.size(); i < n; i++) {
- ComponentReference componentReference = promotedReferences.get(i);
- if (componentReference.isUnresolved()) {
- String componentReferenceName = componentReference.getName();
- componentReference = componentReferences.get(componentReferenceName);
- if (componentReference != null) {
-
- // Point to the resolved component reference
- promotedReferences.set(i, componentReference);
-
- // Use the interface contract from the component
- // reference if none
- // is specified on the composite reference
-
- InterfaceContract compositeReferenceInterfaceContract = compositeReference.getInterfaceContract();
- InterfaceContract componentReferenceInterfaceContract = componentReference.getInterfaceContract();
- if (compositeReferenceInterfaceContract == null) {
- compositeReference.setInterfaceContract(componentReferenceInterfaceContract);
- } else if (componentReferenceInterfaceContract != null) {
- // Check the compositeInterfaceContract and componentInterfaceContract
- boolean isCompatible = interfaceContractMapper.isCompatible(compositeReferenceInterfaceContract, componentReferenceInterfaceContract);
- if (!isCompatible) {
- warning(monitor, "ReferenceInterfaceNotSubSet", compositeReference, componentReferenceName);
- }
- }
- } else {
- warning(monitor, "PromotedReferenceNotFound", composite, composite.getName().toString(), componentReferenceName);
- }
- }
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceConfigurationBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceConfigurationBuilderImpl.java
deleted file mode 100644
index a89f0d402f..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceConfigurationBuilderImpl.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import java.util.List;
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.builder.AutomaticBinding;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-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) $
- */
-public class CompositeReferenceConfigurationBuilderImpl implements CompositeBuilder {
- private AssemblyFactory assemblyFactory;
-
- public CompositeReferenceConfigurationBuilderImpl(AssemblyFactory assemblyFactory) {
- this.assemblyFactory = assemblyFactory;
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositeReferenceConfigurationBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
-
- // Process nested composites recursively
- configureNestedCompositeReferences(composite);
-
- // Process top level composite references
- for (Reference reference : composite.getReferences()) {
- CompositeReference compositeReference = (CompositeReference)reference;
-
- // Get the next lower level promoted reference
- List<ComponentReference> promotedRefs = compositeReference.getPromotedReferences();
- if (!promotedRefs.isEmpty()) {
- if (promotedRefs.size() == 1) {
- ComponentReference promotedReference = promotedRefs.get(0);
-
- // Set the bindings using the top level bindings to override the lower level bindings
- if (bindingsSpecifiedManually(compositeReference.getBindings())) {
- compositeReference.setPromotionOverride(true);
- } else if (bindingsSpecifiedManually(promotedReference.getBindings()) ) {
- compositeReference.getBindings().clear();
- for (Binding binding : promotedReference.getBindings()) {
- try {
- compositeReference.getBindings().add((Binding)binding.clone());
- } catch (CloneNotSupportedException ex) {
- // this binding can't be used in the promoted reference
- }
- }
- }
- if (compositeReference.getInterfaceContract() != null &&
- compositeReference.getInterfaceContract().getCallbackInterface() != null) {
- if (compositeReference.getCallback() != null &&
- bindingsSpecifiedManually(compositeReference.getCallback().getBindings())) {
- compositeReference.setPromotionOverride(true);
- } else if (promotedReference.getCallback() != null &&
- bindingsSpecifiedManually(promotedReference.getCallback().getBindings())) {
- if (compositeReference.getCallback() != null) {
- compositeReference.getCallback().getBindings().clear();
- } else {
- compositeReference.setCallback(assemblyFactory.createCallback());
- }
- for (Binding binding : promotedReference.getCallback().getBindings()) {
- try {
- compositeReference.getCallback().getBindings().add((Binding)binding.clone());
- } catch (CloneNotSupportedException ex) {
- // this binding can't be used in the promoted reference
- }
- }
- }
- }
- } else {
- // This composite reference promotes multiple component references.
- // Because the component reference bindings can all be different, we don't
- // copy any of them up to this composite reference, which will therefore always
- // have its own binding, even if it's only the default SCA binding.
- if (bindingsSpecifiedManually(compositeReference.getBindings()) ||
- (compositeReference.getCallback() != null &&
- bindingsSpecifiedManually(compositeReference.getCallback().getBindings()))) {
- compositeReference.setPromotionOverride(true);
- }
- }
- }
- }
- }
-
- private void configureNestedCompositeReferences(Composite composite) {
-
- // Process nested composites recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
-
- // First process nested composites
- configureNestedCompositeReferences((Composite)implementation);
-
- // Process the component references declared on components in this composite
- for (ComponentReference componentReference : component.getReferences()) {
- Reference implReference = componentReference.getReference();
- if (implReference != null && implReference instanceof CompositeReference) {
- CompositeReference compositeReference = (CompositeReference)implReference;
-
- // Get the next lower level promoted reference
- List<ComponentReference> promotedRefs = compositeReference.getPromotedReferences();
- if (!promotedRefs.isEmpty()) {
- if (promotedRefs.size() == 1) {
- ComponentReference promotedReference = promotedRefs.get(0);
-
- // Set the bindings using the top level bindings to override the lower level bindings
- if (!bindingsSpecifiedManually(compositeReference.getBindings()) &&
- bindingsSpecifiedManually(promotedReference.getBindings()) ) {
- compositeReference.getBindings().clear();
- for (Binding binding : promotedReference.getBindings()) {
- try {
- compositeReference.getBindings().add((Binding)binding.clone());
- } catch (CloneNotSupportedException ex) {
- // this binding can't be used in the promoted reference
- }
- }
- }
- if (bindingsSpecifiedManually(componentReference.getBindings())) {
- componentReference.setPromotionOverride(true);
- } else if (bindingsSpecifiedManually(compositeReference.getBindings()) ) {
- componentReference.getBindings().clear();
- componentReference.getBindings().addAll(compositeReference.getBindings());
- }
- if (componentReference.getInterfaceContract() != null &&
- componentReference.getInterfaceContract().getCallbackInterface() != null) {
- if (!(compositeReference.getCallback() != null &&
- bindingsSpecifiedManually(compositeReference.getCallback().getBindings())) &&
- promotedReference.getCallback() != null &&
- bindingsSpecifiedManually(promotedReference.getCallback().getBindings())) {
- if (compositeReference.getCallback() != null) {
- compositeReference.getCallback().getBindings().clear();
- } else {
- compositeReference.setCallback(assemblyFactory.createCallback());
- }
- compositeReference.getCallback().getBindings().addAll(
- promotedReference.getCallback().getBindings());
- }
- if (componentReference.getCallback() != null &&
- bindingsSpecifiedManually(componentReference.getCallback().getBindings())) {
- componentReference.setPromotionOverride(true);
- } else if (compositeReference.getCallback() != null &&
- bindingsSpecifiedManually(compositeReference.getCallback().getBindings())) {
- if (componentReference.getCallback() != null) {
- componentReference.getCallback().getBindings().clear();
- } else {
- componentReference.setCallback(assemblyFactory.createCallback());
- }
- for (Binding binding : compositeReference.getCallback().getBindings()) {
- try {
- componentReference.getCallback().getBindings().add((Binding)binding.clone());
- } catch (CloneNotSupportedException ex) {
- // this binding can't be used in the promoted reference
- }
- }
- }
- }
- } else {
- // This component reference promotes multiple lower-level component references.
- // Because the lower-level component reference bindings can all be different,
- // we don't copy any of them up to this component reference, which will therefore
- // always have its own binding, even if it's only the default SCA binding.
- if (bindingsSpecifiedManually(componentReference.getBindings()) ||
- (componentReference.getCallback() != null &&
- bindingsSpecifiedManually(componentReference.getCallback().getBindings()))) {
- componentReference.setPromotionOverride(true);
- }
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * If the bindings are specified in the composite file return true as they should
- * otherwise return false
- *
- * @param bindings
- * @return true if the bindings were specified manually
- */
- private boolean bindingsSpecifiedManually(List<Binding> bindings) {
-
- if (bindings.size() > 1) {
- return true;
- } else if (bindings.size() == 1 &&
- bindings.get(0) instanceof AutomaticBinding &&
- ((AutomaticBinding)bindings.get(0)).getIsAutomatic()) {
- return false;
- } else if (bindings.size() == 1) {
- return true;
- } else {
- return false;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceWireBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceWireBuilderImpl.java
deleted file mode 100644
index 3786cdfa38..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceWireBuilderImpl.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.EndpointFactory;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that wires composite references.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeReferenceWireBuilderImpl implements CompositeBuilder {
- private AssemblyFactory assemblyFactory;
- private EndpointFactory endpointFactory;
-
- public CompositeReferenceWireBuilderImpl(AssemblyFactory assemblyFactory, EndpointFactory endpointFactory) {
- this.assemblyFactory = assemblyFactory;
- this.endpointFactory = endpointFactory;
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.ComponentReferenceWireBuilder";
- }
-
- /**
- * Wire composite references in a deployment composite.
- *
- * @param composite
- */
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
-
- // Process composite references declared in this composite
- for (Reference reference : composite.getReferences()) {
- CompositeReference compositeReference = (CompositeReference)reference;
-
- // If the composite reference is a promotion override, override the
- // configuration of the promoted reference.
- //FIXME: Policy configuration or wiring of domain-level composite references
- // doesn't cause a promotion override, unless the composite reference has
- // additional bindings. Do we need to detect this and force an override?
- if (compositeReference.isPromotionOverride()) {
- List<ComponentReference> promotedReferences =
- ReferenceConfigurationUtil.getPromotedComponentReferences(compositeReference);
- for (ComponentReference promotedReference : promotedReferences) {
- ReferenceConfigurationUtil.reconcileReferenceBindings(
- compositeReference, promotedReference, assemblyFactory, endpointFactory, monitor);
- if (compositeReference.getInterfaceContract() != null && // can be null in unit tests
- compositeReference.getInterfaceContract().getCallbackInterface() != null) {
- SCABinding scaCallbackBinding = promotedReference.getCallbackBinding(SCABinding.class);
- if (promotedReference.getCallback() != null) {
- promotedReference.getCallback().getBindings().clear();
- } else {
- promotedReference.setCallback(assemblyFactory.createCallback());
- }
- if (scaCallbackBinding != null) {
- promotedReference.getCallback().getBindings().add(scaCallbackBinding);
- }
- if (compositeReference.getCallback() != null) {
- promotedReference.getCallback().getBindings().addAll(compositeReference.getCallback()
- .getBindings());
- }
- }
- }
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java
deleted file mode 100644
index 6a8da7241a..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.BindingBuilderExtension;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that performs any additional building steps that
- * composite service bindings may need. Used for WSDL generation.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeServiceBindingBuilderImpl implements CompositeBuilder {
-
- public CompositeServiceBindingBuilderImpl() {
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositeServiceBindingBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
- buildServiceBindings(composite, monitor);
- }
-
- private void buildServiceBindings(Composite composite, Monitor monitor) {
-
- // build bindings recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- buildServiceBindings((Composite)implementation, monitor);
- }
- }
-
- // find all the composite service bindings
- for (Service service : composite.getServices()) {
- for (Binding binding : service.getBindings()) {
- if (binding instanceof BindingBuilderExtension) {
- Component component = ServiceConfigurationUtil.getPromotedComponent((CompositeService)service);
- ((BindingBuilderExtension)binding).getBuilder().build(component, service, binding, monitor);
- }
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceConfigurationBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceConfigurationBuilderImpl.java
deleted file mode 100644
index 2fc5e571b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceConfigurationBuilderImpl.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import java.util.List;
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-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.CompositeService;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.builder.AutomaticBinding;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that handles the configuration of composite services.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeServiceConfigurationBuilderImpl implements CompositeBuilder {
- private AssemblyFactory assemblyFactory;
-
- public CompositeServiceConfigurationBuilderImpl(AssemblyFactory assemblyFactory) {
- this.assemblyFactory = assemblyFactory;
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositeServiceConfigurationBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
-
- // Process nested composites recursively
- configureNestedCompositeServices(composite);
-
- // Process top level composite services
- for (Service service : composite.getServices()) {
- CompositeService compositeService = (CompositeService)service;
-
- // Get the next lower level promoted service
- ComponentService promotedService = compositeService.getPromotedService();
- if (promotedService != null) {
-
- // Set the bindings using the top level bindings to override the lower level bindings
- if (!bindingsSpecifiedManually(compositeService.getBindings()) &&
- bindingsSpecifiedManually(promotedService.getBindings())) {
- compositeService.getBindings().clear();
- for (Binding binding : promotedService.getBindings()) {
- try {
- compositeService.getBindings().add((Binding)binding.clone());
- } catch (CloneNotSupportedException ex) {
- // this binding can't be used in the promoted service
- }
- }
- }
- if (compositeService.getInterfaceContract() != null &&
- compositeService.getInterfaceContract().getCallbackInterface() != null) {
- if (!(compositeService.getCallback() != null &&
- bindingsSpecifiedManually(compositeService.getCallback().getBindings())) &&
- promotedService.getCallback() != null &&
- bindingsSpecifiedManually(promotedService.getCallback().getBindings())) {
- if (compositeService.getCallback() != null) {
- compositeService.getCallback().getBindings().clear();
- } else {
- compositeService.setCallback(assemblyFactory.createCallback());
- }
- for (Binding binding : promotedService.getCallback().getBindings()) {
- try {
- compositeService.getCallback().getBindings().add((Binding)binding.clone());
- } catch (CloneNotSupportedException ex) {
- // this binding can't be used in the promoted service
- }
- }
- }
- }
- }
- }
- }
-
- private void configureNestedCompositeServices(Composite composite) {
-
- // Process nested composites recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
-
- // First process nested composites
- configureNestedCompositeServices((Composite)implementation);
-
- // Process the component services declared on components in this composite
- for (ComponentService componentService : component.getServices()) {
- Service implService = componentService.getService();
- if (implService != null && implService instanceof CompositeService) {
- CompositeService compositeService = (CompositeService)implService;
-
- // Get the next lower level promoted service
- ComponentService promotedService = compositeService.getPromotedService();
- if (promotedService != null) {
-
- // Set the bindings using the top level bindings to override the lower level bindings
- if (!bindingsSpecifiedManually(compositeService.getBindings()) &&
- bindingsSpecifiedManually(promotedService.getBindings()) ) {
- compositeService.getBindings().clear();
- for (Binding binding : promotedService.getBindings()) {
- try {
- compositeService.getBindings().add((Binding)binding.clone());
- } catch (CloneNotSupportedException ex) {
- // this binding can't be used in the promoted service
- }
- }
- }
- if (!bindingsSpecifiedManually(componentService.getBindings()) &&
- bindingsSpecifiedManually(compositeService.getBindings()) ) {
- componentService.getBindings().clear();
- componentService.getBindings().addAll(compositeService.getBindings());
- }
- if (componentService.getInterfaceContract() != null &&
- componentService.getInterfaceContract().getCallbackInterface() != null) {
- if (!(compositeService.getCallback() != null &&
- bindingsSpecifiedManually(compositeService.getCallback().getBindings())) &&
- promotedService.getCallback() != null &&
- bindingsSpecifiedManually(promotedService.getCallback().getBindings())) {
- if (compositeService.getCallback() != null) {
- compositeService.getCallback().getBindings().clear();
- } else {
- compositeService.setCallback(assemblyFactory.createCallback());
- }
- for (Binding binding : promotedService.getCallback().getBindings()) {
- try {
- compositeService.getCallback().getBindings().add((Binding)binding.clone());
- } catch (CloneNotSupportedException ex) {
- // this binding can't be used in the promoted service
- }
- }
- }
- if (!(componentService.getCallback() != null &&
- bindingsSpecifiedManually(componentService.getCallback().getBindings())) &&
- compositeService.getCallback() != null &&
- bindingsSpecifiedManually(compositeService.getCallback().getBindings())) {
- if (componentService.getCallback() != null) {
- componentService.getCallback().getBindings().clear();
- } else {
- componentService.setCallback(assemblyFactory.createCallback());
- }
- componentService.getCallback().getBindings().addAll(
- compositeService.getCallback().getBindings());
- }
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * If the bindings are specified in the composite file return true as they should
- * otherwise return false
- *
- * @param bindings
- * @return true if the bindings were specified manually
- */
- private boolean bindingsSpecifiedManually(List<Binding> bindings) {
-
- if (bindings.size() > 1) {
- return true;
- } else if (bindings.size() == 1 &&
- bindings.get(0) instanceof AutomaticBinding &&
- ((AutomaticBinding)bindings.get(0)).getIsAutomatic()) {
- return false;
- } else if (bindings.size() == 1) {
- return true;
- } else {
- return false;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServicePromotionBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServicePromotionBuilderImpl.java
deleted file mode 100644
index 3004a9f590..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServicePromotionBuilderImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-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.CompositeService;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that handles the creation of promoted composite services.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeServicePromotionBuilderImpl implements CompositeBuilder {
- private AssemblyFactory assemblyFactory;
-
- public CompositeServicePromotionBuilderImpl(AssemblyFactory assemblyFactory) {
- this.assemblyFactory = assemblyFactory;
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.assembly.builder.CompositeServicePromotionBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
-
- // Process top level composite services
- for (Service service : composite.getServices()) {
- CompositeService compositeService = (CompositeService)service;
-
- // Get the innermost promoted service
- ComponentService promotedService = ServiceConfigurationUtil.getPromotedComponentService(compositeService);
- if (promotedService != null) {
- Component promotedComponent = ServiceConfigurationUtil.getPromotedComponent(compositeService);
-
- // Create a new component service to represent this composite
- // service on the promoted component
- ComponentService newComponentService = assemblyFactory.createComponentService();
- newComponentService.setName("$promoted$" + compositeService.getName());
- promotedComponent.getServices().add(newComponentService);
- newComponentService.setService(promotedService.getService());
- newComponentService.getBindings().addAll(compositeService.getBindings());
- newComponentService.setInterfaceContract(compositeService.getInterfaceContract());
- if (compositeService.getInterfaceContract() != null &&
- compositeService.getInterfaceContract().getCallbackInterface() != null) {
- newComponentService.setCallback(assemblyFactory.createCallback());
- newComponentService.getCallback().getBindings()
- .addAll(compositeService.getCallback().getBindings());
- }
-
- // Change the composite service to now promote the newly
- // created component service directly
- compositeService.setPromotedComponent(promotedComponent);
- compositeService.setPromotedService(newComponentService);
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
deleted file mode 100644
index 125112a560..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.List;
-
-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.CompositeService;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.builder.EndpointBuilder;
-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.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * A factory for the Endpoint model.
- *
- * @version $Rev$ $Date$
- */
-public abstract class EndpointBuilderImpl implements EndpointBuilder {
-
- public EndpointBuilderImpl (){
- }
-
- private void warning(Monitor monitor, String message, Object model, String... messageParameters) {
- if (monitor != null){
- Problem problem = monitor.createProblem(this.getClass().getName(), "assembly-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- private void error(Monitor monitor, String message, Object model, Exception ex) {
- if (monitor != null){
- Problem problem = null;
- problem = monitor.createProblem(this.getClass().getName(), "assembly-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- /**
- * Resolve an endpoint against the provided target information and the
- * set of candidate bindings.
- */
- public void build(Endpoint endpoint, Monitor monitor) {
-
- // If this endpoint is not fully configured then don't try and resolve it
- if (endpoint.getTargetComponentService() == null){
- return;
- }
-
- // Does the reference expect callbacks
- boolean bidirectional = false;
-
- if (endpoint.getSourceComponentReference().getInterfaceContract() != null &&
- endpoint.getSourceComponentReference().getInterfaceContract().getCallbackInterface() != null) {
- bidirectional = true;
- }
-
- // if the target service is a promoted service then find the
- // service it promotes
- if (endpoint.getTargetComponentService().getService() instanceof CompositeService) {
- CompositeService compositeService = (CompositeService) endpoint.getTargetComponentService().getService();
- // Find the promoted component service
- ComponentService promotedComponentService = ServiceConfigurationUtil.getPromotedComponentService(compositeService);
- if (promotedComponentService != null && !promotedComponentService.isUnresolved()) {
- endpoint.setTargetComponentService(promotedComponentService);
- }
- }
-
- try {
- PolicyConfigurationUtil.determineApplicableBindingPolicySets(endpoint.getSourceComponentReference(),
- endpoint.getTargetComponentService());
- } catch ( Exception e ) {
- error(monitor, "PolicyRelatedException", endpoint, e);
- }
-
-
- // Match the binding against the bindings of the target service
- Binding resolvedBinding = matchBinding(endpoint.getTargetComponent(),
- endpoint.getTargetComponentService(),
- endpoint.getCandidateBindings(),
- endpoint.getTargetComponentService().getBindings());
- if (resolvedBinding == null) {
- warning(monitor, "NoMatchingBinding",
- endpoint.getSourceComponentReference(),
- endpoint.getSourceComponentReference().getName(),
- endpoint.getTargetComponentService().getName());
- } else {
- endpoint.setSourceBinding(resolvedBinding);
- }
-
- if (bidirectional) {
- Binding resolvedCallbackBinding = matchBinding(endpoint.getTargetComponent(),
- endpoint.getTargetComponentService(),
- endpoint.getSourceComponentReference().getCallback().getBindings(),
- endpoint.getTargetComponentService().getCallback().getBindings());
- if (resolvedBinding == null) {
- warning(monitor, "NoMatchingCallbackBinding",
- endpoint.getSourceComponentReference(),
- endpoint.getSourceComponentReference().getName(),
- endpoint.getTargetComponentService().getName());
- } else {
- endpoint.setSourceCallbackBinding(resolvedCallbackBinding);
- }
- }
- }
-
- private boolean hasCompatiblePolicySets(Binding refBinding, Binding svcBinding) {
- boolean isCompatible = true;
- if ( refBinding instanceof PolicySetAttachPoint && svcBinding instanceof PolicySetAttachPoint ) {
- //TODO : need to add more compatibility checks at the policy attachment levels
- for ( PolicySet svcPolicySet : ((PolicySetAttachPoint)svcBinding).getPolicySets() ) {
- isCompatible = false;
- for ( PolicySet refPolicySet : ((PolicySetAttachPoint)refBinding).getPolicySets() ) {
- if ( svcPolicySet.equals(refPolicySet) ) {
- isCompatible = true;
- break;
- }
- }
- //if there exists no matching policy set in the reference binding
- if ( !isCompatible ) {
- return isCompatible;
- }
- }
- }
- return isCompatible;
- }
-
-
- private Binding matchBinding(Component targetComponent, ComponentService targetComponentService, List<Binding> source, List<Binding> target) {
- List<Binding> matched = new ArrayList<Binding>();
- // Find the corresponding bindings from the service side
- for (Binding binding : source) {
- for (Binding serviceBinding : target) {
- if (binding.getClass() == serviceBinding.getClass() &&
- hasCompatiblePolicySets(binding, serviceBinding)) {
-
- try {
- Binding cloned = (Binding)binding.clone();
-
- //Customise the binding name to make it unique
- // regardless of how many bindings or targets there are
- if ( targetComponent != null){
- cloned.setName(binding.getName() + "#" + targetComponent.getName() + "/" + serviceBinding.getName());
- } else {
- cloned.setName(binding.getName() + "#" + serviceBinding.getName());
- }
-
- // Set the binding URI to the URI of the target service
- // that has been matched
- if (binding.getURI() == null) {
- cloned.setURI(serviceBinding.getURI());
- }
-
- if (binding instanceof OptimizableBinding) {
- OptimizableBinding endpoint = ((OptimizableBinding)cloned);
- endpoint.setTargetComponent(targetComponent);
- endpoint.setTargetComponentService(targetComponentService);
- endpoint.setTargetBinding(serviceBinding);
- }
-
- matched.add(cloned);
- break;
- } catch (Exception ex) {
- // do nothing
- }
- }
- }
- }
- if (matched.isEmpty()) {
- // No matching binding
- return null;
- } else {
- for (Binding binding : matched) {
- // If binding.sca is present, use it
- if (SCABinding.class.isInstance(binding)) {
- return binding;
- }
- }
- // Use the first one
- return matched.get(0);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationException.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationException.java
deleted file mode 100644
index 944cf2cf36..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationException.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.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/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java
deleted file mode 100644
index c0bc18dfaf..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java
+++ /dev/null
@@ -1,752 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-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.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
-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(IntentAttachPointType 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 (QName constrained : intent.getConstrains()) {
- 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(IntentAttachPoint 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(IntentAttachPointType 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);
- }
- }
- }
-
-
- static void computeIntentsForOperations(IntentAttachPoint intentAttachPoint) throws PolicyValidationException {
- if ( intentAttachPoint instanceof OperationsConfigurator ) {
- computeIntentsForOperations((OperationsConfigurator)intentAttachPoint,
- intentAttachPoint,
- intentAttachPoint.getRequiredIntents());
- }
- }
-
- private static void computeIntentsForOperations(OperationsConfigurator opConfigurator,
- IntentAttachPoint intentAttachPoint,
- List<Intent> parentIntents) throws PolicyValidationException {
- IntentAttachPointType attachPointType = intentAttachPoint.getType();
-
- boolean found = false;
- for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
- //expand profile intents specified on operations
- PolicyComputationUtils.expandProfileIntents(confOp.getRequiredIntents());
-
- //validateIntents(confOp, attachPointType);
-
- //add intents specified for parent intent attach point (binding / implementation)
- //wherever its not overridden in the operation
- Intent tempIntent = null;
- List<Intent> attachPointOpIntents = new ArrayList<Intent>();
- for (Intent anIntent : parentIntents) {
- found = false;
-
- tempIntent = anIntent;
- while ( tempIntent instanceof QualifiedIntent ) {
- tempIntent = ((QualifiedIntent)tempIntent).getQualifiableIntent();
- }
-
- for ( Intent opIntent : confOp.getRequiredIntents() ) {
- if ( opIntent.getName().getLocalPart().startsWith(tempIntent.getName().getLocalPart())) {
- found = true;
- break;
- }
- }
-
- if ( !found ) {
- boolean conflict = false;
- for (Intent excluded : anIntent.getExcludedIntents()) {
- if (confOp.getRequiredIntents().contains(excluded)) {
- conflict = true;
- break;
- }
- }
- if (!conflict) {
- attachPointOpIntents.add(anIntent);
- }
- }
- }
-
- confOp.getRequiredIntents().addAll(attachPointOpIntents);
-
- //remove duplicates and ...
- //where qualified form of intent exists retain it and remove the qualifiable intent
- filterDuplicatesAndQualifiableIntents(confOp);
-
- //exclude intents that are inherently supported by the parent
- //attachpoint-type (binding-type / implementation-type)
- if ( attachPointType != null ) {
- List<Intent> requiredIntents = new ArrayList<Intent>(confOp.getRequiredIntents());
- for ( Intent intent : requiredIntents ) {
- if ( isProvidedInherently(attachPointType, intent) ) {
- confOp.getRequiredIntents().remove(intent);
- }
- }
- }
- }
- }
-
- private static List<PolicySet> computeInheritablePolicySets(List<PolicySet> inheritablePolicySets,
- List<PolicySet> applicablePolicySets)
- throws PolicyValidationException {
- List<PolicySet> validInheritablePolicySets = new ArrayList<PolicySet>();
- for (PolicySet policySet : inheritablePolicySets) {
- if ( !policySet.isUnresolved() ) {
- if ( applicablePolicySets.contains(policySet) ) {
- validInheritablePolicySets.add(policySet);
- }
- } else {
- throw new PolicyValidationException("Policy Set '" + policySet.getName()
- + "' is not defined in this domain ");
- }
- }
-
- return validInheritablePolicySets;
- }
-
- private static void normalizePolicySets(PolicySetAttachPoint policySetAttachPoint ) {
- //get rid of duplicate entries
- HashMap<QName, PolicySet> policySetTable = new HashMap<QName, PolicySet>();
- for ( PolicySet policySet : policySetAttachPoint.getPolicySets() ) {
- policySetTable.put(policySet.getName(), policySet);
- }
-
- policySetAttachPoint.getPolicySets().clear();
- policySetAttachPoint.getPolicySets().addAll(policySetTable.values());
-
- //expand profile intents
- for ( PolicySet policySet : policySetAttachPoint.getPolicySets() ) {
- PolicyComputationUtils.expandProfileIntents(policySet.getProvidedIntents());
- }
- }
-
- private static void computePolicySetsForOperations(List<PolicySet> applicablePolicySets,
- PolicySetAttachPoint policySetAttachPoint)
- throws PolicyValidationException {
- if ( policySetAttachPoint instanceof OperationsConfigurator ) {
- computePolicySetsForOperations(applicablePolicySets,
- (OperationsConfigurator)policySetAttachPoint,
- policySetAttachPoint);
- }
-
- }
-
- private static void computePolicySetsForOperations(List<PolicySet> applicablePolicySets,
- OperationsConfigurator opConfigurator,
- PolicySetAttachPoint policySetAttachPoint)
- throws PolicyValidationException {
- //String appliesTo = null;
- //String scdlFragment = "";
- HashMap<QName, PolicySet> policySetTable = new HashMap<QName, PolicySet>();
- IntentAttachPointType attachPointType = policySetAttachPoint.getType();
-
- for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
- //validate policysets specified for the attachPoint
- for (PolicySet policySet : confOp.getPolicySets()) {
- if ( !policySet.isUnresolved() ) {
- //appliesTo = policySet.getAppliesTo();
-
- //if (!PolicyValidationUtils.isPolicySetApplicable(scdlFragment, appliesTo, attachPointType)) {
- if (!applicablePolicySets.contains(policySet)) {
- throw new PolicyValidationException("Policy Set '" + policySet.getName()
- + " specified for operation " + confOp.getName()
- + "' does not constrain extension type "
- + attachPointType.getName());
-
- }
- } else {
- throw new PolicyValidationException("Policy Set '" + policySet.getName()
- + " specified for operation " + confOp.getName()
- + "' is not defined in this domain ");
- }
- }
-
- //get rid of duplicate entries
- for ( PolicySet policySet : confOp.getPolicySets() ) {
- policySetTable.put(policySet.getName(), policySet);
- }
-
- confOp.getPolicySets().clear();
- confOp.getPolicySets().addAll(policySetTable.values());
- policySetTable.clear();
-
- //expand profile intents
- for ( PolicySet policySet : confOp.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,
- PolicySetAttachPoint policySetAttachPoint,
- IntentAttachPointType 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(IntentAttachPointType attachPointType, Intent intent) {
- return ( attachPointType != null &&
- (( attachPointType.getAlwaysProvidedIntents() != null &&
- attachPointType.getAlwaysProvidedIntents().contains(intent) ) ||
- ( attachPointType.getMayProvideIntents() != null &&
- attachPointType.getMayProvideIntents().contains(intent) )
- ) );
- }
-
- private static void trimProvidedIntents(List<Intent> requiredIntents, PolicySet policySet) {
- for ( Intent providedIntent : policySet.getProvidedIntents() ) {
- if ( requiredIntents.contains(providedIntent) ) {
- requiredIntents.remove(providedIntent);
- }
- }
-
- for ( Intent mappedIntent : policySet.getMappedPolicies().keySet() ) {
- if ( requiredIntents.contains(mappedIntent) ) {
- requiredIntents.remove(mappedIntent);
- }
- }
- }
-
- private static void filterDuplicatesAndQualifiableIntents(IntentAttachPoint 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 instanceof QualifiedIntent ) {
- QualifiedIntent qualifiedIntent = (QualifiedIntent)intent;
- if ( intentsTable.get(qualifiedIntent.getQualifiableIntent().getName()) != null ) {
- intentsTable.remove(qualifiedIntent.getQualifiableIntent().getName());
- }
- }
- }
- intentAttachPoint.getRequiredIntents().clear();
- intentAttachPoint.getRequiredIntents().addAll(intentsTable.values());
- }
-
- private static void validateIntents(ConfiguredOperation confOp, IntentAttachPointType attachPointType) throws PolicyValidationException {
- boolean found = false;
- if ( attachPointType != null ) {
- //validate intents specified against the parent (binding / implementation)
- found = false;
- for (Intent intent : confOp.getRequiredIntents()) {
- if ( !intent.isUnresolved() ) {
- for (QName constrained : intent.getConstrains()) {
- if (PolicyValidationUtils.isConstrained(constrained, attachPointType)) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- throw new PolicyValidationException("Policy Intent '" + intent.getName()
- + " specified for operation " + confOp.getName()
- + "' does not constrain extension type "
- + attachPointType.getName());
- }
- } else {
- throw new PolicyValidationException("Policy Intent '" + intent.getName()
- + " specified for operation " + confOp.getName()
- + "' is not defined in this domain ");
- }
- }
- }
- }
-
- static void computeBindingIntentsAndPolicySets(Contract contract) throws PolicyValidationException {
- for (Binding binding : contract.getBindings()) {
- if (binding instanceof PolicySetAttachPoint) {
- PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
- computeIntents((IntentAttachPoint)binding, contract.getRequiredIntents());
-
- aggregateAndPruneApplicablePolicySets(contract.getApplicablePolicySets(),
- policiedBinding.getApplicablePolicySets());
-
- computePolicySets(policiedBinding, contract.getPolicySets());
-
- PolicyComputationUtils.checkForMutuallyExclusiveIntents(
- policiedBinding.getRequiredIntents(),
- policiedBinding.getPolicySets(),
- policiedBinding.getType(),
- contract.getName());
-
- if ( binding instanceof OperationsConfigurator &&
- contract instanceof OperationsConfigurator ) {
- //add or merge service operations to the binding
- addInheritedOpConfOnBindings((OperationsConfigurator)contract,
- (OperationsConfigurator)binding,
- (PolicySetAttachPoint)binding);
-
- computeIntentsForOperations((IntentAttachPoint)binding);
- computePolicySetsForOperations(contract.getApplicablePolicySets(),
- policiedBinding);
-
- for ( ConfiguredOperation confOp : ((OperationsConfigurator)binding).getConfiguredOperations() ) {
- PolicyComputationUtils.checkForMutuallyExclusiveIntents(
- confOp.getRequiredIntents(),
- confOp.getPolicySets(),
- policiedBinding.getType(),
- contract.getName() + "." + confOp.getName());
- }
-
- }
- }
- }
-
- if ( contract.getCallback() != null ) {
- for (Binding binding : contract.getCallback().getBindings()) {
- if (binding instanceof PolicySetAttachPoint) {
- PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
- computeIntents((IntentAttachPoint)binding, contract.getCallback().getRequiredIntents());
-
- aggregateAndPruneApplicablePolicySets(contract.getApplicablePolicySets(),
- policiedBinding.getApplicablePolicySets());
-
- computePolicySets(policiedBinding, contract.getCallback().getPolicySets());
-
- PolicyComputationUtils.checkForMutuallyExclusiveIntents(
- policiedBinding.getRequiredIntents(),
- policiedBinding.getPolicySets(),
- policiedBinding.getType(),
- contract.getName() + " callback");
-
- }
- }
- }
- }
-
- private static void computeIntents(IntentAttachPoint 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.getType(),
- inheritedIntents);
- policiedBinding.getRequiredIntents().addAll(prunedIntents);
-
- normalizeIntents(policiedBinding);
- }
-
- private static void computePolicySets(PolicySetAttachPoint policiedBinding,
- List<PolicySet> inheritedPolicySets) throws PolicyValidationException {
-
- List<PolicySet> prunedPolicySets = computeInheritablePolicySets(inheritedPolicySets,
- policiedBinding.getApplicablePolicySets());
- 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 PolicySetAttachPoint) {
- PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)aBinding;
- IntentAttachPointType bindingType = policiedBinding.getType();
-
-
- 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 (QName constrained : intent.getConstrains()) {
- if (bindingType != null && bindingType.getName().getNamespaceURI()
- .equals(constrained.getNamespaceURI())
- && bindingType.getName().getLocalPart().startsWith(constrained
- .getLocalPart())) {
- policiedBinding.getRequiredIntents().add(intent);
- break;
- }
- }
- }
- }
- }
-
- //trim intents specified in operations. First check for policysets specified on the operation
- //and then in the parent implementation
- if ( aBinding instanceof OperationsConfigurator ) {
- OperationsConfigurator opConfigurator = (OperationsConfigurator)aBinding;
-
- for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
- List<Intent> opsIntentsCopy = new ArrayList<Intent>(confOp.getRequiredIntents());
-
- trimInherentlyProvidedIntents(policiedBinding.getType(),
- confOp.getRequiredIntents());
- trimProvidedIntents(confOp.getRequiredIntents(), confOp.getPolicySets());
- trimProvidedIntents(confOp.getRequiredIntents(), policiedBinding.getPolicySets());
-
- determineApplicableDomainPolicySets(policiedBinding.getApplicablePolicySets(),
- confOp,
- policiedBinding.getType());
-
- if (confOp.getRequiredIntents().size() > 0) {
- throw new PolicyConfigurationException("The following are unfulfilled intents for operations configured in "
- + "binding - " + aBinding.getName() + "\nUnfulfilled Intents = " +
- confOp.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
- confOp.getRequiredIntents().clear();
- confOp.getRequiredIntents().addAll(opsIntentsCopy);
-
- }
- }
-
- trimInherentlyProvidedIntents(policiedBinding.getType(),
- 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,
- PolicySetAttachPoint policiedBinding)
- throws PolicyConfigurationException {
- //if ( domainPolicySets != null) {
- determineApplicableDomainPolicySets(policiedBinding.getApplicablePolicySets(),
- policiedBinding,
- policiedBinding.getType());
-
- 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 addInheritedOpConfOnBindings(OperationsConfigurator source,
- OperationsConfigurator target,
- PolicySetAttachPoint attachPoint) throws PolicyValidationException {
- boolean found = false;
-
- List<ConfiguredOperation> additionalOperations = new ArrayList<ConfiguredOperation>();
- for ( ConfiguredOperation sourceConfOp : source.getConfiguredOperations() ) {
- for ( ConfiguredOperation targetConfOp : target.getConfiguredOperations() ) {
- if ( sourceConfOp.getName().equals(targetConfOp.getName())) {
- List<Intent> prunedIntents = computeInheritableIntents(attachPoint.getType(),
- sourceConfOp.getRequiredIntents());
- PolicyComputationUtils.addInheritedIntents(prunedIntents,
- targetConfOp.getRequiredIntents());
-
- List<PolicySet> prunedPolicySets = computeInheritablePolicySets(sourceConfOp.getPolicySets(),
- attachPoint.getApplicablePolicySets());
- PolicyComputationUtils.addInheritedPolicySets(prunedPolicySets, targetConfOp.getPolicySets(), true);
- found = true;
- break;
- }
- }
-
- if ( !found ) {
- additionalOperations.add(sourceConfOp);
- }
- }
-
- if ( !additionalOperations.isEmpty() ) {
- target.getConfiguredOperations().addAll(additionalOperations);
- }
- }
-
- 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 PolicySetAttachPoint ) {
- PolicyComputationUtils.addDefaultPolicies(
- ((PolicySetAttachPoint)parent).getRequiredIntents(),
- ((PolicySetAttachPoint)parent).getPolicySets(),
- contract.getRequiredIntents(),
- contract.getPolicySets());
- }
-
- // The contract's configured operations inherit default policies from the contract.
- for ( ConfiguredOperation confOp : contract.getConfiguredOperations() ) {
- PolicyComputationUtils.addDefaultPolicies(
- contract.getRequiredIntents(),
- contract.getPolicySets(),
- confOp.getRequiredIntents(),
- confOp.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 PolicySetAttachPoint ) {
- PolicySetAttachPoint policiedImplementation = (PolicySetAttachPoint)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.getType(),
- parent.getRequiredIntents());
- parent.getRequiredIntents().clear();
- parent.getRequiredIntents().addAll(prunedIntents);
- normalizeIntents(parent);
-
- computeIntentsForOperations((OperationsConfigurator)parent,
- (IntentAttachPoint)implementation,
- parent.getRequiredIntents());
-
-
- List<PolicySet> prunedPolicySets = computeInheritablePolicySets(parent.getPolicySets(),
- parent.getApplicablePolicySets());
- parent.getPolicySets().clear();
- parent.getPolicySets().addAll(prunedPolicySets);
- normalizePolicySets(parent);
-
- PolicyComputationUtils.checkForMutuallyExclusiveIntents(
- parent.getRequiredIntents(),
- parent.getPolicySets(),
- policiedImplementation.getType(),
- parent.getName());
-
- computePolicySetsForOperations(parent.getApplicablePolicySets(),
- (OperationsConfigurator)parent,
- (PolicySetAttachPoint)implementation);
-
- for ( ConfiguredOperation confOp : ((OperationsConfigurator)parent).getConfiguredOperations() ) {
- PolicyComputationUtils.checkForMutuallyExclusiveIntents(
- confOp.getRequiredIntents(),
- confOp.getPolicySets(),
- policiedImplementation.getType(),
- parent.getName() + "." + confOp.getName());
- }
-
- determineApplicableImplementationPolicySets(parent);
-
- }
- }
-
- private static void determineApplicableImplementationPolicySets(Component component) throws PolicyConfigurationException {
- List<Intent> intentsCopy = null;
- if ( component.getImplementation() instanceof PolicySetAttachPoint ) {
- PolicySetAttachPoint policiedImplementation = (PolicySetAttachPoint)component.getImplementation();
-
- //trim intents specified in operations. First check for policysets specified on the operation
- //and then in the parent implementation
- if ( component instanceof OperationsConfigurator ) {
- OperationsConfigurator opConfigurator = (OperationsConfigurator)component;
-
- for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
- intentsCopy = new ArrayList<Intent>(confOp.getRequiredIntents());
- trimInherentlyProvidedIntents(policiedImplementation.getType(),
- confOp.getRequiredIntents());
- trimProvidedIntents(confOp.getRequiredIntents(), confOp.getPolicySets());
- trimProvidedIntents(confOp.getRequiredIntents(), component.getPolicySets());
-
- determineApplicableDomainPolicySets(component.getApplicablePolicySets(),
- confOp,
- policiedImplementation.getType());
-
- if (confOp.getRequiredIntents().size() > 0) {
- throw new PolicyConfigurationException("The following are unfulfilled intents for operations configured in "
- + "component implementation - " + component.getName() + "\nUnfulfilled Intents = " +
- confOp.getRequiredIntents());
- }
-
- //the intents list could have been trimmed when matching for policysets
- //since the implementation may need the original set of intents we copy that back
- confOp.getRequiredIntents().clear();
- confOp.getRequiredIntents().addAll(intentsCopy);
- }
- }
-
- intentsCopy = new ArrayList<Intent>(component.getRequiredIntents());
- trimInherentlyProvidedIntents(policiedImplementation.getType(),
- 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) {
- determineApplicableDomainPolicySets(component.getApplicablePolicySets(),
- component,
- policiedImplementation.getType());
-
- 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/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PrintUtil.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PrintUtil.java
deleted file mode 100644
index 3762cc6e77..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PrintUtil.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.beans.BeanInfo;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.w3c.dom.Node;
-
-/**
- * A simple print utility class to help print model instances.
- *
- * @version $Rev$ $Date$
- */
-class PrintUtil {
- private boolean useGetters = false;
- private PrintWriter out;
- private int indent;
-
- public PrintUtil(PrintWriter out, boolean useGetters) {
- this.out = out;
- this.useGetters = useGetters;
- }
-
- public PrintUtil(OutputStream out) {
- this.out = new PrintWriter(new OutputStreamWriter(out), true);
- }
-
- void indent() {
- for (int i = 0; i < indent; i++) {
- out.print(" ");
- }
- }
-
- /**
- * Print an object.
- *
- * @param object
- */
- public void print(Object object) {
- Set<Integer> objects = new HashSet<Integer>();
- print(object, objects);
- }
-
- /**
- * Print an object.
- *
- * @param object
- */
- private void print(Object object, Set<Integer> printed) {
- if (object == null) {
- return;
- }
- int id = System.identityHashCode(object);
- if (printed.contains(id)) {
-
- // If we've already printed an object, print just it's HashCode
- indent();
- out.println(object.getClass().getName() + "@" + id);
- } else {
- printed.add(id);
- try {
-
- // Print the object class name
- indent();
- out.println(object.getClass().getSimpleName() + " {");
-
- // Get the object's properties
- ValueAccessor accessor = useGetters ? new PropertyAccessor(object) : new FieldAccessor(object);
- for (int i = 0; i < accessor.size(); i++) {
- try {
-
- // Get the value of each property
- Object value = accessor.getValue(i);
- if (value != null) {
-
- // Convert array value into a list
- if (value.getClass().isArray()) {
- value = Arrays.asList((Object[])value);
- }
-
- // Print elements in a list
- if (value instanceof List) {
- if (!((List<?>)value).isEmpty()) {
- indent++;
- indent();
- out.println(accessor.getName(i) + "= [");
-
- // Print each element, recursively
- for (Object element : (List<?>)value) {
- indent++;
- print(element, printed);
- indent--;
- }
- indent();
- out.println(" ]");
- indent--;
- }
- } else {
- Class<?> valueClass = value.getClass();
-
- // Print a primitive, java built in type or
- // enum, using toString()
- if (valueClass.isPrimitive() || valueClass.getName().startsWith("java.")
- || valueClass.getName().startsWith("javax.")
- || valueClass.isEnum()) {
- if (!accessor.getName(i).equals("class")) {
- if (!(Boolean.FALSE.equals(value))) {
- indent++;
- indent();
- out.println(accessor.getName(i) + "=" + value.toString());
- indent--;
- }
- }
- } else if (value instanceof Node) {
- indent++;
- indent();
- out.println(accessor.getName(i) + "=" + value.toString());
- indent--;
- } else {
-
- // Print an object, recursively
- indent++;
- indent();
- out.println(accessor.getName(i) + "= {");
- indent++;
- print(value, printed);
- indent--;
- indent();
- out.println("}");
- indent--;
- }
- }
- }
- } catch (Exception e) {
- }
- }
- indent();
- out.println("}");
- } catch (Exception e) {
- indent();
- out.println(e);
- }
- }
- }
-
- public static interface ValueAccessor {
- int size();
-
- String getName(int i);
-
- Object getValue(int i) throws Exception;
- }
-
- /**
- * Java field reflection based value accessor
- */
- private static class FieldAccessor implements ValueAccessor {
-
- private Object object;
- private List<Field> fields;
-
- public FieldAccessor(Object object) {
- this.fields = getAllFields(object.getClass());
- this.object = object;
- }
-
- public String getName(int i) {
- return fields.get(i).getName();
- }
-
- public Object getValue(int i) throws Exception {
- return fields.get(i).get(object);
- }
-
- public int size() {
- return fields.size();
- }
-
- }
-
- /**
- * JavaBean-based value accessor
- */
- private static class PropertyAccessor implements ValueAccessor {
-
- private Object object;
- private PropertyDescriptor[] fields;
-
- public PropertyAccessor(Object object) throws IntrospectionException {
- BeanInfo beanInfo = Introspector.getBeanInfo(object.getClass());
- this.fields = beanInfo.getPropertyDescriptors();
- this.object = object;
- }
-
- public String getName(int i) {
- return fields[i].getName();
- }
-
- public Object getValue(int i) throws Exception {
- Method getter = fields[i].getReadMethod();
- if (getter != null) {
- return getter.invoke(object);
- }
- return null;
- }
-
- public int size() {
- return fields.length;
- }
-
- }
-
- /**
- * Returns a collection of fields declared by a class
- * or one of its supertypes
- */
- private static List<Field> getAllFields(Class<?> clazz) {
- return getAllFields(clazz, new ArrayList<Field>());
- }
-
- /**
- * Recursively evaluates the type hierarchy to return all fields
- */
- private static List<Field> getAllFields(Class<?> clazz, List<Field> fields) {
- if (clazz == null || clazz.isArray() || Object.class.equals(clazz)) {
- return fields;
- }
- fields = getAllFields(clazz.getSuperclass(), fields);
- Field[] declaredFields = clazz.getDeclaredFields();
- for (final Field field : declaredFields) {
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- field.setAccessible(true); // ignore Java accessibility
- return null;
- }
- });
- fields.add(field);
- }
- return fields;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java
deleted file mode 100644
index 0105d4af50..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-/**
- * Utility class to deal with processing of component properties that are taking values from the parent
- * composite's properties or an external file.
- *
- * @version $Rev$ $Date$
- */
-abstract class PropertyConfigurationUtil {
-
- private static Document evaluate(Document node, XPathExpression expression, DocumentBuilderFactory documentBuilderFactory)
- throws XPathExpressionException, ParserConfigurationException {
-
- Node value = node.getDocumentElement();
- Node result = (Node)expression.evaluate(value, XPathConstants.NODE);
- if (result == null) {
- return null;
- }
-
- // TODO: How to wrap the result into a Document?
- Document document = documentBuilderFactory.newDocumentBuilder().newDocument();
- if (result instanceof Document) {
- return (Document)result;
- } else {
- //Element root = document.createElementNS(null, "value");
- //document.appendChild(root);
- document.appendChild(document.importNode(result, true));
- return document;
- }
- }
-
- private static Document loadFromFile(String file, TransformerFactory transformerFactory) throws MalformedURLException, IOException,
- TransformerException, ParserConfigurationException {
- URI uri = URI.create(file);
- // URI resolution for relative URIs is done when the composite is resolved.
- URL url = uri.toURL();
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- InputStream is = null;
- try {
- is = connection.getInputStream();
-
- Source streamSource = new SAXSource(new InputSource(is));
- DOMResult result = new DOMResult();
- javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
- transformer.transform(streamSource, result);
-
- Document document = (Document)result.getNode();
-
- // TUSCANY-2377, Add a fake value element so it's consistent with
- // the DOM tree loaded from inside SCDL
- Element root = document.createElementNS(null, "value");
- root.appendChild(document.getDocumentElement());
- document.appendChild(root);
- return document;
- } finally {
- if (is != null) {
- is.close();
- }
- }
- }
-
- static void sourceComponentProperties(Map<String, Property> compositeProperties,
- Component componentDefinition,
- DocumentBuilderFactory documentBuilderFactory,
- TransformerFactory transformerFactory) throws CompositeBuilderException,
- ParserConfigurationException,
- XPathExpressionException,
- TransformerException,
- IOException {
-
- List<ComponentProperty> componentProperties = componentDefinition.getProperties();
- for (ComponentProperty aProperty : componentProperties) {
- String source = aProperty.getSource();
- String file = aProperty.getFile();
- if (source != null) {
- // $<name>/...
- int index = source.indexOf('/');
- if (index == -1) {
- // Tolerating $prop
- source = source + "/";
- index = source.length() - 1;
- }
- if (source.charAt(0) == '$') {
- String name = source.substring(1, index);
- Property compositeProp = compositeProperties.get(name);
- if (compositeProp == null) {
- throw new CompositeBuilderException("The 'source' cannot be resolved to a composite property: " + source);
- }
-
- Document compositePropDefValues = (Document)compositeProp.getValue();
-
- // FIXME: How to deal with namespaces?
- Document node = evaluate(compositePropDefValues, aProperty.getSourceXPathExpression(), documentBuilderFactory);
-
- if (node != null) {
- aProperty.setValue(node);
- }
- } else {
- throw new CompositeBuilderException("The 'source' has an invalid value: " + source);
- }
- } else if (file != null) {
- aProperty.setValue(loadFromFile(aProperty.getFile(), transformerFactory));
-
- }
- }
- }
-
- private static class DOMNamespaceContext implements NamespaceContext {
- private Node node;
-
- /**
- * @param node
- */
- public DOMNamespaceContext(Node node) {
- super();
- this.node = node;
- }
-
- public String getNamespaceURI(String prefix) {
- if (prefix == null) {
- throw new IllegalArgumentException("Prefix is null");
- } else if (XMLConstants.XML_NS_PREFIX.equals(prefix)) {
- return XMLConstants.XML_NS_URI;
- } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix)) {
- return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
- }
- String ns = node.lookupNamespaceURI(prefix);
- return ns == null ? XMLConstants.NULL_NS_URI : ns;
- }
-
- public String getPrefix(String namespaceURI) {
- if (namespaceURI == null) {
- throw new IllegalArgumentException("Namespace URI is null");
- } else if (XMLConstants.XML_NS_URI.equals(namespaceURI)) {
- return XMLConstants.XML_NS_PREFIX;
- } else if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) {
- return XMLConstants.XMLNS_ATTRIBUTE;
- }
- return node.lookupPrefix(namespaceURI);
- }
-
- public Iterator<?> getPrefixes(String namespaceURI) {
- // Not implemented
- if (namespaceURI == null) {
- throw new IllegalArgumentException("Namespace URI is null");
- } else if (XMLConstants.XML_NS_URI.equals(namespaceURI)) {
- return Arrays.asList(XMLConstants.XML_NS_PREFIX).iterator();
- } else if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) {
- return Arrays.asList(XMLConstants.XMLNS_ATTRIBUTE).iterator();
- }
- String prefix = getPrefix(namespaceURI);
- if (prefix == null) {
- return Collections.emptyList().iterator();
- }
- return Arrays.asList(prefix).iterator();
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceConfigurationUtil.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceConfigurationUtil.java
deleted file mode 100644
index 0612f9ae0e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceConfigurationUtil.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointFactory;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * This class encapsulates utility methods to deal with reference definitions
- *
- * @version $Rev$ $Date$
- */
-abstract class ReferenceConfigurationUtil {
-
- /**
- * Report a warning.
- *
- * @param problems
- * @param message
- * @param model
- */
- private static void warning(Monitor monitor, String message, Object model, String... messageParameters) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(ReferenceConfigurationUtil.class.getName(), "assembly-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- static boolean isValidMultiplicityOverride(Multiplicity definedMul, Multiplicity overridenMul) {
- if (definedMul != overridenMul) {
- switch (definedMul) {
- case ZERO_N:
- return overridenMul == Multiplicity.ZERO_ONE;
- case ONE_N:
- return overridenMul == Multiplicity.ONE_ONE;
- default:
- return false;
- }
- } else {
- return true;
- }
- }
-
- static boolean validateMultiplicityAndTargets(Multiplicity multiplicity,
- List<?> targets, List<Binding> bindings) {
-
- // Count targets
- int count = targets.size();
-
- //FIXME workaround, this validation is sometimes invoked too early
- // before we get a chance to init the multiplicity attribute
- if (multiplicity == null) {
- return true;
- }
-
- switch (multiplicity) {
- case ZERO_N:
- break;
- case ZERO_ONE:
- if (count > 1) {
- return false;
- }
- break;
- case ONE_ONE:
- if (count != 1) {
- if (count == 0) {
- for (Binding binding: bindings) {
- if (!(binding instanceof OptimizableBinding) || binding.getURI()!=null) {
- return true;
- }
- }
- }
- return false;
- }
- break;
- case ONE_N:
- if (count < 1) {
- if (count == 0) {
- for (Binding binding: bindings) {
- if (!(binding instanceof OptimizableBinding) || binding.getURI()!=null) {
- return true;
- }
- }
- }
- return false;
- }
- break;
- }
- return true;
- }
-
- /**
- * Follow a reference promotion chain down to the innermost (non composite)
- * component references.
- *
- * @param compositeReference
- * @return
- */
- static List<ComponentReference> getPromotedComponentReferences(CompositeReference compositeReference) {
- List<ComponentReference> componentReferences = new ArrayList<ComponentReference>();
- collectPromotedComponentReferences(compositeReference, componentReferences);
- return componentReferences;
- }
-
- /**
- * Follow a reference promotion chain down to the innermost (non composite)
- * component references.
- *
- * @param compositeReference
- * @param componentReferences
- * @return
- */
- private static void collectPromotedComponentReferences(CompositeReference compositeReference,
- List<ComponentReference> componentReferences) {
- for (ComponentReference componentReference : compositeReference.getPromotedReferences()) {
- Reference reference = componentReference.getReference();
- if (reference instanceof CompositeReference) {
-
- // Continue to follow the reference promotion chain
- collectPromotedComponentReferences((CompositeReference)reference, componentReferences);
-
- } else if (reference != null) {
-
- // Found a non-composite reference
- componentReferences.add(componentReference);
- }
- }
- }
-
- /**
- * Override the bindings for a promoted reference from an outer component
- * reference
- *
- * @param reference
- * @param promotedReference
- */
- static void reconcileReferenceBindings(Reference reference,
- ComponentReference promotedReference,
- AssemblyFactory assemblyFactory,
- EndpointFactory endpointFactory,
- Monitor monitor) {
-
- if (promotedReference.getMultiplicity() == Multiplicity.ONE_ONE ||
- promotedReference.getMultiplicity() == Multiplicity.ZERO_ONE) {
-
- // if necessary override the promoted endpoints (and bindings) with the top level bindings
- if (reference.getBindings().size() > 0 ){
-
- List<Binding> bindingsToCopyDown = new ArrayList<Binding>();
- List<Endpoint> endpointsToCopyDown = new ArrayList<Endpoint>();
-
- for (Binding binding : reference.getBindings()) {
- if ((!(binding instanceof OptimizableBinding)) || binding.getURI() != null) {
- bindingsToCopyDown.add(binding);
-
- if (reference instanceof ComponentReference){
- for (Endpoint endpoint : ((ComponentReference)reference).getEndpoints()){
- if ( endpoint.getSourceBinding() == binding){
- endpointsToCopyDown.add(endpoint);
- break;
- }
- }
- } else {
- // create a new endpoint to represent this promoted binding
- Endpoint endpoint = endpointFactory.createEndpoint();
- endpoint.setTargetName(binding.getURI());
- endpoint.setSourceComponent(null); // TODO - fixed up at start
- endpoint.setSourceComponentReference(promotedReference);
- endpoint.setInterfaceContract(reference.getInterfaceContract());
- endpoint.setSourceBinding(binding);
- endpointsToCopyDown.add(endpoint);
- }
- }
- }
-
- if (bindingsToCopyDown.size() > 0) {
- promotedReference.getBindings().clear();
- promotedReference.getBindings().addAll(bindingsToCopyDown);
-
- promotedReference.getEndpoints().clear();
- promotedReference.getEndpoints().addAll(endpointsToCopyDown);
- }
- }
-
- if (promotedReference.getBindings().size() > 1) {
- warning(monitor, "ComponentReferenceMoreWire", promotedReference, promotedReference.getName());
- }
- } else {
- // if necessary merge the promoted endpoints (and bindings) with the top level bindings
- if (reference.getBindings().size() > 0 ){
-
- for (Binding binding : reference.getBindings()) {
- if ((!(binding instanceof OptimizableBinding)) || binding.getURI() != null) {
- promotedReference.getBindings().add(binding);
-
- if (reference instanceof ComponentReference){
- for (Endpoint endpoint : ((ComponentReference)reference).getEndpoints()){
- if ( endpoint.getSourceBinding() == binding){
- promotedReference.getEndpoints().add(endpoint);
- break;
- }
- }
- } else {
- // create a new endpoint to represent this promoted binding
- Endpoint endpoint = endpointFactory.createEndpoint();
- endpoint.setTargetName(binding.getURI());
- endpoint.setSourceComponent(null); // TODO - fixed up at start
- endpoint.setSourceComponentReference(promotedReference);
- endpoint.setInterfaceContract(reference.getInterfaceContract());
- endpoint.setSourceBinding(binding);
- promotedReference.getEndpoints().add(endpoint);
- }
- }
- }
- }
- }
-
- Set<Binding> callbackBindings = new HashSet<Binding>();
- if (promotedReference.getCallback() != null) {
- callbackBindings.addAll(promotedReference.getCallback().getBindings());
- }
- if (reference.getCallback() != null) {
- callbackBindings.addAll(reference.getCallback().getBindings());
- }
- promotedReference.setCallback(assemblyFactory.createCallback());
- for (Binding binding : callbackBindings) {
- if ((!(binding instanceof OptimizableBinding)) || binding.getURI() != null) {
- promotedReference.getCallback().getBindings().add(binding);
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ServiceConfigurationUtil.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ServiceConfigurationUtil.java
deleted file mode 100644
index 41a8b3f8ba..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ServiceConfigurationUtil.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.Service;
-
-/**
- * This class encapsulates utility methods to deal with service definitions.
- *
- * @version $Rev$ $Date$
- */
-abstract class ServiceConfigurationUtil {
-
- /**
- * Follow a service promotion chain down to the inner most (non composite)
- * component service.
- *
- * @param topCompositeService
- * @return
- */
- static ComponentService getPromotedComponentService(CompositeService compositeService) {
- ComponentService componentService = compositeService.getPromotedService();
- if (componentService != null) {
- Service service = componentService.getService();
- if (componentService.getName() != null && service instanceof CompositeService) {
-
- // Continue to follow the service promotion chain
- return getPromotedComponentService((CompositeService)service);
-
- } else {
-
- // Found a non-composite service
- return componentService;
- }
- } else {
-
- // No promoted service
- return null;
- }
- }
-
- /**
- * Follow a service promotion chain down to the innermost (non-composite) component.
- *
- * @param compositeService
- * @return
- */
- static Component getPromotedComponent(CompositeService compositeService) {
- ComponentService componentService = compositeService.getPromotedService();
- if (componentService != null) {
- Service service = componentService.getService();
- if (componentService.getName() != null && service instanceof CompositeService) {
-
- // Continue to follow the service promotion chain
- return getPromotedComponent((CompositeService)service);
-
- } else {
-
- // Found a non-composite service
- return compositeService.getPromotedComponent();
- }
- } else {
-
- // No promoted service
- return null;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java
deleted file mode 100644
index b7c63dc2b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AbstractProperty;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-
-/**
- * Represents an abstract property.
- *
- * @version $Rev$ $Date$
- */
-public class AbstractPropertyImpl extends ExtensibleImpl implements AbstractProperty {
- private Object value;
- private String name;
- private QName xsdType;
- private QName xsdElement;
- private boolean many;
- private boolean mustSupply;
- private List<Intent> requiredIntents = new ArrayList<Intent>();
-
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- /**
- * Constructs a new abstract property.
- */
- protected AbstractPropertyImpl() {
- }
-
- public Object getValue() {
- return value;
- }
-
- public String getName() {
- return name;
- }
-
- public QName getXSDElement() {
- return xsdElement;
- }
-
- public QName getXSDType() {
- return xsdType;
- }
-
- public boolean isMany() {
- return many;
- }
-
- public boolean isMustSupply() {
- return mustSupply;
- }
-
- public void setValue(Object defaultValue) {
- this.value = defaultValue;
- }
-
- public void setMany(boolean many) {
- this.many = many;
- }
-
- public void setMustSupply(boolean mustSupply) {
- this.mustSupply = mustSupply;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setXSDElement(QName element) {
- this.xsdElement = element;
- }
-
- public void setXSDType(QName type) {
- this.xsdType = type;
- }
-
- public IntentAttachPointType getType() {
- return null;
- }
-
- public void setType(IntentAttachPointType type) {
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java
deleted file mode 100644
index d0ee3832c5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import org.apache.tuscany.sca.assembly.AbstractReference;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-
-/**
- * Represents an abstract reference
- *
- * @version $Rev$ $Date$
- */
-public class AbstractReferenceImpl extends ContractImpl implements AbstractReference {
- private Multiplicity multiplicity = Multiplicity.ONE_ONE;
-
- /**
- * Constructs a new abstract reference.
- */
- protected AbstractReferenceImpl() {
- }
-
- public Multiplicity getMultiplicity() {
- return multiplicity;
- }
-
- public void setMultiplicity(Multiplicity multiplicity) {
- this.multiplicity = multiplicity;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java
deleted file mode 100644
index 346764b1b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import org.apache.tuscany.sca.assembly.AbstractService;
-
-/**
- * Represents an abstract service
- *
- * @version $Rev$ $Date$
- */
-public class AbstractServiceImpl extends ContractImpl implements AbstractService {
-
- /**
- * Constructs a new abstract service.
- */
- protected AbstractServiceImpl() {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java
deleted file mode 100644
index 016a9a5b05..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import org.apache.tuscany.sca.assembly.AbstractProperty;
-import org.apache.tuscany.sca.assembly.AbstractReference;
-import org.apache.tuscany.sca.assembly.AbstractService;
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Callback;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.Wire;
-
-/**
- * A factory for the assembly model.
- *
- * @version $Rev$ $Date$
- */
-public abstract class AssemblyFactoryImpl implements AssemblyFactory {
-
- public AbstractProperty createAbstractProperty() {
- return new AbstractPropertyImpl();
- }
-
- public AbstractReference createAbstractReference() {
- return new AbstractReferenceImpl();
- }
-
- public AbstractService createAbstractService() {
- return new AbstractServiceImpl();
- }
-
- public Callback createCallback() {
- return new CallbackImpl();
- }
-
- public Component createComponent() {
- return new ComponentImpl();
- }
-
- public ComponentProperty createComponentProperty() {
- return new ComponentPropertyImpl();
- }
-
- public ComponentReference createComponentReference() {
- return new ComponentReferenceImpl();
- }
-
- public ComponentService createComponentService() {
- return new ComponentServiceImpl();
- }
-
- public ComponentType createComponentType() {
- return new ComponentTypeImpl();
- }
-
- public Composite createComposite() {
- return new CompositeImpl();
- }
-
- public CompositeReference createCompositeReference() {
- return new CompositeReferenceImpl();
- }
-
- public CompositeService createCompositeService() {
- return new CompositeServiceImpl();
- }
-
- public ConstrainingType createConstrainingType() {
- return new ConstrainingTypeImpl();
- }
-
- public Property createProperty() {
- return new PropertyImpl();
- }
-
- public Reference createReference() {
- return new ReferenceImpl();
- }
-
- public Service createService() {
- return new ServiceImpl();
- }
-
- public Wire createWire() {
- return new WireImpl();
- }
-
- public ConfiguredOperation createConfiguredOperation() {
- return new ConfiguredOperationImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java
deleted file mode 100644
index 553e600bc9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import org.apache.tuscany.sca.assembly.Base;
-
-/**
- * Convenience base class for assembly model objects.
- *
- * @version $Rev$ $Date$
- */
-public abstract class BaseImpl implements Base {
- private boolean unresolved;
-
- /**
- * Constructs a new base model object.
- */
- protected BaseImpl() {
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean undefined) {
- this.unresolved = undefined;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java
deleted file mode 100644
index 4082d81fdb..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Callback;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Represents a reference.
- *
- * @version $Rev$ $Date$
- */
-public class CallbackImpl extends ExtensibleImpl implements Callback {
- private List<Binding> bindings = new ArrayList<Binding>();
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private List<ConfiguredOperation> configuredOperations = new ArrayList<ConfiguredOperation>();
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- protected CallbackImpl() {
- }
-
- public List<Binding> getBindings() {
- return bindings;
- }
-
- public IntentAttachPointType getType() {
- return null;
- }
-
- public void setType(IntentAttachPointType type) {
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
- public List<ConfiguredOperation> getConfiguredOperations() {
- return configuredOperations;
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java
deleted file mode 100644
index 34429a6703..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Represents a component.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentImpl extends ExtensibleImpl implements Component, Cloneable, OperationsConfigurator {
- private ConstrainingType constrainingType;
- private Implementation implementation;
- private String name;
- private String uri;
- private List<ComponentProperty> properties = new ArrayList<ComponentProperty>();
- private List<ComponentReference> references = new ArrayList<ComponentReference>();
- private List<ComponentService> services = new ArrayList<ComponentService>();
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private Boolean autowire;
- private IntentAttachPointType type;
- private List<ConfiguredOperation> configuredImplOperations = new ArrayList<ConfiguredOperation>();
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
- /**
- * Constructs a new component.
- */
- protected ComponentImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- ComponentImpl clone = (ComponentImpl)super.clone();
-
- clone.properties = new ArrayList<ComponentProperty>();
- for (ComponentProperty property : getProperties()) {
- clone.properties.add((ComponentProperty)property.clone());
- }
- clone.references = new ArrayList<ComponentReference>();
- for (ComponentReference reference : getReferences()) {
- clone.references.add((ComponentReference)reference.clone());
- }
- clone.services = new ArrayList<ComponentService>();
- for (ComponentService service : getServices()) {
- clone.services.add((ComponentService)service.clone());
- }
- return clone;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public ConstrainingType getConstrainingType() {
- return constrainingType;
- }
-
- public Implementation getImplementation() {
- return implementation;
- }
-
- public String getName() {
- return name;
- }
-
- public List<ComponentProperty> getProperties() {
- return properties;
- }
-
- public List<ComponentReference> getReferences() {
- return references;
- }
-
- public List<ComponentService> getServices() {
- return services;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- this.constrainingType = constrainingType;
- }
-
- public void setImplementation(Implementation implementation) {
- this.implementation = implementation;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public boolean isAutowire() {
- return (autowire == null) ? false : autowire.booleanValue();
- }
-
- public void setAutowire(Boolean autowire) {
- this.autowire = autowire;
- }
-
- public Boolean getAutowire() {
- return autowire;
- }
-
- public IntentAttachPointType getType() {
- return type;
- }
-
- public void setType(IntentAttachPointType type) {
- this.type = type;
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
-
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
-
- }
-
- public List<ConfiguredOperation> getConfiguredOperations() {
- return configuredImplOperations;
- }
-
- public void setConfiguredOperations(List<ConfiguredOperation> configuredOperations) {
- this.configuredImplOperations = configuredOperations;
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java
deleted file mode 100644
index e2e7b59896..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import javax.xml.xpath.XPathExpression;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.Property;
-
-/**
- * Represents a component property.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentPropertyImpl extends PropertyImpl implements ComponentProperty, Cloneable {
- private String file;
- private Property property;
- private String source;
- private XPathExpression sourceXPathExpression;
-
- /**
- * Constructs a new component property.
- */
- protected ComponentPropertyImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- // FIXME getValue should not delegate to property.getValue()
- // Doing this violates the setValue/getValue semantics, as you
- // can call setValue() then get a different value from getValue()
- @Override
- public Object getValue() {
- if (super.getValue() == null && property != null) {
- return property.getValue();
- } else {
- return super.getValue();
- }
- }
-
- public String getFile() {
- return file;
- }
-
- public Property getProperty() {
- return property;
- }
-
- public String getSource() {
- return source;
- }
-
- public void setFile(String file) {
- this.file = file;
- }
-
- public void setProperty(Property property) {
- this.property = property;
- }
-
- public void setSource(String source) {
- this.source = source;
- }
-
- public XPathExpression getSourceXPathExpression() {
- return sourceXPathExpression;
- }
-
- public void setSourceXPathExpression(XPathExpression sourceXPathExpression) {
- this.sourceXPathExpression = sourceXPathExpression;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java
deleted file mode 100644
index 488023090c..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-
-/**
- * Represents a component reference
- *
- * @version $Rev$ $Date$
- */
-public class ComponentReferenceImpl extends ReferenceImpl implements ComponentReference, Cloneable {
- private Reference reference;
- private Boolean autowire;
- private List<CompositeReference> promotedAs = new ArrayList<CompositeReference>();
- private ComponentService callbackService;
- private List<Endpoint> endpoints = new ArrayList<Endpoint>();
-
- /**
- * Constructs a new component reference.
- */
- protected ComponentReferenceImpl() {
- // Set multiplicity to null so that by default it'll inherit from the Reference
- setMultiplicity(null);
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public Reference getReference() {
- return reference;
- }
-
- public void setReference(Reference reference) {
- this.reference = reference;
- }
-
- public boolean isAutowire() {
- return (autowire == null) ? false : autowire.booleanValue();
- }
-
- public void setAutowire(Boolean autowire) {
- this.autowire = autowire;
- }
-
- public Boolean getAutowire() {
- return autowire;
- }
-
- public List<CompositeReference> promotedAs() {
- return promotedAs;
- }
-
- public ComponentService getCallbackService() {
- return callbackService;
- }
-
- public void setCallbackService(ComponentService callbackService) {
- this.callbackService = callbackService;
- }
-
- public List<Endpoint> getEndpoints(){
- return endpoints;
- }
-
- /**
- * Use endpoint information to work out what the interface contract for the
- * binding is.
- */
- @Override
- public InterfaceContract getInterfaceContract(Binding binding){
- InterfaceContract interfaceContract = null;
-
- for (Endpoint theEndpoint : endpoints){
- if (theEndpoint.getSourceBinding() == binding){
- interfaceContract = theEndpoint.getInterfaceContract();
- }
- }
-
- if (interfaceContract == null){
- interfaceContract = getInterfaceContract();
- }
- return interfaceContract;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java
deleted file mode 100644
index 0c78a2505f..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.Service;
-
-/**
- * Represents a component service
- *
- * @version $Rev$ $Date$
- */
-public class ComponentServiceImpl extends ServiceImpl implements ComponentService, Cloneable {
- private Service service;
- private List<CompositeService> promotedAs = new ArrayList<CompositeService>();
- private ComponentReference callbackReference;
-
- /**
- * Constructs a new component service.
- */
- protected ComponentServiceImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public Service getService() {
- return service;
- }
-
- public void setService(Service service) {
- this.service = service;
- }
-
- public List<CompositeService> promotedAs() {
- return promotedAs;
- }
-
- public ComponentReference getCallbackReference() {
- return callbackReference;
- }
-
- public void setCallbackReference(ComponentReference callbackReference) {
- this.callbackReference = callbackReference;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java
deleted file mode 100644
index bbe665d52f..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-
-/**
- * Represents a component type.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentTypeImpl extends ExtensibleImpl implements ComponentType, Cloneable {
- private String uri;
- private ConstrainingType constrainingType;
- private List<Property> properties = new ArrayList<Property>();
- private List<Reference> references = new ArrayList<Reference>();
- private List<Service> services = new ArrayList<Service>();
- /**
- * Constructs a new component type.
- */
- protected ComponentTypeImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- ComponentTypeImpl clone = (ComponentTypeImpl)super.clone();
-
- clone.services = new ArrayList<Service>();
- for (Service service : getServices()) {
- clone.services.add((Service)service.clone());
- }
- clone.references = new ArrayList<Reference>();
- for (Reference reference : getReferences()) {
- clone.references.add((Reference)reference.clone());
- }
- clone.properties = new ArrayList<Property>();
- for (Property property : getProperties()) {
- clone.properties.add((Property)property.clone());
- }
- return clone;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public ConstrainingType getConstrainingType() {
- return constrainingType;
- }
-
- public List<Property> getProperties() {
- return properties;
- }
-
- public List<Reference> getReferences() {
- return references;
- }
-
- public List<Service> getServices() {
- return services;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- this.constrainingType = constrainingType;
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(getURI()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else {
- if (obj instanceof ComponentType) {
- if (getURI() != null) {
- return getURI().equals(((ComponentType)obj).getURI());
- } else {
- return ((ComponentType)obj).getURI() == null;
- }
- } else {
- return false;
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java
deleted file mode 100644
index 9dd26b5e8e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.Wire;
-
-/**
- * Implementation of a Composite.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeImpl extends ImplementationImpl implements Composite, Cloneable {
- private List<Component> components = new ArrayList<Component>();
- private List<Composite> includes = new ArrayList<Composite>();
- private QName name;
- private List<Wire> wires = new ArrayList<Wire>();
- private Boolean autowire;
- private boolean local = true;
-
- /**
- * Constructs a new composite.
- */
- protected CompositeImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- CompositeImpl clone = (CompositeImpl)super.clone();
-
- clone.components = new ArrayList<Component>();
- for (Component component : getComponents()) {
- Component clonedComponent = (Component)component.clone();
- for (Service service : clone.getServices()) {
- CompositeService compositeService = (CompositeService)service;
- // Force the promoted component/service to be rebuilt against the clone
- if (compositeService.getPromotedComponent() != null) {
- compositeService.getPromotedComponent().setUnresolved(true);
- }
- if (compositeService.getPromotedService() != null) {
- compositeService.getPromotedService().setUnresolved(true);
- }
- }
- for (Reference reference : clone.getReferences()) {
- CompositeReference compositeReference = (CompositeReference)reference;
- for (ComponentReference ref : compositeReference.getPromotedReferences()) {
- // Force the promoted reference to be rebuilt against the clone
- ref.setUnresolved(true);
- }
- }
-
- clone.components.add(clonedComponent);
- }
- clone.wires = new ArrayList<Wire>();
- for (Wire wire : getWires()) {
- clone.wires.add((Wire)wire.clone());
- }
- return clone;
- }
-
- public List<Component> getComponents() {
- return components;
- }
-
- public List<Composite> getIncludes() {
- return includes;
- }
-
- public QName getName() {
- return name;
- }
-
- public List<Wire> getWires() {
- return wires;
- }
-
- public boolean isLocal() {
- return local;
- }
-
- public void setLocal(boolean local) {
- this.local = local;
- }
-
- public boolean isAutowire() {
- return (autowire == null) ? false : autowire.booleanValue();
- }
-
- public void setAutowire(Boolean autowire) {
- this.autowire = autowire;
- }
-
- public Boolean getAutowire() {
- return autowire;
- }
-
- public void setName(QName name) {
- this.name = name;
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(getName()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof Composite) {
- if (getName() != null) {
- return getName().equals(((Composite)obj).getName());
- } else {
- return ((Composite)obj).getName() == null;
- }
- } else {
- return false;
- }
- }
-
- @Override
- public String toString(){
- return ( this.name != null ) ? getName().toString() : "null";
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java
deleted file mode 100644
index 4348e08fcb..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-
-/**
- * Represents a composite reference.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeReferenceImpl extends ReferenceImpl implements CompositeReference, Cloneable {
- private List<ComponentReference> promotedReferences = new ArrayList<ComponentReference>();
-
- /**
- * Constructs a new composite reference.
- */
- protected CompositeReferenceImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public List<ComponentReference> getPromotedReferences() {
- return promotedReferences;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java
deleted file mode 100644
index 6777a96982..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.CompositeService;
-
-/**
- * Represents a composite service
- *
- * @version $Rev$ $Date$
- */
-public class CompositeServiceImpl extends ServiceImpl implements CompositeService, Cloneable {
- private ComponentService promotedService;
- private Component promotedComponent;
-
- /**
- * Constructs a new composite service.
- */
- protected CompositeServiceImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public ComponentService getPromotedService() {
- return promotedService;
- }
-
- public void setPromotedService(ComponentService promotedService) {
- this.promotedService = promotedService;
- }
-
- public Component getPromotedComponent() {
- return promotedComponent;
- }
-
- public void setPromotedComponent(Component promotedComponent) {
- this.promotedComponent = promotedComponent;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConfiguredOperationImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConfiguredOperationImpl.java
deleted file mode 100644
index 1373ce511b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConfiguredOperationImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Represents an Operation.
- *
- * @version $Rev$ $Date$
- */
-public class ConfiguredOperationImpl extends BaseImpl implements ConfiguredOperation {
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- private String name;
- private String contractName;
-
- /**
- * Constructs a new Operation.
- */
- protected ConfiguredOperationImpl() {
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
- public String getContractName() {
- return contractName;
- }
-
- public void setContractName(String contractName) {
- this.contractName = contractName;
- }
-
- public IntentAttachPointType getType() {
- return null;
- }
-
- public void setType(IntentAttachPointType type) {
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java
deleted file mode 100644
index d5701df74e..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AbstractProperty;
-import org.apache.tuscany.sca.assembly.AbstractReference;
-import org.apache.tuscany.sca.assembly.AbstractService;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-
-/**
- * Represents a constraining type.
- *
- * @version $Rev$ $Date$
- */
-public class ConstrainingTypeImpl extends ExtensibleImpl implements ConstrainingType {
- private QName name;
- private List<AbstractProperty> properties = new ArrayList<AbstractProperty>();
- private List<AbstractReference> references = new ArrayList<AbstractReference>();
- private List<AbstractService> services = new ArrayList<AbstractService>();
- private List<Intent> requiredIntents = new ArrayList<Intent>();
-
- /**
- * Constructs a new ConstrainingType
- */
- protected ConstrainingTypeImpl() {
- }
-
- public QName getName() {
- return name;
- }
-
- public void setName(QName name) {
- this.name = name;
- }
-
- public List<AbstractProperty> getProperties() {
- return properties;
- }
-
- public List<AbstractReference> getReferences() {
- return references;
- }
-
- public List<AbstractService> getServices() {
- return services;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(getName()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof ConstrainingType) {
- if (getName() != null) {
- return getName().equals(((ConstrainingType)obj).getName());
- } else {
- return ((ConstrainingType)obj).getName() == null;
- }
- } else {
- return false;
- }
- }
-
- public IntentAttachPointType getType() {
- return null;
- }
-
- public void setType(IntentAttachPointType type) {
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java
deleted file mode 100644
index 491c835246..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-
-/**
- * Implementation of a Contract.
- *
- * @version $Rev$ $Date$
- */
-public class ContractImpl extends ExtensibleImpl implements AbstractContract {
- private InterfaceContract interfaceContract;
- private String name;
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<ConfiguredOperation> configuredOperations = new ArrayList<ConfiguredOperation>();
-
- private boolean isCallback = false;
-
- /**
- * Constructs a new contract.
- */
- protected ContractImpl() {
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public InterfaceContract getInterfaceContract() {
- return interfaceContract;
- }
-
- public void setInterfaceContract(InterfaceContract interfaceContract) {
- this.interfaceContract = interfaceContract;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- public boolean isCallback() {
- return isCallback;
- }
-
- public void setIsCallback(boolean isCallback) {
- this.isCallback = isCallback;
- }
-
- public IntentAttachPointType getType() {
- return null;
- }
-
- public void setType(IntentAttachPointType type) {
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
- public List<ConfiguredOperation> getConfiguredOperations() {
- return configuredOperations;
- }
-
- public void setConfiguredOperations(List<ConfiguredOperation> configuredOperations) {
- this.configuredOperations = configuredOperations;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java
deleted file mode 100644
index ece51cbe9b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointFactory;
-
-/**
- * A factory for the Endpoint model.
- *
- * @version $Rev$ $Date$
- */
-public abstract class EndpointFactoryImpl implements EndpointFactory {
-
- public EndpointFactoryImpl (){
-
- }
-
- public Endpoint createEndpoint() {
- return new EndpointImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
deleted file mode 100644
index 5748abb07d..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-
-/**
- * The assembly model object for an endpoint.
- *
- * @version $Rev$ $Date$
- */
-public class EndpointImpl implements Endpoint {
-
- private String targetName;
-
- private Component sourceComponent;
- private ComponentReference sourceComponentReference;
- private Binding resolvedBinding;
- private Binding resolvedCallbackBinding;
-
- private List<Binding> candidateBindings = new ArrayList<Binding>();
-
- private Component targetComponent;
- private ComponentService targetComponentService;
- private Binding targetBinding;
- private Binding targetCallbackBinding;
-
- private InterfaceContract interfaceContract;
-
- protected EndpointImpl() {
- }
-
- public boolean isUnresolved() {
- return resolvedBinding == null;
- }
-
- public void setUnresolved(boolean unresolved) {
- // do nothing as the status is determined by having
- // a resolved source binding
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public String getTargetName(){
- return targetName;
- }
-
- public void setTargetName(String targetName){
- this.targetName = targetName;
- }
-
- public Component getSourceComponent() {
- return sourceComponent;
- }
-
- public void setSourceComponent(Component sourceComponent) {
- this.sourceComponent = sourceComponent;
- }
-
- public ComponentReference getSourceComponentReference() {
- return sourceComponentReference;
- }
-
- public void setSourceComponentReference(ComponentReference sourceComponentReference) {
- this.sourceComponentReference = sourceComponentReference;
- }
-
- public Binding getSourceBinding() {
- return resolvedBinding;
- }
-
- public void setSourceBinding(Binding resolvedBinding) {
- this.resolvedBinding = resolvedBinding;
- }
-
- public Binding getSourceCallbackBinding(){
- return resolvedCallbackBinding;
- }
-
- public void setSourceCallbackBinding(Binding resolvedCallbackBinding){
- this.resolvedCallbackBinding = resolvedCallbackBinding;
- }
-
- public List<Binding> getCandidateBindings() {
- return candidateBindings;
- }
-
- public Component getTargetComponent() {
- return targetComponent;
- }
-
- public void setTargetComponent(Component targetComponent) {
- this.targetComponent = targetComponent;
- }
-
- public ComponentService getTargetComponentService() {
- return targetComponentService;
- }
-
- public void setTargetComponentService(ComponentService targetComponentService) {
- this.targetComponentService = targetComponentService;
- }
-
- public Binding getTargetBinding() {
- return targetBinding;
- }
-
- public void setTargetBinding(Binding targetBinding) {
- this.targetBinding = targetBinding;
- }
-
- public Binding getTargetCallbackBinding(){
- return targetCallbackBinding;
- }
-
- public void setTargetCallbackBinding(Binding targetCallbackBinding){
- this.targetCallbackBinding = targetCallbackBinding;
- }
-
- public InterfaceContract getInterfaceContract() {
- return interfaceContract;
- }
-
- public void setInterfaceContract(InterfaceContract interfaceContract) {
- this.interfaceContract = interfaceContract;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensibleImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensibleImpl.java
deleted file mode 100644
index 761799a4d5..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensibleImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Extensible;
-import org.apache.tuscany.sca.assembly.Extension;
-
-/**
- * Convenience base class for extensible assembly model objects.
- *
- * @version $Rev$ $Date$
- */
-public abstract class ExtensibleImpl extends BaseImpl implements Extensible {
- private List<Object> extensions = new ArrayList<Object>();
- private List<Extension> attributeExtensions = new ArrayList<Extension>();
-
- /**
- * Constructs a new base model object.
- */
- protected ExtensibleImpl() {
- }
-
- public List<Object> getExtensions() {
- return extensions;
- }
-
- public List<Extension> getAttributeExtensions() {
- return attributeExtensions;
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java
deleted file mode 100644
index 2753bcc091..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Extension;
-
-public class ExtensionImpl implements Extension {
- private QName qName;
- private Object value;
- boolean isAttribute = false;
-
- public ExtensionImpl() {
-
- }
-
- public ExtensionImpl(QName qName, Object value, boolean isAttribute) {
- this.qName = qName;
- this.value = value;
- this.isAttribute = isAttribute;
- }
-
- public QName getQName() {
- return qName;
- }
-
- public void setQName(QName qName) {
- this.qName = qName;
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
-
- public boolean isAttribute() {
- return isAttribute;
- }
-
- public void setIsAttribute(boolean isAttribute) {
- this.isAttribute = isAttribute;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java
deleted file mode 100644
index aa75922489..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * Base implementation class of Implementation model interface
- *
- * @version $Rev$ $Date$
- */
-public abstract class ImplementationImpl extends ComponentTypeImpl implements Implementation, PolicySetAttachPoint,
- OperationsConfigurator {
-
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
- private List<ConfiguredOperation> configuredOperations = new ArrayList<ConfiguredOperation>();
- private IntentAttachPointType type;
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private List<Intent> requiredIntents = new ArrayList<Intent>();
-
- protected ImplementationImpl() {
- super();
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- public List<ConfiguredOperation> getConfiguredOperations() {
- return configuredOperations;
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- public IntentAttachPointType getType() {
- return type;
- }
-
- public void setType(IntentAttachPointType type) {
- this.type = type;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java
deleted file mode 100644
index 0c1051199f..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Represents a property.
- *
- * @version $Rev$ $Date$
- */
-public class PropertyImpl extends AbstractPropertyImpl implements Property, Cloneable {
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- /**
- * Constructs a new property.
- */
- protected PropertyImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
deleted file mode 100644
index 1800222bfb..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Callback;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Represents a reference.
- *
- * @version $Rev$ $Date$
- */
-public class ReferenceImpl extends AbstractReferenceImpl implements Reference, Cloneable {
- private List<Binding> bindings = new ArrayList<Binding>();
- private boolean wiredByImpl;
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private List<ComponentService> targets = new ArrayList<ComponentService>();
- private Callback callback;
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
- private boolean promotionOverride;
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- /**
- * Constructs a new reference.
- */
- protected ReferenceImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- ReferenceImpl clone = (ReferenceImpl)super.clone();
- clone.bindings = new ArrayList<Binding>();
- clone.bindings.addAll(getBindings());
- clone.targets = new ArrayList<ComponentService>();
- clone.targets.addAll(getTargets());
- return clone;
- }
-
- public List<Binding> getBindings() {
- return bindings;
- }
-
- public <B> B getBinding(Class<B> bindingClass) {
- for (Binding binding : bindings) {
- if (bindingClass.isInstance(binding)) {
- return bindingClass.cast(binding);
- }
- }
- return null;
- }
-
- public <B> B getCallbackBinding(Class<B> bindingClass) {
- if (callback != null) {
- for (Binding binding : callback.getBindings()) {
- if (bindingClass.isInstance(binding)) {
- return bindingClass.cast(binding);
- }
- }
- }
- return null;
- }
-
- public boolean isWiredByImpl() {
- return wiredByImpl;
- }
-
- public void setWiredByImpl(boolean wiredByImpl) {
- this.wiredByImpl = wiredByImpl;
- }
-
- public boolean isPromotionOverride() {
- return promotionOverride;
- }
-
- public void setPromotionOverride(boolean promotionOverride) {
- this.promotionOverride = promotionOverride;
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public List<ComponentService> getTargets() {
- return targets;
- }
-
- public Callback getCallback() {
- return callback;
- }
-
- public void setCallback(Callback callback) {
- this.callback = callback;
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- /**
- * By default return the interface contract for the reference
- */
- public InterfaceContract getInterfaceContract(Binding binding){
- return getInterfaceContract();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
deleted file mode 100644
index 8d745cb7e1..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Callback;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Represents a reference.
- *
- * @version $Rev$ $Date$
- */
-public class ServiceImpl extends AbstractServiceImpl implements Service, Cloneable {
- private List<Binding> bindings = new ArrayList<Binding>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private Callback callback;
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- /**
- * Constructs a new service.
- */
- protected ServiceImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- ServiceImpl clone = (ServiceImpl)super.clone();
- clone.bindings = new ArrayList<Binding>();
- clone.bindings.addAll(getBindings());
- return clone;
- }
-
- public List<Binding> getBindings() {
- return bindings;
- }
-
- public <B> B getBinding(Class<B> bindingClass) {
- for (Binding binding : bindings) {
- if (bindingClass.isInstance(binding)) {
- return bindingClass.cast(binding);
- }
- }
- return null;
- }
-
- public <B> B getCallbackBinding(Class<B> bindingClass) {
- if (callback != null) {
- for (Binding binding : callback.getBindings()) {
- if (bindingClass.isInstance(binding)) {
- return bindingClass.cast(binding);
- }
- }
- }
- return null;
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public Callback getCallback() {
- return callback;
- }
-
- public void setCallback(Callback callback) {
- this.callback = callback;
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- /**
- * By default return the interface contract for the service
- */
- public InterfaceContract getInterfaceContract(Binding binding){
- return getInterfaceContract();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java b/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java
deleted file mode 100644
index 1a7abc8564..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Wire;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Represents a wire
- *
- * @version $Rev$ $Date$
- */
-public class WireImpl extends ExtensibleImpl implements Wire, Cloneable {
- private ComponentReference source;
- private ComponentService target;
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- /**
- * Constructs a new wire.
- */
- protected WireImpl() {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public ComponentReference getSource() {
- return source;
- }
-
- public ComponentService getTarget() {
- return target;
- }
-
- public void setSource(ComponentReference source) {
- this.source = source;
- }
-
- public void setTarget(ComponentService target) {
- this.target = target;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public IntentAttachPointType getType() {
- return null;
- }
-
- public void setType(IntentAttachPointType type) {
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.AssemblyFactory b/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.AssemblyFactory
deleted file mode 100644
index 859c4bde4b..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.AssemblyFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.assembly.DefaultAssemblyFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.EndpointFactory b/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.EndpointFactory
deleted file mode 100644
index 8dbff76ad9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.EndpointFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.assembly.DefaultEndpointFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.ExtensionFactory b/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.ExtensionFactory
deleted file mode 100644
index bea25da958..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.ExtensionFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.assembly.DefaultExtensionFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilder b/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilder
deleted file mode 100644
index 9fbabd0c3f..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilder
+++ /dev/null
@@ -1,35 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http:..www.apache.org.licenses.LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.assembly.builder.impl.ComponentConfigurationBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.ComponentConfigurationBuilder
-org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceBindingBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.ComponentReferenceBindingBuilder
-org.apache.tuscany.sca.assembly.builder.impl.ComponentReferencePromotionWireBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.ComponentReferencePromotionWireBuilder
-org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.ComponentReferenceWireBuilder
-org.apache.tuscany.sca.assembly.builder.impl.ComponentServiceBindingBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.ComponentServiceBindingBuilder
-org.apache.tuscany.sca.assembly.builder.impl.ComponentServicePromotionBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.ComponentServicePromotionBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositeBindingURIBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositeBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositeCloneBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositeCloneBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositeIncludeBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositeIncludeBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositePolicyBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositePolicyBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositePromotionBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositePromotionBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositeReferenceConfigurationBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositeReferenceConfigurationBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositeReferenceWireBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositeReferenceWireBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositeServiceBindingBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositeServiceBindingBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositeServiceConfigurationBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositeServiceConfigurationBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositeServicePromotionBuilderImpl;id=org.apache.tuscany.sca.assembly.builder.CompositeServicePromotionBuilder
-org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingConfigurationBuilderImpl;id=org.apache.tuscany.assembly.builder.CompositeBindingConfigurationBuilder
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint b/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint
deleted file mode 100644
index 693834e23d..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.assembly.builder.DefaultCompositeBuilderExtensionPoint \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/assembly-validation-messages.properties b/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/assembly-validation-messages.properties
deleted file mode 100644
index 6aeda18aab..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/assembly-validation-messages.properties
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-DuplicateComponentName = Duplicate component name: Composite = {0} Component = {1}
-DuplicateComponentServiceName = Duplicate component service name: Component = {0} Service = {1}
-DuplicateComponentReferenceName = Duplicate component reference name: Component = {0} Reference = {1}
-DuplicateComponentPropertyName = Duplicate component property name: Component = {0} Property = {1}
-NoComponentImplementation = No implementation for component: Component = {0}
-ServiceNotFoundForComponentService = Service not found for component service: Component = {0} Service = {1}
-UnresolvedComponentImplementation = Component implementation not found: Component = {0} Uri = {1}
-DuplicateImplementationPropertyName = Duplicate property name: Component = {0} Property = {1}
-DuplicateImplementationServiceName = Duplicate service name: Component = {0} Service = {1}
-DuplicateImplementationReferenceName = Duplicate reference name: Component = {0} Reference = {1}
-PropertyNotFound = Property not found for component property: Component = {0} Property = {1}
-PropertyMustSupplyIncompatible = Component property mustSupply attribute incompatible with property: Component = {0} Property = {1}
-PropertyMustSupplyNull = No value configured on a mustSupply property: Component = {0} Property = {1}
-PropertyOverrideManyAttribute = Component property many attribute incompatible with property: Component = {0} Property = {1}
-ReferenceNotFound = Reference not found for component reference: Component = {0} Reference = {1}
-ReferenceIncompatibleMultiplicity = Component reference multiplicity incompatible with reference multiplicity: Component = {0} Reference = {1}
-ReferenceIncompatibleInterface = Incompatible interfaces on component reference and target: Composite = {0} Reference = {1} Service = {2}
-ReferenceIncompatibleComponentInterface = Component reference interface incompatible with reference interface: Component = {0} Reference = {1}
-ServiceIncompatibleComponentInterface = Component service interface incompatible with service interface: Component = {0} Service = {1}
-MultipleBindingsForService = Multiple bindings with the same name for a service: Service = {0} Binding name = {1}
-MultipleBindingsForReference = Multiple bindings with the same name for a reference: Reference = {0} Binding name = {1}
-ReferenceWithoutTargets = No targets for reference: Composite = {0} Reference = {1}
-PromotedReferenceNotFound = Promoted component reference not found: Composite = {0} Reference = {1}
-PromotedServiceNotFound = Promoted component service not found: Composite = {0} Service = {1}
-ComponentReferenceTargetNotFound = Component reference target not found, it might be a remote service running elsewhere in the SCA Domain: Composite = {0} Service = {1}
-NoSCABindingAvailableForUnresolvedService = A local service cannot be found for reference {0} target {1} and there is no SCA binding available to represent the unresolved target
-NoMatchingBinding = Component reference {0} does not have a binding which matches the bindings of service {1}
-NoMatchingCallbackBinding = Component reference {0} does not have a callback binding which matches the callback bindings of service {1}
-ReferenceEndPointMixWithTarget = Reference {0} must not specify endpoints using both target attribute and with binding uri attribute
-PolicyRelatedException = Policy Related Exception occured due to : {0}
-CompositeAlreadyIncluded = Composite {0} has already been included.
-ComponentReferenceMoreWire = Component reference {0} has more than one wires
-WireTargetNotFound = Wire target not found : {0}
-WireSourceNotFound = Wire source not found : {0}
-WireIncompatibleInterface = Incompatible interfaces on wire source and target : source = {0} target = {1}
-ComponentIncompatibleInterface = Incompatible interfaces on component reference and target : reference = {0} target = {1}
-TooManyReferenceTargets = Too many targets on reference: {0}
-ReferenceInterfaceNotSubSet = Interface of composite reference {0} must be compatible with the interface declared by promoted component reference.
-ServiceInterfaceNotSubSet = Interface of composite service {0} must be subset of the interface declared by promoted component service.
-NoComponentReferenceTarget = No target services found for the component reference to be autowired: {0}
-NoTypeForComponentProperty = No type specified on component property: Component = {0} Property = {1}
-URLSyntaxException = URLSyntaxException when creating binding URI at component = {0} service = {1} binding = {2} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/assembly-validation-messages_it.properties b/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/assembly-validation-messages_it.properties
deleted file mode 100644
index b94d37ba2d..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/main/resources/assembly-validation-messages_it.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-DuplicateComponentName = Nome del componente duplicato: Composite = {0} Component = {1}
-DuplicateComponentServiceName = Nome del servizio del componente duplicato: Component = {0} Service = {1}
-DuplicateComponentReferenceName = Nome del reference del componente duplicato: Component = {0} Reference = {1}
-DuplicateComponentPropertyName = Nome della property del componente duplicato: Component = {0} Property = {1}
-NoComponentImplementation = Implementazione insistente per il componente: Component = {0}
-ServiceNotFoundForComponentService = Servizio non trovato per il componente: Component = {0} Service = {1}
-UnresolvedComponentImplementation = Implementazione del componente non trovata: Component = {0} Uri = {1}
-DuplicateImplementationPropertyName = Nome della property del componente duplicata: Component = {0} Property = {1}
-DuplicateImplementationReferenceName = Nome del riferimento duplicato: Component = {0} Reference = {1}
-PropertyNotFound = Property non trovata per il componente: Component = {0} Property = {1}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/AssemblyFactoryTestCase.java b/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/AssemblyFactoryTestCase.java
deleted file mode 100644
index e73119204d..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/AssemblyFactoryTestCase.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import javax.xml.namespace.QName;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-
-/**
- * Test building of assembly model instances using the assembly factory.
- *
- * @version $Rev$ $Date$
- */
-public class AssemblyFactoryTestCase {
-
- private static AssemblyFactory assemblyFactory;
-
- @BeforeClass
- public static void setUp() throws Exception {
- assemblyFactory = new DefaultAssemblyFactory();
- }
-
- @Test
- public void testCreateComponent() {
- createComponent("AccountServiceComponent1");
- }
-
- @Test
- public void testCreateComponentType() {
- createComponentType();
- }
-
- @Test
- public void testCreateComposite() {
- createComposite();
- }
-
- @Test
- public void testCreateConstrainingType() {
- createConstrainingType();
- }
-
- /**
- * Create a composite
- */
- Composite createComposite() {
- Composite c = assemblyFactory.createComposite();
-
- Component c1 = createComponent("AccountServiceComponent1");
- c.getComponents().add(c1);
- Component c2 = createComponent("AccountServiceComponent2");
- c.getComponents().add(c2);
-
- Wire w = assemblyFactory.createWire();
- w.setSource(c1.getReferences().get(0));
- w.setTarget(c2.getServices().get(0));
- c.getWires().add(w);
-
- CompositeService cs = assemblyFactory.createCompositeService();
- cs.setName("AccountService");
- cs.setPromotedService(c1.getServices().get(0));
- cs.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- c.getServices().add(cs);
- cs.getBindings().add(new TestBinding(assemblyFactory));
-
- CompositeReference cr = assemblyFactory.createCompositeReference();
- cr.setName("StockQuoteService");
- cr.getPromotedReferences().add(c2.getReferences().get(1));
- cr.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- c.getReferences().add(cr);
- cr.getBindings().add(new TestBinding(assemblyFactory));
-
- return c;
- }
-
- /**
- * Create a new component
- */
- Component createComponent(String name) {
- Component c = assemblyFactory.createComponent();
- c.setName(name);
-
- ConstrainingType constraint = createConstrainingType();
- c.setConstrainingType(constraint);
-
- Implementation i = new TestImplementation(assemblyFactory);
- c.setImplementation(i);
-
- ComponentProperty p = assemblyFactory.createComponentProperty();
- p.setName("currency");
- p.setValue("USD");
- p.setMustSupply(true);
- p.setXSDType(new QName("", ""));
- p.setProperty(i.getProperties().get(0));
- c.getProperties().add(p);
-
- ComponentReference ref1 = assemblyFactory.createComponentReference();
- ref1.setName("accountDataService");
- ref1.setMultiplicity(Multiplicity.ONE_ONE);
- ref1.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- ref1.setReference(i.getReferences().get(0));
- c.getReferences().add(ref1);
- ref1.getBindings().add(new TestBinding(assemblyFactory));
-
- ComponentReference ref2 = assemblyFactory.createComponentReference();
- ref2.setName("stockQuoteService");
- ref2.setMultiplicity(Multiplicity.ONE_ONE);
- ref2.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- ref2.setReference(i.getReferences().get(1));
- c.getReferences().add(ref2);
- ref2.getBindings().add(new TestBinding(assemblyFactory));
-
- ComponentService s = assemblyFactory.createComponentService();
- s.setName("AccountService");
- s.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- s.setService(i.getServices().get(0));
- c.getServices().add(s);
- s.getBindings().add(new TestBinding(assemblyFactory));
-
- return c;
- }
-
- /**
- * Create a new component type
- *
- * @return
- */
- ComponentType createComponentType() {
- ComponentType ctype = assemblyFactory.createComponentType();
-
- Property p = assemblyFactory.createProperty();
- p.setName("currency");
- p.setValue("USD");
- p.setMustSupply(true);
- p.setXSDType(new QName("", ""));
- ctype.getProperties().add(p);
-
- Reference ref1 = assemblyFactory.createReference();
- ref1.setName("accountDataService");
- ref1.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- ref1.setMultiplicity(Multiplicity.ONE_ONE);
- ctype.getReferences().add(ref1);
- ref1.getBindings().add(new TestBinding(assemblyFactory));
-
- Reference ref2 = assemblyFactory.createReference();
- ref2.setName("stockQuoteService");
- ref2.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- ref2.setMultiplicity(Multiplicity.ONE_ONE);
- ctype.getReferences().add(ref2);
- ref2.getBindings().add(new TestBinding(assemblyFactory));
-
- Service s = assemblyFactory.createService();
- s.setName("AccountService");
- s.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- ctype.getServices().add(s);
- s.getBindings().add(new TestBinding(assemblyFactory));
-
- return ctype;
- }
-
- /**
- * Create a new constraining type
- *
- * @return
- */
- ConstrainingType createConstrainingType() {
- ConstrainingType ctype = assemblyFactory.createConstrainingType();
-
- AbstractProperty p = assemblyFactory.createAbstractProperty();
- p.setName("currency");
- p.setValue("USD");
- p.setMustSupply(true);
- p.setXSDType(new QName("", ""));
- ctype.getProperties().add(p);
-
- AbstractReference ref1 = assemblyFactory.createAbstractReference();
- ref1.setName("accountDataService");
- ref1.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- ref1.setMultiplicity(Multiplicity.ONE_ONE);
- ctype.getReferences().add(ref1);
-
- AbstractReference ref2 = assemblyFactory.createAbstractReference();
- ref2.setName("stockQuoteService");
- ref2.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- ref2.setMultiplicity(Multiplicity.ONE_ONE);
- ctype.getReferences().add(ref2);
-
- AbstractService s = assemblyFactory.createAbstractService();
- s.setName("AccountService");
- s.setInterfaceContract(new TestInterfaceContract(assemblyFactory));
- ctype.getServices().add(s);
-
- return ctype;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java b/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java
deleted file mode 100644
index 5e0a2335d1..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-
-/**
- * A test interface model.
- *
- * @version $Rev$ $Date$
- */
-public class TestBinding implements Binding {
- public TestBinding(AssemblyFactory factory) {
- }
-
- public String getName() {
- return null;
- }
-
- public String getURI() {
- return "http://test";
- }
-
- public void setName(String name) {
- }
-
- public void setURI(String uri) {
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestImplementation.java b/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestImplementation.java
deleted file mode 100644
index 19702954c9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestImplementation.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
-
-/**
- * A test component implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class TestImplementation extends ImplementationImpl implements Implementation {
- public TestImplementation(AssemblyFactory factory) {
-
- Property p = factory.createProperty();
- p.setName("currency");
- p.setValue("USD");
- p.setMustSupply(true);
- p.setXSDType(new QName("", ""));
- getProperties().add(p);
-
- Reference ref1 = factory.createReference();
- ref1.setName("accountDataService");
- ref1.setMultiplicity(Multiplicity.ONE_ONE);
- getReferences().add(ref1);
- ref1.getBindings().add(new TestBinding(factory));
-
- Reference ref2 = factory.createReference();
- ref2.setName("stockQuoteService");
- ref2.setMultiplicity(Multiplicity.ONE_ONE);
- ref2.setInterfaceContract(new TestInterfaceContract(factory));
- getReferences().add(ref2);
- ref2.getBindings().add(new TestBinding(factory));
-
- Service s = factory.createService();
- s.setName("AccountService");
- s.setInterfaceContract(new TestInterfaceContract(factory));
- getServices().add(s);
- s.getBindings().add(new TestBinding(factory));
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterface.java b/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterface.java
deleted file mode 100644
index dbe0cb8225..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterface.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceImpl;
-
-/**
- * A test interface model.
- *
- * @version $Rev$ $Date$
- */
-public class TestInterface extends InterfaceImpl implements Interface {
-
- public TestInterface(AssemblyFactory factory) {
-
- setRemotable(true);
-
- Operation operation = new TestOperation();
- operation.setName("test");
- getOperations().add(operation);
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterfaceContract.java b/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterfaceContract.java
deleted file mode 100644
index ee6b95edc9..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterfaceContract.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractImpl;
-
-/**
- * A test interface contract model.
- *
- * @version $Rev$ $Date$
- */
-public class TestInterfaceContract extends InterfaceContractImpl implements InterfaceContract {
-
- public TestInterfaceContract(AssemblyFactory factory) {
-
- TestInterface testInterface = new TestInterface(factory);
- setInterface(testInterface);
-
- TestInterface testCallbackInterface = new TestInterface(factory);
- setCallbackInterface(testCallbackInterface);
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestOperation.java b/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestOperation.java
deleted file mode 100644
index d94a7e93a3..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestOperation.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-
-/**
- * A test operation model.
- *
- * @version $Rev$ $Date$
- */
-public class TestOperation extends OperationImpl {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderTestCase.java b/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderTestCase.java
deleted file mode 100644
index 2992aeb263..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderTestCase.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import static org.junit.Assert.assertTrue;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test the CompositeBuilder.
- *
- * @version $Rev$ $Date$
- */
-public class CompositeBuilderTestCase {
-
- private static AssemblyFactory assemblyFactory;
-
- @BeforeClass
- public static void setUp() throws Exception {
- assemblyFactory = new DefaultAssemblyFactory();
- }
-
- @Test
- public void testFuseIncludes() throws Exception {
- Composite c1 = assemblyFactory.createComposite();
- c1.setName(new QName("http://foo", "C1"));
- Component a = assemblyFactory.createComponent();
- a.setName("a");
- c1.getComponents().add(a);
- CompositeService s = assemblyFactory.createCompositeService();
- s.setName("s");
- c1.getServices().add(s);
- CompositeReference r = assemblyFactory.createCompositeReference();
- r.setName("r");
- c1.getReferences().add(r);
-
- Composite c2 = assemblyFactory.createComposite();
- c2.setName(new QName("http://foo", "C2"));
- c1.getIncludes().add(c2);
- Component b = assemblyFactory.createComponent();
- b.setName("b");
- c2.getComponents().add(b);
-
- Composite c = assemblyFactory.createComposite();
- c.setName(new QName("http://foo", "C"));
- c.getIncludes().add(c1);
-
- new CompositeIncludeBuilderImpl().build(c, null, null);
-
- assertTrue(c.getComponents().get(0).getName().equals("a"));
- assertTrue(c.getComponents().get(1).getName().equals("b"));
- assertTrue(c.getServices().get(0).getName().equals("s"));
- assertTrue(c.getReferences().get(0).getName().equals("r"));
- }
-
- @Test
- public void testExpandComposites() throws Exception {
- Composite c1 = assemblyFactory.createComposite();
- c1.setName(new QName("http://foo", "C1"));
- Component a = assemblyFactory.createComponent();
- a.setName("a");
- c1.getComponents().add(a);
- CompositeService s = assemblyFactory.createCompositeService();
- s.setName("s");
- c1.getServices().add(s);
- CompositeReference r = assemblyFactory.createCompositeReference();
- r.setName("r");
- c1.getReferences().add(r);
-
- Composite c2 = assemblyFactory.createComposite();
- c2.setName(new QName("http://foo", "C2"));
- Component b = assemblyFactory.createComponent();
- b.setName("b");
- c2.getComponents().add(b);
-
- Composite c = assemblyFactory.createComposite();
- c.setName(new QName("http://foo", "C"));
- Component x = assemblyFactory.createComponent();
- x.setName("x");
- x.setImplementation(c1);
- c.getComponents().add(x);
- Component y = assemblyFactory.createComponent();
- y.setName("y");
- y.setImplementation(c2);
- c.getComponents().add(y);
- Component z = assemblyFactory.createComponent();
- z.setName("z");
- z.setImplementation(c1);
- c.getComponents().add(z);
-
- new CompositeCloneBuilderImpl().build(c, null, null);
-
- assertTrue(c.getComponents().get(0).getImplementation() != c1);
- assertTrue(c.getComponents().get(1).getImplementation() != c2);
- assertTrue(c.getComponents().get(2).getImplementation() != c1);
-
- Composite i = (Composite)c.getComponents().get(0).getImplementation();
- assertTrue(i.getComponents().get(0) != a);
- assertTrue(i.getComponents().get(0).getName().equals("a"));
- assertTrue(i.getServices().get(0).getName().equals("s"));
- assertTrue(i.getServices().get(0) != s);
- assertTrue(i.getReferences().get(0).getName().equals("r"));
- assertTrue(i.getReferences().get(0) != r);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/PrintUtilTestCase.java b/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/PrintUtilTestCase.java
deleted file mode 100644
index 82b1fd8665..0000000000
--- a/tags/java/sca/2.0-M1/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/PrintUtilTestCase.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AbstractProperty;
-import org.apache.tuscany.sca.assembly.AbstractReference;
-import org.apache.tuscany.sca.assembly.AbstractService;
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeReference;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.TestBinding;
-import org.apache.tuscany.sca.assembly.TestImplementation;
-import org.apache.tuscany.sca.assembly.TestInterfaceContract;
-import org.apache.tuscany.sca.assembly.Wire;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PrintUtilTestCase {
-
- private AssemblyFactory factory = new DefaultAssemblyFactory();
-
- /**
- * Create a composite
- */
- Composite createComposite() {
- Composite c = factory.createComposite();
-
- Component c1 = createComponent("AccountServiceComponent1");
- c.getComponents().add(c1);
- Component c2 = createComponent("AccountServiceComponent2");
- c.getComponents().add(c2);
-
- Wire w = factory.createWire();
- w.setSource(c1.getReferences().get(0));
- w.setTarget(c2.getServices().get(0));
- c.getWires().add(w);
-
- CompositeService cs = factory.createCompositeService();
- cs.setName("AccountService");
- cs.setPromotedService(c1.getServices().get(0));
- cs.setInterfaceContract(new TestInterfaceContract(factory));
- c.getServices().add(cs);
- cs.getBindings().add(new TestBinding(factory));
-
- CompositeReference cr = factory.createCompositeReference();
- cr.setName("StockQuoteService");
- cr.getPromotedReferences().add(c2.getReferences().get(1));
- cr.setInterfaceContract(new TestInterfaceContract(factory));
- c.getReferences().add(cr);
- cr.getBindings().add(new TestBinding(factory));
-
- return c;
- }
-
- /**
- * Create a new component
- */
- Component createComponent(String name) {
- Component c = factory.createComponent();
- c.setName(name);
-
- ConstrainingType constraint = createConstrainingType();
- c.setConstrainingType(constraint);
-
- Implementation i = new TestImplementation(factory);
- c.setImplementation(i);
-
- ComponentProperty p = factory.createComponentProperty();
- p.setName("currency");
- p.setValue("USD");
- p.setMustSupply(true);
- p.setXSDType(new QName("", ""));
- p.setProperty(i.getProperties().get(0));
- c.getProperties().add(p);
-
- ComponentReference ref1 = factory.createComponentReference();
- ref1.setName("accountDataService");
- ref1.setMultiplicity(Multiplicity.ONE_ONE);
- ref1.setInterfaceContract(new TestInterfaceContract(factory));
- ref1.setReference(i.getReferences().get(0));
- c.getReferences().add(ref1);
- ref1.getBindings().add(new TestBinding(factory));
-
- ComponentReference ref2 = factory.createComponentReference();
- ref2.setName("stockQuoteService");
- ref2.setMultiplicity(Multiplicity.ONE_ONE);
- ref2.setInterfaceContract(new TestInterfaceContract(factory));
- ref2.setReference(i.getReferences().get(1));
- c.getReferences().add(ref2);
- ref2.getBindings().add(new TestBinding(factory));
-
- ComponentService s = factory.createComponentService();
- s.setName("AccountService");
- s.setInterfaceContract(new TestInterfaceContract(factory));
- s.setService(i.getServices().get(0));
- c.getServices().add(s);
- s.getBindings().add(new TestBinding(factory));
-
- return c;
- }
-
- /**
- * Create a new component type
- *
- * @return
- */
- ComponentType createComponentType() {
- ComponentType ctype = factory.createComponentType();
-
- Property p = factory.createProperty();
- p.setName("currency");
- p.setValue("USD");
- p.setMustSupply(true);
- p.setXSDType(new QName("", ""));
- ctype.getProperties().add(p);
-
- Reference ref1 = factory.createReference();
- ref1.setName("accountDataService");
- ref1.setInterfaceContract(new TestInterfaceContract(factory));
- ref1.setMultiplicity(Multiplicity.ONE_ONE);
- ctype.getReferences().add(ref1);
- ref1.getBindings().add(new TestBinding(factory));
-
- Reference ref2 = factory.createReference();
- ref2.setName("stockQuoteService");
- ref2.setInterfaceContract(new TestInterfaceContract(factory));
- ref2.setMultiplicity(Multiplicity.ONE_ONE);
- ctype.getReferences().add(ref2);
- ref2.getBindings().add(new TestBinding(factory));
-
- Service s = factory.createService();
- s.setName("AccountService");
- s.setInterfaceContract(new TestInterfaceContract(factory));
- ctype.getServices().add(s);
- s.getBindings().add(new TestBinding(factory));
-
- return ctype;
- }
-
- /**
- * Create a new constraining type
- *
- * @return
- */
- ConstrainingType createConstrainingType() {
- ConstrainingType ctype = factory.createConstrainingType();
-
- AbstractProperty p = factory.createAbstractProperty();
- p.setName("currency");
- p.setValue("USD");
- p.setMustSupply(true);
- p.setXSDType(new QName("", ""));
- ctype.getProperties().add(p);
-
- AbstractReference ref1 = factory.createAbstractReference();
- ref1.setName("accountDataService");
- ref1.setInterfaceContract(new TestInterfaceContract(factory));
- ref1.setMultiplicity(Multiplicity.ONE_ONE);
- ctype.getReferences().add(ref1);
-
- AbstractReference ref2 = factory.createAbstractReference();
- ref2.setName("stockQuoteService");
- ref2.setInterfaceContract(new TestInterfaceContract(factory));
- ref2.setMultiplicity(Multiplicity.ONE_ONE);
- ctype.getReferences().add(ref2);
-
- AbstractService s = factory.createAbstractService();
- s.setName("AccountService");
- s.setInterfaceContract(new TestInterfaceContract(factory));
- ctype.getServices().add(s);
-
- return ctype;
- }
-
- @Test
- public void testPrint1() {
- Composite composite = createComposite();
- StringWriter sw = new StringWriter();
- PrintUtil p = new PrintUtil(new PrintWriter(sw), true);
- p.print(composite);
- // System.out.println(sw.toString());
- }
-
- @Test
- public void testPrint2() {
- Composite composite = createComposite();
- StringWriter sw = new StringWriter();
- PrintUtil p = new PrintUtil(new PrintWriter(sw), false);
- p.print(composite);
- // System.out.println(sw.toString());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/LICENSE b/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/NOTICE b/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/NOTICE
deleted file mode 100644
index fdfa0e9faa..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2008 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/pom.xml b/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/pom.xml
deleted file mode 100644
index a32135306d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/pom.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>1.5-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-dwr</artifactId>
- <name>Apache Tuscany SCA AJAX DWR Binding Extension</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extension-helper</artifactId>
- <version>1.5-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>1.5-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.directwebremoting</groupId>
- <artifactId>dwr</artifactId>
- <version>2.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version> <!-- to keep compatible with older servlet containers -->
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Bundle-Version>${tuscany.version}</Bundle-Version>
- <Bundle-SymbolicName>org.apache.tuscany.sca.binding.dwr</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.dwr*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRBinding.java b/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRBinding.java
deleted file mode 100644
index ae5cf327ab..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRBinding.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.dwr;
-
-/**
- * The runtime representation of the <binding.dwr> SCDL
- *
- * @version $Rev$ $Date$
- */
-public class DWRBinding {
-
- // Empty as <binding.dwr> doesn't use any additional attributes or elements (yet).
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRBindingActivator.java b/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRBindingActivator.java
deleted file mode 100644
index d14751f235..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRBindingActivator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.dwr;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.extension.helper.BindingActivator;
-import org.apache.tuscany.sca.extension.helper.ComponentLifecycle;
-import org.apache.tuscany.sca.extension.helper.InvokerFactory;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * The Binding Activator for the DWR Binding.
- *
- * @version $Rev$ $Date$
- */
-public class DWRBindingActivator implements BindingActivator<DWRBinding>{
-
- private ServletHost servletHost;
-
- public DWRBindingActivator(ServletHost servletHost) {
- this.servletHost = servletHost;
- }
-
- public Class<DWRBinding> getBindingClass() {
- return DWRBinding.class;
- }
-
- public InvokerFactory createInvokerFactory(RuntimeComponent rc, RuntimeComponentReference rcr, Binding b, DWRBinding ab) {
- return new DWRInvokerFactory(rc, rcr, b, ab, servletHost);
- }
-
- public ComponentLifecycle createService(RuntimeComponent rc, RuntimeComponentService rcs, Binding b, DWRBinding ab) {
- return new DWRService(rc, rcs, b, ab, servletHost);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRInvoker.java b/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRInvoker.java
deleted file mode 100644
index 24e6dbbcd4..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRInvoker.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.dwr;
-
-import java.util.Collection;
-
-import org.apache.tuscany.sca.core.invocation.MessageImpl;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.directwebremoting.ScriptBuffer;
-import org.directwebremoting.WebContext;
-import org.directwebremoting.WebContextFactory;
-import org.directwebremoting.proxy.dwr.Util;
-
-/**
- * The invoker for a DWR Binding.
- *
- * @version $Rev$ $Date$
- */
-public class DWRInvoker implements Invoker {
-
- private String referenceFunction;
-
- public DWRInvoker(String referenceName, Operation operation) {
- this.referenceFunction = referenceName + "." + operation.getName();
- }
-
- public Message invoke(Message requestMsg) {
-
- invoke((Object[])requestMsg.getBody());
-
- // DWR references can not return anything
- return new MessageImpl();
- }
-
- public void invoke(Object[] args) {
-
- // TODO: this only works if its the same thread as request
- WebContext wctx = WebContextFactory.get();
- String currentPage = wctx.getCurrentPage();
-
- // Get a DWR Util proxy for all the browsers on the current page:
- Collection sessions = wctx.getScriptSessionsByPage(currentPage);
- Util utilAll = new Util(sessions);
-
- ScriptBuffer referenceInvoke = getInvokeFragment(args, wctx);
-
- // add the reference call to the Util proxy which will cause DWR to
- // asynchronously send it to be run on each active browser client
- utilAll.addScript(referenceInvoke);
- }
-
- /**
- * Creates a fragment of JavaScript code to invoke the reference function
- * Eg: "<referenceName>.<operationName>(arg1, arg2,...);"
- */
- protected ScriptBuffer getInvokeFragment(Object[] args, WebContext wctx) {
-
- ScriptBuffer sb = new ScriptBuffer();
- sb.appendScript(referenceFunction);
- sb.appendScript("(");
- if (args != null) {
- for (int i = 0; i < args.length; i++) {
- sb.appendData(args[i]);
- if (i < (args.length - 1)) {
- sb.appendScript(", ");
- }
- }
- }
- sb.appendScript(");");
-
- return sb;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRInvokerFactory.java b/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRInvokerFactory.java
deleted file mode 100644
index 1d073c9ecf..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRInvokerFactory.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.dwr;
-
-import static org.apache.tuscany.sca.binding.dwr.DWRService.SERVLET_PATH;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.extension.helper.ComponentLifecycle;
-import org.apache.tuscany.sca.extension.helper.InvokerFactory;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-
-/**
- * InvokerFactory for the DWRBinding.
- *
- * @version $Rev$ $Date$
- */
-public class DWRInvokerFactory implements InvokerFactory, ComponentLifecycle {
-
- private Binding binding;
- private ServletHost servletHost;
-
- public DWRInvokerFactory(RuntimeComponent rc, RuntimeComponentReference rcr, Binding b, DWRBinding ab, ServletHost servletHost) {
- this.binding = b;
- this.servletHost = servletHost;
- }
-
- public Invoker createInvoker(Operation operation) {
- return new DWRInvoker(binding.getName(), operation);
- }
-
- public void start() {
-
- DWRServlet servlet = (DWRServlet) servletHost.getServletMapping(SERVLET_PATH);
- if (servlet == null) {
- servlet = new DWRServlet();
- servletHost.addServletMapping(SERVLET_PATH, servlet);
- }
-
- servlet.addReference(binding.getName());
- }
-
- public void stop() {
- servletHost.removeServletMapping(SERVLET_PATH);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRService.java b/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRService.java
deleted file mode 100644
index 7d5a7f1677..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRService.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.dwr;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.extension.helper.ComponentLifecycle;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * DWR Service.
- *
- * @version $Rev$ $Date$
- */
-public class DWRService implements ComponentLifecycle {
-
- private RuntimeComponent rc;
- private RuntimeComponentService rcs;
- private Binding binding;
- private ServletHost servletHost;
-
- static final String SERVLET_PATH = "/SCADomain/*";
-
- public DWRService(RuntimeComponent rc, RuntimeComponentService rcs, Binding binding, DWRBinding ab, ServletHost servletHost) {
- this.rc = rc;
- this.rcs = rcs;
- this.binding = binding;
- this.servletHost = servletHost;
- }
-
- public void start() {
-
- DWRServlet servlet = (DWRServlet) servletHost.getServletMapping(SERVLET_PATH);
- if (servlet == null) {
- servlet = new DWRServlet();
- servletHost.addServletMapping(SERVLET_PATH, servlet);
- }
-
- // Create a Java proxy to the target service
- Class<?> type = ((JavaInterface)rcs.getInterfaceContract().getInterface()).getJavaClass();
- Object proxy = Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, new InvocationHandler() {
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- RuntimeWire wire = rcs.getRuntimeWire(binding);
- Operation op = JavaInterfaceUtil.findOperation(method, rcs.getInterfaceContract().getInterface().getOperations());
- return wire.invoke(op, args);
- }});
-
- servlet.addService(binding.getName(), type, proxy);
- }
-
- public void stop() {
- servletHost.removeServletMapping(SERVLET_PATH);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRServlet.java b/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRServlet.java
deleted file mode 100644
index 3a2471d8f3..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRServlet.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.dwr;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.directwebremoting.Container;
-import org.directwebremoting.create.AbstractCreator;
-import org.directwebremoting.extend.CreatorManager;
-import org.directwebremoting.extend.Handler;
-import org.directwebremoting.extend.Remoter;
-import org.directwebremoting.servlet.DwrServlet;
-import org.directwebremoting.servlet.EngineHandler;
-import org.directwebremoting.servlet.PathConstants;
-import org.directwebremoting.servlet.UrlProcessor;
-
-/**
- * Tuscany customized DWR Servlet to implement support for the DWR binding
- *
- * Handles requests for SCA services and references that use <binding.dwr>,
- * and also the HTTP GET for the Tuscany DWR system script "scaDomain.js"
- *
- * @version $Rev$ $Date$
- */
-public class DWRServlet extends DwrServlet {
- private static final long serialVersionUID = 1L;
-
- private transient Map<String, ServiceHolder> services;
- private transient List<String> referenceNames;
- private transient boolean initialized;
- private transient Map<String, String> initParams;
-
- private static final String SCADOMAIN_SCRIPT_PATH = "/scaDomain.js";
-
- public DWRServlet() {
- this.services = new HashMap<String, ServiceHolder>();
- this.referenceNames = new ArrayList<String>();
-
- this.initParams = new HashMap<String, String>();
- // maybe use <binding.dwr> attributes to define the init params
- initParams.put("activeReverseAjaxEnabled", "true");
- }
-
- @Override
- public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
- super.service(req, res);
- }
-
- /**
- * Initialize the Servlet
- * There is a single instance of this Servlet which is registered
- * for multiple path mappings, but the init should only run once.
- */
- @Override
- public void init(ServletConfig servletConfig) throws ServletException {
- if (!initialized) {
- super.init(patchConfig(servletConfig));
- addScriptHandler();
- initServices();
- initialized = true;
- }
- }
-
- /**
- * Add in the handler to process the HTTP get for /sca/scaDomain.js
- *
- * This wrappers the DWR Engine handler which returns the DWR engine.js script,
- * this wrappers that handler so as to add Tuscany specific header and footer code
- * to the DWR engine.js to define the Tuscany SCADomain control functions and
- * functions for each SCA service and reference that use <binding.dwr>.
- */
- private void addScriptHandler() {
-
- UrlProcessor urlProcessor = (UrlProcessor)getContainer().getBean(UrlProcessor.class.getName());
-
- final EngineHandler engineHandler =
- (EngineHandler)getContainer().getBean(PathConstants.URL_PREFIX + "/engine.js");
-
- final Handler scaDomainScriptHandler = new Handler() {
- public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException {
- PrintWriter out = response.getWriter();
- out.println("/** Apache Tuscany scaDomain.js Header */");
-
- engineHandler.handle(request, response);
-
- tuscanyFooter(request, out);
- }
-
- };
-
- // add the scaDomainScriptHandler to the urlProcessor
- // bit of a hack, there's probably cleaner way to get it registered
- urlProcessor.afterContainerSetup(new Container() {
- public Object getBean(String name) {
- return scaDomainScriptHandler;
- }
- public Collection getBeanNames() {
- return Arrays.asList(new String[] {PathConstants.URL_PREFIX + SCADOMAIN_SCRIPT_PATH});
- }
- });
- }
-
- /**
- * Adds the JavaScript defining SCADomain, its control functions,
- * and functions for all the available SCA services and references.
- */
- private void tuscanyFooter(HttpServletRequest request, PrintWriter out) {
- out.println("/** Apache Tuscany scaDomain.js Footer */");
- out.println();
- out.println("function scaDomain() { }");
- out.println();
- out.println("// SCA services");
-
- // Use the DWR remoter to generate the JavaScipt function for each SCA service
- Remoter remoter = (Remoter)getContainer().getBean(Remoter.class.getName());
-
- String path = request.getContextPath() + request.getServletPath();
-
- for (String serviceName : services.keySet()) {
- String serviceScript = remoter.generateInterfaceScript(serviceName, path);
- out.println(serviceScript);
- }
-
- if (referenceNames.size() > 0) {
-
- out.println("// SCA reverse ajax control functions");
- out.println();
- out.println("scaDomain.open = function() { dwr.engine.setActiveReverseAjax(true); };");
- out.println("scaDomain.close = function() { dwr.engine.setActiveReverseAjax(false); };");
-
- out.println();
- out.println("// SCA references");
- out.println();
-
- // the JavaScript function for SCA references has an
- // empty impl as it uses DWR severside "push"
- for (String referenceName : referenceNames) {
- out.println("function " + referenceName + "() { }");
- }
- }
-
- out.println();
- out.println("/** End of Apache Tuscany scaDomain.js */");
- out.println();
- }
-
- /**
- * Add an SCA reference to be added to the DWR runtime
- */
- public void addReference(String name) {
- referenceNames.add(name);
- }
-
- /**
- * Add an SCA service to be added to the DWR runtime
- */
- public void addService(String name, final Class type, final Object instance) {
- ServiceHolder holder = new ServiceHolder();
- holder.name = name;
- holder.type = type;
- holder.instance = instance;
- services.put(name, holder);
- }
-
- /**
- * Defines each SCA service proxy instance to DWR
- */
- private void initServices() {
- CreatorManager creatorManager = (CreatorManager)getContainer().getBean(CreatorManager.class.getName());
-
- for (final ServiceHolder holder : services.values()) {
- creatorManager.addCreator(holder.name, new AbstractCreator() {
- public Class getType() {
- return holder.type;
- }
-
- public Object getInstance() throws InstantiationException {
- return holder.instance;
- }
- });
- }
- }
-
- // utility class to aid passing around services
- private class ServiceHolder {
- String name;
- Class type;
- Object instance;
- }
-
- /**
- * Patch the ServletConfig to enable setting init params for DWR
- * and so DWR can't see the Tuscany servlet's init params.
- */
- private ServletConfig patchConfig(final ServletConfig servletConfig) {
- ServletConfig patchedContext = new ServletConfig() {
- public String getInitParameter(String name) {
- return initParams.get(name);
- }
- public Enumeration getInitParameterNames() {
- return Collections.enumeration(initParams.keySet());
- }
- public ServletContext getServletContext() {
- return servletConfig.getServletContext();
- }
- public String getServletName() {
- return servletConfig.getServletName();
- }
- };
- return patchedContext;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator b/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator
deleted file mode 100644
index 1a9f91fab2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-dwr-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.extension.helper.BindingActivator
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# Implementation class for the ExtensionActivator
-org.apache.tuscany.sca.binding.dwr.DWRBindingActivator
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/LICENSE b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/META-INF/MANIFEST.MF
deleted file mode 100644
index f2a680cbad..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,31 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.binding.rmi.provider;version="
- 1.4"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA RMI Binding Extension
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397324375
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA RMI Binding Extension
-Import-Package: org.objectweb.asm,
- net.sf.cglib.core,
- net.sf.cglib.proxy,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.binding.rmi;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.host.rmi;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.impl;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.oasisopen.sca;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0";resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.rmi.runtime
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/NOTICE b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/pom.xml b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/pom.xml
deleted file mode 100644
index bab2ebdb7b..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/pom.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <name>Apache Tuscany SCA RMI Binding Extension</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-rmi</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- <version>2.2</version>
- </dependency>
-
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- <version>3.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingInvoker.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingInvoker.java
deleted file mode 100644
index 9eec4aa6a8..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingInvoker.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.rmi.provider;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.rmi.Remote;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import org.apache.tuscany.sca.host.rmi.RMIHost;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-/**
- * Invoker for RMI References.
- *
- * @version $Rev$ $Date$
- */
-public class RMIBindingInvoker implements Invoker, DataExchangeSemantics {
-
- private RMIHost rmiHost;
- private String uri;
- private Method remoteMethod;
- private Remote proxy;
-
- public RMIBindingInvoker(RMIHost rmiHost, String uri, Method remoteMethod) {
- this.rmiHost = rmiHost;
- this.remoteMethod = remoteMethod;
- this.uri = uri;
- }
-
- public Message invoke(Message msg) {
- try {
-
- Object[] args = msg.getBody();
- Object resp = invokeTarget(args);
- msg.setBody(resp);
-
- } catch (InvocationTargetException e) {
- msg.setFaultBody(e.getCause());
- } catch (Throwable e) {
- msg.setFaultBody(e);
- }
-
- return msg;
- }
-
- public Object invokeTarget(final Object payload) throws InvocationTargetException, SecurityException,
- NoSuchMethodException, IllegalArgumentException, IllegalAccessException {
- if (proxy == null) {
- final Class<?> remote = remoteMethod.getDeclaringClass();
- final ClassLoader stubClassLoader = remote.getClassLoader();
- // The generated remote interface is not available for the service lookup
- final ClassLoader tccl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(stubClassLoader);
- return tccl;
- }
- });
- try {
- proxy = rmiHost.findService(uri);
- } finally {
- AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- ClassLoader current = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(tccl);
- return current;
- }
- });
- }
- }
-
- remoteMethod = proxy.getClass().getMethod(remoteMethod.getName(), remoteMethod.getParameterTypes());
-
- if (payload != null && !payload.getClass().isArray()) {
- return remoteMethod.invoke(proxy, payload);
- } else {
- return remoteMethod.invoke(proxy, (Object[])payload);
- }
- }
-
- public boolean allowsPassByReference() {
- // RMI always pass by value
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingProviderFactory.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingProviderFactory.java
deleted file mode 100644
index 11a03a4768..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIBindingProviderFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.rmi.provider;
-
-import org.apache.tuscany.sca.binding.rmi.RMIBinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.rmi.ExtensibleRMIHost;
-import org.apache.tuscany.sca.host.rmi.RMIHost;
-import org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * RMI Binding Provider Factory
- *
- * @version $Rev$ $Date$
- */
-public class RMIBindingProviderFactory implements BindingProviderFactory<RMIBinding> {
-
- private RMIHost rmiHost;
-
- public RMIBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- RMIHostExtensionPoint rmiHosts = extensionPoints.getExtensionPoint(RMIHostExtensionPoint.class);
- this.rmiHost = new ExtensibleRMIHost(rmiHosts);
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- RMIBinding binding) {
-
- return new RMIReferenceBindingProvider(component, reference, binding, rmiHost);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- RMIBinding binding) {
- return new RMIServiceBindingProvider(component, service, binding, rmiHost);
- }
-
- public Class<RMIBinding> getModelType() {
- return RMIBinding.class;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java
deleted file mode 100644
index 8a368a26c3..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIReferenceBindingProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.rmi.provider;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.binding.rmi.RMIBinding;
-import org.apache.tuscany.sca.host.rmi.RMIHost;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-
-/**
- * Implementation of the RMI Binding Provider for References
- *
- * @version $Rev$ $Date$
- */
-public class RMIReferenceBindingProvider implements ReferenceBindingProvider {
-
- private RuntimeComponentReference reference;
- private RMIBinding binding;
- private RMIHost rmiHost;
-
- public RMIReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- RMIBinding binding,
- RMIHost rmiHost) {
- this.reference = reference;
- this.binding = binding;
- this.rmiHost = rmiHost;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- public Invoker createInvoker(Operation operation) {
- Class<?> iface = ((JavaInterface)reference.getInterfaceContract().getInterface()).getJavaClass();
- Method remoteMethod;
- try {
- remoteMethod = JavaInterfaceUtil.findMethod(iface, operation);
- } catch (NoSuchMethodException e) {
- throw new IllegalArgumentException(e);
- }
-
- return new RMIBindingInvoker(rmiHost, binding.getURI(), remoteMethod);
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java
deleted file mode 100644
index 2efb470d33..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RMIServiceBindingProvider.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.rmi.provider;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.rmi.NoSuchObjectException;
-import java.rmi.Remote;
-import java.rmi.server.UnicastRemoteObject;
-import java.security.AccessController;
-import java.security.PrivilegedExceptionAction;
-
-import net.sf.cglib.proxy.Enhancer;
-import net.sf.cglib.proxy.MethodInterceptor;
-import net.sf.cglib.proxy.MethodProxy;
-
-import org.apache.tuscany.sca.binding.rmi.RMIBinding;
-import org.apache.tuscany.sca.host.rmi.RMIHost;
-import org.apache.tuscany.sca.host.rmi.RMIHostException;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Implementation of a Service for the RMIBinding.
- *
- * @version $Rev$ $Date$
- */
-public class RMIServiceBindingProvider implements ServiceBindingProvider {
-
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private RMIBinding binding;
- private RMIHost rmiHost;
- private RuntimeWire wire;
- private Remote rmiProxy;
-
- public RMIServiceBindingProvider(RuntimeComponent rc, RuntimeComponentService rcs, RMIBinding binding, RMIHost rmiHost) {
- this.component = rc;
- this.service = rcs;
- this.binding = binding;
- this.rmiHost = rmiHost;
- }
-
- public void start() {
- // URI uri = URI.create(component.getURI() + "/" + binding.getName());
- // binding.setURI(uri.toString());
-
- wire = service.getRuntimeWire(binding);
- Interface serviceInterface = service.getInterfaceContract().getInterface();
-
- rmiProxy = createRmiService(serviceInterface);
-
- try {
-
- rmiHost.registerService(binding.getURI(), rmiProxy);
-
- } catch (RMIHostException e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public void stop() {
- rmiHost.unregisterService(binding.getURI());
- try {
- UnicastRemoteObject.unexportObject(rmiProxy, false);
- } catch (NoSuchObjectException e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- private int getPort(String port) {
- int portNumber = RMIHost.RMI_DEFAULT_PORT;
- if (port != null && port.length() > 0) {
- portNumber = Integer.decode(port);
- }
- return portNumber;
- }
-
- private Remote createRmiService(final Interface serviceInterface) {
- Enhancer enhancer = new Enhancer();
- enhancer.setSuperclass(UnicastRemoteObject.class);
- enhancer.setCallback(new MethodInterceptor() {
- public Object intercept(Object arg0, Method method, Object[] args, MethodProxy arg3) throws Throwable {
- try {
- return invokeTarget(JavaInterfaceUtil.findOperation(method, serviceInterface.getOperations()), args);
- } catch (InvocationTargetException e) {
- final Throwable cause = e.getCause();
- for (Class<?> declaredType : method.getExceptionTypes()) {
- if (declaredType.isInstance(cause)) {
- throw e;
- }
- }
-
- if (cause.getCause() != null) {
- // TUSCANY-2545: don't inlcude nested cause object
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws Exception {
- Field field = Throwable.class.getDeclaredField("cause");
- field.setAccessible(true);
- field.set(cause, null);
- field.setAccessible(false);
- return null;
- }
- });
- }
-
- throw cause;
- }
- }
- });
- Class<?> targetJavaInterface = getTargetJavaClass(serviceInterface);
- targetJavaInterface = RemoteInterfaceGenerator.generate(targetJavaInterface);
- enhancer.setClassLoader(targetJavaInterface.getClassLoader());
- enhancer.setInterfaces(new Class[] {targetJavaInterface});
- return (Remote)enhancer.create();
- }
-
- private Object invokeTarget(Operation op, Object[] args) throws InvocationTargetException {
- return wire.invoke(op, args);
- }
-
- private Class<?> getTargetJavaClass(Interface targetInterface) {
- // TODO: right now assume that the target is always a Java
- // Implementation. Need to figure out
- // how to generate Java Interface in cases where the target is not a
- // Java Implementation
- return ((JavaInterface)targetInterface).getJavaClass();
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RemoteInterfaceGenerator.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RemoteInterfaceGenerator.java
deleted file mode 100644
index b351bfacc7..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/java/org/apache/tuscany/sca/binding/rmi/provider/RemoteInterfaceGenerator.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.rmi.provider;
-
-import java.lang.reflect.Method;
-import java.rmi.Remote;
-import java.util.Collections;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import net.sf.cglib.core.Constants;
-
-import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.Type;
-
-/**
- *
- */
-public class RemoteInterfaceGenerator {
- private final static Map<Class<?>, Class<? extends Remote>> remoteInterfaces =
- Collections.synchronizedMap(new WeakHashMap<Class<?>, Class<? extends Remote>>());
-
- static class RemoteInterfaceClassLoader extends ClassLoader {
- public RemoteInterfaceClassLoader(ClassLoader parent) {
- super(parent);
- }
-
- public Class<?> defineClass(String name, byte[] byteArray) {
- return defineClass(name, byteArray, 0, byteArray.length);
- }
- }
-
- /**
- * if the interface of the component whose serviceBindings must be exposed as RMI Service, does not
- * implement java.rmi.Remote, then generate such an interface. This method will stop with just
- * generating the bytecode. Defining the class from the byte code must be the responsibility of the
- * caller of this method, since it requires a ClassLoader to be created to define and load this interface.
- */
- private static byte[] generateRemoteInterface(Class<?> serviceInterface) {
- String interfazeName = serviceInterface.getName();
- ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
-
- cw.visit(Constants.V1_5, Constants.ACC_PUBLIC + Constants.ACC_ABSTRACT + Constants.ACC_INTERFACE, interfazeName
- .replace('.', '/'), null, "java/lang/Object", new String[] {"java/rmi/Remote"});
-
- StringBuffer argsAndReturn = null;
- Method[] methods = serviceInterface.getMethods();
- for (Method method : methods) {
- argsAndReturn = new StringBuffer("(");
- Class<?>[] paramTypes = method.getParameterTypes();
- Class<?> returnType = method.getReturnType();
-
- for (Class<?> paramType : paramTypes) {
- argsAndReturn.append(Type.getType(paramType));
- }
- argsAndReturn.append(")");
- argsAndReturn.append(Type.getType(returnType));
-
- cw.visitMethod(Constants.ACC_PUBLIC + Constants.ACC_ABSTRACT,
- method.getName(),
- argsAndReturn.toString(),
- null,
- new String[] {"java/rmi/RemoteException"});
- }
- cw.visitEnd();
- return cw.toByteArray();
- }
-
- public static Class<? extends Remote> generate(Class<?> javaInterface) {
- if (!Remote.class.isAssignableFrom(javaInterface)) {
- Class<? extends Remote> remote = remoteInterfaces.get(javaInterface);
- if (remote == null) {
- RemoteInterfaceClassLoader classloader = new RemoteInterfaceClassLoader(javaInterface.getClassLoader());
- final byte[] byteCode = generateRemoteInterface(javaInterface);
- javaInterface = classloader.defineClass(javaInterface.getName(), byteCode);
- remote = (Class<? extends Remote>)javaInterface;
- remoteInterfaces.put(javaInterface, remote);
- }
- return remote;
- } else {
- return (Class<? extends Remote>)javaInterface;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index b188c24a20..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the binding extension
-org.apache.tuscany.sca.binding.rmi.provider.RMIBindingProviderFactory;model=org.apache.tuscany.sca.binding.rmi.RMIBinding
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloException.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloException.java
deleted file mode 100644
index cbc860ecc6..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package helloworld;
-
-/**
- * @version $Rev$ $Date$
- */
-public class HelloException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 2570611055132507470L;
-
- /**
- *
- */
- public HelloException() {
- }
-
- /**
- * @param message
- */
- public HelloException(String message) {
- super(message);
- }
-
- /**
- * @param cause
- */
- public HelloException(Throwable cause) {
- super(cause);
- }
-
- /**
- * @param message
- * @param cause
- */
- public HelloException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldImpl.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldImpl.java
deleted file mode 100644
index cd7a0fd625..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package helloworld;
-
-import org.oasisopen.sca.annotation.Service;
-
-
-/**
- * This class implements the HelloWorld service.
- *
- * @version $Rev$ $Date$
- */
-@Service(HelloWorldService.class)
-public class HelloWorldImpl implements HelloWorldService {
-
- public String sayHello(String name) {
- return "Hello from the RMI Service to - " + name;
- }
-
- public String sayHi(String name, String greeter) throws HelloException {
- if (name == null || greeter == null) {
- throw new HelloException("Invalid name or greeter: name=" + name + " greeter=" + greeter);
- }
- return "Hi from " + greeter + " in RMI Service to - " + name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldRmiImpl.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldRmiImpl.java
deleted file mode 100644
index 89ea795529..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldRmiImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package helloworld;
-
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements the HelloWorld service.
- *
- * @version $Rev$ $Date$
- */
-@Service(HelloWorldRmiService.class)
-public class HelloWorldRmiImpl implements HelloWorldRmiService {
- private HelloWorldService extService;
-
- public HelloWorldService getExtService() {
- return extService;
- }
-
- @Reference
- public void setExtService(HelloWorldService extService) {
- this.extService = extService;
- }
-
- public String sayRmiHello(String name) {
- return extService.sayHello(name) + " thro the RMI Reference";
- }
-
- public String sayRmiHi(String name, String greeter) throws HelloException {
- return extService.sayHi(name, greeter) + " thro the RMI Reference";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldRmiService.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldRmiService.java
deleted file mode 100644
index 461c176e1e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldRmiService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package helloworld;
-
-/**
- * This is the business interface of the HelloWorld greetings service.
- *
- * @version $Rev$ $Date$
- */
-public interface HelloWorldRmiService {
-
- String sayRmiHello(String name);
- String sayRmiHi(String name, String greeter) throws HelloException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldService.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldService.java
deleted file mode 100644
index 3b705d2c97..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/helloworld/HelloWorldService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package helloworld;
-
-/**
- * This is the business interface of the HelloWorld greetings service.
- *
- * @version $Rev$ $Date$
- */
-public interface HelloWorldService {
-
- String sayHello(String name);
- String sayHi(String name, String greeter) throws HelloException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
deleted file mode 100644
index c62e3a6b8b..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.rmi;
-
-import helloworld.HelloException;
-import helloworld.HelloWorldRmiService;
-import junit.framework.Assert;
-
-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;
-
-/**
- * Tests for the RMIBinding.
- *
- * @version $Rev$ $Date$
- */
-public class BindingTestCase {
- private static HelloWorldRmiService helloWorldRmiService;
- private static Node node;
-
- @Test
- public void testRmiService() {
- String msg = helloWorldRmiService.sayRmiHello("Tuscany World!");
- System.out.println(msg);
- Assert.assertEquals("Hello from the RMI Service to - Tuscany World! thro the RMI Reference", msg);
-
- try {
- msg = helloWorldRmiService.sayRmiHi("Tuscany World!", "Apache World");
- System.out.println(msg);
- Assert.assertEquals("Hi from Apache World in RMI Service to - Tuscany World! thro the RMI Reference", msg);
- } catch (HelloException e) {
- Assert.fail(e.getMessage());
- }
- try {
- msg = helloWorldRmiService.sayRmiHi(null, "Apache World");
- Assert.fail("HelloException should have been thrown");
- } catch (HelloException e) {
- System.out.println("Expected exception :" + e.getClass().getName());
- }
- }
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- String contribution = ContributionLocationHelper.getContributionLocation(BindingTestCase.class);
- node = NodeFactory.newInstance().createNode("RMIBindingTest.composite", new Contribution("test", contribution));
- node.start();
- helloWorldRmiService = node.getService(HelloWorldRmiService.class, "HelloWorldRmiServiceComponent");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/HelloWorldImpl.componentType b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/HelloWorldImpl.componentType
deleted file mode 100644
index 224a68f88d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/HelloWorldImpl.componentType
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <service name="HelloWorldService">
- <interface.java interface="helloworld.HelloWorldService"/>
- </service>
-</componentType>
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/HelloWorldRmiImpl.componentType b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/HelloWorldRmiImpl.componentType
deleted file mode 100644
index a83e7e6d1d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/HelloWorldRmiImpl.componentType
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <service name="HelloWorldRmiService">
- <interface.java interface="helloworld.HelloWorldRmiService"/>
- </service>
- <reference name="extService">
- <interface.java interface="helloworld.HelloWorldService"/>
- </reference>
-</componentType>
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/RMIBindingTest.composite b/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/RMIBindingTest.composite
deleted file mode 100644
index 2a0bcf0f76..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi-runtime/src/test/resources/RMIBindingTest.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- name="HelloWorldRmiComposite">
-
- <service name="HelloWorldRmiService" promote="HelloWorldServiceComponent">
- <interface.java interface="helloworld.HelloWorldService"/>
- <tuscany:binding.rmi uri="rmi://localhost:8099/HelloWorldRemoteService" />
- </service>
-
- <component name="HelloWorldServiceComponent">
- <implementation.java class="helloworld.HelloWorldImpl"/>
- </component>
-
- <component name="HelloWorldRmiServiceComponent">
- <implementation.java class="helloworld.HelloWorldRmiImpl"/>
- <reference name="extService"></reference>
- </component>
-
- <reference name="HelloWorldRmiReference" promote="HelloWorldRmiServiceComponent/extService">
- <interface.java interface="helloworld.HelloWorldService"/>
- <tuscany:binding.rmi uri="rmi://localhost:8099/HelloWorldRemoteService" />
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi/LICENSE b/tags/java/sca/2.0-M1/modules/binding-rmi/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/binding-rmi/META-INF/MANIFEST.MF
deleted file mode 100644
index a6e936016c..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.binding.rmi;uses:="org.apache.t
- uscany.sca.assembly";version="2.0.0"
-Private-Package: org.apache.tuscany.sca.binding.rmi.impl;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA RMI Binding Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397320062
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA RMI Binding Model
-Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.xml;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.binding.rmi;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.rmi
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi/NOTICE b/tags/java/sca/2.0-M1/modules/binding-rmi/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi/pom.xml b/tags/java/sca/2.0-M1/modules/binding-rmi/pom.xml
deleted file mode 100644
index c551fa8e22..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-rmi</artifactId>
- <name>Apache Tuscany SCA RMI Binding Model</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java b/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java
deleted file mode 100644
index 02ecc6b65c..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.rmi;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-/**
- * RMI Binding model
- *
- * @version $Rev$ $Date$
- */
-public interface RMIBinding extends Binding {
-
- /**
- * @return the host name of the RMI Service
- */
- String getHost();
-
- /**
- * @return the port number for the RMI Service
- */
- String getPort();
-
- /**
- * @return returns the RMI Service Name
- */
- String getServiceName();
-
- /**
- * @param rmiHostName the hostname of the RMI Service
- */
- void setHost(String rmiHostName);
-
- /**
- * @param rmiPort the port number for the RMI Service
- */
- void setPort(String rmiPort);
-
- /**
- * Sets the service name for the RMI Server
- *
- * @param rmiServiceName the name of the RMI service
- */
- void setServiceName(String rmiServiceName);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java b/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java
deleted file mode 100644
index 38445fa838..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.rmi;
-
-/**
- * Factory to create RMIBinding instances
- *
- * @version $Rev$ $Date$
- */
-public interface RMIBindingFactory {
- /**
- * Create RMIBinding model
- * @return
- */
- RMIBinding createRMIBinding();
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingFactoryImpl.java b/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingFactoryImpl.java
deleted file mode 100644
index dfe96105e8..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingFactoryImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.rmi.impl;
-
-import org.apache.tuscany.sca.binding.rmi.RMIBinding;
-import org.apache.tuscany.sca.binding.rmi.RMIBindingFactory;
-
-/**
- * Factory implementation to create RMI Models
- *
- * @version $Rev$ $Date$
- */
-public class RMIBindingFactoryImpl implements RMIBindingFactory {
- public RMIBinding createRMIBinding() {
- // TODO Auto-generated method stub
- return new RMIBindingImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingImpl.java b/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingImpl.java
deleted file mode 100644
index 4acb9783f5..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/impl/RMIBindingImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.rmi.impl;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.apache.tuscany.sca.binding.rmi.RMIBinding;
-
-/**
- * Represents a binding to an RMI service.
- *
- * @version $Rev$ $Date$
- */
-public class RMIBindingImpl implements RMIBinding {
- private String name;
- private String uri;
- private String host;
- private String port;
- private String serviceName;
-
- /**
- * @return the host name of the RMI Service
- */
- public String getHost() {
- return host;
- }
-
- /**
- * @param rmiHostName the hostname of the RMI Service
- */
- public void setHost(String rmiHostName) {
- this.host = rmiHostName;
- }
-
- /**
- * @return the port number for the RMI Service
- */
- public String getPort() {
- return port;
- }
-
- /**
- * @param rmiPort the port number for the RMI Service
- */
- public void setPort(String rmiPort) {
- this.port = rmiPort;
- }
-
- /**
- * @return returns the RMI Service Name
- */
- public String getServiceName() {
- return serviceName;
- }
-
- /**
- * Sets the service name for the RMI Server
- *
- * @param rmiServiceName the name of the RMI service
- */
- public void setServiceName(String rmiServiceName) {
- this.serviceName = rmiServiceName;
- }
-
- public String getName() {
- return name;
- }
-
- public String getURI() {
- compose();
- return uri;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- parse(uri);
- }
-
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- // The sample binding is always resolved
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- /*
- rmi://[host][:port][/[object]]
- rmi:[/][object]
- */
- private void parse(String uriStr) {
- if (uriStr == null) {
- return;
- }
- URI uri = URI.create(uriStr);
- if (host == null) {
- this.host = uri.getHost();
- }
- if (port == null) {
- this.port = String.valueOf(uri.getPort());
- }
- if (serviceName == null) {
- String path = uri.getPath();
- if (path != null && path.charAt(0) == '/') {
- path = path.substring(1);
- }
- this.serviceName = path;
- }
- }
-
- private void compose() {
- if (uri == null) {
- int p = -1;
- if (port != null && port.length() > 0) {
- p = Integer.decode(port);
- }
- String path = serviceName;
- if (path != null) {
- path = "/" + path;
- }
- try {
- uri = new URI("rmi", null, host, p, path, null, null).toString();
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException(e);
- }
- }
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rmi.RMIBindingFactory b/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rmi.RMIBindingFactory
deleted file mode 100644
index 889fcafae2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rmi.RMIBindingFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for model factory
-org.apache.tuscany.sca.binding.rmi.impl.RMIBindingFactoryImpl
diff --git a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 56532d4f82..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#binding.rmi,model=org.apache.tuscany.sca.binding.rmi.RMIBinding,factory=org.apache.tuscany.sca.binding.rmi.RMIBindingFactory
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca-xml/LICENSE b/tags/java/sca/2.0-M1/modules/binding-sca-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/binding-sca-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index a814b20348..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,26 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.binding.sca.xml;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Default Binding XML Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397190578
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Default Binding XML Model
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.builder;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.assembly.xml;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.sca.xml
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca-xml/NOTICE b/tags/java/sca/2.0-M1/modules/binding-sca-xml/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca-xml/pom.xml b/tags/java/sca/2.0-M1/modules/binding-sca-xml/pom.xml
deleted file mode 100644
index 5550696b6b..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca-xml/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-sca-xml</artifactId>
- <name>Apache Tuscany SCA Binding SCA XML Model</name>
-
- <dependencies>
-
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java b/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java
deleted file mode 100644
index 56468c8204..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.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.assembly.xml.Constants;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-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.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * A processor to read the XML that describes the SCA binding.
- *
- * @version $Rev$ $Date$
- */
-
-public class SCABindingProcessor implements StAXArtifactProcessor<SCABinding>, Constants{
-
- private PolicyFactory policyFactory;
- private SCABindingFactory scaBindingFactory;
- private PolicyAttachPointProcessor policyProcessor;
- private IntentAttachPointTypeFactory intentAttachPointTypeFactory;
-
- protected static final String BINDING_SCA = "binding.sca";
- protected static final QName BINDING_SCA_QNAME = new QName(Constants.SCA10_NS, BINDING_SCA);
-
- public SCABindingProcessor(FactoryExtensionPoint modelFactories) {
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
- policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- this.intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.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();
- IntentAttachPointType bindingType = intentAttachPointTypeFactory.createBindingType();
- bindingType.setName(getArtifactType());
- bindingType.setUnresolved(true);
- ((PolicySetAttachPoint)scaBinding).setType(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(Constants.SCA10_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/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 3b002cf6b6..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.binding.sca.xml.SCABindingProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#binding.sca,model=org.apache.tuscany.sca.assembly.SCABinding
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java b/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java
deleted file mode 100644
index 42b2f1c248..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.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/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java b/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java
deleted file mode 100644
index 887dbb059a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.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://www.osoa.org/xmlns/sca/1.0\" xmlns:ns1=\"http://www.osoa.org/xmlns/sca/1.0\"><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://www.osoa.org/xmlns/sca/1.0\" xmlns:ns1=\"http://www.osoa.org/xmlns/sca/1.0\" 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/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/resources/Calculator.composite b/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/resources/Calculator.composite
deleted file mode 100644
index 0be16ec536..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/resources/Calculator.composite
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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: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/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/resources/CalculatorServiceImpl.componentType b/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/resources/CalculatorServiceImpl.componentType
deleted file mode 100644
index 55e8926504..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca-xml/src/test/resources/CalculatorServiceImpl.componentType
+++ /dev/null
@@ -1,33 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
- <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/tags/java/sca/2.0-M1/modules/binding-sca/LICENSE b/tags/java/sca/2.0-M1/modules/binding-sca/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/binding-sca/META-INF/MANIFEST.MF
deleted file mode 100644
index 9d5ca9e53f..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,31 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.binding.sca.impl;version="2.0.0"
- ,org.apache.tuscany.sca.binding.sca.provider;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Default Binding Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397165593
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Default Binding Model
-Import-Package: javax.xml.stream;resolution:=optional,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.builder;version="2.0.0",
- org.apache.tuscany.sca.assembly.xml;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.contribution;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.oasisopen.sca;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.sca
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/NOTICE b/tags/java/sca/2.0-M1/modules/binding-sca/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/pom.xml b/tags/java/sca/2.0-M1/modules/binding-sca/pom.xml
deleted file mode 100644
index 65844cbdef..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-sca</artifactId>
- <name>Apache Tuscany SCA Binding SCA Model</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/DistributedSCABinding.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/DistributedSCABinding.java
deleted file mode 100644
index 167c93e86d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/DistributedSCABinding.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.sca;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.SCABinding;
-
-
-/**
- * Represents an SCA binding used in the distributed runtime.
- * At the moment just provides us with a sensibly named type
- * against which the 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 {
-
- SCABinding getSCABinding();
- void setSCABinding(SCABinding scaBinding);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/DistributedSCABindingImpl.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/DistributedSCABindingImpl.java
deleted file mode 100644
index 43b0cd8f4e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/DistributedSCABindingImpl.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.sca.impl;
-
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.binding.sca.DistributedSCABinding;
-
-/**
- * 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;
-
- /**
- * Getter for the wrapped sca binding model object
- *
- * @return the sca binding model element
- */
- public SCABinding getSCABinding(){
- return scaBinding;
- }
-
- /**
- * Setter for the wrapped sca binding model element
- *
- * @param scaBinding the sca binding model element
- */
- public void setSCABinding(SCABinding scaBinding){
- this.scaBinding = scaBinding;
- }
-
-
- // Operation implementations provided to make this class a
- // valid Binding
-
- /**
- * Returns the binding URI.
- *
- * @return the binding URI
- */
- public String getURI(){
- return null;
- }
-
- /**
- * Sets the binding URI.
- *
- * @param uri the binding URI
- */
- public void setURI(String uri){
- }
-
- /**
- * Returns the binding name.
- *
- * @return the binding name
- */
- public String getName(){
- return null;
- }
-
- /**
- * Sets the binding name.
- *
- * @param name the binding name
- */
- public void setName(String name){
- }
-
- /**
- * Returns true if the model element is unresolved.
- *
- * @return true if the model element is unresolved.
- */
- public boolean isUnresolved(){
- return false;
- }
-
- /**
- * Sets whether the model element is unresolved.
- *
- * @param unresolved whether the model element is unresolved
- */
- public void setUnresolved(boolean unresolved){
- }
-
- /**
- * Clone the binding
- */
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingFactoryImpl.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingFactoryImpl.java
deleted file mode 100644
index ea758823a9..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingFactoryImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.sca.impl;
-
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-
-/**
- * A factory for the SCA binding model.
- *
- * @version $Rev$ $Date$
- */
-public class SCABindingFactoryImpl implements SCABindingFactory {
-
- public SCABindingFactoryImpl (){
-
- }
-
- public SCABinding createSCABinding() {
- return new SCABindingImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingImpl.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingImpl.java
deleted file mode 100644
index fb8ab4104c..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingImpl.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.sca.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.Extensible;
-import org.apache.tuscany.sca.assembly.Extension;
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.builder.AutomaticBinding;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * The assembly mode object for an SCA binding.
- *
- * @version $Rev$ $Date$
- */
-public class SCABindingImpl implements SCABinding, Extensible, PolicySetAttachPoint, OptimizableBinding, AutomaticBinding {
- private String name;
- private String uri;
- private List<Object> extensions = new ArrayList<Object>();
- private List<Extension> attributeExtensions = new ArrayList<Extension>();
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private IntentAttachPointType intentAttachPointType;
-
- private Component targetComponent;
- private ComponentService targetComponentService;
- private Binding targetBinding;
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-
- private boolean isAutomatic = false;
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- /**
- * Constructs a new SCA binding.
- */
- protected SCABindingImpl() {
- }
-
- // SCA Binding operations
-
- /**
- * Setters for the binding name. Defaults to the
- * name of the service or reference with which the binding is
- * associated
- *
- * @return the binding name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Setter for the binding name
- *
- * @param name the binding name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Getters for the binding URI. The computed URI for the
- * service that the reference is targeting or which the service represents
- * depending on whether the biding is associated with a reference or
- * service
- *
- * @return the binding URI
- */
- public String getURI() {
- return uri;
- }
-
- /**
- * Setter for the binding URI
- *
- * @param uri the binding URI
- */
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public List<Object> getExtensions() {
- return extensions;
- }
-
- public List<Extension> getAttributeExtensions() {
- return attributeExtensions;
- }
-
-
- /**
- * Returns true if the model element is unresolved.
- *
- * @return true if the model element is unresolved.
- */
- public boolean isUnresolved() {
- if (targetComponentService == null){
- return true;
- } else {
- return targetComponentService.isUnresolved();
- }
- }
-
- /**
- * Sets whether the model element is unresolved.
- *
- * @param unresolved whether the model element is unresolved
- */
- public void setUnresolved(boolean unresolved) {
- }
-
- /**
- * @see java.lang.Object#clone()
- */
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- public IntentAttachPointType getType() {
- return intentAttachPointType;
- }
-
- public void setType(IntentAttachPointType intentAttachPointType) {
- this.intentAttachPointType = intentAttachPointType;
- }
-
- // Wireable binding operations
-
- /**
- * @return the targetComponent
- */
- public Component getTargetComponent() {
- return targetComponent;
- }
-
- /**
- * @param targetComponent the targetComponent to set
- */
- public void setTargetComponent(Component targetComponent) {
- this.targetComponent = targetComponent;
- }
-
- /**
- * @return the targetComponentService
- */
- public ComponentService getTargetComponentService() {
- return targetComponentService;
- }
-
- /**
- * @param targetComponentService the targetComponentService to set
- */
- public void setTargetComponentService(ComponentService targetComponentService) {
- this.targetComponentService = targetComponentService;
- }
-
- /**
- * @return the targetBinding
- */
- public Binding getTargetBinding() {
- return targetBinding;
- }
-
- /**
- * @param targetBinding the targetBinding to set
- */
- public void setTargetBinding(Binding targetBinding) {
- this.targetBinding = targetBinding;
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
-
- public void setIsAutomatic(boolean isAutomatic){
- this.isAutomatic = isAutomatic;
- }
-
- public boolean getIsAutomatic(){
- return this.isAutomatic;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RemoteBindingHelper.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RemoteBindingHelper.java
deleted file mode 100644
index 29c5374d51..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RemoteBindingHelper.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCABindingProvider.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCABindingProvider.java
deleted file mode 100644
index c4daa7c727..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCABindingProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.sca.provider;
-
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-
-/**
- * The local SCA Binding provider implementation. It is not currently used.
- *
- * @version $Rev$ $Date$
- */
-public class RuntimeSCABindingProvider implements ReferenceBindingProvider {
-
- private RuntimeComponentReference reference;
-
- public RuntimeSCABindingProvider(RuntimeComponent component, RuntimeComponentReference reference, SCABinding binding) {
- this.reference = reference;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- public Invoker createInvoker(Operation operation) {
- return null;
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCABindingProviderFactory.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCABindingProviderFactory.java
deleted file mode 100644
index 5d1b3ca399..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCABindingProviderFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.sca.provider;
-
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * The factory for creating SCA Binding providers
- *
- * @version $Rev$ $Date$
- */
-public class RuntimeSCABindingProviderFactory implements BindingProviderFactory<SCABinding> {
-
- private ExtensionPointRegistry extensionPoints;
-
- public RuntimeSCABindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
-
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- SCABinding binding) {
-
- return new RuntimeSCAReferenceBindingProvider(extensionPoints, component, reference, binding);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- SCABinding binding) {
- return new RuntimeSCAServiceBindingProvider(extensionPoints, component, service, binding);
- }
-
- public Class<SCABinding> getModelType() {
- return SCABinding.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java
deleted file mode 100644
index 3c0ef4a17a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.net.URI;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.binding.sca.DistributedSCABinding;
-import org.apache.tuscany.sca.binding.sca.impl.DistributedSCABindingImpl;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.ServiceUnavailableException;
-
-/**
- * The sca reference binding provider mediates between the twin requirements of
- * local sca bindings and remote sca bindings. In the local case is does
- * very little. When the sca binding model is set as being remote (because a
- * reference target can't be resolved in the current model) this binding will
- * try and create a remote connection to it
- *
- * @version $Rev$ $Date$
- */
-public class RuntimeSCAReferenceBindingProvider implements ReferenceBindingProvider {
-
- private static final Logger logger = Logger.getLogger(RuntimeSCAReferenceBindingProvider.class.getName());
-
- private RuntimeComponent component;
- private RuntimeComponentReference reference;
- private SCABinding binding;
- private boolean started = false;
-
- private BindingProviderFactory<DistributedSCABinding> distributedProviderFactory = null;
- private ReferenceBindingProvider distributedProvider = null;
-
- public RuntimeSCAReferenceBindingProvider(ExtensionPointRegistry extensionPoints,
- RuntimeComponent component,
- RuntimeComponentReference reference,
- SCABinding binding) {
- this.component = component;
- this.reference = reference;
- this.binding = binding;
-
- // look to see if a distributed SCA binding implementation has
- // been included on the classpath. This will be needed by the
- // provider itself to do it's thing
- ProviderFactoryExtensionPoint factoryExtensionPoint =
- extensionPoints.getExtensionPoint(ProviderFactoryExtensionPoint.class);
- distributedProviderFactory =
- (BindingProviderFactory<DistributedSCABinding>)factoryExtensionPoint
- .getProviderFactory(DistributedSCABinding.class);
-
- }
-
- public boolean isTargetRemote() {
- boolean targetIsRemote = false;
-
- // first look at the target service and see if this has been resolved
- OptimizableBinding optimizableBinding = (OptimizableBinding)binding;
-
- // The decision is based on the results of the wiring process in the assembly model
- // The SCA binding is used to represent unresolved reference targets, i.e. those
- // reference targets that need resolving at run time. We can tell by lookin if the
- // service to which this binding refers is resolved or not.
- //
- // TODO - When a callback is in operation. A callback reference bindings sometimes has to
- // act as though there is a local wire and sometimes as if there is a remote wire
- // what are the implications of this here?
-
- if (RemoteBindingHelper.isTargetRemote()) {
- if (reference.getInterfaceContract() != null) {
- targetIsRemote = reference.getInterfaceContract().getInterface().isRemotable();
- } else {
- targetIsRemote = true;
- }
- } else if (optimizableBinding.getTargetComponentService() != null) {
- if (optimizableBinding.getTargetComponentService().isUnresolved() == true) {
- targetIsRemote = true;
- } else {
- targetIsRemote = false;
- }
- } else {
- // the case where the wire is specified by URI, e.g. callbacks or user specified bindings, and
- // look at the provided URI to decide whether it is a local or remote case
- try {
- URI uri = new URI(binding.getURI());
- if (uri.isAbsolute()) {
- targetIsRemote = true;
- } else {
- targetIsRemote = false;
- }
- } catch (Exception ex) {
- targetIsRemote = false;
- }
- }
- return targetIsRemote;
- }
-
- private ReferenceBindingProvider getDistributedProvider() {
-
- if (isTargetRemote()) {
- // initialize the remote provider if it hasn't been done already
- if (distributedProvider == null) {
- if (reference.getInterfaceContract() != null && !reference.getInterfaceContract().getInterface().isRemotable()) {
- throw new IllegalStateException("Reference interface not remotable for component: " + component
- .getName()
- + " and reference: "
- + reference.getName());
- }
-
- if (distributedProviderFactory == null) {
- throw new IllegalStateException("No distributed SCA binding available for component: " + component
- .getName()
- + " and reference: "
- + reference.getName());
- }
-
- // create the remote provider
- DistributedSCABinding distributedBinding = new DistributedSCABindingImpl();
- distributedBinding.setSCABinding(binding);
-
- distributedProvider =
- distributedProviderFactory.createReferenceBindingProvider(component, reference, distributedBinding);
- }
- }
-
- return distributedProvider;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- if (isTargetRemote()) {
- return getDistributedProvider().getBindingInterfaceContract();
- } else {
- if (reference.getReference() != null) {
- return reference.getReference().getInterfaceContract();
- } else {
- return reference.getInterfaceContract();
- }
- }
- }
-
- public boolean supportsOneWayInvocation() {
- if (isTargetRemote()) {
- return getDistributedProvider().supportsOneWayInvocation();
- } else {
- return false;
- }
- }
-
- private Invoker getInvoker(RuntimeWire wire, Operation operation) {
- EndpointReference target = wire.getTarget();
- if (target != null) {
- RuntimeComponentService service = (RuntimeComponentService)target.getContract();
- if (service != null) { // not a callback wire
- SCABinding scaBinding = service.getBinding(SCABinding.class);
- InvocationChain chain =
- service.getInvocationChain(scaBinding, wire.getSource().getInterfaceContract(), operation);
- return chain == null ? null : new SCABindingInvoker(chain);
- }
- }
- return null;
- }
-
- public Invoker createInvoker(Operation operation) {
- if (isTargetRemote()) {
- return getDistributedProvider().createInvoker(operation);
- } else {
- RuntimeWire wire = reference.getRuntimeWire(binding);
- Invoker invoker = getInvoker(wire, operation);
- if (invoker == null) {
- throw new ServiceUnavailableException("Unable to create SCA binding invoker for local target " + component.getName()
- + " reference "
- + reference.getName()
- + " (bindingURI="
- + binding.getURI()
- + " operation="
- + operation.getName()
- + ")" );
- }
- return invoker;
- }
- }
-
- public void start() {
- if (started) {
- return;
- } else {
- started = true;
- }
-
- if (getDistributedProvider() != null) {
- distributedProvider.start();
- }
- }
-
- public void stop() {
- if (!started) {
- return;
- } else {
- started = false;
- }
-
- if (getDistributedProvider() != null) {
- distributedProvider.stop();
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java
deleted file mode 100644
index 6a23c5011f..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.net.URI;
-
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.binding.sca.DistributedSCABinding;
-import org.apache.tuscany.sca.binding.sca.impl.DistributedSCABindingImpl;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * The sca service binding provider mediates between the twin requirements of
- * local sca bindings and remote sca bindings. In the local case is does
- * very little. When the sca binding model is set as being remote this binding will
- * try and create a remote service endpoint for remote references to connect to
- *
- * @version $Rev$ $Date$
- */
-public class RuntimeSCAServiceBindingProvider implements ServiceBindingProvider {
-
- private RuntimeComponentService service;
- private BindingProviderFactory<DistributedSCABinding> distributedProviderFactory;
- private ServiceBindingProvider distributedProvider;
- private DistributedSCABinding distributedBinding;
-
- public RuntimeSCAServiceBindingProvider(ExtensionPointRegistry extensionPoints,
- RuntimeComponent component,
- RuntimeComponentService service,
- SCABinding binding) {
- this.service = service;
- // if there is potentially a wire to this service that crosses the node boundary
- if (service.getInterfaceContract().getInterface().isRemotable()) {
-
- // look to see if a distributed SCA binding implementation has
- // been included on the classpath. This will be needed by the
- // provider itself to do it's thing
- ProviderFactoryExtensionPoint factoryExtensionPoint =
- extensionPoints.getExtensionPoint(ProviderFactoryExtensionPoint.class);
- distributedProviderFactory =
- (BindingProviderFactory<DistributedSCABinding>)factoryExtensionPoint
- .getProviderFactory(DistributedSCABinding.class);
-
- // Check the things that will generally be required to set up a
- // distributed sca domain reference provider. I.e. make sure that we have a
- // - distributed implementation of the sca binding available
- // - remotable interface on the service
- if (distributedProviderFactory != null) {
-
- URI serviceURI = null;
- try {
- serviceURI = new URI(binding.getURI());
- } catch(Exception ex) {
-
- }
-
- if (RemoteBindingHelper.isTargetRemote() || ((serviceURI != null) && (serviceURI.isAbsolute()))) {
-
- // create a nested provider to handle the remote case
- distributedBinding = new DistributedSCABindingImpl();
- distributedBinding.setSCABinding(binding);
-
- distributedProvider =
- distributedProviderFactory.createServiceBindingProvider(component, service, distributedBinding);
-
-
- } else {
- /* do nothing at the moment as only apps using the node implementation
- * will currently have the distributed domain set.
- *
- throw new IllegalStateException("No distributed domain available for component: "+
- component.getName() +
- " and service: " +
- service.getName());
- */
- }
- } else {
- /* do nothing at the moment as all services with remotable interfaces
- * are marked as remote
- throw new IllegalStateException("No distributed SCA binding available for component: "+
- component.getName() +
- " and service: " +
- service.getName());
- */
- }
- }
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- if (distributedProvider != null) {
- return distributedProvider.getBindingInterfaceContract();
- } else {
- if (service.getService() != null) {
- return service.getService().getInterfaceContract();
- } else {
- return service.getInterfaceContract();
- }
- }
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- if (distributedProvider != null) {
- distributedProvider.start();
- }
- }
-
- public void stop() {
- if (distributedProvider != null) {
- distributedProvider.stop();
- }
-
- if (distributedBinding != null) {
- // reset the binding URI to null so that if the composite containing the component
- // with the service/binding is restarted the binding will have the correct URI set
- SCABinding scaBinding = distributedBinding.getSCABinding();
- try {
- URI tempURI = new URI(scaBinding.getURI());
- if (!tempURI.isAbsolute()){
- scaBinding.setURI(null);
- }
- } catch (Exception ex){
- scaBinding.setURI(null);
- }
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingDefinitionsProvider.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingDefinitionsProvider.java
deleted file mode 100644
index b72e5d9cfc..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingDefinitionsProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.sca.provider;
-
-import java.net.URI;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
-
-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.provider.DefinitionsProvider;
-import org.apache.tuscany.sca.provider.DefinitionsProviderException;
-
-/**
- * Provider for Policy Intents and PolicySet definitions related to security
- *
- * @version $Rev$ $Date$
- */
-public class SCABindingDefinitionsProvider implements DefinitionsProvider {
- private String definitionsFile = "org/apache/tuscany/sca/binding/sca/definitions.xml";
- URLArtifactProcessor urlArtifactProcessor = null;
-
- public SCABindingDefinitionsProvider(ExtensionPointRegistry registry) {
- URLArtifactProcessorExtensionPoint documentProcessors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- urlArtifactProcessor = (URLArtifactProcessor)documentProcessors.getProcessor(Definitions.class);
- }
-
- public Definitions getDefinitions() throws DefinitionsProviderException {
- // Allow privileged access to load resource. Requires RuntimePermssion in security policy.
- final URL definitionsFileUrl = AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- return getClass().getClassLoader().getResource(definitionsFile);
- }
- });
-
- Definitions scaDefn = null;
- try {
- final URI uri = new URI(definitionsFile);
- // Allow bindings to read properties. Requires PropertyPermission read in security policy.
- scaDefn = AccessController.doPrivileged(new PrivilegedExceptionAction<Definitions>() {
- public Definitions run() throws ContributionReadException {
- return (Definitions)urlArtifactProcessor.read(null, uri, definitionsFileUrl);
- }
- });
- } catch (Exception e) {
- throw new DefinitionsProviderException(e);
- }
- return scaDefn;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingInvoker.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingInvoker.java
deleted file mode 100644
index 613c75d9bf..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingInvoker.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.sca.provider;
-
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SCABindingInvoker implements Interceptor, DataExchangeSemantics {
- private InvocationChain chain;
-
- /**
- * Construct a SCABindingInvoker that delegates to the service invocaiton chain
- * @param chain
- */
- public SCABindingInvoker(InvocationChain chain) {
- super();
- this.chain = chain;
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Interceptor#getNext()
- */
- public Invoker getNext() {
- return chain.getHeadInvoker();
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Interceptor#setNext(org.apache.tuscany.sca.invocation.Invoker)
- */
- public void setNext(Invoker next) {
- // NOOP
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Invoker#invoke(org.apache.tuscany.sca.invocation.Message)
- */
- public Message invoke(Message msg) {
- return getNext().invoke(msg);
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.DataExchangeSemantics#allowsPassByReference()
- */
- public boolean allowsPassByReference() {
- return chain.allowsPassByReference();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.SCABindingFactory b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.SCABindingFactory
deleted file mode 100644
index 4efa03a933..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.SCABindingFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.binding.sca.impl.SCABindingFactoryImpl
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index 6b2ddd8600..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the binding extension
-org.apache.tuscany.sca.binding.sca.provider.RuntimeSCABindingProviderFactory;model=org.apache.tuscany.sca.assembly.SCABinding
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider
deleted file mode 100644
index a88144344f..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for SCA Definitions Providers
-org.apache.tuscany.sca.binding.sca.provider.SCABindingDefinitionsProvider \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml b/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml
deleted file mode 100644
index 8bac9e01c9..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
-
- <sca:bindingType type="sca:binding.sca" mayProvide="" alwaysProvides=""/>
- </sca:definitions> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java b/tags/java/sca/2.0-M1/modules/binding-sca/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java
deleted file mode 100644
index 1b4b770f66..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apace.tuscany.sca.binding.sca;
-
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.assembly.xml.CompositeModelResolver;
-import org.apache.tuscany.sca.binding.sca.impl.SCABindingFactoryImpl;
-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.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * SCABindingTestCase
- *
- * @version $Rev$ $Date$
- */
-public class SCABindingTestCase {
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private CompositeModelResolver resolver;
- private CompositeBuilder compositeBuilder;
-
- @Before
- public void init() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
-
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- resolver = new CompositeModelResolver(null, null);
-
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
- IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
-
- compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
-
- }
-
- @Test
- public void testSCABindingFactory() {
- SCABindingFactory factory = new SCABindingFactoryImpl();
- Assert.assertNotNull(factory.createSCABinding());
- }
-
- @Test
- public void testBuildModel() {
- try{
- InputStream is = getClass().getResourceAsStream("/Calculator.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
-
- is.close();
- Assert.assertNotNull(composite);
-
- resolver.addModel(composite);
-
- staxProcessor.resolve(composite, resolver);
-
- 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);
- } catch (Exception ex) {
- Assert.fail(ex.getMessage());
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-sca/src/test/resources/Calculator.composite b/tags/java/sca/2.0-M1/modules/binding-sca/src/test/resources/Calculator.composite
deleted file mode 100644
index 37b26f3d68..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-sca/src/test/resources/Calculator.composite
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:calc="http://calc"
- targetNamespace="http://calc"
- 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"/>
- <service name="AddService">
- <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> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/LICENSE b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/META-INF/MANIFEST.MF
deleted file mode 100644
index ade6a717fc..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,60 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;version="2.0.0";
- uses:="org.apache.axis2,
- org.apache.tuscany.sca.runtime,
- org.apache.tuscany.sca.assembly,
- org.apache.tuscany.sca.provider,
- org.apache.tuscany.sca.core,
- org.apache.axis2.context,
- org.apache.tuscany.sca.monitor,
- org.apache.tuscany.sca.policy,
- javax.xml.namespace,
- org.apache.axiom.om,
- org.apache.axis2.description,
- javax.xml.stream,
- org.apache.axis2.engine,
- org.apache.tuscany.sca.contribution.resolver,
- org.apache.tuscany.sca.policy.util,
- org.apache.tuscany.sca.contribution.processor,
- org.oasisopen.sca",
- org.apache.tuscany.sca.binding.ws.axis2.policy.header;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany Policy Model for Axis2 WS binding
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397340328
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany Policy Model for Axis2 WS binding
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.axiom.om,
- org.apache.axiom.om.impl.llom.factory,
- org.apache.axiom.soap,
- org.apache.axis2,
- org.apache.axis2.context,
- org.apache.axis2.description,
- org.apache.axis2.engine,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.axis2.policy.header;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.databinding.axiom;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.policy.authentication.token;version="2.0.0",
- org.apache.tuscany.sca.policy.security;version="2.0.0",
- org.apache.tuscany.sca.policy.util;version="2.0.0",
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.oasisopen.sca;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.ws.axis2.policy
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/NOTICE b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/pom.xml b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/pom.xml
deleted file mode 100644
index 4689a1558f..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/pom.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-ws-axis2-policy</artifactId>
- <name>Apache Tuscany SCA Policy Model for Axis2 WS binding</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-axiom</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <exclusions>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- <version>1.2.7</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.7</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-kernel</artifactId>
- <version>1.4.1</version>
- <exclusions>
- <exclusion>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- <version>3.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.neethi</groupId>
- <artifactId>neethi</artifactId>
- <version>2.0.4</version>
- <exclusions>
- <exclusion>
- <groupId>wsdl4j</groupId>
- <artifactId>wsdl4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java
deleted file mode 100644
index 004d52be9c..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * 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 implements Policy {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- public static final QName AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME = new QName(SCA10_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/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java
deleted file mode 100644
index 7dde20af87..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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 SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
-
- 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", SCA10_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/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProviderFactory.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProviderFactory.java
deleted file mode 100644
index 805d6f80cb..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProviderFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Implementation;
-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;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @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;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createImplementationPolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.assembly.Implementation)
- */
- public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
- return null;//new TokenAuthenticationImplementationPolicyProvider(component, implementation);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createReferencePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentReference, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- return new Axis2TokenAuthenticationReferencePolicyProvider(component, reference, binding);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createServicePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentService, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createServicePolicyProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding) {
- return new Axis2TokenAuthenticationServicePolicyProvider(component, service, binding);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class getModelType() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java
deleted file mode 100644
index 41682c29b1..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-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.0/impl/java}LoggingPolicy
- *
- * @version $Rev: 698457 $ $Date: 2008-09-24 09:13:02 +0100 (Wed, 24 Sep 2008) $
- */
-public class Axis2TokenAuthenticationReferencePolicyInterceptor implements Interceptor {
-
- 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;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java
deleted file mode 100644
index 2226c691ee..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-
-/**
- * @version $Rev: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
- */
-public class Axis2TokenAuthenticationReferencePolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private RuntimeComponentReference reference;
- private Binding binding;
-
- public Axis2TokenAuthenticationReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- super();
- this.component = component;
- this.reference = reference;
- this.binding = binding;
- }
-
- private PolicySet findPolicySet() {
- if (binding instanceof PolicySetAttachPoint) {
- List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {
- return ps;
- }
- }
- }
- }
- return null;
- }
-
- private String getContext() {
- return "component.reference: " + component.getURI()
- + "#"
- + reference.getName()
- + "("
- + binding.getClass().getName()
- + ")";
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
- */
- public Interceptor createInterceptor(Operation operation) {
- PolicySet ps = findPolicySet();
- return ps == null ? null : new Axis2TokenAuthenticationReferencePolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.REFERENCE_POLICY;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java
deleted file mode 100644
index e02aa52b79..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-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.0/impl/java}LoggingPolicy
- *
- * @version $Rev: 721811 $ $Date: 2008-11-30 13:46:51 +0000 (Sun, 30 Nov 2008) $
- */
-public class Axis2TokenAuthenticationServicePolicyInterceptor implements Interceptor {
- 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;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java
deleted file mode 100644
index 8a18e4f4af..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
- */
-public class Axis2TokenAuthenticationServicePolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private Binding binding;
-
- public Axis2TokenAuthenticationServicePolicyProvider(RuntimeComponent component, RuntimeComponentService service, Binding binding) {
- super();
- this.component = component;
- this.service = service;
- this.binding = binding;
- }
-
- private PolicySet findPolicySet() {
- if (binding instanceof PolicySetAttachPoint) {
- List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {
- return ps;
- }
- }
- }
- }
- return null;
- }
-
- private String getContext() {
- return "component.service: " + component.getURI()
- + "#"
- + service.getName()
- + "("
- + binding.getClass().getName()
- + ")";
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
- */
- public Interceptor createInterceptor(Operation operation) {
- PolicySet ps = findPolicySet();
- return ps == null ? null : new Axis2TokenAuthenticationServicePolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.SERVICE_POLICY;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java
deleted file mode 100644
index fa26fedc9e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * Implementation for policies that could be injected as parameter
- * into the axis2config.
- *
- * @version $Rev$ $Date$
- */
-public class Axis2ConfigParamPolicy implements Policy {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- public static final QName NAME = new QName(SCA10_TUSCANY_NS, "wsConfigParam");
- private Map<String, OMElement> paramElements = new Hashtable<String, OMElement>();
-
- public Map<String, OMElement> getParamElements() {
- return paramElements;
- }
-
- public QName getSchemaName() {
- return NAME;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java
deleted file mode 100644
index 5ac4e3f5fd..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.description.Parameter;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-
-
-/**
- * Policy handler to handle PolicySet that contain Axis2ConfigParamPolicy instances
- *
- * @version $Rev$ $Date$
- */
-public class Axis2ConfigParamPolicyHandler implements PolicyHandler {
- private PolicySet applicablePolicySet = null;
-
- public void setUp(Object... context) {
- Axis2ConfigParamPolicy axis2ConfigParamPolicy = null;
- Parameter configParam = null;
- for ( Object contextObject : context ) {
- if ( contextObject instanceof ConfigurationContext ) {
- ConfigurationContext configContext = (ConfigurationContext)contextObject;
- for ( Object policy : applicablePolicySet.getPolicies() ) {
- if ( policy instanceof Axis2ConfigParamPolicy ) {
- axis2ConfigParamPolicy = (Axis2ConfigParamPolicy)policy;
- for ( String paramName : axis2ConfigParamPolicy.getParamElements().keySet() ) {
- configParam = new Parameter(paramName,
- axis2ConfigParamPolicy.getParamElements().get(paramName).getFirstElement());
- configParam.setParameterElement(axis2ConfigParamPolicy.getParamElements().get(paramName));
- try {
- configContext.getAxisConfiguration().addParameter(configParam);
- } catch ( AxisFault e ) {
- throw new RuntimeException(e);
- }
- }
- }
- }
- }
- }
- }
-
- public void cleanUp(Object... context) {
- }
-
- public void beforeInvoke(Object... context) {
- }
-
- public void afterInvoke(Object... context) {
-
- }
-
- public PolicySet getApplicablePolicySet() {
- return applicablePolicySet;
- }
-
- public void setApplicablePolicySet(PolicySet applicablePolicySet) {
- this.applicablePolicySet = applicablePolicySet;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java
deleted file mode 100644
index 33a1688138..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProcessor.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;
-
-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.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-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;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Axis2ConfigParamPolicyProcessor implements StAXArtifactProcessor<Axis2ConfigParamPolicy> {
- public static final QName AXIS2_CONFIG_PARAM_POLICY_QNAME = Axis2ConfigParamPolicy.NAME;
- public static final String PARAMETER = "parameter";
- public QName getArtifactType() {
- return AXIS2_CONFIG_PARAM_POLICY_QNAME;
- }
-
- public Axis2ConfigParamPolicyProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- }
-
- public Axis2ConfigParamPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- Axis2ConfigParamPolicy policy = new Axis2ConfigParamPolicy();
- int event = reader.getEventType();
- QName name = null;
- OMElement parameterElement = null;
- String paramName = null;
- while (reader.hasNext()) {
- event = reader.getEventType();
- switch (event) {
- case START_ELEMENT : {
- name = reader.getName();
- if ( PARAMETER.equals(name.getLocalPart()) ) {
- paramName = reader.getAttributeValue(null, "name");
- parameterElement = loadElement(reader);
- policy.getParamElements().put(paramName, parameterElement);
- }
- break;
- }
- }
-
- if ( event == END_ELEMENT ) {
- if ( AXIS2_CONFIG_PARAM_POLICY_QNAME.equals(reader.getName()) ) {
- break;
- }
- }
-
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
-
- return policy;
- }
-
- public void write(Axis2ConfigParamPolicy arg0, XMLStreamWriter arg1) throws ContributionWriteException,
- XMLStreamException {
- }
-
- public Class<Axis2ConfigParamPolicy> getModelType() {
- return Axis2ConfigParamPolicy.class;
- }
-
- public void resolve(Axis2ConfigParamPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
- private OMElement loadElement(XMLStreamReader reader) throws XMLStreamException {
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMElement head = fac.createOMElement(reader.getName());
- OMElement current = head;
- while (true) {
- switch (reader.next()) {
- case XMLStreamConstants.START_ELEMENT:
- //since the axis2 code checks against a no namespace we need to generate accordingly
- QName name = new QName(reader.getName().getLocalPart());
- OMElement child = fac.createOMElement(name, current);
-
- int count = reader.getNamespaceCount();
- for (int i = 0; i < count; i++) {
- String prefix = reader.getNamespacePrefix(i);
- String ns = reader.getNamespaceURI(i);
- child.declareNamespace(ns, prefix);
- }
-
- if(!"".equals(name.getNamespaceURI())) {
- child.declareNamespace(name.getNamespaceURI(), name.getPrefix());
- }
-
- // add the attributes for this element
- count = reader.getAttributeCount();
- for (int i = 0; i < count; i++) {
- String ns = reader.getAttributeNamespace(i);
- String prefix = reader.getAttributePrefix(i);
- String qname = reader.getAttributeLocalName(i);
- String value = reader.getAttributeValue(i);
-
- if (ns != null) {
- child.addAttribute(qname, value, fac.createOMNamespace(ns, prefix));
- child.declareNamespace(ns, prefix);
- } else {
- child.addAttribute(qname, value, null);
- }
- }
- current = child;
- break;
- case XMLStreamConstants.CDATA:
- fac.createOMText(current, reader.getText());
- break;
- case XMLStreamConstants.CHARACTERS:
- fac.createOMText(current, reader.getText());
- break;
- case XMLStreamConstants.END_ELEMENT:
- if ( current == head ) {
- return head;
- } else {
- current = (OMElement)current.getParent();
- }
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProviderFactory.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProviderFactory.java
deleted file mode 100644
index ed4335baa7..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyProviderFactory.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.description.Parameter;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.provider.PolicyProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class Axis2ConfigParamPolicyProviderFactory implements PolicyProviderFactory<Axis2ConfigParamPolicy> {
-
- public Axis2ConfigParamPolicyProviderFactory(ExtensionPointRegistry registry) {
- super();
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createImplementationPolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.assembly.Implementation)
- */
- public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createReferencePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentReference, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createServicePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentService, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createServicePolicyProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding) {
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class<Axis2ConfigParamPolicy> getModelType() {
- return Axis2ConfigParamPolicy.class;
- }
-
- // FIXME: [rfeng] I think this should be refactored into the binding.ws axis2 code
- public void setUp(ConfigurationContext configContext, PolicySet ps) {
- Axis2ConfigParamPolicy axis2ConfigParamPolicy = null;
- Parameter configParam = null;
- for (Object policy : ps.getPolicies()) {
- if (policy instanceof Axis2ConfigParamPolicy) {
- axis2ConfigParamPolicy = (Axis2ConfigParamPolicy)policy;
- for (String paramName : axis2ConfigParamPolicy.getParamElements().keySet()) {
- configParam =
- new Parameter(paramName, axis2ConfigParamPolicy.getParamElements().get(paramName)
- .getFirstElement());
- configParam.setParameterElement(axis2ConfigParamPolicy.getParamElements().get(paramName));
- try {
- configContext.getAxisConfiguration().addParameter(configParam);
- } catch (AxisFault e) {
- throw new ServiceRuntimeException(e);
- }
- }
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java
deleted file mode 100644
index 0c9cf76a29..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.header;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * Implementation for policies that could be injected as parameter
- * into the axis2config.
- *
- * @version $Rev$ $Date$
- */
-public class Axis2HeaderPolicy implements Policy {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- public static final QName AXIS2_HEADER_POLICY_QNAME = new QName(SCA10_TUSCANY_NS, "axis2Header");
- public static final String AXIS2_HEADER_NAME = "headerName";
-
- private QName headerName;
-
- public QName getHeaderName() {
- return headerName;
- }
-
- public void setHeaderName(QName headerName) {
- this.headerName = headerName;
- }
-
- public QName getSchemaName() {
- return AXIS2_HEADER_POLICY_QNAME;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProcessor.java
deleted file mode 100644
index b6962ff243..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProcessor.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.header;
-
-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;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Axis2HeaderPolicyProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<Axis2HeaderPolicy> {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
-
- public QName getArtifactType() {
- return Axis2HeaderPolicy.AXIS2_HEADER_POLICY_QNAME;
- }
-
- public Axis2HeaderPolicyProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- }
-
-
- public Axis2HeaderPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- Axis2HeaderPolicy policy = new Axis2HeaderPolicy();
- 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.setHeaderName(getQName(reader, Axis2HeaderPolicy.AXIS2_HEADER_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(Axis2HeaderPolicy policy, XMLStreamWriter writer)
- throws ContributionWriteException, XMLStreamException {
- String prefix = "tuscany";
- writer.writeStartElement(prefix,
- getArtifactType().getLocalPart(),
- getArtifactType().getNamespaceURI());
- writer.writeNamespace("tuscany", SCA10_TUSCANY_NS);
-
- if ( policy.getHeaderName() != null ) {
- writer.writeStartElement(prefix,
- Axis2HeaderPolicy.AXIS2_HEADER_NAME,
- getArtifactType().getNamespaceURI());
- writer.writeCharacters(policy.getHeaderName().toString());
- writer.writeEndElement();
- }
-
- writer.writeEndElement();
- }
-
- public Class<Axis2HeaderPolicy> getModelType() {
- return Axis2HeaderPolicy.class;
- }
-
- public void resolve(Axis2HeaderPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProviderFactory.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProviderFactory.java
deleted file mode 100644
index 71833df382..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyProviderFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.header;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Implementation;
-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;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev$ $Date$
- */
-public class Axis2HeaderPolicyProviderFactory implements PolicyProviderFactory<Axis2HeaderPolicy> {
- private ExtensionPointRegistry registry;
-
- public Axis2HeaderPolicyProviderFactory(ExtensionPointRegistry registry) {
- super();
- this.registry = registry;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createImplementationPolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.assembly.Implementation)
- */
- public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
- return null;//new TokenAuthenticationImplementationPolicyProvider(component, implementation);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createReferencePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentReference, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- return new Axis2HeaderReferencePolicyProvider(component, reference, binding);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createServicePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentService, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createServicePolicyProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding) {
- return new Axis2HeaderServicePolicyProvider(component, service, binding);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class getModelType() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyUtil.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyUtil.java
deleted file mode 100644
index 98d011a8fc..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicyUtil.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.header;
-
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.invocation.Message;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Axis2HeaderPolicyUtil {
-
- public static Axis2SOAPHeader getHeader(Message msg, QName headerName){
-
- Axis2SOAPHeader axis2Header = null;
-
- for (Object header : msg.getHeaders()){
- if (header instanceof Axis2SOAPHeader){
- Axis2SOAPHeader tmpHeader = (Axis2SOAPHeader)header;
-
- if (tmpHeader.getHeaderName().equals(headerName)){
- axis2Header = tmpHeader;
- break;
- }
- }
- }
-
- return axis2Header;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyInterceptor.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyInterceptor.java
deleted file mode 100644
index 78adfae484..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyInterceptor.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.header;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Policy handler to handle PolicySet related to Logging with the QName
- * {http://tuscany.apache.org/xmlns/sca/1.0/impl/java}LoggingPolicy
- *
- * @version $Rev$ $Date$
- */
-public class Axis2HeaderReferencePolicyInterceptor implements Interceptor {
- private Invoker next;
- private Operation operation;
- private PolicySet policySet = null;
- private String context;
- private Axis2HeaderPolicy policy;
-
- public Axis2HeaderReferencePolicyInterceptor(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 Axis2HeaderPolicy){
- policy = (Axis2HeaderPolicy)policyObject;
- break;
- }
- }
- }
- }
-
- public Message invoke(Message msg) {
- // TODO - not yet implemented
-
- return getNext().invoke(msg);
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java
deleted file mode 100644
index 0176fee05d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.header;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-
-/**
- * @version $Rev$ $Date$
- */
-public class Axis2HeaderReferencePolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private RuntimeComponentReference reference;
- private Binding binding;
-
- public Axis2HeaderReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- super();
- this.component = component;
- this.reference = reference;
- this.binding = binding;
- }
-
- private PolicySet findPolicySet() {
- if (binding instanceof PolicySetAttachPoint) {
- List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (Axis2HeaderPolicy.class.isInstance(p)) {
- return ps;
- }
- }
- }
- }
- return null;
- }
-
- private String getContext() {
- return "component.reference: " + component.getURI()
- + "#"
- + reference.getName()
- + "("
- + binding.getClass().getName()
- + ")";
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
- */
- public Interceptor createInterceptor(Operation operation) {
- PolicySet ps = findPolicySet();
- return ps == null ? null : new Axis2HeaderReferencePolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.REFERENCE_POLICY;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyInterceptor.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyInterceptor.java
deleted file mode 100644
index 860678a4e4..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyInterceptor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.header;
-
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Policy handler to handle PolicySet related to Logging with the QName
- * {http://tuscany.apache.org/xmlns/sca/1.0/impl/java}LoggingPolicy
- *
- * @version $Rev$ $Date$
- */
-public class Axis2HeaderServicePolicyInterceptor implements Interceptor {
- private Invoker next;
- private Operation operation;
- private PolicySet policySet = null;
- private String context;
- private Axis2HeaderPolicy policy;
-
- public Axis2HeaderServicePolicyInterceptor(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 Axis2HeaderPolicy){
- policy = (Axis2HeaderPolicy)policyObject;
- break;
- }
- }
- }
- }
-
- public Message invoke(Message msg) {
- // TODO - not yet implemented
-
- return getNext().invoke(msg);
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java
deleted file mode 100644
index 7a3ff2a48e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.header;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev$ $Date$
- */
-public class Axis2HeaderServicePolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private Binding binding;
-
- public Axis2HeaderServicePolicyProvider(RuntimeComponent component, RuntimeComponentService service, Binding binding) {
- super();
- this.component = component;
- this.service = service;
- this.binding = binding;
- }
-
- private PolicySet findPolicySet() {
- if (binding instanceof PolicySetAttachPoint) {
- List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (Axis2HeaderPolicy.class.isInstance(p)) {
- return ps;
- }
- }
- }
- }
- return null;
- }
-
- private String getContext() {
- return "component.service: " + component.getURI()
- + "#"
- + service.getName()
- + "("
- + binding.getClass().getName()
- + ")";
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
- */
- public Interceptor createInterceptor(Operation operation) {
- PolicySet ps = findPolicySet();
- return ps == null ? null : new Axis2HeaderServicePolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.SERVICE_POLICY;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeader.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeader.java
deleted file mode 100644
index 36916f4ff5..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeader.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.header;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAPFactory;
-
-/**
- * Implementation for policies that could be injected as parameter
- * into the axis2config.
- *
- * @version $Rev$ $Date$
- */
-public class Axis2SOAPHeader {
-
- private QName headerName;
-
- public QName getHeaderName() {
- return headerName;
- }
-
- public void setHeaderName(QName headerName) {
- this.headerName = headerName;
- }
-
- public OMElement getAsSOAPHeaderBlock(OMFactory factory) {
- OMNamespace ns1 = factory.createOMNamespace(headerName.getNamespaceURI(),
- headerName.getPrefix());
- OMElement header = ((SOAPFactory)factory).createSOAPHeaderBlock(headerName.getLocalPart(),ns1);
- return header;
- }
-
- public void setAsSOAPHeaderBlock(OMElement header) {
- headerName = header.getQName();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeaderString.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeaderString.java
deleted file mode 100644
index c593f07780..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2SOAPHeaderString.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.header;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMText;
-
-/**
- * Implementation for policies that could be injected as parameter
- * into the axis2config.
- *
- * @version $Rev$ $Date$
- */
-public class Axis2SOAPHeaderString extends Axis2SOAPHeader {
-
- private String headerString;
-
- public String getHeaderString() {
- return headerString;
- }
-
- public void setHeaderString(String headerString) {
- this.headerString = headerString;
- }
-
- public OMElement getAsSOAPHeaderBlock(OMFactory factory) {
- OMElement header = super.getAsSOAPHeaderBlock(factory);
- OMText headerText = factory.createOMText(header, headerString);
- header.addChild(headerText);
- return header;
- }
-
- public void setAsSOAPHeaderBlock(OMElement header) {
- super.setAsSOAPHeaderBlock(header);
- headerString = header.getText();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 96782b74bf..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#wsConfigParam,model=org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicy
-org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token.Axis2TokenAuthenticationPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#axis2TokenAuthentication,model=org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token.Axis2TokenAuthenticationPolicy
-org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#axis2Header,model=org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicy
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
deleted file mode 100644
index ced48cf236..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the policy extension
-org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token.Axis2TokenAuthenticationPolicyProviderFactory;model=org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token.Axis2TokenAuthenticationPolicy
-org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicyProviderFactory;model=org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicy \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java
deleted file mode 100644
index 44533fe0b6..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/PolicyReadTestCase.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;
-
-
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-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;
-
-/**
- *
- * Test the reading of ws config params policy.
- *
- * @version $Rev$ $Date$
- */
-public class PolicyReadTestCase extends TestCase {
-
- public void testPolicyReading() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- XMLInputFactory inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessor<Object> staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- URL url = getClass().getResource("mock_policies.xml");
-
- InputStream urlStream = url.openStream();
- XMLStreamReader reader = inputFactory.createXMLStreamReader(urlStream);
-
- Axis2ConfigParamPolicy policy = (Axis2ConfigParamPolicy)staxProcessor.read(reader);
- assertEquals(policy.getParamElements().size(), 2);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/mock_policies.xml b/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/mock_policies.xml
deleted file mode 100644
index 77f750cd0d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2-policy/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/mock_policies.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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:wsConfigParam xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
- <parameter name="InflowSecurity">
- <action>
- <items>Timestamp Signature</items>
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/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/security.properties</signaturePropFile>
- <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.IntegrityPWCBHandler</passwordCallbackClass>" +
- <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
- </action>
- </parameter>
-</tuscany:wsConfigParam> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/LICENSE b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/META-INF/MANIFEST.MF
deleted file mode 100644
index 3474b0fe83..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,152 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.binding.ws.axis2;version="2.0.0";
- uses:="org.apache.axis2.deployment.util,
- org.apache.tuscany.sca.definitions,
- org.apache.tuscany.sca.policy.authentication.basic,
- org.apache.tuscany.sca.policy.security.ws,
- org.apache.ws.security.handler,
- javax.xml.namespace,
- org.apache.axiom.om,
- org.xml.sax,
- org.apache.commons.httpclient,
- org.apache.axiom.soap,
- org.apache.axis2.util,
- javax.servlet,
- javax.xml.stream,
- org.apache.tuscany.sca.core.assembly,
- org.apache.axis2.transport.http.server,
- org.oasisopen.sca,
- org.apache.axis2.i18n,
- org.apache.axis2.transport,
- org.apache.axis2.transport.jms,
- org.apache.axis2.client,
- org.apache.axis2.context,
- org.apache.axiom.om.impl.builder,
- org.apache.tuscany.sca.interfacedef.java,
- org.w3c.dom,
- javax.wsdl,
- org.apache.tuscany.sca.xsd.xml,
- org.apache.tuscany.sca.binding.ws,
- org.apache.axis2.engine,
- org.apache.axis2.receivers,
- org.apache.commons.httpclient.params,
- org.apache.tuscany.sca.interfacedef.wsdl,
- org.apache.tuscany.sca.xsd,
- org.apache.tuscany.sca.databinding,
- org.apache.axis2.addressing,
- org.apache.axis2.deployment,
- org.apache.axis2.transport.http,
- org.apache.tuscany.sca.runtime,
- org.apache.commons.logging,
- org.apache.tuscany.sca.interfacedef.util,
- org.apache.tuscany.sca.provider,
- org.apache.tuscany.sca.core,
- javax.xml.transform.dom,
- org.apache.tuscany.sca.policy,
- org.apache.axis2.description,
- javax.wsdl.extensions,
- org.apache.tuscany.sca.host.http,
- org.apache.tuscany.sca.policy.util,
- org.apache.axis2.util.threadpool,
- org.apache.ws.security,
- org.apache.axis2,
- org.apache.ws.commons.schema,
- org.apache.tuscany.sca.assembly,
- org.apache.ws.commons.schema.resolver,
- javax.wsdl.extensions.soap,
- org.apache.tuscany.sca.interfacedef,
- org.apache.tuscany.sca.invocation,
- javax.xml.transform,
- javax.wsdl.extensions.soap12,
- org.apache.tuscany.sca.contribution.processor,
- javax.servlet.http"
-Private-Package: org.apache.tuscany.sca.binding.ws.axis2.engine.config
- ;version="2.0.0",org.apache.tuscany.sca.binding.ws.axis2.engine.config.
- modules;version="2.0.0",org.apache.tuscany.sca.binding.ws.axis2.engine.
- config.services;version="2.0.0",org.apache.tuscany.sca.binding.ws.axis2
- .policy.authentication.basic;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Axis2-based WS Binding Extension
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397353000
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Axis2-based WS Binding Extensio
- n
-Eclipse-RegisterBuddy: org.apache.axis2.kernel
-Import-Package: javax.security.auth.callback;resolution:=optional,
- javax.servlet,
- javax.servlet.http,
- javax.wsdl,
- javax.wsdl.extensions,
- javax.wsdl.extensions.soap,
- javax.wsdl.extensions.soap12,
- javax.wsdl.factory;resolution:=optional,
- javax.wsdl.xml;resolution:=optional,
- javax.xml.namespace,
- javax.xml.stream,
- javax.xml.transform,
- javax.xml.transform.dom,
- org.apache.axiom.om,
- org.apache.axiom.om.impl.builder,
- org.apache.axiom.om.util,
- org.apache.axiom.soap,
- org.apache.axis2,
- org.apache.axis2.addressing,
- org.apache.axis2.client,
- org.apache.axis2.context,
- org.apache.axis2.deployment,
- org.apache.axis2.deployment.util,
- org.apache.axis2.description,
- org.apache.axis2.engine,
- org.apache.axis2.handlers,
- org.apache.axis2.i18n,
- org.apache.axis2.receivers,
- org.apache.axis2.transport,
- org.apache.axis2.transport.http,
- org.apache.axis2.transport.http.server,
- org.apache.axis2.transport.jms,
- org.apache.axis2.util,
- org.apache.axis2.util.threadpool,
- org.apache.commons.httpclient,
- org.apache.commons.httpclient.params,
- org.apache.neethi,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.binding.ws;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.axis2;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.axis2.policy.configuration;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.axis2.policy.header;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.core.assembly;version="2.0.0",
- org.apache.tuscany.sca.databinding;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0",
- org.apache.tuscany.sca.host.http;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.wsdl;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.policy.authentication.basic;version="2.0.0",
- org.apache.tuscany.sca.policy.security;version="2.0.0",
- org.apache.tuscany.sca.policy.util;version="2.0.0",
- org.apache.tuscany.sca.policy.xml.ws;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.apache.tuscany.sca.xsd;version="2.0.0",
- org.apache.tuscany.sca.xsd.xml;version="2.0.0",
- org.apache.ws.commons.schema,
- org.apache.ws.commons.schema.resolver,
- org.apache.ws.security,
- org.apache.ws.security.handler,
- org.oasisopen.sca;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0";resolution:=optional,
- org.w3c.dom,
- org.xml.sax
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.ws.axis2
-Fragment-Host: org.apache.axis2.kernel
-Bundle-DocURL: http://www.apache.org/
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/NOTICE b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/pom.xml b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/pom.xml
deleted file mode 100644
index 4fbffa4ef7..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/pom.xml
+++ /dev/null
@@ -1,348 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <name>Apache Tuscany SCA Axis2-based WS Binding Extension</name>
-
- <repositories>
- <repository>
- <id>apache.ws</id>
- <name>Apache WebServices Repository</name>
- <url>http://ws.zones.apache.org/repository/</url>
- <layout>legacy</layout>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-xml</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-axiom</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb-axiom</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2-policy</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml-ws</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!-- Added by Mike Edwards, 11th December 2008 -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <!-- end of addition -->
-
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-kernel</artifactId>
- <version>1.4.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-launcher</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-java2wsdl</artifactId>
- <version>1.4.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-launcher</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xom</groupId>
- <artifactId>xom</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-codegen</artifactId>
- <version>1.4.1</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.neethi</groupId>
- <artifactId>neethi</artifactId>
- <version>2.0.4</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-mtompolicy</artifactId>
- <version>1.4.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.santuario</groupId>
- <artifactId>xmlsec</artifactId>
- <version>1.4.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.security</groupId>
- <artifactId>wss4j</artifactId>
- <version>1.5.4</version>
- <exclusions>
- <exclusion>
- <groupId>bouncycastle</groupId>
- <artifactId>bcprov-jdk13</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>mex</artifactId>
- <version>1.41</version>
- <classifier>impl</classifier>
- </dependency>
-
- <dependency>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rampart-core</artifactId>
- <version>1.4</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>mex</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-adb</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-codegen</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-adb-codegen</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ws.commons.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- </exclusion>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>bouncycastle</groupId>
- <artifactId>bcprov-jdk13</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- xerces, xalan, and xml-apis are required for running in websphere -->
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.0</version>
- <scope>optional</scope>
- </dependency>
-
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.8.1</version>
- </dependency>
-
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.3.03</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java
deleted file mode 100644
index cfa2b2678f..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.addressing.EndpointReferenceHelper;
-import org.apache.axis2.client.OperationClient;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token.Axis2TokenAuthenticationPolicy;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.configurator.Axis2BindingBasicAuthenticationConfigurator;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.configurator.Axis2BindingHeaderConfigurator;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicy;
-import org.apache.tuscany.sca.interfacedef.util.FaultException;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicy;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-
-/**
- * Axis2BindingInvoker uses an Axis2 OperationClient to invoke a remote web service
- *
- * @version $Rev$ $Date$
- */
-public class Axis2BindingInvoker implements Invoker, DataExchangeSemantics {
- private final static String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
-
- public static final QName QNAME_WSA_FROM =
- new QName(AddressingConstants.Final.WSA_NAMESPACE, AddressingConstants.WSA_FROM,
- AddressingConstants.WSA_DEFAULT_PREFIX);
- public static final String TUSCANY_PREFIX = "tuscany";
- public static final QName CALLBACK_ID_REFPARM_QN =
- new QName(SCA10_TUSCANY_NS, "CallbackID", TUSCANY_PREFIX);
- public static final QName CONVERSATION_ID_REFPARM_QN =
- new QName(SCA10_TUSCANY_NS, "ConversationID", TUSCANY_PREFIX);
-
- private Axis2ServiceClient serviceClient;
- private QName wsdlOperationName;
- private Options options;
- private SOAPFactory soapFactory;
- private List<PolicyHandler> policyHandlerList = null;
- private WebServiceBinding wsBinding;
-
- private BasicAuthenticationPolicy basicAuthenticationPolicy = null;
- private Axis2TokenAuthenticationPolicy axis2TokenAuthenticationPolicy = null;
- private List<Axis2HeaderPolicy> axis2HeaderPolicies = new ArrayList<Axis2HeaderPolicy>();
-
- public Axis2BindingInvoker(Axis2ServiceClient serviceClient,
- QName wsdlOperationName,
- Options options,
- SOAPFactory soapFactory,
- List<PolicyHandler> policyHandlerList,
- WebServiceBinding wsBinding) {
- this.serviceClient = serviceClient;
- this.wsdlOperationName = wsdlOperationName;
- this.options = options;
- this.soapFactory = soapFactory;
- this.policyHandlerList = policyHandlerList;
- this.wsBinding = wsBinding;
-
- // find out which policies are active
- if (wsBinding instanceof PolicySetAttachPoint) {
- List<PolicySet> policySets = ((PolicySetAttachPoint)wsBinding).getApplicablePolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (BasicAuthenticationPolicy.class.isInstance(p)) {
- basicAuthenticationPolicy = (BasicAuthenticationPolicy)p;
- } else if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {
- axis2TokenAuthenticationPolicy = (Axis2TokenAuthenticationPolicy)p;
- } else if (Axis2HeaderPolicy.class.isInstance(p)) {
- axis2HeaderPolicies.add((Axis2HeaderPolicy)p);
- }else {
- // etc. check for other types of policy being present
- }
- }
- }
- }
- }
-
- private static final QName EXCEPTION = new QName("", "Exception");
-
- public Message invoke(Message msg) {
- try {
- Object resp = invokeTarget(msg);
-
- msg.setBody(resp);
- } catch (AxisFault e) {
- if (e.getDetail() != null ) {
- FaultException f = new FaultException(e.getMessage(), e.getDetail(), e);
- f.setFaultName(e.getDetail().getQName());
- msg.setFaultBody(f);
- } else {
- msg.setFaultBody(e);
- }
- } catch (Throwable e) {
- msg.setFaultBody(e);
- }
-
- return msg;
- }
-
- protected Object invokeTarget(Message msg) throws AxisFault {
- final OperationClient operationClient = createOperationClient(msg);
-
- // ensure connections are tracked so that they can be closed by the reference binding
- MessageContext requestMC = operationClient.getMessageContext("Out");
- requestMC.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
- requestMC.getOptions().setTimeOutInMilliSeconds(240000L);
-
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.beforeInvoke(msg, requestMC, operationClient);
- }
-
- // set policy specified headers
- for (Axis2HeaderPolicy policy : axis2HeaderPolicies){
- Axis2BindingHeaderConfigurator.setHeader(requestMC, msg, policy.getHeaderName());
- }
-
- if (basicAuthenticationPolicy != null) {
- Axis2BindingBasicAuthenticationConfigurator.setOperationOptions(operationClient, msg, basicAuthenticationPolicy);
- }
-
- if (axis2TokenAuthenticationPolicy != null) {
- Axis2BindingHeaderConfigurator.setHeader(requestMC, msg, axis2TokenAuthenticationPolicy.getTokenName());
- }
-
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws AxisFault {
- operationClient.execute(true);
- return null;
- }
- });
- } catch (PrivilegedActionException e) {
- operationClient.complete(requestMC);
- throw (AxisFault)e.getException();
- }
-
- MessageContext responseMC = operationClient.getMessageContext("In");
-
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.afterInvoke(msg, responseMC, operationClient);
- }
-
- OMElement response = responseMC.getEnvelope().getBody().getFirstElement();
-
- // FIXME: [rfeng] We have to pay performance penalty to build the complete OM as the operationClient.complete() will
- // release the underlying HTTP connection.
- // Force the response to be populated, see https://issues.apache.org/jira/browse/TUSCANY-1541
- if (response != null) {
- response.build();
- }
-
- operationClient.complete(requestMC);
-
- return response;
- }
-
- @SuppressWarnings("deprecation")
- protected OperationClient createOperationClient(Message msg) throws AxisFault {
- SOAPEnvelope env = soapFactory.getDefaultEnvelope();
- Object[] args = (Object[])msg.getBody();
- if (args != null && args.length > 0) {
- SOAPBody body = env.getBody();
- for (Object bc : args) {
- if (bc instanceof OMElement) {
- body.addChild((OMElement)bc);
- } else {
- throw new IllegalArgumentException(
- "Can't handle mixed payloads between OMElements and other types.");
- }
- }
- }
- final MessageContext requestMC = new MessageContext();
- requestMC.setEnvelope(env);
-
- // Axis2 operationClients can not be shared so create a new one for each request
- final OperationClient operationClient = serviceClient.getServiceClient().createClient(wsdlOperationName);
- operationClient.setOptions(options);
-
- ReferenceParameters parameters = msg.getFrom().getReferenceParameters();
-
- // set callback endpoint and callback ID for WS-Addressing header
- EndpointReference fromEPR = null;
- org.apache.tuscany.sca.runtime.EndpointReference callbackEPR = parameters.getCallbackReference();
- if (callbackEPR != null) {
- fromEPR = new EndpointReference(callbackEPR.getBinding().getURI());
- }
- Object callbackID = parameters.getCallbackID();
- if (callbackID != null) {
- if (fromEPR == null) {
- fromEPR = new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL);
- }
- //FIXME: serialize callback ID to XML in case it is not a string
- fromEPR.addReferenceParameter(CALLBACK_ID_REFPARM_QN, callbackID.toString());
- }
-
- // set conversation ID for WS-Addressing header
- Object conversationId = parameters.getConversationID();
- if (conversationId != null) {
- if (fromEPR == null) {
- fromEPR = new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL);
- }
- //FIXME: serialize conversation ID to XML in case it is not a string
- fromEPR.addReferenceParameter(CONVERSATION_ID_REFPARM_QN, conversationId.toString());
- }
-
- // add WS-Addressing header
- //FIXME: is there any way to use the Axis2 addressing support for this?
- if (fromEPR != null) {
- SOAPEnvelope sev = requestMC.getEnvelope();
- SOAPHeader sh = sev.getHeader();
- OMElement epr =
- EndpointReferenceHelper.toOM(sev.getOMFactory(),
- fromEPR,
- QNAME_WSA_FROM,
- AddressingConstants.Final.WSA_NAMESPACE);
- sh.addChild(epr);
- requestMC.setFrom(fromEPR);
- }
-
- // Set any message headers required by policy
- // Get the header from the tuscany message
- // If its not already an OM convert it to OM
- // add it to the envelope header
-
- // if target endpoint was not specified when this invoker was created,
- // use dynamically specified target endpoint passed in on this call
- if (options.getTo() == null) {
- org.apache.tuscany.sca.runtime.EndpointReference ep = msg.getTo();
- if (ep != null) {
- requestMC.setTo(new EndpointReference(ep.getURI()));
- } else {
- throw new RuntimeException("Unable to determine destination endpoint");
- }
- } else {
- requestMC.setTo(new EndpointReference(options.getTo().getAddress()));
- }
-
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws AxisFault {
- operationClient.addMessageContext(requestMC);
- return null;
- }
- });
- } catch (PrivilegedActionException e) {
- throw (AxisFault)e.getException();
- }
- return operationClient;
- }
-
- public boolean allowsPassByReference() {
- return true;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java
deleted file mode 100644
index a532f899bc..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerDefinitionsLoader;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Axis2BindingProviderFactory
- *
- * @version $Rev$ $Date$
- */
-
-public class Axis2BindingProviderFactory implements BindingProviderFactory<WebServiceBinding> {
-
- private FactoryExtensionPoint modelFactories;
- private ServletHost servletHost;
- private List<PolicyHandlerTuple> policyHandlerClassnames = null;
- private DataBindingExtensionPoint dataBindings;
-
- public Axis2BindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- List<ServletHost> hosts = servletHosts.getServletHosts();
- if (!hosts.isEmpty()) {
- this.servletHost = hosts.get(0);
- }
- modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- policyHandlerClassnames = PolicyHandlerDefinitionsLoader.loadPolicyHandlerClassnames();
- dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class);
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- WebServiceBinding binding) {
- return new Axis2ReferenceBindingProvider(component, reference, binding,
- modelFactories, policyHandlerClassnames, dataBindings);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- WebServiceBinding binding) {
- return new Axis2ServiceBindingProvider(component, service, binding,
- servletHost, modelFactories,
- policyHandlerClassnames, dataBindings);
- }
-
- public Class<WebServiceBinding> getModelType() {
- return WebServiceBinding.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java
deleted file mode 100644
index 97eb3949af..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.client.OperationClient;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-
-/**
- * Axis2OneWayBindingInvoker uses an Axis2 OperationClient to invoke a OneWay remote web service.
- *
- * @version $Rev$ $Date$
- */
-public class Axis2OneWayBindingInvoker extends Axis2BindingInvoker {
-
- public Axis2OneWayBindingInvoker(Axis2ServiceClient serviceClient,
- QName wsdlOperationName,
- Options options,
- SOAPFactory soapFactory,
- List<PolicyHandler> policyHandlerList,
- WebServiceBinding wsBinding) {
-
- super(serviceClient, wsdlOperationName, options, soapFactory, policyHandlerList, wsBinding);
- }
-
- @Override
- protected Object invokeTarget(Message msg) throws AxisFault {
- OperationClient operationClient = createOperationClient(msg);
-
- // ensure connections are tracked so that they can be closed by the reference binding
- MessageContext requestMC = operationClient.getMessageContext("Out");
- //requestMC.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
- Options opt = requestMC.getOptions();
- opt.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
- opt.setUseSeparateListener(true);
- opt.setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION,Boolean.TRUE);
-
- operationClient.execute(false);
-
- // REVIEW it seems ok to return null
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java
deleted file mode 100644
index 83f1f3219e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import java.util.List;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-public class Axis2ReferenceBindingProvider implements ReferenceBindingProvider {
-
- private WebServiceBinding wsBinding;
- private Axis2ServiceClient axisClient;
-
- public Axis2ReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- WebServiceBinding wsBinding,
- FactoryExtensionPoint modelFactories,
- List<PolicyHandlerTuple> policyHandlerClassnames,
- DataBindingExtensionPoint dataBindings) {
-
- MessageFactory messageFactory = modelFactories.getFactory(MessageFactory.class);
- this.wsBinding = wsBinding;
-
- // A WSDL document should always be present in the binding
- if (wsBinding.getWSDLDocument() == null) {
- throw new ServiceRuntimeException("No WSDL document for " + component.getName() + "/" + reference.getName());
- }
-
- // Set to use the Axiom data binding
- InterfaceContract contract = wsBinding.getBindingInterfaceContract();
- if (contract.getInterface() != null) {
- contract.getInterface().resetDataBinding(OMElement.class.getName());
- }
-
- axisClient = new Axis2ServiceClient(component, reference, wsBinding, messageFactory, policyHandlerClassnames);
- }
-
- public void start() {
- axisClient.start();
- }
-
- public void stop() {
- axisClient.stop();
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return wsBinding.getBindingInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return true;
- }
-
- public Invoker createInvoker(Operation operation) {
- return axisClient.createInvoker(operation);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java
deleted file mode 100644
index d7f8096ff2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import java.util.List;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-public class Axis2ServiceBindingProvider implements ServiceBindingProvider {
-
- private WebServiceBinding wsBinding;
- private Axis2ServiceProvider axisProvider;
-
- public Axis2ServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- WebServiceBinding wsBinding,
- ServletHost servletHost,
- FactoryExtensionPoint modelFactories,
- List<PolicyHandlerTuple> policyHandlerClassnames,
- DataBindingExtensionPoint dataBindings) {
-
- if (servletHost == null) {
- throw new ServiceRuntimeException("No Servlet host is avaible for HTTP web services");
- }
-
- MessageFactory messageFactory = modelFactories.getFactory(MessageFactory.class);
- this.wsBinding = wsBinding;
-
- // A WSDL document should always be present in the binding
- if (wsBinding.getWSDLDocument() == null) {
- throw new ServiceRuntimeException("No WSDL document for " + component.getName() + "/" + service.getName());
- }
-
- // Set to use the Axiom data binding
- InterfaceContract contract = wsBinding.getBindingInterfaceContract();
- contract.getInterface().resetDataBinding(OMElement.class.getName());
-
- axisProvider = new Axis2ServiceProvider(component, service, wsBinding, servletHost, messageFactory, policyHandlerClassnames);
- }
-
- public void start() {
- axisProvider.start();
- }
-
- public void stop() {
- axisProvider.stop();
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return wsBinding.getBindingInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
deleted file mode 100644
index c4bb3e9342..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
+++ /dev/null
@@ -1,500 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import static org.apache.tuscany.sca.binding.ws.axis2.AxisPolicyHelper.SOAP12_INTENT;
-import static org.apache.tuscany.sca.binding.ws.axis2.AxisPolicyHelper.isIntentRequired;
-
-import java.io.IOException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Binding;
-import javax.wsdl.BindingOperation;
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Port;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap.SOAPOperation;
-import javax.wsdl.extensions.soap12.SOAP12Address;
-import javax.xml.namespace.QName;
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.dom.DOMSource;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.addressing.EndpointReferenceHelper;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.description.AxisEndpoint;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
-import org.apache.axis2.description.WSDL2Constants;
-import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.util.threadpool.ThreadPool;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
-import org.apache.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicy;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerUtils;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.xsd.xml.XMLDocumentHelper;
-import org.apache.ws.commons.schema.resolver.URIResolver;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-public class Axis2ServiceClient {
-
- private RuntimeComponent component;
- private AbstractContract contract;
- private WebServiceBinding wsBinding;
- private ServiceClient serviceClient;
- List<PolicyHandlerTuple> policyHandlerClassnames = null;
- private List<PolicyHandler> policyHandlerList = new ArrayList<PolicyHandler>();
-
- public Axis2ServiceClient(RuntimeComponent component,
- AbstractContract contract,
- WebServiceBinding wsBinding,
- MessageFactory messageFactory,
- List<PolicyHandlerTuple> policyHandlerClassnames) {
-
- this.component = component;
- this.contract = contract;
- this.wsBinding = wsBinding;
- this.policyHandlerClassnames = policyHandlerClassnames;
- }
-
- protected void start() {
- if (serviceClient == null) {
- this.serviceClient = createServiceClient();
- }
- }
-
- public ServiceClient getServiceClient() {
- return serviceClient;
- }
-
- protected void configurePolicy(ConfigurationContext context, PolicySet ps) throws AxisFault {
- if (ps == null) {
- return;
- }
- for (Object policy : ps.getPolicies()) {
- if (policy instanceof Axis2ConfigParamPolicy) {
- Axis2ConfigParamPolicy axis2ConfigParamPolicy = (Axis2ConfigParamPolicy)policy;
- for (Map.Entry<String, OMElement> param : axis2ConfigParamPolicy.getParamElements().entrySet()) {
- Parameter configParam = new Parameter(param.getKey(), param.getValue().getFirstElement());
- configParam.setParameterElement(param.getValue());
- context.getAxisConfiguration().addParameter(configParam);
- }
- }
- }
- }
-
- /**
- * Create an Axis2 ServiceClient
- */
- protected ServiceClient createServiceClient() {
- try {
- final boolean isRampartRequired = AxisPolicyHelper.isRampartRequired(wsBinding);
- ConfigurationContext configContext;
-
- try {
- // TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator();
- // Allow privileged access to read properties. Requires PropertyPermission read in
- // security policy.
- TuscanyAxisConfigurator tuscanyAxisConfigurator =
- AccessController.doPrivileged(new PrivilegedExceptionAction<TuscanyAxisConfigurator>() {
- public TuscanyAxisConfigurator run() throws AxisFault {
- return new TuscanyAxisConfigurator(isRampartRequired);
- }
- });
- configContext = tuscanyAxisConfigurator.getConfigurationContext();
- // deployRampartModule();
- // configureSecurity();
- } catch (PrivilegedActionException e) {
- throw new ServiceRuntimeException(e.getException());
- }
-
- createPolicyHandlers();
- setupPolicyHandlers(policyHandlerList, configContext);
-
- Definition definition = wsBinding.getWSDLDocument();
- QName serviceQName = wsBinding.getService().getQName();
- Port port = wsBinding.getPort();
- if (port == null) {
- // service has multiple ports, select one port to use
- Collection<Port> ports = wsBinding.getService().getPorts().values();
- for (Port p : ports) {
- // look for a SOAP 1.1 port first
- if (p.getExtensibilityElements().get(0) instanceof SOAPAddress) {
- port = p;
- break;
- }
- }
- if (port == null) {
- // no SOAP 1.1 port available, so look for a SOAP 1.2 port
- for (Port p : ports) {
- if (p.getExtensibilityElements().get(0) instanceof SOAP12Address) {
- port = p;
- break;
- }
- }
- }
- }
- AxisService axisService =
- createClientSideAxisService(definition, serviceQName, port.getName(), new Options());
-
- HttpClient httpClient = (HttpClient)configContext.getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
- if (httpClient == null) {
- MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
- HttpConnectionManagerParams connectionManagerParams = new HttpConnectionManagerParams();
- connectionManagerParams.setDefaultMaxConnectionsPerHost(2);
- connectionManagerParams.setTcpNoDelay(true);
- connectionManagerParams.setStaleCheckingEnabled(true);
- connectionManagerParams.setLinger(0);
- connectionManager.setParams(connectionManagerParams);
- httpClient = new HttpClient(connectionManager);
- configContext.setThreadPool(new ThreadPool(1, 5));
- configContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
- configContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
- }
-
- return new ServiceClient(configContext, axisService);
-
- } catch (AxisFault e) {
- throw new RuntimeException(e); // TODO: better exception
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- } catch (InstantiationException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * URI resolver implementation for XML schema
- */
- public static class URIResolverImpl implements URIResolver {
- private Definition definition;
-
- public URIResolverImpl(Definition definition) {
- this.definition = definition;
- }
-
- public org.xml.sax.InputSource resolveEntity(java.lang.String targetNamespace,
- java.lang.String schemaLocation,
- java.lang.String baseUri) {
- try {
- if (baseUri == null) {
- baseUri = definition.getDocumentBaseURI();
- }
- URL url = new URL(new URL(baseUri), schemaLocation);
- return XMLDocumentHelper.getInputSource(url);
- } catch (IOException e) {
- return null;
- }
- }
- }
-
- /**
- * Workaround for https://issues.apache.org/jira/browse/AXIS2-3205
- * @param definition
- * @param serviceName
- * @return
- */
- private static Definition getDefinition(Definition definition, QName serviceName) {
-
- if (serviceName == null) {
- return definition;
- }
-
- if (definition == null) {
- return null;
- }
- Object service = definition.getServices().get(serviceName);
- if (service != null) {
- return definition;
- }
- for (Object i : definition.getImports().values()) {
- List<Import> imports = (List<Import>)i;
- for (Import imp : imports) {
- Definition d = getDefinition(imp.getDefinition(), serviceName);
- if (d != null) {
- return d;
- }
- }
- }
- return null;
- }
-
- /**
- * This method is copied from AxisService.createClientSideAxisService to
- * work around http://issues.apache.org/jira/browse/WSCOMMONS-228
- *
- * @param wsdlDefinition
- * @param wsdlServiceName
- * @param portName
- * @param options
- * @return
- * @throws AxisFault
- */
- @Deprecated
- public static AxisService createClientSideAxisService(Definition definition,
- QName serviceName,
- String portName,
- Options options) throws AxisFault {
- Definition def = getDefinition(definition, serviceName);
- final WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisServiceBuilder(def, serviceName, portName);
- serviceBuilder.setServerSide(false);
- // [rfeng] Add a custom resolver to work around WSCOMMONS-228
- serviceBuilder.setCustomResolver(new URIResolverImpl(def));
- serviceBuilder.setBaseUri(def.getDocumentBaseURI());
- // [rfeng]
- // Allow access to read properties. Requires PropertiesPermission in security policy.
- AxisService axisService;
- try {
- axisService = AccessController.doPrivileged(new PrivilegedExceptionAction<AxisService>() {
- public AxisService run() throws AxisFault {
- return serviceBuilder.populateService();
- }
- });
- } catch ( PrivilegedActionException e ) {
- throw (AxisFault) e.getException();
- }
-
- AxisEndpoint axisEndpoint = (AxisEndpoint)axisService.getEndpoints().get(axisService.getEndpointName());
- options.setTo(new EndpointReference(axisEndpoint.getEndpointURL()));
- if (axisEndpoint != null) {
- options.setSoapVersionURI((String)axisEndpoint.getBinding().getProperty(WSDL2Constants.ATTR_WSOAP_VERSION));
- }
- return axisService;
- }
-
- /*
- private static <T extends ExtensibilityElement> T getExtensibilityElement(List elements, Class<T> type) {
- for (Object e : elements) {
- if (type.isInstance(e)) {
- return type.cast(e);
- }
- }
- return null;
- }
- */
-
- protected void stop() {
- if (serviceClient != null) {
- // close all connections that we have initiated, so that the jetty server
- // can be restarted without seeing ConnectExceptions
- HttpClient httpClient =
- (HttpClient)serviceClient.getServiceContext().getConfigurationContext()
- .getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
- if (httpClient != null)
- ((MultiThreadedHttpConnectionManager)httpClient.getHttpConnectionManager()).shutdown();
-
- serviceClient = null;
- }
- }
-
- /**
- * Create and configure an Axis2BindingInvoker for each operation
- */
- protected Invoker createInvoker(Operation operation) {
- Options options = new Options();
- EndpointReference epTo = getWSATOEPR(wsBinding);
- if (epTo != null) {
- options.setTo(epTo);
- }
- options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
-
- String operationName = operation.getName();
-
- String soapAction = getSOAPAction(operationName);
- if (soapAction != null && soapAction.length() > 1) {
- options.setAction(soapAction);
- }
-
- options.setTimeOutInMilliSeconds(30 * 1000); // 30 seconds
-
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- SOAPFactory soapFactory = AccessController.doPrivileged(new PrivilegedAction<SOAPFactory>() {
- public SOAPFactory run() {
- if (requiresSOAP12())
- return OMAbstractFactory.getSOAP12Factory();
- else
- return OMAbstractFactory.getSOAP11Factory();
-
- }
- });
- QName wsdlOperationQName = new QName(operationName);
- if (requiresMTOM())
- {
- options.setProperty(org.apache.axis2.Constants.Configuration.ENABLE_MTOM, org.apache.axis2.Constants.VALUE_TRUE);
- }
- Axis2BindingInvoker invoker;
- if (operation.isNonBlocking()) {
- invoker = new Axis2OneWayBindingInvoker(this, wsdlOperationQName, options, soapFactory, policyHandlerList, wsBinding);
- } else {
- invoker = new Axis2BindingInvoker(this, wsdlOperationQName, options, soapFactory, policyHandlerList, wsBinding);
- }
-
- return invoker;
- }
-
- private boolean requiresSOAP12() {
- return isIntentRequired(wsBinding, SOAP12_INTENT);
- }
-
- private boolean requiresMTOM() {
- return isIntentRequired(wsBinding, AxisPolicyHelper.MTOM_INTENT);
- }
-
- protected EndpointReference getWSATOEPR(WebServiceBinding binding) {
- EndpointReference epr = getEPR(binding);
- if (epr == null) {
- epr = getPortLocationEPR(binding);
- } else if (epr.getAddress() == null || epr.getAddress().length() < 1) {
- EndpointReference bindingEPR = getPortLocationEPR(binding);
- if (bindingEPR != null) {
- epr.setAddress(bindingEPR.getAddress());
- }
- }
- return epr;
- }
-
- protected EndpointReference getPortLocationEPR(WebServiceBinding binding) {
- String ep = null;
- if (binding.getPort() != null) {
- List<?> wsdlPortExtensions = binding.getPort().getExtensibilityElements();
- for (final Object extension : wsdlPortExtensions) {
- if (extension instanceof SOAPAddress) {
- ep = ((SOAPAddress)extension).getLocationURI();
- break;
- }
- if (extension instanceof SOAP12Address) {
- SOAP12Address address = (SOAP12Address)extension;
- ep = address.getLocationURI();
- break;
- }
- }
- }
- if(ep == null || ep.equals("")) {
- ep = binding.getURI();
- }
- return ep == null || "".equals(ep) ? null : new EndpointReference(ep);
- }
-
- protected org.apache.axis2.addressing.EndpointReference getEPR(WebServiceBinding wsBinding) {
- if (wsBinding.getEndPointReference() == null) {
- return null;
- }
- try {
-
- XMLStreamReader parser =
- XMLInputFactory.newInstance().createXMLStreamReader(new DOMSource(wsBinding.getEndPointReference()));
- StAXOMBuilder builder = new StAXOMBuilder(parser);
- OMElement omElement = builder.getDocumentElement();
- org.apache.axis2.addressing.EndpointReference epr = EndpointReferenceHelper.fromOM(omElement);
- return epr;
-
- } catch (IOException e) {
- throw new RuntimeException(e);
- } catch (XMLStreamException e) {
- throw new RuntimeException(e);
- } catch (FactoryConfigurationError e) {
- throw new RuntimeException(e);
- }
- }
-
- protected String getSOAPAction(String operationName) {
- Binding binding = wsBinding.getBinding();
- if (binding != null) {
- for (Object o : binding.getBindingOperations()) {
- BindingOperation bop = (BindingOperation)o;
- if (bop.getName().equalsIgnoreCase(operationName)) {
- for (Object o2 : bop.getExtensibilityElements()) {
- if (o2 instanceof SOAPOperation) {
- return ((SOAPOperation)o2).getSoapActionURI();
- }
- }
- }
- }
- }
- return null;
- }
-
- private void createPolicyHandlers() throws IllegalAccessException, InstantiationException, ClassNotFoundException {
- if (wsBinding instanceof PolicySetAttachPoint) {
- PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)wsBinding;
- PolicyHandler policyHandler = null;
- for (PolicySet policySet : policiedBinding.getPolicySets()) {
- policyHandler = PolicyHandlerUtils.findPolicyHandler(policySet, policyHandlerClassnames);
- if (policyHandler != null) {
- policyHandler.setApplicablePolicySet(policySet);
- policyHandlerList.add(policyHandler);
- }
- }
-
- // code to create policy handlers using the new policy SPI based
- // on policy providers
-/*
- List<PolicyProvider> policyProviders = ((RuntimeComponentReference)contract).getPolicyProviders(wsBinding);
-
- for (PolicyProvider policyProvider : policyProviders){
- policyHandler = policyProvider.createHandler();
- if (policyHandler != null) {
- policyHandlerList.add(policyHandler);
- }
- }
-*/
- }
- }
-
- private void setupPolicyHandlers(List<PolicyHandler> policyHandlers, ConfigurationContext configContext) {
- for (PolicyHandler aHandler : policyHandlers) {
- aHandler.setUp(configContext);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java
deleted file mode 100644
index a0cfab9154..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInMessageReceiver.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.receivers.AbstractInMessageReceiver;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-
-public class Axis2ServiceInMessageReceiver extends AbstractInMessageReceiver {
-
- protected Operation operation;
-
- private Axis2ServiceProvider provider;
-
- private List<PolicyHandler> policyHandlerList = null;
-
- public Axis2ServiceInMessageReceiver(Axis2ServiceProvider provider, Operation operation, List<PolicyHandler> policyHandlerList) {
- this.provider = provider;
- this.operation = operation;
- this.policyHandlerList = policyHandlerList;
- }
-
- public Axis2ServiceInMessageReceiver() {
- }
-
- @Override
- public void invokeBusinessLogic(MessageContext inMC) throws AxisFault {
- try {
- OMElement requestOM = inMC.getEnvelope().getBody().getFirstElement();
- Object[] args = new Object[] {requestOM};
-
- /*
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.beforeInvoke(operation, args, inMC);
- }
- */
-
- provider.invokeTarget(operation, args, inMC);
-
- /*
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.afterInvoke(operation, args, inMC);
- }
- */
-
- } catch (InvocationTargetException e) {
- Throwable t = e.getCause();
- if (t instanceof Exception) {
- throw AxisFault.makeFault((Exception)t);
- }
- throw new RuntimeException(e);
- } catch (Exception e) {
- e.printStackTrace();
- throw AxisFault.makeFault(e);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java
deleted file mode 100644
index 64e49e0b0d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceInOutSyncMessageReceiver.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.FaultException;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-public class Axis2ServiceInOutSyncMessageReceiver extends AbstractInOutSyncMessageReceiver {
- private static final Logger logger = Logger.getLogger(Axis2ServiceInOutSyncMessageReceiver.class.getName());
-
- protected Operation operation;
- private List<PolicyHandler> policyHandlerList = null;
-
- private Axis2ServiceProvider provider;
-
- public Axis2ServiceInOutSyncMessageReceiver(Axis2ServiceProvider provider, Operation operation, List<PolicyHandler> policyHandlerList) {
- this.provider = provider;
- this.operation = operation;
- this.policyHandlerList = policyHandlerList;
- }
-
- public Axis2ServiceInOutSyncMessageReceiver() {
- }
-
- @Override
- public void invokeBusinessLogic(MessageContext inMC, MessageContext outMC) throws AxisFault {
- try {
- OMElement requestOM = inMC.getEnvelope().getBody().getFirstElement();
- Object[] args = null;
-
- if (requestOM != null) {
- args = new Object[] {requestOM};
- }
-
- /*
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.beforeInvoke(operation, args, inMC);
- }
- */
-
- OMElement responseOM = (OMElement)provider.invokeTarget(operation, args, inMC);
-
- /*
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.afterInvoke(operation, args, inMC, responseOM);
- }
- */
-
- SOAPEnvelope soapEnvelope = getSOAPFactory(inMC).getDefaultEnvelope();
- if (null != responseOM ) {
- soapEnvelope.getBody().addChild(responseOM);
- }
- outMC.setEnvelope(soapEnvelope);
- outMC.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE);
-
- } catch (InvocationTargetException e) {
- Throwable t = e.getCause();
- if (t instanceof FaultException && ((FaultException)t).getFaultInfo() instanceof OMElement) {
- OMElement faultDetail = (OMElement)((FaultException)t).getFaultInfo();
- inMC.setProperty(Constants.FAULT_NAME, faultDetail.getQName().getLocalPart());
- AxisFault f = new AxisFault(null, e.getMessage(), "faultNode", "faultRole", faultDetail);
- throw f;
- }
- if (t instanceof Exception) {
- throw AxisFault.makeFault((Exception)t);
- }
- logger.log(Level.SEVERE, e.getMessage(), t);
- throw new ServiceRuntimeException(e);
- } catch (Throwable e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- throw AxisFault.makeFault(e);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
deleted file mode 100644
index e5b64b99cc..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
+++ /dev/null
@@ -1,835 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.lang.reflect.InvocationTargetException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Port;
-import javax.wsdl.Types;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap12.SOAP12Address;
-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.soap.SOAPHeader;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.Constants.Configuration;
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.deployment.util.Utils;
-import org.apache.axis2.description.AxisEndpoint;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.description.TransportInDescription;
-import org.apache.axis2.description.TransportOutDescription;
-import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
-import org.apache.axis2.description.WSDL2Constants;
-import org.apache.axis2.description.WSDLToAxisServiceBuilder;
-import org.apache.axis2.engine.ListenerManager;
-import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.transport.jms.JMSConstants;
-import org.apache.axis2.transport.jms.JMSListener;
-import org.apache.axis2.transport.jms.JMSSender;
-import org.apache.axis2.transport.jms.JMSUtils;
-import org.apache.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceClient.URIResolverImpl;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token.Axis2TokenAuthenticationPolicy;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicy;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.configurator.Axis2BindingBasicAuthenticationConfigurator;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.configurator.Axis2BindingHeaderConfigurator;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicy;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2SOAPHeaderString;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicy;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerUtils;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaExternal;
-import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.handler.WSHandlerConstants;
-import org.apache.ws.security.handler.WSHandlerResult;
-import org.oasisopen.sca.ServiceRuntimeException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-public class Axis2ServiceProvider {
- public static final String IMPORT_TAG = "import";
- public static final String INCLUDE_TAG = "include";
-
- private static final Logger logger = Logger.getLogger(Axis2ServiceProvider.class.getName());
-
- private RuntimeComponent component;
- private AbstractContract contract;
- private WebServiceBinding wsBinding;
- private ServletHost servletHost;
- private MessageFactory messageFactory;
- private ConfigurationContext configContext;
- private JMSSender jmsSender;
- private JMSListener jmsListener;
- private List<PolicyHandlerTuple> policyHandlerClassnames = null;
- private List<PolicyHandler> policyHandlerList = new ArrayList<PolicyHandler>();
- private Map<String, Port> urlMap = new HashMap<String, Port>();
-
- private BasicAuthenticationPolicy basicAuthenticationPolicy = null;
- private Axis2TokenAuthenticationPolicy axis2TokenAuthenticationPolicy = null;
- private List<Axis2HeaderPolicy> axis2HeaderPolicies = new ArrayList<Axis2HeaderPolicy>();
-
- public static final QName QNAME_WSA_ADDRESS =
- new QName(AddressingConstants.Final.WSA_NAMESPACE, AddressingConstants.EPR_ADDRESS);
- public static final QName QNAME_WSA_FROM =
- new QName(AddressingConstants.Final.WSA_NAMESPACE, AddressingConstants.WSA_FROM);
- public static final QName QNAME_WSA_REFERENCE_PARAMETERS =
- new QName(AddressingConstants.Final.WSA_NAMESPACE, AddressingConstants.EPR_REFERENCE_PARAMETERS);
-
- private static final QName TRANSPORT_JMS_QUALIFIED_INTENT =
- new QName("http://www.osoa.org/xmlns/sca/1.0", "transport.jms");
- private static final String DEFAULT_QUEUE_CONNECTION_FACTORY = "TuscanyQueueConnectionFactory";
-
- //Schema element names
- public static final String ELEM_SCHEMA = "schema";
-
- //Schema URI
- public static final String NS_URI_XSD_1999 = "http://www.w3.org/1999/XMLSchema";
- public static final String NS_URI_XSD_2000 = "http://www.w3.org/2000/10/XMLSchema";
- public static final String NS_URI_XSD_2001 = "http://www.w3.org/2001/XMLSchema";
-
- //Schema QNames
- public static final QName Q_ELEM_XSD_1999 = new QName(NS_URI_XSD_1999, ELEM_SCHEMA);
- public static final QName Q_ELEM_XSD_2000 = new QName(NS_URI_XSD_2000, ELEM_SCHEMA);
- public static final QName Q_ELEM_XSD_2001 = new QName(NS_URI_XSD_2001, ELEM_SCHEMA);
- public static final List<QName> XSD_QNAME_LIST =
- Arrays.asList(new QName[] {Q_ELEM_XSD_1999, Q_ELEM_XSD_2000, Q_ELEM_XSD_2001});
-
- public Axis2ServiceProvider(RuntimeComponent component,
- AbstractContract contract,
- WebServiceBinding wsBinding,
- ServletHost servletHost,
- MessageFactory messageFactory,
- List<PolicyHandlerTuple> policyHandlerClassnames) {
-
- this.component = component;
- this.contract = contract;
- this.wsBinding = wsBinding;
- this.servletHost = servletHost;
- this.messageFactory = messageFactory;
- this.policyHandlerClassnames = policyHandlerClassnames;
-
- final boolean isRampartRequired = AxisPolicyHelper.isRampartRequired(wsBinding);
- try {
- // TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator();
- // Allow privileged access to read properties. Requires PropertyPermission read in
- // security policy.
- TuscanyAxisConfigurator tuscanyAxisConfigurator =
- AccessController.doPrivileged(new PrivilegedExceptionAction<TuscanyAxisConfigurator>() {
- public TuscanyAxisConfigurator run() throws AxisFault {
- return new TuscanyAxisConfigurator(isRampartRequired);
- }
- });
- configContext = tuscanyAxisConfigurator.getConfigurationContext();
- // deployRampartModule();
- // configureSecurity();
- } catch (PrivilegedActionException e) {
- throw new ServiceRuntimeException(e.getException());
- } catch (AxisFault e) {
- throw new ServiceRuntimeException(e); // TODO: better exception
- }
-
- configContext.setContextRoot(servletHost.getContextPath());
-
- // Enable MTOM if the policy intent is specified.
- if (AxisPolicyHelper.isIntentRequired(wsBinding, AxisPolicyHelper.MTOM_INTENT)) {
- configContext.getAxisConfiguration().getParameter(Configuration.ENABLE_MTOM).setLocked(false);
- configContext.getAxisConfiguration().getParameter(Configuration.ENABLE_MTOM).setValue("true");
- }
-
- // Update port addresses with runtime information, and create a
- // map from endpoint URIs to WSDL ports that eliminates duplicate
- // ports for the same endpoint.
- for (Object port : wsBinding.getService().getPorts().values()) {
- String portAddress = getPortAddress((Port)port);
- String endpointURI = computeEndpointURI(portAddress, servletHost);
- setPortAddress((Port)port, endpointURI);
- urlMap.put(endpointURI, (Port)port);
- }
-
- // find out which policies are active
- if (wsBinding instanceof PolicySetAttachPoint) {
- List<PolicySet> policySets = ((PolicySetAttachPoint)wsBinding).getApplicablePolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (BasicAuthenticationPolicy.class.isInstance(p)) {
- basicAuthenticationPolicy = (BasicAuthenticationPolicy)p;
- } else if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {
- axis2TokenAuthenticationPolicy = (Axis2TokenAuthenticationPolicy)p;
- } else if (Axis2HeaderPolicy.class.isInstance(p)) {
- axis2HeaderPolicies.add((Axis2HeaderPolicy)p);
- } else {
- // etc. check for other types of policy being present
- }
- }
- }
- }
- }
-
- static String getPortAddress(Port port) {
- Object ext = port.getExtensibilityElements().get(0);
- if (ext instanceof SOAPAddress) {
- return ((SOAPAddress)ext).getLocationURI();
- }
- if (ext instanceof SOAP12Address) {
- return ((SOAP12Address)ext).getLocationURI();
- }
- return null;
- }
-
- static void setPortAddress(Port port, String locationURI) {
- Object ext = port.getExtensibilityElements().get(0);
- if (ext instanceof SOAPAddress) {
- ((SOAPAddress)ext).setLocationURI(locationURI);
- }
- if (ext instanceof SOAP12Address) {
- ((SOAP12Address)ext).setLocationURI(locationURI);
- }
- }
-
- // FIXME: [rfeng] Need to have a better way
- private EndpointReference createEndpointReference(String uri) {
- FactoryExtensionPoint factories =
- component.getComponentContext().getExtensionPointRegistry().getExtensionPoint(FactoryExtensionPoint.class);
- RuntimeAssemblyFactory factory = (RuntimeAssemblyFactory)factories.getFactory(AssemblyFactory.class);
- return factory.createEndpointReference(uri);
- }
-
- private String computeEndpointURI(String uri, ServletHost servletHost) {
-
- if (uri == null) {
- return null;
- }
-
- // pull out the binding intents to see what sort of transport is required
- PolicySet transportJmsPolicySet = AxisPolicyHelper.getPolicySet(wsBinding, TRANSPORT_JMS_QUALIFIED_INTENT);
- if (transportJmsPolicySet != null){
- if (!uri.startsWith("jms:/")) {
- uri = "jms:" + uri;
- }
-
- // construct the rest of the URI based on the policy. All the details are put
- // into the URI here rather than being place directly into the Axis configuration
- // as the Axis JMS sender relies on parsing the target URI
- Axis2ConfigParamPolicy axis2ConfigParamPolicy = null;
- for ( Object policy : transportJmsPolicySet.getPolicies() ) {
- if ( policy instanceof Axis2ConfigParamPolicy ) {
- axis2ConfigParamPolicy = (Axis2ConfigParamPolicy)policy;
- Iterator paramIterator = axis2ConfigParamPolicy.getParamElements().get(DEFAULT_QUEUE_CONNECTION_FACTORY).getChildElements();
-
- if (paramIterator.hasNext()){
- StringBuffer uriParams = new StringBuffer("?");
-
- while (paramIterator.hasNext()){
- OMElement parameter = (OMElement)paramIterator.next();
- uriParams.append(parameter.getAttributeValue(new QName("","name")));
- uriParams.append("=");
- uriParams.append(parameter.getText());
-
- if (paramIterator.hasNext()){
- uriParams.append("&");
- }
- }
-
- uri = uri + uriParams;
- }
- }
- }
- } else {
- if (!uri.startsWith("jms:")) {
- uri = servletHost.getURLMapping(uri).toString();
- }
- }
-
- return uri;
- }
-
- public void start() {
-
- try {
- createPolicyHandlers();
- for (Map.Entry<String, Port> entry : urlMap.entrySet()) {
- AxisService axisService = createAxisService(entry.getKey(), entry.getValue());
- configContext.getAxisConfiguration().addService(axisService);
- }
- setupPolicyHandlers(policyHandlerList, configContext);
-
- Axis2ServiceServlet servlet = null;
- for (String endpointURL : urlMap.keySet()) {
- if (endpointURL.startsWith("http://") || endpointURL.startsWith("https://") || endpointURL.startsWith("/")) {
- if (servlet == null) {
- servlet = new Axis2ServiceServlet();
- servlet.init(configContext);
- }
- //[nash] configContext.setContextRoot(endpointURL);
- servletHost.addServletMapping(endpointURL, servlet);
- } else if (endpointURL.startsWith("jms")) {
- logger.log(Level.INFO,"Axis2 JMS URL=" + endpointURL);
-
- jmsListener = new JMSListener();
- jmsSender = new JMSSender();
- ListenerManager listenerManager = configContext.getListenerManager();
- TransportInDescription trsIn = configContext.getAxisConfiguration().getTransportIn(Constants.TRANSPORT_JMS);
-
- // get JMS transport parameters from the computed URL
- Map<String, String> jmsProps = JMSUtils.getProperties(endpointURL);
-
- // collect the parameters used to configure the JMS transport
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMElement parms = fac.createOMElement(DEFAULT_QUEUE_CONNECTION_FACTORY, null);
-
- for ( String key : jmsProps.keySet() ) {
- OMElement param = fac.createOMElement("parameter", null);
- param.addAttribute( "name", key, null );
- param.addChild(fac.createOMText(param, jmsProps.get(key)));
- parms.addChild(param);
- }
-
- Parameter queueConnectionFactory = new Parameter(DEFAULT_QUEUE_CONNECTION_FACTORY, parms);
- trsIn.addParameter( queueConnectionFactory );
-
- trsIn.setReceiver(jmsListener);
-
- configContext.getAxisConfiguration().addTransportIn( trsIn );
- TransportOutDescription trsOut = configContext.getAxisConfiguration().getTransportOut(Constants.TRANSPORT_JMS);
- //configContext.getAxisConfiguration().addTransportOut( trsOut );
- trsOut.setSender(jmsSender);
-
- if (listenerManager == null) {
- listenerManager = new ListenerManager();
- listenerManager.init(configContext);
- }
- listenerManager.addListener(trsIn, true);
- jmsSender.init(configContext, trsOut);
- jmsListener.init(configContext, trsIn);
- jmsListener.start();
- }
- }
- } catch (AxisFault e) {
- throw new RuntimeException(e);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- } catch (InstantiationException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- }
-
- public void stop() {
- if ( jmsListener != null ) {
- jmsListener.stop();
- jmsListener.destroy();
- }
- else {
- for (String endpointURL : urlMap.keySet()) {
- servletHost.removeServletMapping(endpointURL);
- }
- }
-
- if ( jmsSender != null )
- jmsSender.stop();
-
- try {
- for (String endpointURL : urlMap.keySet()) {
- // get the path to the service
- URI uriPath = new URI(endpointURL);
- String stringURIPath = uriPath.getPath();
-
- /* [nash] Need a leading slash for WSDL imports to work with ?wsdl
- // remove any "/" from the start of the path
- if (stringURIPath.startsWith("/")) {
- stringURIPath = stringURIPath.substring(1, stringURIPath.length());
- }
- */
-
- configContext.getAxisConfiguration().removeService(stringURIPath);
- }
- } catch (URISyntaxException e) {
- throw new RuntimeException(e);
- } catch (AxisFault e) {
- throw new RuntimeException(e);
- }
- }
-
- private AxisService createAxisService(String endpointURL, Port port) throws AxisFault {
- AxisService axisService;
- if (wsBinding.getWSDLDocument() != null) {
- axisService = createWSDLAxisService(endpointURL, port);
- } else {
- axisService = createJavaAxisService(endpointURL);
- }
- initAxisOperations(axisService);
- return axisService;
- }
-
- /**
- * Create an AxisService from the interface class from the SCA service interface
- */
- protected AxisService createJavaAxisService(String endpointURL) throws AxisFault {
- AxisService axisService = new AxisService();
- String path = URI.create(endpointURL).getPath();
- axisService.setName(path);
- axisService.setServiceDescription("Tuscany configured AxisService for service: " + endpointURL);
- axisService.setClientSide(false);
- Parameter classParam =
- new Parameter(Constants.SERVICE_CLASS, ((JavaInterface)contract.getInterfaceContract().getInterface())
- .getJavaClass().getName());
- axisService.addParameter(classParam);
- try {
- Utils.fillAxisService(axisService, configContext.getAxisConfiguration(), null, null);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- return axisService;
- }
-
- /**
- * Workaround for https://issues.apache.org/jira/browse/AXIS2-3205
- * @param definition
- * @param serviceName
- * @return
- */
- private static Definition getDefinition(Definition definition, QName serviceName) {
-
- if (serviceName == null){
- return definition;
- }
-
- if (definition == null) {
- return null;
- }
- Object service = definition.getServices().get(serviceName);
- if (service != null) {
- return definition;
- }
- for (Object i : definition.getImports().values()) {
- List<Import> imports = (List<Import>)i;
- for (Import imp : imports) {
- Definition d = getDefinition(imp.getDefinition(), serviceName);
- if (d != null) {
- return d;
- }
- }
- }
- return null;
- }
-
- /**
- * Create an AxisService from the WSDL doc used by ws binding
- */
- protected AxisService createWSDLAxisService(String endpointURL, Port port) throws AxisFault {
-
- Definition definition = wsBinding.getWSDLDocument();
- QName serviceQName = wsBinding.getService().getQName();
- Definition def = getDefinition(definition, serviceQName);
-
- final WSDLToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(def, serviceQName, port.getName());
- builder.setServerSide(true);
- // [rfeng] Add a custom resolver to work around WSCOMMONS-228
- builder.setCustomResolver(new URIResolverImpl(def));
- builder.setBaseUri(def.getDocumentBaseURI());
- // [rfeng]
- // AxisService axisService = builder.populateService();
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- AxisService axisService;
- try {
- axisService = AccessController.doPrivileged(new PrivilegedExceptionAction<AxisService>() {
- public AxisService run() throws AxisFault {
- return builder.populateService();
- }
- });
- } catch (PrivilegedActionException e) {
- throw (AxisFault)e.getException();
- }
-
- String name = URI.create(endpointURL).getPath();
- //[nash] HTTP endpoints need a leading slash for WSDL imports to work with ?wsdl
- if (endpointURL.startsWith("jms")) {
- name = name.startsWith("/") ? name.substring(1) : name;
- }
- axisService.setName(name);
- axisService.setEndpointURL(endpointURL);
- axisService.setDocumentation("Tuscany configured AxisService for service: " + endpointURL);
- for ( Iterator i = axisService.getEndpoints().values().iterator(); i.hasNext(); ) {
- AxisEndpoint ae = (AxisEndpoint)i.next();
- if (endpointURL.startsWith("jms") ) {
- Parameter qcf = new Parameter(JMSConstants.CONFAC_PARAM, null);
- qcf.setValue(DEFAULT_QUEUE_CONNECTION_FACTORY);
- axisService.addParameter(qcf);
- break;
- }
- }
-
- // Add schema information to the AxisService (needed for "?xsd=" support)
- addSchemas(wsBinding.getWSDLDefinition(), axisService);
-
- // Use the existing WSDL
- Parameter wsdlParam = new Parameter("wsdl4jDefinition", null);
- wsdlParam.setValue(definition);
- axisService.addParameter(wsdlParam);
- Parameter userWSDL = new Parameter("useOriginalwsdl", "true");
- axisService.addParameter(userWSDL);
-
- // Modify schema imports and includes to add "servicename?xsd=" prefix.
- // Axis2 does this for schema extensibility elements, but Tuscany has
- // overriden the WSDl4J deserializer to create UnknownExtensibilityElement
- // elements in place of these.
- modifySchemaImportsAndIncludes(definition, name);
-
- // Axis2 1.3 has a bug with returning incorrect values for the port
- // addresses. To work around this, compute the values here.
- Parameter modifyAddr = new Parameter("modifyUserWSDLPortAddress", "false");
- axisService.addParameter(modifyAddr);
-
- return axisService;
- }
-
- private void addSchemas(WSDLDefinition wsdlDef, AxisService axisService) {
- for (XSDefinition xsDef : wsdlDef.getXmlSchemas()) {
- if (xsDef.getSchema() != null) {
- axisService.addSchema(xsDef.getSchema());
- updateSchemaRefs(xsDef.getSchema(), axisService.getName());
- }
- }
- for (WSDLDefinition impDef : wsdlDef.getImportedDefinitions()) {
- addSchemas(impDef, axisService);
- }
- }
-
- private void updateSchemaRefs(XmlSchema parentSchema, String name) {
- for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) {
- Object obj = iter.next();
- if (obj instanceof XmlSchemaExternal) {
- XmlSchemaExternal extSchema = (XmlSchemaExternal)obj;
- String location = extSchema.getSchemaLocation();
- if (location.length() > 0 && location.indexOf(":/") < 0 && location.indexOf("?xsd=") < 0) {
- extSchema.setSchemaLocation(name + "?xsd=" + location);
- }
- if (extSchema.getSchema() != null) {
- updateSchemaRefs(extSchema.getSchema(), name);
- }
- }
- }
- }
-
- private void modifySchemaImportsAndIncludes(Definition definition, String name){
- // adjust the schema locations in types section
- Types types = definition.getTypes();
- if (types != null) {
- for (Iterator iter = types.getExtensibilityElements().iterator(); iter.hasNext();) {
- Object ext = iter.next();
- if (ext instanceof UnknownExtensibilityElement &&
- XSD_QNAME_LIST.contains(((UnknownExtensibilityElement)ext).getElementType())) {
- changeLocations(((UnknownExtensibilityElement)ext).getElement(), name);
- }
- }
- }
- for (Iterator iter = definition.getImports().values().iterator(); iter.hasNext();) {
- Vector values = (Vector)iter.next();
- for (Iterator valuesIter = values.iterator(); valuesIter.hasNext();) {
- Import wsdlImport = (Import)valuesIter.next();
- modifySchemaImportsAndIncludes(wsdlImport.getDefinition(), name);
- }
- }
- }
-
- private void changeLocations(Element element, String name) {
- NodeList nodeList = element.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- String tagName = nodeList.item(i).getLocalName();
- if (IMPORT_TAG.equals(tagName) || INCLUDE_TAG.equals(tagName)) {
- processImport(nodeList.item(i), name);
- }
- }
- }
-
- private void processImport(Node importNode, String name) {
- NamedNodeMap nodeMap = importNode.getAttributes();
- for (int i = 0; i < nodeMap.getLength(); i++) {
- Node attribute = nodeMap.item(i);
- if (attribute.getNodeName().equals("schemaLocation")) {
- String location = attribute.getNodeValue();
- if (location.indexOf(":/") < 0 & location.indexOf("?xsd=") < 0) {
- attribute.setNodeValue(name + "?xsd=" + location);
- }
- }
- }
- }
-
- protected void initAxisOperations(AxisService axisService) {
- for (Iterator<?> i = axisService.getOperations(); i.hasNext();) {
- AxisOperation axisOp = (AxisOperation)i.next();
- Operation op = getOperation(axisOp);
- if (op != null) {
-
- if (op.isNonBlocking()) {
- axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY);
- } else {
- axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT);
- }
-
- MessageReceiver msgrec = null;
- if (op.isNonBlocking()) {
- msgrec = new Axis2ServiceInMessageReceiver(this, op, policyHandlerList);
- } else {
- msgrec = new Axis2ServiceInOutSyncMessageReceiver(this, op, policyHandlerList);
- }
- axisOp.setMessageReceiver(msgrec);
- }
- }
- }
-
- protected Operation getOperation(AxisOperation axisOp) {
- String operationName = axisOp.getName().getLocalPart();
- Interface iface = wsBinding.getBindingInterfaceContract().getInterface();
- for (Operation op : iface.getOperations()) {
- if (op.getName().equalsIgnoreCase(operationName)) {
- return op;
- }
- }
- return null;
- }
-
- // methods for Axis2 message receivers
-
- public Object invokeTarget(Operation op, Object[] args, MessageContext inMC) throws InvocationTargetException {
- String callbackAddress = null;
- String callbackID = null;
- Object conversationID = null;
-
- // create a message object and set the args as its body
- Message msg = messageFactory.createMessage();
- msg.setBody(args);
- msg.setOperation(op);
-
- //FIXME: can we use the Axis2 addressing support for this?
- SOAPHeader header = inMC.getEnvelope().getHeader();
- if (header != null) {
- OMElement from = header.getFirstChildWithName(QNAME_WSA_FROM);
- if (from != null) {
- OMElement callbackAddrElement = from.getFirstChildWithName(QNAME_WSA_ADDRESS);
- if (callbackAddrElement != null) {
- if (contract.getInterfaceContract().getCallbackInterface() != null) {
- callbackAddress = callbackAddrElement.getText();
- }
- }
- OMElement params = from.getFirstChildWithName(QNAME_WSA_REFERENCE_PARAMETERS);
- if (params != null) {
- OMElement convIDElement =
- params.getFirstChildWithName(Axis2BindingInvoker.CONVERSATION_ID_REFPARM_QN);
- if (convIDElement != null) {
- if (isConversational()) {
- conversationID = convIDElement.getText();
- }
- }
- OMElement callbackIDElement =
- params.getFirstChildWithName(Axis2BindingInvoker.CALLBACK_ID_REFPARM_QN);
- if (callbackIDElement != null) {
- callbackID = callbackIDElement.getText();
- }
- }
- }
-
- // get policy specified headers
- for (Axis2HeaderPolicy policy : axis2HeaderPolicies){
- //Axis2BindingHeaderConfigurator.getHeader(inMC, msg, policy.getHeaderName());
- }
-
- if (axis2TokenAuthenticationPolicy != null) {
- Axis2SOAPHeaderString tokenHeader = new Axis2SOAPHeaderString();
- Axis2BindingHeaderConfigurator.getHeader(inMC,
- msg,
- axis2TokenAuthenticationPolicy.getTokenName(),
- tokenHeader);
- }
- }
-
- //fill message with QoS context info
- fillQoSContext(msg, inMC);
-
- // if reference parameters are needed, create a new "From" EPR to hold them
- EndpointReference from = null;
- ReferenceParameters parameters = null;
- if (callbackAddress != null ||
- callbackID != null ||
- conversationID != null) {
- from = createEndpointReference(null);
- parameters = from.getReferenceParameters();
- msg.setFrom(from);
- }
-
- // set the reference parameters into the "From" EPR
- if (callbackAddress != null) {
- parameters.setCallbackReference(createEndpointReference(callbackAddress));
- }
- if (callbackID != null) {
- parameters.setCallbackID(callbackID);
- }
- if (conversationID != null) {
- parameters.setConversationID(conversationID);
- }
-
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.beforeInvoke(msg, inMC);
- }
-
- if (basicAuthenticationPolicy != null) {
- Axis2BindingBasicAuthenticationConfigurator.parseHTTPHeader(inMC, msg, basicAuthenticationPolicy);
- }
-
- // find the runtime wire and invoke it with the message
- RuntimeWire wire = ((RuntimeComponentService)contract).getRuntimeWire(getBinding());
- Object response = wire.invoke(op, msg);
-
- for ( PolicyHandler policyHandler : policyHandlerList ) {
- policyHandler.afterInvoke(response, inMC);
- }
-
- return response;
- }
-
- public boolean isConversational() {
- return wsBinding.getBindingInterfaceContract().getInterface().isConversational();
- }
-
- /**
- * Return the binding for this provider as a primitive binding type
- * For use when looking up wires registered against the binding.
- *
- * @return the binding
- */
- protected Binding getBinding() {
- return wsBinding;
- }
-
- private void setupPolicyHandlers(List<PolicyHandler> policyHandlers, ConfigurationContext configContext) {
- for ( PolicyHandler aHandler : policyHandlers ) {
- aHandler.setUp(configContext);
- }
- }
-
- private void createPolicyHandlers() throws IllegalAccessException,
- InstantiationException,
- ClassNotFoundException {
- if (wsBinding instanceof PolicySetAttachPoint) {
- PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)wsBinding;
- PolicyHandler policyHandler = null;
-
- for (PolicySet policySet : policiedBinding.getPolicySets()) {
- policyHandler =
- PolicyHandlerUtils.findPolicyHandler(policySet, policyHandlerClassnames);
-
- if (policyHandler != null) {
- policyHandler.setApplicablePolicySet(policySet);
- policyHandlerList.add(policyHandler);
- }
- }
-
- // code to create policy handlers using a policy SPI based
- // on policy providers
-/*
- List<PolicyProvider> policyProviders = ((RuntimeComponentService)contract).getPolicyProviders(wsBinding);
-
- for (PolicyProvider policyProvider : policyProviders){
- policyHandler = policyProvider.createHandler();
- if (policyHandler != null) {
- policyHandlerList.add(policyHandler);
- }
- }
-*/
- }
- }
-
- private void fillQoSContext(Message message, MessageContext axis2MsgCtx) {
- if ( axis2MsgCtx.getProperty(WSHandlerConstants.RECV_RESULTS) != null &&
- axis2MsgCtx.getProperty(WSHandlerConstants.RECV_RESULTS) instanceof Vector ) {
- Vector recvResults = (Vector)axis2MsgCtx.getProperty(WSHandlerConstants.RECV_RESULTS);
- for ( int count1 = 0 ; count1 < recvResults.size() ; ++count1 ) {
- if ( recvResults.elementAt(count1) instanceof WSHandlerResult ) {
- WSHandlerResult wshr = (WSHandlerResult)recvResults.elementAt(count1);
- Vector results = wshr.getResults();
- for ( int count2 = 0 ; count2 < results.size() ; ++count2 ) {
- if ( results.elementAt(count2) instanceof WSSecurityEngineResult ) {
- WSSecurityEngineResult securityResult =
- (WSSecurityEngineResult)wshr.getResults().elementAt(count2);
- if ( securityResult.get("principal") != null ) {
- message.getHeaders().add(securityResult.get("principal"));
- }
- }
- }
- }
- }
-
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceServlet.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceServlet.java
deleted file mode 100644
index 746b850ff0..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceServlet.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.SocketException;
-import java.net.URI;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.transport.http.AxisServlet;
-import org.apache.axis2.transport.http.ListingAgent;
-import org.apache.axis2.transport.http.server.HttpUtils;
-
-/**
- * This overrides the Servlet init of the AxisServlet so Tuscany can use
- * a single Axis2 ConfigurationContext instance shared between AxisServlet
- * instances for each SCA service with a ws binding.
- * TODO: need to review if thats really what we want to be doing
- *
- * @version $Rev$ $Date$
- */
-public class Axis2ServiceServlet extends AxisServlet {
-
- protected TuscanyListingAgent agent;
-
- private static final long serialVersionUID = 1L;
- private static final ServletConfig DUMMY_CONFIG = createDummyServletConfig();
-
-//JIRA TUSCANY-1561 Port to Axis2 1.3
- private ConfigurationContext tmpconfigContext;
-
- public void init(ConfigurationContext configContext) {
- this.tmpconfigContext = configContext;
- try {
- super.init(DUMMY_CONFIG);
- } catch (ServletException e) {
- throw new RuntimeException(e);
- }
- agent = new TuscanyListingAgent(configContext);
- }
-
- /**
- * Override Axis2 Servlet method to avoid loop when init
- * is called after servletConfig already initialized by
- * this classes init(ConfigurationContext) method.
- */
- @Override
- public void init() throws ServletException {
- }
-
- @Override
- public void init(ServletConfig config) throws ServletException {
- ServletContext servletContext = config.getServletContext();
- servletContext.setAttribute(CONFIGURATION_CONTEXT, tmpconfigContext);
- super.init(config);
- }
-
- /**
- * We've setup the Servlet by passing in a ConfigurationContext on our init method
- * override this method to just return that
- */
- @Override
- protected ConfigurationContext initConfigContext(ServletConfig config) throws ServletException {
- return this.tmpconfigContext;
- }
-
- @Override
- public ServletConfig getServletConfig() {
- return DUMMY_CONFIG;
- }
-
- @Override
- public String getServletName() {
- return "TuscanyAxis2Servlet";
- }
-
- /**
- * The AxisServlet gets NPE during init without a ServletConfig so this is a mocked up one to prevent that.
- */
- private static ServletConfig createDummyServletConfig() {
- ServletConfig sc = new ServletConfig() {
-
- public String getServletName() {
- return "TuscanyAxis2DummyServlet";
- }
-
- public ServletContext getServletContext() {
- return new ServletContext() {
-
- public ServletContext getContext(String uripath) {
- return null;
- }
-
- @SuppressWarnings("unused") // it's on the Servlet 2.5 API so we need it
- public String getContextPath() {
- return null;
- }
-
- public int getMajorVersion() {
- return 0;
- }
-
- public int getMinorVersion() {
- return 0;
- }
-
- public String getMimeType(String file) {
- return null;
- }
-
- public Set<?> getResourcePaths(String path) {
- return Collections.emptySet();
- }
-
- public URL getResource(String path) throws MalformedURLException {
- if("/".equals(path)) {
- // HACK: To avoid NPE
- return new URL("/axis2");
- }
- return null;
- }
-
- public InputStream getResourceAsStream(String path) {
- return null;
- }
-
- public RequestDispatcher getRequestDispatcher(String path) {
- return null;
- }
-
- public RequestDispatcher getNamedDispatcher(String arg0) {
- return null;
- }
-
- public Servlet getServlet(String arg0) throws ServletException {
- return null;
- }
-
- public Enumeration getServlets() {
- return null;
- }
-
- public Enumeration getServletNames() {
- return null;
- }
-
- public void log(String arg0) {
- }
-
- public void log(Exception arg0, String arg1) {
- }
-
- public void log(String arg0, Throwable arg1) {
- }
-
- public String getRealPath(String arg0) {
- return null;
- }
-
- public String getServerInfo() {
- return null;
- }
-
- public String getInitParameter(String arg0) {
- return null;
- }
-
- public Enumeration getInitParameterNames() {
- return null;
- }
-
- public Object getAttribute(String arg0) {
- return null;
- }
-
- public Enumeration getAttributeNames() {
- return null;
- }
-
- public void setAttribute(String arg0, Object arg1) {
- }
-
- public void removeAttribute(String arg0) {
- }
-
- public String getServletContextName() {
- return null;
- }
- };
- }
-
- public String getInitParameter(String arg0) {
- return null;
- }
-
- public Enumeration getInitParameterNames() {
- return new Vector().elements();
- }
- };
- return sc;
- }
-
- @Override
- public void destroy() {
- try {
- super.destroy();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Override the AxisServlet doGet to use the TuscanyListingAgent for ?wsdl
- */
- @Override
- protected void doGet(HttpServletRequest request,
- HttpServletResponse response) throws ServletException, IOException {
-
- initContextRoot(request);
-
- String query = request.getQueryString();
- if ((query != null) && (query.indexOf("wsdl2") >= 0 ||
- query.indexOf("wsdl") >= 0 || query.indexOf("xsd") >= 0 ||
- query.indexOf("policy") >= 0)) {
- agent.processListService(request, response);
- } else {
- super.doGet(request, response);
- }
- }
-
- /**
-
- /**
- * Override the AxisServlet method so as to not add "/services" into the URL
- * and to work with Tuscany service names. can go once moved to Axis2 1.3
- */
- @Override
- public EndpointReference[] getEPRsForService(String serviceName, String ip) throws AxisFault {
- //RUNNING_PORT
- String port = (String) configContext.getProperty(ListingAgent.RUNNING_PORT);
- if (port == null) {
- port = "8080";
- }
- if (ip == null) {
- try {
- ip = HttpUtils.getIpAddress();
- if (ip == null) {
- ip = "localhost";
- }
- } catch (SocketException e) {
-//TUSCANY-1561 Port to Axis2 1.3
-// throw new AxisFault.(e);
- throw AxisFault.makeFault(e);
- }
- }
-
- URI epURI = URI.create("http://" + ip + ":" + port + "/" + serviceName).normalize();
-
- return new EndpointReference[]{new EndpointReference(epURI.toString())};
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java
deleted file mode 100644
index 1f389b422f..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * @version $Rev$ $Date$
- */
-public class AxisPolicyHelper {
-
- public static final String XMLNS_SCA_1_0 = "http://www.osoa.org/xmlns/sca/1.0";
- public static final QName AUTHENTICATION_INTENT = new QName(XMLNS_SCA_1_0, "authentication");
- public static final QName CONFIDENTIALITY_INTENT = new QName(XMLNS_SCA_1_0, "confidentiality");
- public static final QName INTEGRITY_INTENT = new QName(XMLNS_SCA_1_0, "integrity");
- public static final QName MTOM_INTENT = new QName(XMLNS_SCA_1_0, "MTOM");
- public static final QName SOAP12_INTENT = new QName(XMLNS_SCA_1_0, "SOAP12");
-
- public static PolicySet getPolicySet(Binding wsBinding, QName intentName) {
- PolicySet returnPolicySet = null;
-
- if (wsBinding instanceof PolicySetAttachPoint) {
- PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)wsBinding;
- for (PolicySet policySet : policiedBinding.getPolicySets()) {
- for (Intent intent : policySet.getProvidedIntents()) {
- if (intent.getName().equals(intentName)) {
- returnPolicySet = policySet;
- break;
- }
- }
- }
- }
-
- return returnPolicySet;
- }
-
- public static boolean isIntentRequired(Binding wsBinding, QName intent) {
- if (wsBinding instanceof IntentAttachPoint) {
- List<Intent> intents = ((IntentAttachPoint)wsBinding).getRequiredIntents();
- for (Intent i : intents) {
- if (intent.equals(i.getName())) {
- return true;
- }
- }
- }
- return getPolicySet(wsBinding, intent) != null;
- }
-
- public static boolean isRampartRequired(Binding wsBinding) {
- return isIntentRequired(wsBinding, AUTHENTICATION_INTENT) || isIntentRequired(wsBinding, INTEGRITY_INTENT)
- || isIntentRequired(wsBinding, CONFIDENTIALITY_INTENT);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java
deleted file mode 100644
index 853bfbc0cb..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.deployment.DeploymentConstants;
-import org.apache.axis2.deployment.DeploymentErrorMsgs;
-import org.apache.axis2.deployment.DeploymentException;
-import org.apache.axis2.deployment.ModuleBuilder;
-import org.apache.axis2.deployment.URLBasedAxisConfigurator;
-import org.apache.axis2.description.AxisModule;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisConfigurator;
-import org.apache.axis2.i18n.Messages;
-
-/**
- * Helps configure Axis2 from a resource in binding.ws.axis2 instead of Axis2.xml
- * <p/> TODO: Review: should there be a single global Axis ConfigurationContext
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyAxisConfigurator extends URLBasedAxisConfigurator implements AxisConfigurator {
-
- /* these two fields are part of a temporary fix to solve problems that Maven has with including
- * rampart-1.4.mar into the classpath and also at the time of Release 1.0 rampart-1.4.mar seems
- * to pull in a SNAPSHOT version of rampart-project pom. Hence rampart.mar has been excluded
- * as a Maven dependency and has been packed with this module
- */
- /************start of fix *********************************************************************/
- private URL axis2_xml =
- getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml");
- private URL axis2_repository = null;
- private URL rampart_mar_url =
- getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.4.mar");
- /************** end of fix *************************************************************/
-
- private boolean isRampartRequired;
-
- public TuscanyAxisConfigurator(boolean isRampartRequired) throws AxisFault {
- //super(TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml"),
- // TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart.mar"));
- super(getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml"),
- null);
- this.isRampartRequired = isRampartRequired;
- }
-
- private static URL getResource(final String name) {
- return AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- return TuscanyAxisConfigurator.class.getResource(name);
- }
- });
- }
-
- public ConfigurationContext getConfigurationContext() throws AxisFault {
- if (configContext == null) {
- configContext = ConfigurationContextFactory.createConfigurationContext(this);
- }
- return configContext;
- }
-
- private InputStream getResourceAsStream(final String resource) {
- return AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
- public InputStream run() {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- return cl.getResourceAsStream(resource);
- }
- });
- }
-
- /* these three methods are part of a temporary fix to solve problems that Maven has with including
- * rampart-1.3.mar into the classpath and also at the time of Release 1.0 rampart-1.3.mar seems
- * to pull in a SNAPSHOT version of rampart-project pom. Hence rampart.mar has been excluded
- * as a Maven dependency and has been packed with this module
- */
- /************start of fix *********************************************************************/
- @Override
- public AxisConfiguration getAxisConfiguration() throws AxisFault {
- InputStream axis2xmlStream;
- try {
- if (axis2_xml == null) {
- axis2xmlStream =
- getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE);
- } else {
- axis2xmlStream = axis2_xml.openStream();
- }
- axisConfig = populateAxisConfiguration(axis2xmlStream);
- if (isRampartRequired) {
- axisConfig.addGlobalModuleRef("rampart");
- }
- if (axis2_repository == null) {
- Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
- if (axis2repoPara != null) {
- String repoValue = (String) axis2repoPara.getValue();
- if (repoValue != null && !"".equals(repoValue.trim())) {
- if (repoValue.startsWith("file:/")) {
- // we treat this case specially , by assuming file is
- // located in the local machine
- loadRepository(repoValue);
- } else {
- loadRepositoryFromURL(new URL(repoValue));
- }
- }
- } else {
- //log.info("No repository found , module will be loaded from classpath");
- try {
- loadFromClassPath();
- } catch ( Exception e ) {
- if (isRampartRequired) {
- loadRampartModule();
- }
- }
- }
-
- } else {
- loadRepositoryFromURL(axis2_repository);
- }
-
- } catch (IOException e) {
- throw new AxisFault(e.getMessage());
- }
- axisConfig.setConfigurator(this);
- return axisConfig;
- }
-
- public void loadRampartModule() throws DeploymentException {
- try {
- ClassLoader deploymentClassLoader =
- org.apache.axis2.deployment.util.Utils.createClassLoader(
- new URL[]{rampart_mar_url},
- axisConfig.getModuleClassLoader(),
- true,
- (File) axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
- final AxisModule module = new AxisModule();
- module.setModuleClassLoader(deploymentClassLoader);
- module.setParent(axisConfig);
- //String moduleFile = fileUrl.substring(0, fileUrl.indexOf(".mar"));
- if (module.getName() == null) {
- module.setName("rampart");
- module.setVersion("1.4");
- }
- populateModule(module, rampart_mar_url);
- module.setFileName(rampart_mar_url);
- // Allow privileged access to read properties. Requires PropertiesPermission read in
- // security policy.
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws IOException {
- addNewModule(module, axisConfig);
- return null;
- }
- });
- } catch (PrivilegedActionException e) {
- throw (AxisFault)e.getException();
- }
-
- calculateDefaultModuleVersion(axisConfig.getModules(), axisConfig);
- axisConfig.validateSystemPredefinedPhases();
- } catch (IOException e) {
- throw new DeploymentException(e);
- }
- }
- /**
- * Get the name of the module , where archive name is combination of module name + its version
- * The format of the name is as follows:
- * moduleName-00.0000
- * Example: "addressing-01.0001.mar" would return "addressing"
- *
- * @param moduleName the name of the module archive
- * @return the module name parsed out of the file name
- */
- public static String getModuleName(String moduleName) {
- if (moduleName.endsWith("-SNAPSHOT")) {
- return moduleName.substring(0, moduleName.indexOf("-SNAPSHOT"));
- }
- char delimiter = '-';
- int version_index = moduleName.lastIndexOf(delimiter);
- if (version_index > 0) {
- String versionString = getModuleVersion(moduleName);
- if (versionString == null) {
- return moduleName;
- } else {
- return moduleName.substring(0, version_index);
- }
- } else {
- return moduleName;
- }
- }
-
- public static String getModuleVersion(String moduleName) {
- if (moduleName.endsWith("-SNAPSHOT")) {
- return "SNAPSHOT";
- }
- char version_seperator = '-';
- int version_index = moduleName.lastIndexOf(version_seperator);
- if (version_index > 0) {
- String versionString = moduleName.substring(version_index + 1, moduleName.length());
- try {
- Float.parseFloat(versionString);
- return versionString;
- } catch (NumberFormatException e) {
- return null;
- }
- } else {
- return null;
- }
- }
-
- public static String getModuleName(String moduleName, String moduleVersion) {
- if (moduleVersion != null && moduleVersion.length() != 0) {
- moduleName = moduleName + "-" + moduleVersion;
- }
- return moduleName;
- }
-
- public static boolean isLatest(String moduleVersion, String currentDefaultVersion) {
- if (AxisModule.VERSION_SNAPSHOT.equals(moduleVersion)) {
- return true;
- } else {
- float m_version = Float.parseFloat(moduleVersion);
- float m_c_vresion = Float.parseFloat(currentDefaultVersion);
- return m_version > m_c_vresion;
- }
- }
-
- public static void calculateDefaultModuleVersion(HashMap modules,
- AxisConfiguration axisConfig) {
- Iterator allModules = modules.values().iterator();
- HashMap defaultModules = new HashMap();
- while (allModules.hasNext()) {
- AxisModule axisModule = (AxisModule) allModules.next();
- String moduleName = axisModule.getName();
- String moduleNameString;
- String moduleVersionString;
- if (AxisModule.VERSION_SNAPSHOT.equals(axisModule.getVersion())) {
- moduleNameString = axisModule.getName();
- moduleVersionString = axisModule.getVersion();
- } else {
- if (axisModule.getVersion() == null) {
- moduleNameString = getModuleName(moduleName);
- moduleVersionString = getModuleVersion(moduleName);
- if (moduleVersionString != null) {
- try {
- Float.valueOf(moduleVersionString);
- axisModule.setVersion(moduleVersionString);
- axisModule.setName(moduleName);
- } catch (NumberFormatException e) {
- moduleVersionString = null;
- }
- }
- } else {
- moduleNameString = axisModule.getName();
- moduleVersionString = axisModule.getVersion();
- }
- }
- String currentDefaultVerison = (String) defaultModules.get(moduleNameString);
- if (currentDefaultVerison != null) {
- // if the module version is null then , that will be ignore in this case
- if (!AxisModule.VERSION_SNAPSHOT.equals(currentDefaultVerison)) {
- if (moduleVersionString != null &&
- isLatest(moduleVersionString, currentDefaultVerison)) {
- defaultModules.put(moduleNameString, moduleVersionString);
- }
- }
- } else {
- defaultModules.put(moduleNameString, moduleVersionString);
- }
-
- }
- Iterator def_mod_itr = defaultModules.keySet().iterator();
- while (def_mod_itr.hasNext()) {
- String moduleName = (String) def_mod_itr.next();
- axisConfig.addDefaultModuleVersion(moduleName, (String) defaultModules.get(moduleName));
- }
- }
-
-
- private void populateModule(AxisModule module, URL moduleUrl) throws DeploymentException {
- try {
- ClassLoader classLoader = module.getModuleClassLoader();
- InputStream moduleStream = classLoader.getResourceAsStream("META-INF/module.xml");
- if (moduleStream == null) {
- moduleStream = classLoader.getResourceAsStream("meta-inf/module.xml");
- }
- if (moduleStream == null) {
- throw new DeploymentException(
- Messages.getMessage(
- DeploymentErrorMsgs.MODULE_XML_MISSING, moduleUrl.toString()));
- }
- ModuleBuilder moduleBuilder = new ModuleBuilder(moduleStream, module, axisConfig);
- moduleBuilder.populateModule();
- } catch (IOException e) {
- throw new DeploymentException(e);
- }
- }
-
- /************** end of fix *************************************************************/
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java
deleted file mode 100644
index 3527061a66..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyDispatcher.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import java.net.URI;
-import java.util.HashMap;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.RequestURIBasedDispatcher;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * A Tuscany specific Axis2 Dispatcher that enables using services
- * exposed at the SCA defined service URI instead of /services/<serviceName>
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyDispatcher extends RequestURIBasedDispatcher {
-
- public static final String NAME = "TuscanyDispatcher";
- private static final Log log = LogFactory.getLog(RequestURIBasedDispatcher.class);
- private static final boolean isDebugEnabled = log.isDebugEnabled();
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
- */
- @Override
- public AxisService findService(MessageContext messageContext) throws AxisFault {
- EndpointReference toEPR = messageContext.getTo();
-
- if (toEPR != null) {
- if(isDebugEnabled){
- log.debug("Checking for Service using target endpoint address : " + toEPR.getAddress());
- }
-
- String path = URI.create(toEPR.getAddress()).getPath();
-
- ConfigurationContext configurationContext = messageContext.getConfigurationContext();
- AxisConfiguration registry = configurationContext.getAxisConfiguration();
-
- String serviceName = findAxisServiceName(registry, path);
- return registry.getService(serviceName);
-
- } else {
- if(isDebugEnabled){
- log.debug("Attempted to check for Service using null target endpoint URI");
- }
- return null;
- }
- }
-
- @Override
- public void initDispatcher() {
- init(new HandlerDescription(NAME));
- }
-
- protected String findAxisServiceName(AxisConfiguration registry, String path) {
- HashMap services = registry.getServices();
- if (services == null) {
- return null;
- }
- String[] parts = path.split("/");
- String serviceName = "";
- for (int i=parts.length-1; i>=0; i--) {
- serviceName = parts[i] + serviceName;
- if (services.containsKey(serviceName)) {
- return serviceName;
- }
- serviceName = "/" + serviceName;
- if (services.containsKey(serviceName)) {
- return serviceName;
- }
- }
-
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
deleted file mode 100644
index 3f8599b118..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.transport.http.ListingAgent;
-import org.apache.axis2.transport.http.server.HttpUtils;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaExternal;
-
-/**
- * A Tuscany specific Axis2 ListingAgent as the Axis2 one does not work
- * with the Tuscany service names which include slash ('/') characters.
- * Unfortunately it ends up having to copy a fair amount of Axis2 code to do this.
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyListingAgent extends ListingAgent {
-
- private static final String LIST_SINGLE_SERVICE_JSP_NAME =
- "listSingleService.jsp";
-
- public TuscanyListingAgent(ConfigurationContext aConfigContext) {
- super(aConfigContext);
- }
-
- /**
- * This method overrides the Axis2 listing agent's computation of the
- * service name.
- */
- @Override
- public String extractServiceName(String urlString) {
- String serviceName = findAxisServiceName(urlString);
- setContextRoot(urlString, serviceName);
- return serviceName;
- }
-
- /**
- * Override ?xsd processing so that WSDL documents with XSD imports
- * and includes work correctly. When we move to Axis2 1.4, we may
- * be able to use SchemaSupplier to do this in a cleaner way. Also
- * ensure that the correct IP address and port are returned by ?wsdl.
- */
- @Override
- public void processListService(HttpServletRequest req,
- HttpServletResponse res)
- throws IOException, ServletException {
-
- String url = req.getRequestURL().toString();
- String query = req.getQueryString();
-
- // for ?wsdl requests, need to update the WSDL with correct IPaddr and port
- int wsdl = query.indexOf("wsdl");
- if (wsdl >= 0) {
- String serviceName = extractServiceName(url);
- HashMap services = configContext.getAxisConfiguration().getServices();
- if ((services != null) && !services.isEmpty()) {
- AxisService axisService = (AxisService)services.get(serviceName);
- Parameter wsld4jdefinition = axisService.getParameter("wsdl4jDefinition");
- Definition definition = (Definition)wsld4jdefinition.getValue();
- for (Object s : definition.getServices().values()) {
- for (Object p : ((Service)s).getPorts().values()) {
- String endpointURL = Axis2ServiceProvider.getPortAddress((Port)p);
- String modifiedURL = setIPAddress(endpointURL, url);
- Axis2ServiceProvider.setPortAddress((Port)p, modifiedURL);
- }
- }
- }
- }
-
- // handle ?xsd requests here
- int xsd = query.indexOf("xsd");
- if (xsd >= 0) {
- String serviceName = extractServiceName(url);
- HashMap services = configContext.getAxisConfiguration().getServices();
- if ((services != null) && !services.isEmpty()) {
- Object serviceObj = services.get(serviceName);
- if (serviceObj != null) {
- String xsds = req.getParameter("xsd");
- if (xsds != null && !"".equals(xsds)) {
- // a schema name (perhaps with path) is present
- AxisService axisService = (AxisService)serviceObj;
- ArrayList schemas = axisService.getSchema();
- for (Object rootSchema : axisService.getSchema()) {
- XmlSchema schema = getSchema(((XmlSchema)rootSchema), xsds);
- if (schema != null) {
- // found the schema
- res.setContentType("text/xml");
- OutputStream out = res.getOutputStream();
- schema.write(new OutputStreamWriter(out, "UTF8"));
- out.flush();
- out.close();
- return;
- }
- }
- }
- }
- }
- }
-
- // in all other cases, delegate to the Axis2 code
- super.processListService(req, res);
- }
-
- private XmlSchema getSchema(XmlSchema parentSchema, String name) {
- for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) {
- Object obj = iter.next();
- if (obj instanceof XmlSchemaExternal) {
- XmlSchemaExternal extSchema = (XmlSchemaExternal)obj;
- if (extSchema.getSchemaLocation().endsWith(name)) {
- return extSchema.getSchema();
- } else {
- XmlSchema schema = getSchema(extSchema.getSchema(), name);
- if (schema != null) {
- return schema;
- }
- }
- }
- }
- return null;
- }
-
- private String findAxisServiceName(String path) {
- HashMap services = configContext.getAxisConfiguration().getServices();
- if (services == null) {
- return null;
- }
- String[] parts = path.split("/");
- String serviceName = "";
- for (int i=parts.length-1; i>=0; i--) {
- serviceName = parts[i] + serviceName;
- if (services.containsKey(serviceName)) {
- return serviceName;
- }
- serviceName = "/" + serviceName;
- if (services.containsKey(serviceName)) {
- return serviceName;
- }
- }
-
- return null;
- }
-
- /**
- * Hack for Tuscany to get ?wsdl working with Tuscany service names
- * Can go once moved up to Axis2 1.3
- */
- private void setContextRoot(String filePart, String serviceName) {
- String contextRoot = configContext.getContextRoot();
- if (contextRoot != null && contextRoot.length() > 0) {
- if (contextRoot.equals("/")) {
- configContext.setServicePath("/");
- } else {
- int i = filePart.indexOf(contextRoot) + contextRoot.length();
- int j = filePart.lastIndexOf(serviceName);
- if (i>=j || (i+1 == j)) {
- configContext.setServicePath("/");
- } else {
- String mapping = filePart.substring(i+1, j);
- configContext.setServicePath(mapping);
- }
- }
- configContext.setContextRoot(contextRoot);
- }
- }
-
- private static String setIPAddress(String wsdlURI, String requestURI) {
- try {
- URI wsdlURIObj = new URI(wsdlURI);
- String wsdlHost = wsdlURIObj.getHost();
- int wsdlPort = wsdlURIObj.getPort();
- String wsdlAddr = wsdlHost + (wsdlPort != -1 ? ":" + Integer.toString(wsdlPort) : "");
- URI requestURIObj = new URI(requestURI);
- String ipAddr = HttpUtils.getIpAddress();
- int requestPort = requestURIObj.getPort();
- String newAddr = ipAddr + (requestPort != -1 ? ":" + Integer.toString(requestPort) : "");
- return wsdlURI.replace(wsdlAddr, newAddr);
- } catch (Exception e) {
- // URI string not in expected format, so return the WSDL URI unmodified
- return wsdlURI;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/WSBindingDefinitionsProvider.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/WSBindingDefinitionsProvider.java
deleted file mode 100644
index 34f752e229..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/WSBindingDefinitionsProvider.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import java.net.URI;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedExceptionAction;
-
-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.provider.DefinitionsProvider;
-import org.apache.tuscany.sca.provider.DefinitionsProviderException;
-
-/**
- * Provider for Policy Intents and PolicySet definitions related to security
- *
- * @version $Rev$ $Date$
- */
-public class WSBindingDefinitionsProvider implements DefinitionsProvider {
- private String definitionsFile = "org/apache/tuscany/sca/binding/ws/axis2/definitions.xml";
- URLArtifactProcessor urlArtifactProcessor = null;
-
- public WSBindingDefinitionsProvider(ExtensionPointRegistry registry) {
- URLArtifactProcessorExtensionPoint documentProcessors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- urlArtifactProcessor = (URLArtifactProcessor)documentProcessors.getProcessor(Definitions.class);
- }
-
- public Definitions getDefinitions() throws DefinitionsProviderException {
- final URL definitionsFileUrl = getClass().getClassLoader().getResource(definitionsFile);
- Definitions scaDefn = null;
- try {
- final URI uri = new URI(definitionsFile);
- // Allow bindings to read properties. Requires PropertyPermission read in security policy.
- scaDefn = AccessController.doPrivileged(new PrivilegedExceptionAction<Definitions>() {
- public Definitions run() throws ContributionReadException {
- return (Definitions)urlArtifactProcessor.read(null, uri, definitionsFileUrl);
- }
- });
- } catch (Exception e) {
- throw new DefinitionsProviderException(e);
- }
- return scaDefn;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java
deleted file mode 100644
index eba7a01798..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingBasicAuthenticationConfigurator.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.configurator;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.security.auth.Subject;
-
-import org.apache.axiom.om.util.Base64;
-import org.apache.axis2.client.OperationClient;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.transport.http.HttpTransportProperties;
-import org.apache.axis2.transport.http.HttpTransportProperties.Authenticator;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.security.SecurityUtil;
-import org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicy;
-import org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPrincipal;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Policy handler to handle PolicySet that contain Axis2ConfigParamPolicy instances
- *
- * @version $Rev$ $Date$
- */
-public class Axis2BindingBasicAuthenticationConfigurator {
-
-
- public static void setOperationOptions(OperationClient operationClient, Message msg, BasicAuthenticationPolicy policy) {
- String username = null;
- String password = null;
-
- // get the security context
- Subject subject = SecurityUtil.getSubject(msg);
- BasicAuthenticationPrincipal principal = SecurityUtil.getPrincipal(subject,
- BasicAuthenticationPrincipal.class);
-
- // could use the security principal to look up basic auth credentials
- if ( principal != null ) {
- username = ((BasicAuthenticationPrincipal)principal).getName();
- password = ((BasicAuthenticationPrincipal)principal).getPassword();
- }
-
- if (username == null || password == null ){
- throw new ServiceRuntimeException("Basic authentication username or password is null");
- }
-
- HttpTransportProperties.Authenticator authenticator = new HttpTransportProperties.Authenticator();
- List<String> auth = new ArrayList<String>();
- auth.add(Authenticator.BASIC);
- authenticator.setAuthSchemes(auth);
- authenticator.setPreemptiveAuthentication(true);
- authenticator.setUsername(username);
- authenticator.setPassword(password);
-
- operationClient.getOptions().setProperty(HTTPConstants.AUTHENTICATE,
- authenticator);
- }
-
- public static void parseHTTPHeader(MessageContext messageContext, Message msg, BasicAuthenticationPolicy policy) {
-
- Map httpHeaderProperties = (Map)messageContext.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
-
- String basicAuthString = (String)httpHeaderProperties.get("Authorization");
- String decodedBasicAuthString = null;
- String username = null;
- String password = null;
-
- if (basicAuthString != null) {
- basicAuthString = basicAuthString.trim();
-
- if (basicAuthString.startsWith("Basic ")) {
- decodedBasicAuthString = new String(Base64.decode(basicAuthString.substring(6)));
- }
-
- int collonIndex = decodedBasicAuthString.indexOf(':');
-
- if (collonIndex == -1){
- username = decodedBasicAuthString;
- } else {
- username = decodedBasicAuthString.substring(0, collonIndex);
- password = decodedBasicAuthString.substring(collonIndex + 1);
- }
- }
-
- // get the security context
- Subject subject = SecurityUtil.getSubject(msg);
- BasicAuthenticationPrincipal principal = new BasicAuthenticationPrincipal(username,
- password);
- subject.getPrincipals().add(principal);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingHeaderConfigurator.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingHeaderConfigurator.java
deleted file mode 100644
index 647f934c02..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configurator/Axis2BindingHeaderConfigurator.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.configurator;
-
-
-
-import javax.xml.namespace.QName;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axis2.context.MessageContext;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicyUtil;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2SOAPHeader;
-import org.apache.tuscany.sca.invocation.Message;
-
-
-/**
- * Policy handler to handle PolicySet that contain Axis2ConfigParamPolicy instances
- *
- * @version $Rev$ $Date$
- */
-public class Axis2BindingHeaderConfigurator {
-
-
- public static void setHeader(MessageContext messageContext, Message msg, QName headerQName) {
-
- if (headerQName != null){
- SOAPEnvelope envelope = messageContext.getEnvelope();
- OMFactory factory = envelope.getOMFactory();
- SOAPHeader soapHeader = envelope.getHeader();
-
- Axis2SOAPHeader header = Axis2HeaderPolicyUtil.getHeader(msg, headerQName) ;
-
- if (header != null){
- soapHeader.addChild(header.getAsSOAPHeaderBlock(factory));
- }
- }
- }
-
- public static void getHeader(MessageContext messageContext, Message msg, QName headerQName, Axis2SOAPHeader header) {
-
- SOAPEnvelope sev = messageContext.getEnvelope();
- SOAPHeader sh = sev.getHeader();
- OMElement omHeader = sh.getFirstChildWithName(headerQName);
-
- header.setAsSOAPHeaderBlock(omHeader);
-
- msg.getHeaders().add(header);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index a48ff54c77..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the binding extension
-org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingProviderFactory;model=org.apache.tuscany.sca.binding.ws.WebServiceBinding
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider
deleted file mode 100644
index 370b83f87b..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for SCA Definitions Providers
-org.apache.tuscany.sca.binding.ws.axis2.WSBindingDefinitionsProvider \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml
deleted file mode 100644
index 6bff613a7c..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
-
- <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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml
deleted file mode 100644
index ea32836f2a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml
+++ /dev/null
@@ -1,504 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<axisconfig name="AxisJava2.0">
- <!-- ================================================= -->
- <!-- Parameters -->
- <!-- ================================================= -->
- <parameter name="hotdeployment">true</parameter>
- <parameter name="hotupdate">false</parameter>
- <parameter name="enableMTOM">false</parameter>
- <parameter name="enableSwA">false</parameter>
-
- <!-- Customized by Tuscany -->
- <!-- parameter name="OutflowSecurity">
- <action>
- <items>Timestamp</items>
- </action>
- </parameter-->
-
- <!--Uncomment if you want to enable file caching for attachments -->
- <!--parameter name="cacheAttachments">true</parameter>
- <parameter name="attachmentDIR"></parameter>
- <parameter name="sizeThreshold">4000</parameter-->
-
- <!--This will give out the timout of the configuration contexts, in milliseconds-->
- <parameter name="ConfigContextTimeoutInterval">30000</parameter>
-
- <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
- <!--that behavior.-->
-
- <!-- Customized by Tuscany -->
- <parameter name="sendStacktraceDetailsWithFaults">true</parameter>
-
- <!--If there aren't any information available to find out the fault reason, we set the message of the exception-->
- <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
- <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
- <!--is set, then Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
- <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
-
- <parameter name="userName">admin</parameter>
- <parameter name="password">axis2</parameter>
-
- <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
- <!--ServicesDirectory only works on the following cases-->
- <!---File based configurator and in that case the value should be a file URL (http:// not allowed)-->
- <!---When creating URL Based configurator with URL “file://†-->
- <!--- War based configurator with expanded case , -->
-
- <!--All the other scenarios it will be ignored.-->
- <!--<parameter name="ServicesDirectory">service</parameter>-->
- <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
- <!--<parameter name="ModulesDirectory">modules</parameter>-->
-
-
-
- <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
- <!--root which can configured using the following contextRoot parameter-->
- <!--<parameter name="contextRoot">axis2</parameter>-->
-
- <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distinguiush those endpoints-->
- <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
- <!--context path to proper Axis2 servlets-->
-
- <!-- Customized by Tuscany -->
- <parameter name="servicePath">/</parameter>
-
- <!--<parameter name="restPath">rest</parameter>-->
-
- <!-- Following parameter will completely disable REST handling in Axis2-->
-
- <parameter name="disableREST" locked="true">false</parameter>
-
- <!--POJO deployer , this will alow users to drop .class file and make that into a service-->
- <deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"/>
-
- <!-- Following parameter will set the host name for the epr-->
- <!--<parameter name="hostname" locked="true">myhost.com</parameter>-->
-
- <!-- If you have a frontend host which exposes this webservice using a different public URL -->
- <!-- use this parameter to override autodetected url -->
- <!--<parameter name="httpFrontendHostUrl">https://someotherhost/context</parameter>-->
-
-
- <!-- The way of adding listener to the system-->
- <!-- <listener class="org.apache.axis2.ObserverIMPL">-->
- <!-- <parameter name="RSS_URL">http://127.0.0.1/rss</parameter>-->
- <!-- </listener>-->
-
- <!-- ================================================= -->
- <!-- Message Receivers -->
- <!-- ================================================= -->
- <!--This is the deafult MessageReceiver for the system , if you want to have MessageReceivers for -->
- <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
- <!--any operation -->
- <!--Note : You can ovrride this for a particular service by adding the same element with your requirement-->
- <messageReceivers>
-
- <!-- Added by Tuscany -->
- <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
- class="org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInMessageReceiver"/>
-
- <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
- class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
- <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
- class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
-
- <!-- Added by Tuscany -->
- <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
- class="org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver"/>
-
- <!-- Added by Tuscany -->
- <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
- class="org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInMessageReceiver"/>
-
- <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
- class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
- <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
- class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
-
- <!-- Added by Tuscany -->
- <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
- class="org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver"/>
-
- </messageReceivers>
- <!-- ================================================= -->
- <!-- Message Formatter -->
- <!-- ================================================= -->
- <!--Following content type to message formatter mapping can be used to implement support for different message -->
- <!--format serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
- <messageFormatters>
- <messageFormatter contentType="application/x-www-form-urlencoded"
- class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
- <messageFormatter contentType="multipart/form-data"
- class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
- <messageFormatter contentType="application/xml"
- class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
- </messageFormatters>
-
- <!-- ================================================= -->
- <!-- Message Builders -->
- <!-- ================================================= -->
- <!--Following content type to builder mapping can be used to implement support for different message -->
- <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
- <messageBuilders>
- <messageBuilder contentType="application/xml"
- class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
- <messageBuilder contentType="application/x-www-form-urlencoded"
- class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
- <messageBuilder contentType="multipart/form-data"
- class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
- </messageBuilders>
-
- <!-- ================================================= -->
- <!-- Transport Ins -->
- <!-- ================================================= -->
- <transportReceiver name="http"
- class="org.apache.axis2.transport.http.SimpleHTTPServer">
-
- <!-- Customized by Tuscany -->
- <parameter name="port" locked="false">6060</parameter>
-
- <!-- Here is the complete list of supported parameters (see example settings further below):
- port: the port to listen on (default 6060)
- hostname: if non-null, url prefix used in reply-to endpoint references (default null)
- originServer: value of http Server header in outgoing messages (default "Simple-Server/1.1")
- requestTimeout: value in millis of time that requests can wait for data (default 20000)
- requestTcpNoDelay: true to maximize performance and minimize latency (default true)
- false to minimize bandwidth consumption by combining segments
- requestCoreThreadPoolSize: number of threads available for request processing (unless queue fills up) (default 25)
- requestMaxThreadPoolSize: number of threads available for request processing if queue fills up (default 150)
- note that default queue never fills up: see HttpFactory
- threadKeepAliveTime: time to keep threads in excess of core size alive while inactive (default 180)
- note that no such threads can exist with default unbounded request queue
- threadKeepAliveTimeUnit: TimeUnit of value in threadKeepAliveTime (default SECONDS) (default SECONDS)
- -->
- <!-- <parameter name="hostname">http://www.myApp.com/ws</parameter> -->
- <!-- <parameter name="originServer">My-Server/1.1</parameter> -->
- <!-- <parameter name="requestTimeout">10000</parameter> -->
- <!-- <parameter name="requestTcpNoDelay">false</parameter> -->
- <!-- <parameter name="requestCoreThreadPoolSize">50</parameter> -->
- <!-- <parameter name="RequestMaxThreadPoolSize">100</parameter> -->
- <!-- <parameter name="threadKeepAliveTime">240000</parameter> -->
- <!-- <parameter name="threadKeepAliveTimeUnit">MILLISECONDS</parameter> -->
- </transportReceiver>
-
- <!-- Added by Tuscany -->
- <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
- <!-- These configuation parameters now come from the binding.ws uri
- or from a policy set
- <parameter name="myTopicConnectionFactory">
- <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
- <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
- <parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
- </parameter>
-
- <parameter name="myQueueConnectionFactory">
- <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
- <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
- <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
- </parameter>
-
- <parameter name="default">
- <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
- <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
- <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
- </parameter>
- -->
- </transportReceiver>
-
- <!-- ================================================= -->
- <!-- Non-blocking http/s Transport Listener -->
-
- <!-- the non blocking http transport based on HttpCore + NIO extensions
- <transportReceiver name="http" class="org.apache.axis2.transport.nhttp.HttpCoreNIOListener">
- <parameter name="port" locked="false">9000</parameter>
- <parameter name="non-blocking" locked="false">true</parameter>
- </transportReceiver>-->
-
- <!-- the non blocking https transport based on HttpCore + SSL-NIO extensions
- <transportReceiver name="https" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSSLListener">
- <parameter name="port" locked="false">9002</parameter>
- <parameter name="non-blocking" locked="false">true</parameter>
- <parameter name="keystore" locked="false">
- <KeyStore>
- <Location>identity.jks</Location>
- <Type>JKS</Type>
- <Password>password</Password>
- <KeyPassword>password</KeyPassword>
- </KeyStore>
- </parameter>
- <parameter name="truststore" locked="false">
- <TrustStore>
- <Location>trust.jks</Location>
- <Type>JKS</Type>
- <Password>password</Password>
- </TrustStore>
- </parameter>-->
- <!--<parameter name="SSLVerifyClient">require</parameter>
- supports optional|require or defaults to none -->
- <!--</transportReceiver>-->
-
- <!-- ================================================= -->
- <!-- Mail Transport Listener -->
- <!-- This is a sample configuration. It assumes a mail server running in localhost.
- Listener pops messages that comes to the email address red@localhost. Users
- password is red. Listener connect to the server every 3000 milliseconds.
- Parameters with "transport." prefix is Axis2 specific. Others are all from Java Mail API.
- http://people.apache.org/~pzf/SMTPBase64Binding-0.2.html
- -->
- <!-- ================================================= -->
- <!--<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.SimpleMailListener">
- <parameter name="mail.pop3.host">localhost</parameter>
- <parameter name="mail.pop3.user">red</parameter>
- <parameter name="mail.store.protocol">pop3</parameter>
- <parameter name="transport.mail.pop3.password">red</parameter>
- <parameter name="transport.mail.replyToAddress">red@localhost</parameter>
- <parameter name="transport.listener.interval">3000</parameter>
- </transportReceiver>-->
-
- <!--Uncomment if you want to have TCP transport support-->
- <!--transportReceiver name="tcp"
- class="org.apache.axis2.transport.tcp.TCPServer">
- <parameter name="port">6060</parameter-->>
- <!--If you want to give your own host address for EPR generation-->
- <!--uncomment the following paramter , and set it as you required.-->
- <!--<parameter name="hostname">tcp://myApp.com/ws</parameter>-->
- <!-- /transportReceiver -->
-
- <!-- ================================================= -->
- <!-- Transport Outs -->
- <!-- ================================================= -->
-
- <transportSender name="tcp"
- class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
- <transportSender name="local"
- class="org.apache.axis2.transport.local.LocalTransportSender"/>
- <transportSender name="http"
- class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
- <parameter name="PROTOCOL">HTTP/1.1</parameter>
- <parameter name="Transfer-Encoding">chunked</parameter>
-
- <!-- If following is set to 'true', optional action part of the Content-Type will not be added to the SOAP 1.2 messages -->
- <!-- <parameter name="OmitSOAP12Action">true</parameter> -->
- </transportSender>
-
- <transportSender name="https"
- class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
- <parameter name="PROTOCOL">HTTP/1.1</parameter>
- <parameter name="Transfer-Encoding">chunked</parameter>
- </transportSender>
- <transportSender name="jms"
- class="org.apache.axis2.transport.jms.JMSSender"/>
-
- <!-- ================================================= -->
- <!-- Non-blocking http/s Transport Sender -->
-
- <!-- the non-blocking http transport sender based on HttpCore + NIO extensions
- <transportSender name="http" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSender">
- <parameter name="non-blocking" locked="false">true</parameter>
- </transportSender>-->
-
- <!-- the non-blocking https transport sender based on HttpCore + NIO SSL extensions
- <transportSender name="https" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSSLSender">
- <parameter name="non-blocking" locked="false">true</parameter>
- <parameter name="keystore" locked="false">
- <KeyStore>
- <Location>identity.jks</Location>
- <Type>JKS</Type>
- <Password>password</Password>
- <KeyPassword>password</KeyPassword>
- </KeyStore>
- </parameter>
- <parameter name="truststore" locked="false">
- <TrustStore>
- <Location>trust.jks</Location>
- <Type>JKS</Type>
- <Password>password</Password>
- </TrustStore>
- </parameter>-->
- <!--<parameter name="HostnameVerifier">DefaultAndLocalhost</parameter>
- supports Strict|AllowAll|DefaultAndLocalhost or the default if none specified -->
- <!--</transportSender>-->
-
- <!-- ================================================= -->
- <!-- Mail Transport Sender -->
- <!--Only need to uncomment the sender. Configuration is achieved with every client.
- At any instant mail host should be given. Sample configuration has been given.
- http://people.apache.org/~pzf/SMTPBase64Binding-0.2.html
- -->
- <!-- ================================================= -->
- <!--<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
- <parameter name="mail.smtp.host">localhost</parameter>
- </transportSender>-->
-
- <!-- ================================================= -->
- <!-- Global Modules -->
- <!-- ================================================= -->
- <!-- Comment this to disable Addressing -->
-
- <!-- Commented out by Tuscany
- <module ref="addressing"/>
- -->
-
- <!-- Added by Tuscany -->
- <!--
- <module ref="rampart"/>
- -->
-
- <!-- 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-->
-
- <!--Configuring module , providing parameters for modules whether they refer or not-->
- <!--<moduleConfig name="addressing">-->
- <!--<parameter name="addressingPara">N/A</parameter>-->
- <!--</moduleConfig>-->
-
- <!-- ================================================= -->
- <!-- Clustering -->
- <!-- ================================================= -->
- <!-- Configure and uncomment following for preparing Axis2 to a clustered environment -->
- <!--
- <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager">
- <parameter name="param1">value1</parameter>
- <parameter name="domain">apache.axis2.domain</parameter>
- <configurationManager class="org.apache.axis2.cluster.configuration.TribesConfigurationManager">
- <listener class="org.apache.axis2.cluster.configuration.DefaultConfigurationManagerListener"/>
- </configurationManager>
- <contextManager class="org.apache.axis2.cluster.context.TribesContextManager">
- <listener class="org.apache.axis2.cluster.context.DefaultContextManagerListener"/>
- </contextManager>
- </cluster>
- -->
-
- <!-- ================================================= -->
- <!-- Phases -->
- <!-- ================================================= -->
- <phaseOrder type="InFlow">
- <!-- System pre defined phases -->
- <phase name="Transport">
-
- <!-- Added by Tuscany -->
- <handler name="TuscanyDispatcher"
- class="org.apache.tuscany.sca.binding.ws.axis2.TuscanyDispatcher">
- <order phase="Transport"/>
- </handler>
-
- <handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
- <order phase="Transport"/>
- </handler>
- <handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
- <order phase="Transport"/>
- </handler>
- </phase>
- <phase name="Addressing">
- <handler name="AddressingBasedDispatcher"
- class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
- <order phase="Addressing"/>
- </handler>
- </phase>
- <phase name="Security"/>
- <phase name="PreDispatch"/>
- <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
- <handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
- <handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
- <handler name="RequestURIOperationDispatcher"
- class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
- <handler name="SOAPMessageBodyBasedDispatcher"
- class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
-<!--
- <handler name="HTTPLocationBasedDispatcher"
- class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
--->
- </phase>
- <phase name="RMPhase"/>
- <!-- System pre defined phases -->
- <!-- After Postdispatch phase module author or service author can add any phase he want -->
- <phase name="OperationInPhase"/>
- <phase name="soapmonitorPhase"/>
- </phaseOrder>
- <phaseOrder type="OutFlow">
- <!-- user can add his own phases to this area -->
- <phase name="soapmonitorPhase"/>
- <phase name="OperationOutPhase"/>
- <!--system predefined phase-->
- <!--these phase will run irrespective of the service-->
- <phase name="RMPhase"/>
- <phase name="PolicyDetermination"/>
- <phase name="MessageOut"/>
- <phase name="Security"/>
- </phaseOrder>
- <phaseOrder type="InFaultFlow">
- <phase name="Addressing">
- <handler name="AddressingBasedDispatcher"
- class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
- <order phase="Addressing"/>
- </handler>
- </phase>
- <phase name="Security"/>
- <phase name="PreDispatch"/>
- <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
- <handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
- <handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
- <handler name="RequestURIOperationDispatcher"
- class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
- <handler name="SOAPMessageBodyBasedDispatcher"
- class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
-<!--
- <handler name="HTTPLocationBasedDispatcher"
- class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
--->
- </phase>
- <phase name="RMPhase"/>
- <!-- user can add his own phases to this area -->
- <phase name="OperationInFaultPhase"/>
- <phase name="soapmonitorPhase"/>
- </phaseOrder>
- <phaseOrder type="OutFaultFlow">
- <!-- user can add his own phases to this area -->
- <phase name="soapmonitorPhase"/>
- <phase name="OperationOutFaultPhase"/>
- <phase name="RMPhase"/>
- <phase name="PolicyDetermination"/>
- <phase name="MessageOut"/>
- <phase name="Security"/>
- </phaseOrder>
-</axisconfig>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/modules.list b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/modules.list
deleted file mode 100644
index e6e70dfd4b..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/modules.list
+++ /dev/null
@@ -1 +0,0 @@
-rampart-1.4.mar \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.4.mar b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.4.mar
deleted file mode 100644
index ec870734a5..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.4.mar
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/services/services.list b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/services/services.list
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/services/services.list
+++ /dev/null
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java
deleted file mode 100644
index 2ce23bf2c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceTestCase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import junit.framework.TestCase;
-
-public class Axis2ReferenceTestCase extends TestCase {
-
- public void testInvokeService() throws Exception {
-// Axis2ReferenceBinding axis2Reference = createAxis2Reference("testWebAppName", "testServiceName");
-// ServiceContract contract = new JavaServiceContract();
-// Operation operation = new Operation<Type>("sayHi", null, null, null, false, null, NO_CONVERSATION);
-// TargetInvoker targetInvoker = axis2Reference.createTargetInvoker(contract, operation);
-// assertNotNull(targetInvoker);
-// assertFalse(targetInvoker instanceof Axis2AsyncTargetInvoker);
- }
-
- public void testAsyncTargetInvoker() throws Exception {
-// Axis2ReferenceBinding axis2Reference = createAxis2Reference("testWebAppName", "testServiceName");
-// //Create a mocked InboundWire, make the call of ServiceBindingExtension.getInterface() returns a Class
-// Wire inboundWire = EasyMock.createNiceMock(Wire.class);
-// JavaServiceContract contract = new JavaServiceContract(Greeter.class);
-// contract.setCallbackName("");
-// contract.setCallbackClass(GreetingCallback.class);
-// Operation<Type> callbackOp =
-// new Operation<Type>("sayHiCallback", null, null, null, true, null, NO_CONVERSATION);
-// HashMap<String, Operation<Type>> callbackOps = new HashMap<String, Operation<Type>>();
-// callbackOps.put("sayHiCallback", callbackOp);
-// contract.setCallbackOperations(callbackOps);
-// EasyMock.expect(inboundWire.getTargetContract()).andReturn(contract).anyTimes();
-// EasyMock.replay(inboundWire);
-//
-// axis2Reference.setWire(inboundWire);
-// Operation operation = new Operation<Type>("sayHi", null, null, null, true, null, NO_CONVERSATION);
-// TargetInvoker asyncTargetInvoker = axis2Reference.createTargetInvoker(contract, operation);
-// assertNotNull(asyncTargetInvoker);
-// assertTrue(asyncTargetInvoker instanceof Axis2AsyncTargetInvoker);
- }
-
-// @SuppressWarnings("unchecked")
-// private Axis2ReferenceBinding createAxis2Reference(String webAppName, String serviceName) throws Exception {
-// //Create WebServiceBindingDefinition
-// String wsdlLocation = "/wsdl/hello_world_doc_lit.wsdl";
-// URL url = getClass().getResource(wsdlLocation);
-// assertNotNull("Could not find wsdl " + url.toString(), url);
-//
-// WSDLFactory factory = WSDLFactory.newInstance();
-// WSDLReader reader = factory.newWSDLReader();
-// reader.setFeature("javax.wsdl.verbose", false);
-// InputSource input = new InputSource(url.openStream());
-// Definition wsdlDef = reader.readWSDL(url.toString(), input);
-// Service wsdlService = wsdlDef.getService(new QName("http://objectweb.org/hello_world_soap_http",
-// "SOAPService"));
-// Port port = wsdlService.getPort("SoapPort");
-// WebServiceBindingDefinition wsBinding =
-// new WebServiceBindingDefinition(wsdlDef, port, "uri", "portURI", wsdlService);
-// //Create a mocked WireService, make the call of ServiceBindingExtension.getServiceInstance() returns a proxy instance.
-// // TODO figure out what to do with the service contract
-// ServiceContract<?> contract = new WSDLServiceContract();
-// contract.setInterfaceClass(Greeter.class);
-// return new Axis2ReferenceBinding(URI.create(serviceName),
-// wsBinding,
-// contract,
-// null,
-// null);
-// }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java
deleted file mode 100644
index d4d20414e5..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceTestCase.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-import junit.framework.TestCase;
-
-public class Axis2ServiceTestCase extends TestCase {
-
- public void testInvokeService() throws Exception {
-// TestServletHost tomcatHost = new TestServletHost();
-// Axis2ServiceBinding axis2Service = createAxis2Service("testServiceName", tomcatHost, false);
-// axis2Service.start();
-//
-// if (true) return;
-// Servlet servlet = tomcatHost.getMapping("testWebAppName/serviceBindings/testServiceName");
-// assertNotNull(servlet);
-//
-// //Create mocked HttpRequest and HttpResponse object to test the Axis2Servlet
-// //To be done:
-
- }
-
- public void testAsyncMessageReceiver() throws Exception {
-
-// TestServletHost tomcatHost = new TestServletHost();
-// Axis2ServiceBinding axis2Service = createAxis2Service("testServiceName", tomcatHost, true);
-// axis2Service.start();
- }
-
-// @SuppressWarnings("unchecked")
-// private Axis2ServiceBinding createAxis2Service(String serviceName, ServletHost tomcatHost, boolean callback)
-// throws Exception {
-// //Create WebServiceBindingDefinition
-// String wsdlLocation = "/wsdl/hello_world_doc_lit.wsdl";
-// URL url = getClass().getResource(wsdlLocation);
-// assertNotNull("Could not find wsdl " + url.toString(), url);
-//
-// WSDLFactory factory = WSDLFactory.newInstance();
-// WSDLReader reader = factory.newWSDLReader();
-// reader.setFeature("javax.wsdl.verbose", false);
-// InputSource input = new InputSource(url.openStream());
-// Definition wsdlDef = reader.readWSDL(url.toString(), input);
-// Service wsdlService = wsdlDef.getService(new QName("http://objectweb.org/hello_world_soap_http",
-// "SOAPService"));
-// Port port = wsdlService.getPort("SoapPort");
-// WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition(wsdlDef, port, "uri", "portURI", wsdlService);
-//
-// //Create a mocked WireService, make the call of ServiceBindingExtension.getServiceInstance() returns a proxy instance.
-//// WireService wireService = EasyMock.createNiceMock(WireService.class);
-//// wireService.createProxy(EasyMock.isA(Class.class), EasyMock.isA(Wire.class));
-//// EasyMock.expectLastCall().andReturn(null);
-//// EasyMock.replay(wireService);
-//
-// //Create a mocked InboundWire, make the call of ServiceBindingExtension.getInterface() returns a Class
-// Wire inboundWire = EasyMock.createNiceMock(Wire.class);
-// JavaServiceContract contract = new JavaServiceContract(Greeter.class);
-// Map<String, Operation<Type>> opMap = new HashMap<String, Operation<Type>>();
-// for (Method m : Greeter.class.getMethods()) {
-// opMap.put(m.getName(), new Operation<Type>(m.getName(), null, null, null));
-// }
-// contract.setOperations(opMap);
-// EasyMock.expect(inboundWire.getTargetContract()).andReturn(contract).anyTimes();
-// if (callback) {
-// contract.setCallbackName("");
-// }
-// EasyMock.replay(inboundWire);
-//
-// Wire outboundWire = EasyMock.createNiceMock(Wire.class);
-// Map<Operation<?>, InvocationChain> map = new HashMap<Operation<?>, InvocationChain>();
-// EasyMock.expect(outboundWire.getInvocationChains()).andReturn(map).once();
-// EasyMock.replay(outboundWire);
-//
-// TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator();
-// ConfigurationContext configurationContext = tuscanyAxisConfigurator.getConfigurationContext();
-// Axis2ServiceBinding axis2Service =
-// new Axis2ServiceBinding(URI.create(serviceName),
-// contract,
-// null,
-// wsBinding,
-// tomcatHost,
-// configurationContext, null);
-// axis2Service.setWire(inboundWire);
-//// axis2Service.setOutboundWire(outboundWire);
-//
-// return axis2Service;
-// }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java
deleted file mode 100644
index 767f59646f..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/Greeter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-public interface Greeter {
-
- String sayHi();
-
- String greetMe(String requestType);
-
- void greetMeOneWay(String requestType);
-
- void greetMeWithCallback(String requestType);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java
deleted file mode 100644
index e5e76af0b7..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/GreetingCallback.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2;
-
-public interface GreetingCallback {
-
- void greetMeCallback(String greetMeResponse);
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java
deleted file mode 100644
index 40d769d83a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java
deleted file mode 100644
index 5edb4ddc5a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Bar.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Bar.java
deleted file mode 100644
index 2dc7d8dee4..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Bar.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import java.io.Serializable;
-
-public class Bar implements Serializable {
- private static final long serialVersionUID = 1249963611910502668L;
-
- private String s;
- private int x;
- private Integer y;
-
- private Boolean b;
-
- public Boolean getB() {
- return b;
- }
- public void setB(Boolean b) {
- this.b = b;
- }
- public String getS() {
- return s;
- }
- public void setS(String s) {
- this.s = s;
- }
- public int getX() {
- return x;
- }
- public void setX(int x) {
- this.x = x;
- }
- public Integer getY() {
- return y;
- }
- public void setY(Integer y) {
- this.y = y;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java
deleted file mode 100644
index 5c1ee6a435..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java
deleted file mode 100644
index 4e1e7dbdad..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Echo.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface Echo {
-
- Foo echoFoo(Foo foo);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java
deleted file mode 100644
index 3e96480c20..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoComponent.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import org.oasisopen.sca.annotation.Reference;
-
-public class EchoComponent implements Echo {
-
- @Reference
- public Echo echoWS;
-
- public Foo echoFoo(Foo foo) {
- return echoWS.echoFoo(foo);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoImpl.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoImpl.java
deleted file mode 100644
index d028ced69e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/EchoImpl.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-
-public class EchoImpl implements Echo {
-
- public Foo echoFoo(Foo foo) {
- return foo;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Foo.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Foo.java
deleted file mode 100644
index c7b503af17..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Foo.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import java.io.Serializable;
-
-public class Foo implements Serializable {
- private static final long serialVersionUID = 4879476066850018458L;
-
- private Bar[] bars;
-
- public Bar[] getBars() {
- return bars;
- }
-
- public void setBars(Bar[] bars) {
- this.bars = bars;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java
deleted file mode 100644
index 3ac30780b3..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface HelloWorld {
-
- String getGreetings(String s);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java
deleted file mode 100644
index 0dd6e90c72..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldComponent.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import org.oasisopen.sca.annotation.Reference;
-
-public class HelloWorldComponent implements HelloWorld {
-
- @Reference
- public HelloWorld helloWorldWS;
-
- public String getGreetings(String s) {
- return helloWorldWS.getGreetings(s);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldMultiService.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldMultiService.java
deleted file mode 100644
index f30286feea..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldMultiService.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-
-public class HelloWorldMultiService implements HelloWorldOM, HelloWorldOM2 {
-
- public OMElement getGreetings(OMElement requestOM) {
- String name = requestOM.getFirstElement().getText();
-
- OMFactory omFactory = OMAbstractFactory.getOMFactory();
- OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld");
- OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld");
- responseOM.addChild(param);
- param.addChild(omFactory.createOMText("Hello " + name));
-
- return responseOM;
- }
-
- public OMElement getGreetings2(OMElement requestOM) {
- String name = requestOM.getFirstElement().getText();
-
- OMFactory omFactory = OMAbstractFactory.getOMFactory();
- OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld");
- OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld");
- responseOM.addChild(param);
- param.addChild(omFactory.createOMText("Hello2 " + name));
-
- return responseOM;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java
deleted file mode 100644
index 09b414b2d8..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDLTestCase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests ;
-
-import junit.framework.TestCase;
-
-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 HelloWorldNoWSDLTestCase extends TestCase {
-
- private Node node;
-
- public void testHelloWorld() throws Exception {
- HelloWorld helloWorld = node.getService(HelloWorld.class, "HelloWorldComponent");
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
-
- /**
- * Test a a WS call with a complex type
- */
- public void testEchoFoo() throws Exception {
- Echo echo = node.getService(Echo.class, "EchoComponent");
-
- Foo f = new Foo();
- Bar b1 = new Bar();
- b1.setS("petra");
- b1.setX(1);
- b1.setY(new Integer(2));
- b1.setB(Boolean.TRUE);
- Bar b2 = new Bar();
- b2.setS("beate");
- b2.setX(3);
- b2.setY(new Integer(4));
- b2.setB(Boolean.FALSE);
- f.setBars(new Bar[] { b1, b2} );
-
- Foo f2 = echo.echoFoo(f);
-
- assertEquals("petra", f2.getBars()[0].getS());
- assertEquals(1, f2.getBars()[0].getX());
- assertEquals(2, f2.getBars()[0].getY().intValue());
- assertTrue(f2.getBars()[0].getB().booleanValue());
- assertEquals("beate", f2.getBars()[1].getS());
- assertEquals(3, f2.getBars()[1].getX());
- assertEquals(4, f2.getBars()[1].getY().intValue());
- assertFalse(f2.getBars()[1].getB().booleanValue());
-
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite", new Contribution("test", contribution));
- node.start();
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java
deleted file mode 100644
index 13a16c8e8a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import org.apache.axiom.om.OMElement;
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface HelloWorldOM {
-
- OMElement getGreetings(OMElement parmE);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java
deleted file mode 100644
index 0e50781061..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOM2.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import org.apache.axiom.om.OMElement;
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface HelloWorldOM2 {
-
- OMElement getGreetings2(OMElement parmE);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java
deleted file mode 100644
index 82f61bd7c2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMComponent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import org.apache.axiom.om.OMElement;
-import org.oasisopen.sca.annotation.Reference;
-
-public class HelloWorldOMComponent implements HelloWorldOM {
-
- @Reference
- public HelloWorldOM helloWorldWS;
-
- public OMElement getGreetings(OMElement om) {
- return helloWorldWS.getGreetings(om);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMService.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMService.java
deleted file mode 100644
index 71d7bf68fb..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-
-public class HelloWorldOMService implements HelloWorldOM {
-
- public OMElement getGreetings(OMElement requestOM) {
- System.out.println(" **** getGreetings **** ");
- String name = requestOM.getFirstElement().getText();
-
- OMFactory omFactory = OMAbstractFactory.getOMFactory();
- OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld");
- OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld");
- responseOM.addChild(param);
- param.addChild(omFactory.createOMText("Hello " + name));
-
- return responseOM;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java
deleted file mode 100644
index 4bb5bdb87d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldOMTestCase.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.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 HelloWorldOMTestCase 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.composite", new Contribution("test", contribution));
- node.start();
- helloWorld = node.getService(HelloWorldOM.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldService.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldService.java
deleted file mode 100644
index 017d9bb478..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-public class HelloWorldService implements HelloWorld {
-
- public String getGreetings(String s) {
- return "Hello " + s;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java
deleted file mode 100644
index b7146098ec..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldTestCase.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import junit.framework.TestCase;
-
-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 HelloWorldTestCase extends TestCase {
-
- private Node node;
- private HelloWorld helloWorld;
-
- public void testCalculator() throws Exception {
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite", new Contribution("test", contribution));
- node.start();
- helloWorld = node.getService(HelloWorld.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java
deleted file mode 100644
index a239d95c3a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java
deleted file mode 100644
index 6c62d52cc6..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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);
- Service service = definition.getService(new QName("http://account2/AccountService/$promoted$ep1", "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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java
deleted file mode 100644
index a9d31fb9a8..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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);
- Service service = definition.getService(new QName("http://accounts/AccountService/$promoted$ep1", "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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java
deleted file mode 100644
index 63026f95f7..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLTestCase.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 QuestionMarkWSDLTestCase extends TestCase {
-
- private Node node;
-
- /**
- * Tests ?wsdl works and returns the correct port endpoint from the WSDL
- */
- public void testWSDLPortEndpoint() throws Exception {
- InputStream inp = new URL("http://localhost:8085/services/HelloWorldWebService?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/services/HelloWorldWebService?wsdl");
- assertNotNull(definition);
- Service service = definition.getService(new QName("http://helloworld/HelloWorldService/$promoted$ep1",
- "HelloWorldService"));
- Port port = service.getPort("HelloWorldSoapPort");
-
- String endpoint = getEndpoint(port);
- String ip = HttpUtils.getIpAddress();
- assertEquals("http://" + ip + ":8085/services/HelloWorldWebService", endpoint);
- }
-
- /**
- * Tests ?wsdl works and returns the correct port endpoint from binding.ws with a custom URI
- */
- public void testCustomEndpoint() throws Exception {
- InputStream inp = new URL("http://localhost:8085/foo/bar?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/foo/bar?wsdl");
- assertNotNull(definition);
- Service service = definition.getService(new QName("http://itests.axis2.ws.binding.sca.tuscany.apache.org/",
- "HelloWorldService"));
- Port port = service.getPort("HelloWorldPort");
-
- String endpoint = getEndpoint(port);
- String ip = HttpUtils.getIpAddress();
- assertEquals("http://" + ip + ":8085/foo/bar", endpoint);
- }
-
- protected String getEndpoint(Port port) {
- List wsdlPortExtensions = port.getExtensibilityElements();
- for (final Object extension : wsdlPortExtensions) {
- if (extension instanceof SOAPAddress) {
- return ((SOAPAddress) extension).getLocationURI();
- }
- }
- throw new RuntimeException("no SOAPAddress");
- }
-
- @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.composite", new Contribution("test", contribution));
- node.start();
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/UriPrecedenceTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/UriPrecedenceTestCase.java
deleted file mode 100644
index 01abbd5382..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/UriPrecedenceTestCase.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.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;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * This test verifies that the Endpoint URI specified in the wsdl takes precedence over the URI specified
- * in binding. Ref: WS Binding Specification V1.00 - Section 2.1.1
- *
- * @version $Rev$ $Date$
- */
-public class UriPrecedenceTestCase extends TestCase {
-
- private Node node;
- private HelloWorldOM helloWorld;
-
- public void testUriPrecedence() throws Exception {
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-prec", "helloworld");
- OMElement parmE = fac.createOMElement("name", "http://helloworld-prec", "helloworld");
- requestOM.addChild(parmE);
- parmE.addChild(fac.createOMText("petra"));
- try {
- OMElement responseOM = helloWorld.getGreetings(requestOM);
- OMElement child = (OMElement)responseOM.getFirstElement();
- Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
- } catch (ServiceRuntimeException e) {
- fail("Endpoint URI from wsdl did not take precedence over URI in binding.");
- }
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite", new Contribution("test", contribution));
- node.start();
- helloWorld = node.getService(HelloWorldOM.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
deleted file mode 100644
index a41e0fd2c9..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.endpoints;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMText;
-import org.apache.tuscany.sca.binding.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 AbstractHelloWorldOMTestCase extends TestCase {
-
- private Node node;
- private HelloWorldOM helloWorld;
-
- public void testCalculator() throws Exception {
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
- OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
- requestOM.addChild(parmE);
- parmE.addChild(fac.createOMText("petra"));
- OMElement responseOM = helloWorld.getGreetings(requestOM);
- OMElement child = (OMElement)responseOM.getFirstElement();
- Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
- }
-
- @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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiServiceTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiServiceTestCase.java
deleted file mode 100644
index 661afdddad..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiServiceTestCase.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.endpoints;
-
-public class DefaultMultiServiceTestCase extends AbstractHelloWorldOMTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleServiceTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleServiceTestCase.java
deleted file mode 100644
index 9b2e0eafa0..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleServiceTestCase.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.endpoints;
-
-public class DefaultSingleServiceTestCase extends AbstractHelloWorldOMTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURITestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURITestCase.java
deleted file mode 100644
index 98d9a73926..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURITestCase.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.endpoints;
-
-public class WSDLExplicitURITestCase extends AbstractHelloWorldOMTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURITestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURITestCase.java
deleted file mode 100644
index 201d11a79f..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURITestCase.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.endpoints;
-
-public class WSDLRelativeURITestCase extends AbstractHelloWorldOMTestCase {
- // super class does it all getting composite based on this class name
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java
deleted file mode 100644
index 23dcd5ff6d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorldTestCase.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.epr;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorld;
-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 HelloWorldTestCase extends TestCase {
-
- private Node node;
- private HelloWorld helloWorld;
-
- public void testCalculator() throws Exception {
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite", new Contribution("test", contribution));
- node.start();
- helloWorld = node.getService(HelloWorld.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java
deleted file mode 100644
index 5aefaac9ee..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCaseOFF.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCaseOFF.java
deleted file mode 100644
index f14229c541..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCaseOFF.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
deleted file mode 100644
index 457e80ebdb..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java
deleted file mode 100644
index d947b0db0b..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCaseOFF.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCaseOFF.java
deleted file mode 100644
index 351cb87760..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCaseOFF.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java
deleted file mode 100644
index 67d6f1c56e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java
deleted file mode 100644
index 45c5472100..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java
deleted file mode 100644
index 7a4b50cc2c..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java
deleted file mode 100644
index 5ddfe359a5..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
deleted file mode 100644
index 15eda714f0..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCaseOFF.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCaseOFF.java
deleted file mode 100644
index fcb317013c..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCaseOFF.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/AbstractHelloWorldOMTestCaseOFF.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/AbstractHelloWorldOMTestCaseOFF.java
deleted file mode 100644
index a6223a3ccc..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/AbstractHelloWorldOMTestCaseOFF.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.mixed;
-
-import junit.framework.Assert;
-
-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;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public abstract class AbstractHelloWorldOMTestCaseOFF {
-
- private Node node;
- private HelloWorldOM helloWorld;
-
- @Test
- 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());
- }
-
- @Before
- public 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");
- }
-
- @After
- public 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ClientPWCBHandler.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ClientPWCBHandler.java
deleted file mode 100644
index 88fc0d63fa..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ClientPWCBHandler.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.mixed;
-
-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];
-
- System.out.println(" **** 1. UserId : " + pwcb.getIdentifer());
- System.out.println(" **** 2. Passwd : " + pwcb.getPassword());
- System.out.println(" **** 3. Usage : " + pwcb.getUsage());
-
- pwcb.setPassword("TuscanyWsUserPasswd");
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/IntegrityPWCBHandler.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/IntegrityPWCBHandler.java
deleted file mode 100644
index 0d8914156f..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/IntegrityPWCBHandler.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.mixed;
-
-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];
-
- System.out.println(" **** 1. UserId : " + pwcb.getIdentifer());
- System.out.println(" **** 2. Passwd : " + pwcb.getPassword());
- System.out.println(" **** 3. Usage : " + pwcb.getUsage());
-
- pwcb.setPassword("TuscanyWsUserPasswd");
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ServerPWCBHandler.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ServerPWCBHandler.java
deleted file mode 100644
index 5840f71057..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/ServerPWCBHandler.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.mixed;
-
-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];
- System.out.println(" **** 1. UserId : " + pwcb.getIdentifer());
- System.out.println(" **** 2. Passwd : " + pwcb.getPassword());
- System.out.println(" **** 3. Usage : " + pwcb.getUsage());
-
- pwcb.setPassword("TuscanyWsUserPasswd");
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixedTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixedTestCase.java
deleted file mode 100644
index cdf96bdb58..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixedTestCase.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.mixed;
-
-import org.junit.Ignore;
-
-@Ignore("Temporarily ignore rampart module validation failure")
-public class WSSecurityMixedTestCase extends AbstractHelloWorldOMTestCaseOFF {
- // super class does it all getting composite based on this class name
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCaseOFF.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCaseOFF.java
deleted file mode 100644
index 5f6824669a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCaseOFF.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java
deleted file mode 100644
index cf342653c7..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java
deleted file mode 100644
index 84b64d3902..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java
deleted file mode 100644
index 04825b6b56..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCaseOFF.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCaseOFF.java
deleted file mode 100644
index 355fa657f0..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCaseOFF.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
deleted file mode 100644
index 3d514e5624..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCaseOFF.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCaseOFF.java
deleted file mode 100644
index 6a5ff8e231..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCaseOFF.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCaseOFF.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCaseOFF.java
deleted file mode 100644
index 45c0a6932a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12TestCaseOFF.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.soap12 ;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorld;
-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 HelloWorldSOAP12TestCaseOFF extends TestCase {
-
- private Node node;
-
- public void testHelloWorld() throws Exception {
- HelloWorld helloWorld = node.getService(HelloWorld.class, "HelloWorldClient");
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
- public void testHelloWorldSOAP() throws Exception {
- HelloWorld helloWorld = node.getService(HelloWorld.class, "HelloWorldClientSOAP");
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
- public void testHelloWorldSOAP11() throws Exception {
- HelloWorld helloWorld = node.getService(HelloWorld.class, "HelloWorldClientSOAP11");
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
- public void testHelloWorldSOAP12() throws Exception {
- HelloWorld helloWorld = node.getService(HelloWorld.class, "HelloWorldClientSOAP12");
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.composite", new Contribution("test", contribution));
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCaseOFF.java b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCaseOFF.java
deleted file mode 100644
index c74ffee695..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/QuestionMarkWSDLTestCaseOFF.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.soap12;
-
-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.extensions.soap12.SOAP12Address;
-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 QuestionMarkWSDLTestCaseOFF extends TestCase {
-
- private static boolean newGenerator = true;
- private Node node;
-
- /**
- * Tests ?wsdl returns a soap 1.1 port by default
- */
- public void testSOAPDefault() throws Exception {
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose",false);
- wsdlReader.setFeature("javax.wsdl.importDocuments",true);
-
- Definition definition = wsdlReader.readWSDL("http://localhost:8085/ep1?wsdl");
- assertNotNull(definition);
- Service service = definition.getService(new QName(
- "http://itests.axis2.ws.binding.sca.tuscany.apache.org" + (newGenerator ? "/" : ""),
- newGenerator ? "HelloWorldService" : "HelloWorld"));
- Port port = service.getPort(newGenerator ? "HelloWorldPort" : "HelloWorldSOAP11port_http");
-
- String endpoint = getSOAP11Endpoint(port);
- String ip = HttpUtils.getIpAddress();
- assertEquals("http://" + ip + ":8085/ep1", endpoint);
- }
-
- /**
- * Tests ?wsdl returns a soap 1.1 port when binding uses requires="SOAP.1_1"
- */
- public void testSOAP11Endpoint() throws Exception {
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose",false);
- wsdlReader.setFeature("javax.wsdl.importDocuments",true);
-
- Definition definition = wsdlReader.readWSDL("http://localhost:8085/ep2?wsdl");
- assertNotNull(definition);
- Service service = definition.getService(new QName(
- "http://itests.axis2.ws.binding.sca.tuscany.apache.org" + (newGenerator ? "/" : ""),
- newGenerator ? "HelloWorldService" : "HelloWorld"));
- Port port = service.getPort(newGenerator ? "HelloWorldPort" : "HelloWorldSOAP11port_http");
-
- String endpoint = getSOAP11Endpoint(port);
- String ip = HttpUtils.getIpAddress();
- assertEquals("http://" + ip + ":8085/ep2", endpoint);
- }
-
- /**
- * Tests ?wsdl returns a soap 1.2 port when binding uses requires="SOAP.1_2"
- */
- public void testSOAP12Endpoint() throws Exception {
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose",false);
- wsdlReader.setFeature("javax.wsdl.importDocuments",true);
-
- Definition definition = wsdlReader.readWSDL("http://localhost:8085/ep3?wsdl");
- assertNotNull(definition);
- Service service = definition.getService(new QName(
- "http://itests.axis2.ws.binding.sca.tuscany.apache.org" + (newGenerator ? "/" : ""),
- newGenerator ? "HelloWorldService" : "HelloWorld"));
- Port port = service.getPort(newGenerator ? "HelloWorldPort" : "HelloWorldSOAP12port_http");
-
- String endpoint = getSOAP12Endpoint(port);
- String ip = HttpUtils.getIpAddress();
- assertEquals("http://" + ip + ":8085/ep3", endpoint);
- }
-
- protected String getSOAP11Endpoint(Port port) {
- List wsdlPortExtensions = port.getExtensibilityElements();
- for (final Object extension : wsdlPortExtensions) {
- if (extension instanceof SOAPAddress) {
- return ((SOAPAddress) extension).getLocationURI();
- }
- }
- throw new RuntimeException("no SOAPAddress");
- }
-
- protected String getSOAP12Endpoint(Port port) {
- List wsdlPortExtensions = port.getExtensibilityElements();
- for (final Object extension : wsdlPortExtensions) {
- if (extension instanceof SOAP12Address) {
- return ((SOAP12Address) 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/soap12/questionmark-wsdl.composite", new Contribution("test", contribution));
- node.start();
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
deleted file mode 100644
index 32b042402b..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# PolicyHandlerClasses to interpret specific PolicyModels against specific QoS infrastructures
-# handler classname;qname=<policy intent addressed>;model=<policy model class>
-org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicyHandler;intent=http://tuscany.apache.org/xmlns/sca/1.0#wsAuthentication,model=org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicy
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite
deleted file mode 100644
index f1032515ea..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorld">
-
- <service name="helloWorld" promote="HelloWorldService">
- <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
- <!-- interface.java interface="org.apache.tuscany.sca.binding.ws.axis2.itests.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 name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS">
- <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
- <!-- interface.java interface="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorld" / -->
- <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite
deleted file mode 100644
index 894216ac50..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorldNoWSDL">
-
- <service name="helloWorld" promote="HelloWorldService">
- <!-- interface.java interface="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorld" / -->
- <binding.ws uri="http://localhost:8085/helloWorld"/>
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS">
- <!-- interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" / -->
- <!-- interface.java interface="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorld" / -->
- <binding.ws uri="http://localhost:8085/helloWorld"/>
- </reference>
-
- <service name="Echo" promote="EchoService">
- <binding.ws uri="http://localhost:8085/Echo"/>
- </service>
-
- <component name="EchoService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.EchoImpl"/>
- </component>
-
- <component name="EchoComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.EchoComponent"/>
- <reference name="echoWS" />
- </component>
-
- <reference name="echoWS" promote="EchoComponent/echoWS">
- <binding.ws uri="http://localhost:8085/Echo"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd
deleted file mode 100644
index f09ed09b6a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd
deleted file mode 100644
index ec67b84851..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd
deleted file mode 100644
index 7c903c6394..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite
deleted file mode 100644
index 95b013fca3..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService/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 name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldMultiService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite
deleted file mode 100644
index 20eaf1c58d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService">
- <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 name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite
deleted file mode 100644
index 7923bad0bb..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService">
- <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite
deleted file mode 100644
index af3bb3c107..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService">
- <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 name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/helloworld-om-relative-uri.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/helloworld-om-relative-uri.wsdl
deleted file mode 100644
index fe68755c47..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/helloworld-om-relative-uri.wsdl
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-relative-uri" xmlns:tns="http://helloworld-om-relative-uri" 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">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://helloworld-om-relative-uri" 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: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/HelloWorldService/helloWorld/myRelativeURI"/>
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite
deleted file mode 100644
index 1dd231af6c..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorld">
-
- <service name="helloWorld" promote="HelloWorldService">
- <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 name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-binding.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-binding.wsdl
deleted file mode 100644
index 7bf47bc412..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-binding.wsdl
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-bindings">
-
- <wsdl:import namespace="http://helloworld-om-merged"
- location="helloworld-om-porttype.wsdl"/>
-
- <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://endpoint.not.used"/>
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite
deleted file mode 100644
index 75158310ed..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorldOM-Merged">
-
- <service name="helloWorld" promote="HelloWorldMergedService">
- <interface.wsdl interface="http://helloworld-om-merged#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"/>
- </service>
-
- <component name="HelloWorldMergedService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldWSDLMergedComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- </component>
-
- <reference name="mergedHelloWorldWS" promote="HelloWorldWSDLMergedComponent/helloWorldWS">
- <interface.wsdl interface="http://helloworld-om-merged#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld" />
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl
deleted file mode 100644
index c66fa51c34..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-uri.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-uri.wsdl
deleted file mode 100644
index baa223f41c..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-uri.wsdl
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-uri" xmlns:tns="http://helloworld-om-uri" 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">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://helloworld-om-uri" 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: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/myExplicitURI"/>
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite
deleted file mode 100644
index b72140ebea..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorldOM">
-
- <service name="helloWorld" promote="HelloWorldService">
- <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"/>
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS">
- <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld" />
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.wsdl
deleted file mode 100644
index 73ca02246d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.wsdl
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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" xmlns:tns="http://helloworld-om" 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">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://helloworld-om" 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: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://endpoint.not.used"/>
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite
deleted file mode 100644
index 9ca0ff6438..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorldPrec">
-
- <service name="helloWorld" promote="HelloWorldService">
- <interface.wsdl interface="http://helloworld-prec#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"/>
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.wsdl
deleted file mode 100644
index 5908c43e7d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.wsdl
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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$ -->
-
-<wsdl:definitions targetNamespace="http://helloworld-prec" xmlns:tns="http://helloworld-prec" 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-prec">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://helloworld-prec" 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: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/HelloWorldService/helloWorld"/>
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld.wsdl
deleted file mode 100644
index 1a2272d7ee..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld.wsdl
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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">
-
- <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: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/services/HelloWorldWebService"/>
- </wsdl:port>
- <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort2">
- <wsdlsoap:address location="http://localhost:8085/services/HelloWorldWebService2"/>
- </wsdl:port>
- <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort3">
- <wsdlsoap:address location="http://localhost:8085/services/HelloWorldWebService3"/>
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransfer.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransfer.wsdl
deleted file mode 100644
index 1c67a1b26a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransfer.wsdl
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.compositeOFF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.compositeOFF
deleted file mode 100644
index 03a16d9433..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.compositeOFF
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://filetransfer"
- xmlns:hw="http://filetransfer"
- name="filetransferws">
-
- <component name="FileTransferServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.FileTransferServiceImpl" />
- <service name="FileTransferService">
- <interface.wsdl interface="http://filetransfer#wsdl.interface(FileTransfer)" />
- <binding.ws uri="http://localhost:8085/FileTransferService"/>
- </service>
- </component>
-
- <component name="FileTransferClientComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.FileTransferClient"/>
- <reference name="fileTransferWS" />
- </component>
-
- <reference name="fileTransferWS" promote="FileTransferClientComponent/fileTransferWS">
- <binding.ws uri="http://localhost:8085/FileTransferService"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthentication.composite.OFF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthentication.composite.OFF
deleted file mode 100644
index d09c52bb9c..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthentication.composite.OFF
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService" requires="authentication">
- <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS" policySets="tuscany:wsClientAuthenticationPolicy">
- <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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentiality.composite.OFF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentiality.composite.OFF
deleted file mode 100644
index 8a33100be1..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentiality.composite.OFF
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService" requires="confidentiality">
- <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS" requires="confidentiality">
- <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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrity.composite.OFF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrity.composite.OFF
deleted file mode 100644
index 117344d33a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrity.composite.OFF
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService" requires="integrity">
- <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS" requires="integrity">
- <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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml
deleted file mode 100644
index 8fa2d3b8c0..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
-
- <!-- 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties
deleted file mode 100644
index 592edf183b..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks
deleted file mode 100644
index 307edb9b37..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml
deleted file mode 100644
index 65f8cb67d8..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
-
- <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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixed.composite.OFF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixed.composite.OFF
deleted file mode 100644
index 3bbf99f560..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/WSSecurityMixed.composite.OFF
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService"
- policySets="tuscany:serverWsPolicyForAuthentication">
- <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS"
- policySets="tuscany:clientWsPolicyForAuthentication">
- <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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/definitions.xml b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/definitions.xml
deleted file mode 100644
index 871e889835..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/definitions.xml
+++ /dev/null
@@ -1,323 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
-
- <!-- 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.mixed.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.mixed.ClientPWCBHandler</passwordCallbackClass>" +
- <passwordType>PasswordText</passwordType>
- </action>
- </parameter>
- </tuscany:wsConfigParam>
- </sca:policySet>
-
- <sca:policySet name="wsMixedReceiverIntegrityPolicy"
- provides="sca:integrity"
- appliesTo="//sca:binding.ws">
- <tuscany:wsConfigParam>
- <parameter name="InflowSecurity">
- <action>
- <items>Signature</items>
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties</signaturePropFile>
- </action>
- </parameter>
- </tuscany:wsConfigParam>
- </sca:policySet>
-
- <sca:policySet name="wsMixedSenderIntegrityPolicy"
- provides="sca:integrity"
- appliesTo="//sca:binding.ws">
- <tuscany:wsConfigParam>
- <parameter name="OutflowSecurity">
- <action>
- <items>Signature</items>
- <user>TuscanyWsUser</user>
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties</signaturePropFile>
- <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.mixed.IntegrityPWCBHandler</passwordCallbackClass>
- <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
- </action>
- </parameter>
- </tuscany:wsConfigParam>
- </sca:policySet>
-
- <sca:policySet name="wsServerAuthenticationIntegrityPolicy"
- provides="sca:authentication sca:integrity"
- appliesTo="//sca:binding.ws"
- >
- <tuscany:wsConfigParam>
- <parameter name="InflowSecurity">
- <action>
- <items>UsernameToken Signature</items>
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties</signaturePropFile>
- <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.mixed.ServerPWCBHandler</passwordCallbackClass>
- </action>
- </parameter>
- <parameter name="OutflowSecurity">
- <action>
- <items>Signature</items>
- <user>TuscanyWsUser</user>
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties</signaturePropFile>
- <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.mixed.ServerPWCBHandler</passwordCallbackClass>
- <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
- </action>
- </parameter>
- </tuscany:wsConfigParam>
- </sca:policySet>
-
- <sca:policySet name="wsClientAuthenticationIntegrityPolicy"
- provides="tuscany:wsAuthentication"
- appliesTo="//sca:binding.ws">
- <tuscany:wsConfigParam>
- <parameter name="InflowSecurity">
- <action>
- <items>Signature</items>
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties</signaturePropFile>
- </action>
- </parameter>
- <parameter name="OutflowSecurity">
- <action>
- <items>UsernameToken Signature</items>
- <user>TuscanyWsUser</user>
- <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.mixed.ClientPWCBHandler</passwordCallbackClass>" +
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties</signaturePropFile>
- <passwordType>PasswordText</passwordType>
- <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
- </action>
- </parameter>
- </tuscany:wsConfigParam>
- </sca:policySet>
-
- <sca:policySet name="clientWsPolicyForAuthentication"
- 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.mixed.ClientPWCBHandler</ramp:passwordCallbackClass>
- </ramp:RampartConfig>
- </wsp:All>
- </wsp:ExactlyOne>
- </wsp:Policy>
- </sca:policySet>
-
- <sca:policySet name="serverWsPolicyForAuthentication"
- 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:passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.mixed.ServerPWCBHandler</ramp:passwordCallbackClass>
- </ramp:RampartConfig>
- </wsp:All>
- </wsp:ExactlyOne>
- </wsp:Policy>
- </sca:policySet>
-
- <!-- A policyset that uses WS Policy -->
- <sca:policySet name="serverWsPolicyForIntegrity"
- 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="tuscany:wsSecurityPolicyForIntegritys"
- 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.mixed.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/mixed/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-->
- </sca:definitions> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties
deleted file mode 100644
index cb188e6676..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/security.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks
deleted file mode 100644
index 307edb9b37..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthentication.composite.OFF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthentication.composite.OFF
deleted file mode 100644
index fbf0da5585..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthentication.composite.OFF
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService" policySets="tuscany:wsSecurityPolicyForAuthentication">
- <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS" policySets="tuscany:wsSecurityPolicyForAuthentication">
- <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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentiality.composite.OFF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentiality.composite.OFF
deleted file mode 100644
index be78b04dc0..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentiality.composite.OFF
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService" policySets="wsSecurityPolicyForConfidentiality">
- <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS" policySets="wsSecurityPolicyForConfidentiality">
- <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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrity.composite.OFF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrity.composite.OFF
deleted file mode 100644
index 4832629dc9..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrity.composite.OFF
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- 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
- -->
-
- <service name="helloWorld" promote="HelloWorldService" policySets="tuscany:wsSecurityPolicyForIntegrity">
- <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldComponent/helloWorldWS" policySets="tuscany:wsSecurityPolicyForIntegrity">
- <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>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml
deleted file mode 100644
index d7f40ccf0e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml
+++ /dev/null
@@ -1,203 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
-
- <!-- 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks
deleted file mode 100644
index 307edb9b37..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl
deleted file mode 100644
index 41a491361f..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import.wsdl
deleted file mode 100644
index 99a8c6d81d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import.wsdl
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://account2"
- xmlns:tns="http://account2"
- xmlns:account3="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">
-
- <wsdl:import namespace="http://account3" location="/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl" />
-
- <wsdl:binding name="AccountSoapBinding" type="account3:Account">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getCustomerProfile">
- <wsdlsoap:operation soapAction="" />
- <wsdl:input name="getCustomerProfileRequest">
- <wsdlsoap:body use="literal" />
- </wsdl:input>
- <wsdl:output name="getCustomerProfileResponse">
- <wsdlsoap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="AccountService">
- <wsdl:port binding="tns:AccountSoapBinding" name="AccountSoapPort">
- <wsdlsoap:address location="http://localhost:8086/AccountService" />
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-include.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-include.wsdl
deleted file mode 100644
index 80e4b62801..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-include.wsdl
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://accounts"
- xmlns:tns="http://accounts"
- 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-include">
-
- <wsdl:types>
- <xsd:schema elementFormDefault="qualified"
- targetNamespace="http://accounts"
- xmlns:account="http://accounts"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:include schemaLocation="/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.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="xsd:string" />
- <!--
- <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:binding name="AccountSoapBinding" type="tns:Account">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getCustomerProfile">
- <wsdlsoap:operation soapAction="" />
- <wsdl:input name="getCustomerProfileRequest">
- <wsdlsoap:body use="literal" />
- </wsdl:input>
- <wsdl:output name="getCustomerProfileResponse">
- <wsdlsoap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
-
- </wsdl:binding>
-
- <wsdl:service name="AccountService">
- <wsdl:port binding="tns:AccountSoapBinding" name="AccountSoapPort">
- <wsdlsoap:address location="http://localhost:8085/AccountService" />
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite
deleted file mode 100644
index 5fe01d3fda..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="QuestionMarkWSDLImport">
-
- <service name="ep1" promote="AccountService">
- <binding.ws wsdlElement="http://account2#wsdl.port(AccountService/AccountSoapPort)" />
- </service>
-
- <component name="AccountService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.AccountService" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite
deleted file mode 100644
index b966897ccd..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="QuestionMarkWSDLInclude">
-
- <service name="ep1" promote="AccountService">
- <binding.ws wsdlElement="http://accounts#wsdl.port(AccountService/AccountSoapPort)" />
- </service>
-
- <component name="AccountService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.AccountService" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl.composite b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl.composite
deleted file mode 100644
index d26fd4347a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="QuestionMarkWSDLTests">
-
- <service name="ep1" promote="HelloWorldService">
- <binding.ws wsdlElement="http://helloworld#wsdl.service(HelloWorldService)"/>
- <!--
- <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
- -->
- </service>
-
- <service name="ep2" promote="HelloWorldService">
- <binding.ws uri="http://localhost:8085/foo/bar" />
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.composite.OFF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.composite.OFF
deleted file mode 100644
index e4330cb550..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/HelloWorldSOAP12.composite.OFF
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorld">
-
- <service name="helloWorld" promote="HelloWorldService">
- <binding.ws uri="http://localhost:8085/helloWorld"/>
- </service>
- <service name="helloWorldSOAP" promote="HelloWorldService">
- <binding.ws requires="SOAP" uri="http://localhost:8085/helloWorldSOAP"/>
- </service>
- <service name="helloWorldSOAP11" promote="HelloWorldService">
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/helloWorldSOAP11"/>
- </service>
- <service name="helloWorldSOAP12" promote="HelloWorldService">
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/helloWorldSOAP12"/>
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
- </component>
-
- <component name="HelloWorldClient">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
- <reference name="helloWorldWS" />
- </component>
- <component name="HelloWorldClientSOAP">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
- <reference name="helloWorldWS" />
- </component>
- <component name="HelloWorldClientSOAP11">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
- <reference name="helloWorldWS" />
- </component>
- <component name="HelloWorldClientSOAP12">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
- <reference name="helloWorldWS" />
- </component>
-
- <reference name="helloWorldWS" promote="HelloWorldClient/helloWorldWS">
- <binding.ws uri="http://localhost:8085/helloWorld"/>
- </reference>
- <reference name="helloWorldWS" promote="HelloWorldClientSOAP/helloWorldWS">
- <binding.ws uri="http://localhost:8085/helloWorldSOAP" requires="SOAP"/>
- </reference>
- <reference name="helloWorldWS" promote="HelloWorldClientSOAP11/helloWorldWS">
- <binding.ws uri="http://localhost:8085/helloWorldSOAP11" requires="SOAP.1_1"/>
- </reference>
- <reference name="helloWorldWS" promote="HelloWorldClientSOAP12/helloWorldWS">
- <binding.ws uri="http://localhost:8085/helloWorldSOAP12" requires="SOAP.1_2"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/questionmark-wsdl.composite.OFF b/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/questionmark-wsdl.composite.OFF
deleted file mode 100644
index d7fa33c937..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/soap12/questionmark-wsdl.composite.OFF
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="QuestionMarkWSDLTests">
-
- <service name="ep1" promote="HelloWorldService">
- <binding.ws uri="http://localhost:8085/ep1"/>
- </service>
-
- <service name="ep2" promote="HelloWorldService">
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/ep2"/>
- </service>
-
- <service name="ep3" promote="HelloWorldService">
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/ep3"/>
- </service>
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/LICENSE b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/META-INF/MANIFEST.MF
deleted file mode 100644
index 6ccbaf735e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,60 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.binding.ws.wsdlgen;uses:="org.a
- pache.tuscany.sca.databinding,org.apache.tuscany.sca.interfacedef.uti
- l,org.apache.tuscany.sca.core,org.apache.tuscany.sca.policy,javax.wsd
- l.extensions.schema,javax.xml.namespace,javax.wsdl.xml,javax.wsdl.ext
- ensions,org.apache.tuscany.sca.contribution.resolver,org.oasisopen.sca,org
- .apache.ws.commons.schema,javax.wsdl.factory,org.apache.tuscany.sca.a
- ssembly,javax.wsdl.extensions.soap,javax.xml.parsers,org.apache.tusca
- ny.sca.monitor,org.apache.tuscany.sca.interfacedef.java,org.apache.tu
- scany.sca.interfacedef,org.w3c.dom,javax.wsdl,org.apache.tuscany.sca.
- binding.ws,javax.wsdl.extensions.soap12,org.apache.tuscany.sca.databi
- nding.jaxb,org.apache.tuscany.sca.interfacedef.wsdl,org.apache.ws.com
- mons.schema.utils,org.apache.tuscany.sca.xsd";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Web Service binding WSDL Generator
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397303515
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Web Service binding WSDL Genera
- tor
-Import-Package: javax.jws;resolution:=optional,
- javax.wsdl,
- javax.wsdl.extensions,
- javax.wsdl.extensions.schema,
- javax.wsdl.extensions.soap,
- javax.wsdl.extensions.soap12,
- javax.wsdl.factory,
- javax.wsdl.xml,
- javax.xml.bind.annotation;resolution:=optional,
- javax.xml.namespace,
- javax.xml.parsers,
- javax.xml.ws;resolution:=optional,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.binding.ws;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.wsdlgen;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.databinding;version="2.0.0",
- org.apache.tuscany.sca.databinding.jaxb;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.jaxws;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.wsdl;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.xsd;version="2.0.0",
- org.apache.tuscany.sca.xsd.xml;version="2.0.0";resolution:=optional,
- org.apache.ws.commons.schema,
- org.apache.ws.commons.schema.utils,
- org.oasisopen.sca;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0";resolution:=optional,
- org.w3c.dom
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.ws.wsdlgen
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/NOTICE b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/pom.xml b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/pom.xml
deleted file mode 100644
index 11f759dd15..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/pom.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-jaxws</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2-policy</artifactId>
- <version>2.0-M1</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-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java
deleted file mode 100644
index 79213a1ce7..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.wsdlgen;
-
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.wsdl.Definition;
-import javax.wsdl.PortType;
-import javax.wsdl.WSDLException;
-import javax.wsdl.xml.WSDLWriter;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ResolverExtension;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-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.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BindingWSDLGenerator {
- private static final Logger logger = Logger.getLogger(BindingWSDLGenerator.class.getName());
- private static final QName SOAP12_INTENT = new QName("http://www.osoa.org/xmlns/sca/1.0", "SOAP.1_2");
-
- public static boolean printWSDL; // external code sets this to print generated WSDL
-
- private BindingWSDLGenerator() {
- // this class has static methods only and cannot be instantiated
- }
-
- /**
- * Log a warning message.
- * @param problem
- */
- private static void logWarning(Problem problem) {
- Logger problemLogger = Logger.getLogger(problem.getSourceClassName(), problem.getBundleName());
- if (problemLogger != null){
- problemLogger.logp(Level.WARNING, problem.getSourceClassName(), null, problem.getMessageId(), problem.getMessageParams());
- } else {
- logger.severe("Can't get logger " + problem.getSourceClassName()+ " with bundle " + problem.getBundleName());
- }
- }
-
- /**
- * Report a warning.
- * @param message
- * @param binding
- * @param parameters
- */
- private static void warning(Monitor monitor, String message, WebServiceBinding wsBinding, String... messageParameters) {
- Problem problem = monitor.createProblem(BindingWSDLGenerator.class.getName(), "wsdlgen-validation-messages", Severity.WARNING, wsBinding, message, (Object[])messageParameters);
- if (monitor != null) {
- monitor.problem(problem);
- } else {
- logWarning(problem);
- }
- }
-
- /**
- * Report an error.
- * @param message
- * @param binding
- * @param parameters
- */
- private static void error(Monitor monitor, String message, WebServiceBinding wsBinding, String... messageParameters) {
- Problem problem = monitor.createProblem(BindingWSDLGenerator.class.getName(), "wsdlgen-validation-messages", Severity.ERROR, wsBinding, message, (Object[])messageParameters);
- if (monitor != null) {
- monitor.problem(problem);
- } else {
- throw new WSDLGenerationException(problem.toString(), null, problem);
- }
- }
-
- /**
- * Report an exception error.
- * @param message
- * @param binding
- * @param exception
- */
- private static void error(Monitor monitor, String message, WebServiceBinding wsBinding, Exception ex) {
- Problem problem = monitor.createProblem(BindingWSDLGenerator.class.getName(), "wsdlgen-validation-messages", Severity.ERROR, wsBinding, message, ex);
- if (monitor != null) {
- monitor.problem(problem);
- } else {
- throw new WSDLGenerationException(problem.toString(), ex, problem);
- }
- }
-
- /**
- * Report a fatal error.
- * @param message
- * @param binding
- * @param exception
- */
- private static void fatal(Monitor monitor, String message, WebServiceBinding wsBinding, String... messageParameters) {
- Problem problem = monitor.createProblem(BindingWSDLGenerator.class.getName(), "wsdlgen-validation-messages", Severity.ERROR,wsBinding, message, (Object[])messageParameters);
- throw new WSDLGenerationException(problem.toString(), null, problem);
- }
-
- /**
- * Report a fatal exception error.
- * @param message
- * @param binding
- * @param exception
- */
- private static void fatal(Monitor monitor, String message, WebServiceBinding wsBinding, Exception ex) {
- Problem problem = monitor.createProblem(BindingWSDLGenerator.class.getName(), "wsdlgen-validation-messages", Severity.ERROR, wsBinding, message, ex);
- throw new WSDLGenerationException(problem.toString(), ex, problem);
- }
-
- /**
- * This method can be called from the binding builder or from the runtime.
- * Report problems and exceptions in the most appropriate way for both
- * of these cases.
- */
- public static void generateWSDL(Component component,
- AbstractContract contract,
- WebServiceBinding wsBinding,
- ExtensionPointRegistry extensionPoints,
- Monitor monitor) {
- try {
- createWSDLDocument(component, contract, wsBinding, extensionPoints, monitor);
- } catch (WSDLGenerationException ex) {
- if (ex.getProblem() != null) {
- warning(monitor, "WsdlGenProblem", wsBinding, component.getName(), contract.getName());
- if (monitor != null) {
- monitor.problem(ex.getProblem());
- } else {
- throw ex;
- }
- } else if (ex.getCause() instanceof Exception) {
- warning(monitor, "WsdlGenException", wsBinding, component.getName(), contract.getName());
- error(monitor, "UnexpectedException", wsBinding, (Exception)ex.getCause());
- } else { // should never happen
- throw new IllegalStateException(ex);
- }
- } catch (RuntimeException ex) {
- warning(monitor, "WsdlGenException", wsBinding, component.getName(), contract.getName());
- error(monitor, "UnexpectedException", wsBinding, ex);
- }
- }
-
- private static void createWSDLDocument(Component component,
- AbstractContract contract,
- WebServiceBinding wsBinding,
- ExtensionPointRegistry extensionPoints,
- Monitor monitor) {
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- DataBindingExtensionPoint dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class);
- WSDLFactory wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
- XSDFactory xsdFactory = modelFactories.getFactory(XSDFactory.class);
-
- if (((Contract)contract).getInterfaceContract(wsBinding) == null) {
- // can happen if incorrect component service name
- fatal(monitor, "MissingInterfaceContract", wsBinding, component.getName(), contract.getName());
- }
-
- InterfaceContract icontract = wsBinding.getBindingInterfaceContract();
- if (icontract == null) {
- icontract = ((Contract)contract).getInterfaceContract(wsBinding).makeUnidirectional(false);
- if (icontract instanceof JavaInterfaceContract) {
- ModelResolver resolver = component instanceof ResolverExtension ?
- ((ResolverExtension)component).getModelResolver() : null;
- icontract = createWSDLInterfaceContract(
- (JavaInterfaceContract)icontract,
- requiresSOAP12(wsBinding),
- resolver,
- dataBindings,
- wsdlFactory,
- xsdFactory,
- monitor);
- } else {
- try {
- //TUSCANY-2316 Cloning the Interface Contract to avoid overriding data binding information
- icontract = (InterfaceContract)icontract.clone();
- } catch (Exception e) {
- //ignore
- }
- }
- wsBinding.setBindingInterfaceContract(icontract);
- }
-
- // TODO - fix up the conversational flag and operation sequences in case the contract has come from WSDL
- // as we don't yet support requires="conversational" or sca:endConversation annotations
- // in WSDL interface descriptions (see section 1.5.4 of the Assembly Specification V1.0)
- if (contract.getInterfaceContract().getInterface() != null ) {
- icontract.getInterface().setConversational(contract.getInterfaceContract().getInterface().isConversational());
-
- for (Operation operation : icontract.getInterface().getOperations()){
- Operation serviceOperation = null;
-
- for (Operation tmpOp : contract.getInterfaceContract().getInterface().getOperations()){
- if (operation.getName().equals(tmpOp.getName())) {
- serviceOperation = tmpOp;
- break;
- }
- }
-
- if (serviceOperation != null ){
- operation.setConversationSequence(serviceOperation.getConversationSequence());
- }
- }
- }
-
- /*
- // Look at all the Web Service bindings of the SCA service to see if any
- // of them have an existing generated WSDL definitions document. If found,
- // use it for this binding as well. If not found, generate a new document.
- Definition definition = null;
- for (Binding binding : contract.getBindings()) {
- if (binding instanceof WebServiceBinding) {
- definition = ((WebServiceBinding)binding).getWSDLDocument();
- if (definition != null) {
- wsBinding.setWSDLDocument(definition);
- break;
- }
- }
- }
- */
- // The above code is currently not used. Instead, we only look
- // for a WSDL definitions document in this binding and don't
- // attempt to share the same document across multiple bindings.
-
- // generate a WSDL definitions document if needed
- Definition definition = wsBinding.getWSDLDocument();
- if (definition == null) {
- definition = WSDLServiceGenerator.configureWSDLDefinition(wsBinding, component, contract, monitor);
- wsBinding.setWSDLDocument(definition);
- }
- }
-
- protected static boolean requiresSOAP12(WebServiceBinding wsBinding) {
- if (wsBinding instanceof IntentAttachPoint) {
- List<Intent> intents = ((IntentAttachPoint)wsBinding).getRequiredIntents();
- for (Intent intent : intents) {
- if (SOAP12_INTENT.equals(intent.getName())) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Create a WSDLInterfaceContract from a JavaInterfaceContract
- */
- protected static WSDLInterfaceContract createWSDLInterfaceContract(JavaInterfaceContract contract,
- boolean requiresSOAP12,
- ModelResolver resolver,
- DataBindingExtensionPoint dataBindings,
- WSDLFactory wsdlFactory,
- XSDFactory xsdFactory,
- Monitor monitor) {
-
- WSDLInterfaceContract wsdlContract = wsdlFactory.createWSDLInterfaceContract();
- WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface();
- wsdlContract.setInterface(wsdlInterface);
-
- WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition();
- JavaInterface iface = (JavaInterface)contract.getInterface();
-
- Definition def = null;
- try {
- Interface2WSDLGenerator wsdlGenerator =
- new Interface2WSDLGenerator(requiresSOAP12, resolver, dataBindings, xsdFactory, monitor);
- def = wsdlGenerator.generate(iface, wsdlDefinition);
- } catch (WSDLException e) {
- throw new WSDLGenerationException(e);
- }
-
- // for debugging
- if (printWSDL) {
- try {
- System.out.println("Generated WSDL for Java interface " + iface.getName() + " class " + iface.getJavaClass().getName());
- WSDLWriter writer = javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter();
- writer.writeWSDL(def, System.out);
- } catch (WSDLException e) {
- throw new WSDLGenerationException(e);
- }
- }
-
- wsdlDefinition.setDefinition(def);
- wsdlInterface.setWsdlDefinition(wsdlDefinition);
- wsdlInterface.setRemotable(true);
- wsdlInterface.setConversational(contract.getInterface().isConversational());
- wsdlInterface.setUnresolved(false);
- wsdlInterface.setRemotable(true);
- PortType portType = (PortType)def.getAllPortTypes().values().iterator().next();
- wsdlInterface.setPortType(portType);
-
- try {
- wsdlFactory.createWSDLInterface(wsdlInterface, portType, wsdlDefinition, resolver);
- } catch (InvalidInterfaceException e) {
- throw new WSDLGenerationException(e);
- }
-
- return wsdlContract;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
deleted file mode 100644
index ee02632096..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
+++ /dev/null
@@ -1,841 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.wsdlgen;
-
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.wsdl.Binding;
-import javax.wsdl.BindingOperation;
-import javax.wsdl.Definition;
-import javax.wsdl.Fault;
-import javax.wsdl.Input;
-import javax.wsdl.Message;
-import javax.wsdl.OperationType;
-import javax.wsdl.Output;
-import javax.wsdl.Part;
-import javax.wsdl.PortType;
-import javax.wsdl.Types;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.schema.Schema;
-import javax.wsdl.factory.WSDLFactory;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.databinding.DataBinding;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.XMLTypeHelper;
-import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-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.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;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.ws.commons.schema.XmlSchemaException;
-import org.apache.ws.commons.schema.utils.NamespaceMap;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-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) $
- */
-public class Interface2WSDLGenerator {
- private static final Logger logger = Logger.getLogger(Interface2WSDLGenerator.class.getName());
- private static final String SCHEMA_NS = "http://www.w3.org/2001/XMLSchema";
- private static final String SCHEMA_NAME = "schema";
- private static final QName SCHEMA_QNAME = new QName(SCHEMA_NS, SCHEMA_NAME);
- private static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/";
-
- private static final String ANYTYPE_NAME = "anyType";
- private static final QName ANYTYPE_QNAME = new QName(SCHEMA_NS, ANYTYPE_NAME);
-
-
- private WSDLFactory factory;
- private DataBindingExtensionPoint dataBindings;
- private WSDLDefinitionGenerator definitionGenerator;
- private boolean requiresSOAP12;
- private ModelResolver resolver;
- private XSDFactory xsdFactory;
- private Monitor monitor;
-
- public Interface2WSDLGenerator(boolean requiresSOAP12,
- ModelResolver resolver,
- DataBindingExtensionPoint dataBindings,
- XSDFactory xsdFactory,
- Monitor monitor) throws WSDLException {
- super();
- this.requiresSOAP12 = requiresSOAP12;
- this.resolver = resolver;
- definitionGenerator = new WSDLDefinitionGenerator(requiresSOAP12);
- this.dataBindings = dataBindings;
- this.xsdFactory = xsdFactory;
- this.monitor = monitor;
- this.factory = WSDLFactory.newInstance();
- }
-
- /**
- * Log a warning message.
- * @param problem
- */
- private static void logWarning(Problem problem) {
- Logger problemLogger = Logger.getLogger(problem.getSourceClassName(), problem.getBundleName());
- if (problemLogger != null){
- problemLogger.logp(Level.WARNING, problem.getSourceClassName(), null, problem.getMessageId(), problem.getMessageParams());
- } else {
- logger.severe("Can't get logger " + problem.getSourceClassName()+ " with bundle " + problem.getBundleName());
- }
- }
-
- /**
- * Report a warning.
- * @param message
- * @param binding
- * @param parameters
- */
- private void warning(String message, Interface interfaze, String... messageParameters) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "wsdlgen-validation-messages", Severity.WARNING, interfaze, message, (Object[])messageParameters);
- if (monitor != null) {
- monitor.problem(problem);
- } else {
- logWarning(problem);
- }
- }
-
- /**
- * Report a fatal error.
- * @param message
- * @param binding
- * @param parameters
- */
- private void fatal(String message, Interface interfaze, String... messageParameters) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "wsdlgen-validation-messages", Severity.ERROR, interfaze, message, (Object[])messageParameters);
- throw new WSDLGenerationException(problem.toString(), null, problem);
- }
-
- private XMLTypeHelper getTypeHelper(DataType type, Map<String, XMLTypeHelper> helpers) {
- if (type == null) {
- return null;
- }
- String db = type.getDataBinding();
- if (db == null) {
- return null;
- }
- if ("java:array".equals(db)) {
- DataType dt = (DataType)type.getLogical();
- db = dt.getDataBinding();
- }
- return helpers.get(db);
- }
-
- private boolean inputTypesCompatible(DataType wrapperType, DataType<List<DataType>> inputType, Map<String, XMLTypeHelper> helpers) {
- XMLTypeHelper wrapperHelper = getTypeHelper(wrapperType, helpers);
- for (DataType dt : inputType.getLogical()) {
- if (getTypeHelper(dt, helpers) != wrapperHelper) {
- return false;
- }
- }
- return true;
- }
-
- private boolean outputTypeCompatible(DataType wrapperType, DataType outputType, Map<String, XMLTypeHelper> helpers) {
- if (getTypeHelper(outputType, helpers) != getTypeHelper(wrapperType, helpers)) {
- return false;
- } else {
- return true;
- }
- }
-
- private void addDataType(Map<XMLTypeHelper, List<DataType>> map, DataType type, Map<String, XMLTypeHelper> helpers) {
- if (type == null) {
- return;
- }
- String db = type.getDataBinding();
- if (db == null) {
- return;
- }
- if ("java:array".equals(db)) {
- DataType dt = (DataType)type.getLogical();
- db = dt.getDataBinding();
- }
- XMLTypeHelper helper = helpers.get(db);
- List<DataType> types = map.get(helper);
- if (types == null) {
- types = new ArrayList<DataType>();
- map.put(helper, types);
- }
- types.add(type);
- }
-
- private Map<XMLTypeHelper, List<DataType>> getDataTypes(Interface intf, boolean useWrapper, Map<String, XMLTypeHelper> helpers) {
- Map<XMLTypeHelper, List<DataType>> dataTypes = new HashMap<XMLTypeHelper, List<DataType>>();
- for (Operation op : intf.getOperations()) {
- WrapperInfo wrapper = op.getWrapper();
- DataType dt1 = null;
- boolean useInputWrapper = useWrapper & wrapper != null;
- if (useInputWrapper) {
- dt1 = wrapper.getInputWrapperType();
- useInputWrapper &= inputTypesCompatible(dt1, op.getInputType(), helpers);
- }
- if (useInputWrapper) {
- addDataType(dataTypes, dt1, helpers);
- } else {
- for (DataType dt : op.getInputType().getLogical()) {
- addDataType(dataTypes, dt, helpers);
- }
- }
-
- DataType dt2 = null;
- boolean useOutputWrapper = useWrapper & wrapper != null;
- if (useOutputWrapper) {
- dt2 = wrapper.getOutputWrapperType();
- useOutputWrapper &= outputTypeCompatible(dt2, op.getOutputType(), helpers);
- }
- if (useOutputWrapper) {
- addDataType(dataTypes, dt2, helpers);
- } else {
- dt2 = op.getOutputType();
- addDataType(dataTypes, dt2, helpers);
- }
-
- for (DataType<DataType> dt3 : op.getFaultTypes()) {
- DataType dt4 = dt3.getLogical();
- addDataType(dataTypes, dt4, helpers);
- }
- }
- return dataTypes;
- }
-
-
- public Definition generate(Interface interfaze, WSDLDefinition wsdlDefinition) throws WSDLException {
- if (interfaze == null) {
- return null;
- }
- if (interfaze instanceof WSDLInterface) {
- return ((WSDLInterface)interfaze).getWsdlDefinition().getDefinition();
- }
- JavaInterface iface = (JavaInterface)interfaze;
- if (!interfaze.isRemotable()) {
- fatal("InterfaceNotRemotable", interfaze, iface.getName());
- }
- QName name = getQName(iface);
- Definition definition = factory.newDefinition();
- if (requiresSOAP12) {
- definition.addNamespace("SOAP12", "http://schemas.xmlsoap.org/wsdl/soap12/");
- } else {
- definition.addNamespace("SOAP", "http://schemas.xmlsoap.org/wsdl/soap/");
- }
- definition.addNamespace("wsdl", "http://schemas.xmlsoap.org/wsdl/");
- definition.addNamespace("xs", SCHEMA_NS);
-
- String namespaceURI = name.getNamespaceURI();
- definition.setTargetNamespace(namespaceURI);
- definition.setQName(new QName(namespaceURI, name.getLocalPart() + "Service", name.getPrefix()));
- definition.addNamespace(name.getPrefix(), namespaceURI);
-
- PortType portType = definition.createPortType();
- portType.setQName(name);
- Binding binding = definitionGenerator.createBinding(definition, portType);
- Map<String, XMLTypeHelper> helpers = new HashMap<String, XMLTypeHelper>();
- Map<QName, List<ElementInfo>> wrappers = new HashMap<QName, List<ElementInfo>>();
- for (Operation op : interfaze.getOperations()) {
- javax.wsdl.Operation operation = generateOperation(definition, op, helpers, wrappers);
- portType.addOperation(operation);
- String action = ((JavaOperation)op).getAction();
- if ((action == null || "".equals(action)) && !op.isWrapperStyle() && op.getWrapper() == null) {
- // Bare style
- action = "urn:" + op.getName();
- }
- BindingOperation bindingOp = definitionGenerator.createBindingOperation(definition, operation, action);
- binding.addBindingOperation(bindingOp);
- }
- portType.setUndefined(false);
- definition.addPortType(portType);
- binding.setUndefined(false);
- definition.addBinding(binding);
- wsdlDefinition.setBinding(binding);
-
- // call each helper in turn to populate the wsdl.types element
- XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
-
- for (Map.Entry<XMLTypeHelper, List<DataType>> en: getDataTypes(interfaze, false, helpers).entrySet()) {
- XMLTypeHelper helper = en.getKey();
- if (helper == null) {
- continue;
- }
- List<XSDefinition> xsDefinitions = helper.getSchemaDefinitions(xsdFactory, resolver, en.getValue());
- for (XSDefinition xsDef: xsDefinitions) {
- addSchemaExtension(xsDef, schemaCollection, wsdlDefinition, definition);
- }
- }
-
- // remove global wrapper elements with schema definitions from generation list
- for (QName wrapperName: new HashSet<QName>(wrappers.keySet())) {
- if (wsdlDefinition.getXmlSchemaElement(wrapperName) != null) {
- wrappers.remove(wrapperName);
- }
- }
-
- // generate schema elements for wrappers that aren't defined in the schemas
- if (wrappers.size() > 0) {
- int i = 0;
- int index = 0;
- Map<String, XSDefinition> wrapperXSDs = new HashMap<String, XSDefinition>();
- Map<Element, Map<String, String>> prefixMaps = new HashMap<Element, Map<String, String>>();
- for (Map.Entry<QName, List<ElementInfo>> entry: wrappers.entrySet()) {
- String targetNS = entry.getKey().getNamespaceURI();
- Document schemaDoc = null;
- Element schema = null;
- XSDefinition xsDef = wrapperXSDs.get(targetNS);
- if (xsDef != null) {
- schemaDoc = xsDef.getDocument();
- schema = schemaDoc.getDocumentElement();
- } else {
- schemaDoc = createDocument();
- schema = schemaDoc.createElementNS(SCHEMA_NS, "xs:schema");
- // The elementFormDefault should be set to unqualified, see TUSCANY-2388
- schema.setAttribute("elementFormDefault", "unqualified");
- schema.setAttribute("attributeFormDefault", "qualified");
- schema.setAttribute("targetNamespace", targetNS);
- schema.setAttributeNS(XMLNS_NS, "xmlns:xs", SCHEMA_NS);
- schemaDoc.appendChild(schema);
- Schema schemaExt = createSchemaExt(definition);
- schemaExt.setElement(schema);
- prefixMaps.put(schema, new HashMap<String, String>());
- xsDef = xsdFactory.createXSDefinition();
- xsDef.setUnresolved(true);
- xsDef.setNamespace(targetNS);
- xsDef.setDocument(schemaDoc);
- // TUSCANY-2465: Set the system id to avoid schema conflict
- xsDef.setLocation(URI.create("xsd_" + index + ".xsd"));
- index++;
- wrapperXSDs.put(targetNS, xsDef);
- }
- Element wrapper = schemaDoc.createElementNS(SCHEMA_NS, "xs:element");
- schema.appendChild(wrapper);
- wrapper.setAttribute("name", entry.getKey().getLocalPart());
- if (entry.getValue().size() == 1 && entry.getValue().get(0).getQName() == null) {
- // special case for global fault element
- QName typeName = entry.getValue().get(0).getType().getQName();
- String nsURI = typeName.getNamespaceURI();
- if ("".equals(nsURI)) {
- wrapper.setAttribute("type", typeName.getLocalPart());
- addSchemaImport(schema, "", schemaDoc);
- } else if (targetNS.equals(nsURI)) {
- wrapper.setAttribute("type", typeName.getLocalPart());
- } else if (SCHEMA_NS.equals(nsURI)) {
- wrapper.setAttribute("type", "xs:" + typeName.getLocalPart());
- } else {
- Map<String, String> prefixMap = prefixMaps.get(schema);
- String prefix = prefixMap.get(nsURI);
- if (prefix == null) {
- prefix = "ns" + i++;
- prefixMap.put(nsURI, prefix);
- schema.setAttributeNS(XMLNS_NS, "xmlns:" + prefix, nsURI);
- addSchemaImport(schema, nsURI, schemaDoc);
- }
- wrapper.setAttribute("type", prefix + ":" + typeName.getLocalPart());
- }
- } else {
- // normal wrapper containing type definition inline
- Element complexType = schemaDoc.createElementNS(SCHEMA_NS, "xs:complexType");
- wrapper.appendChild(complexType);
- if (entry.getValue().size() > 0) {
- Element sequence = schemaDoc.createElementNS(SCHEMA_NS, "xs:sequence");
- complexType.appendChild(sequence);
- for (ElementInfo element: entry.getValue()) {
- Element xsElement = schemaDoc.createElementNS(SCHEMA_NS, "xs:element");
- if (element.isMany()) {
- xsElement.setAttribute("maxOccurs", "unbounded");
- }
- xsElement.setAttribute("minOccurs", "0");
- xsElement.setAttribute("name", element.getQName().getLocalPart());
- if (element.isNillable()) {
- xsElement.setAttribute("nillable", "true");
- }
- QName typeName = element.getType().getQName();
- String nsURI = typeName.getNamespaceURI();
- if ("".equals(nsURI)) {
- xsElement.setAttribute("type", typeName.getLocalPart());
- addSchemaImport(schema, "", schemaDoc);
- } else if (SCHEMA_NS.equals(nsURI)) {
- xsElement.setAttribute("type", "xs:" + typeName.getLocalPart());
- } else {
- Map<String, String> prefixMap = prefixMaps.get(schema);
- String prefix = prefixMap.get(nsURI);
- if (prefix == null) {
- if (targetNS.equals(nsURI)) {
- prefix = "tns";
- } else {
- prefix = "ns" + i++;
- addSchemaImport(schema, nsURI, schemaDoc);
- }
- prefixMap.put(nsURI, prefix);
- schema.setAttributeNS(XMLNS_NS, "xmlns:" + prefix, nsURI);
- }
- xsElement.setAttribute("type", prefix + ":" + typeName.getLocalPart());
- }
- sequence.appendChild(xsElement);
- }
- }
- }
- }
-
- // resolve XSDefinitions containing generated wrappers
- for (XSDefinition xsDef: wrapperXSDs.values()) {
- loadXSD(schemaCollection, xsDef);
- wsdlDefinition.getXmlSchemas().add(xsDef);
- }
- }
-
- return definition;
- }
-
- private static void addSchemaImport(Element schema, String nsURI, Document schemaDoc) {
- Element imp = schemaDoc.createElementNS(SCHEMA_NS, "xs:import");
- if (!"".equals(nsURI)) {
- imp.setAttribute("namespace", nsURI);
- }
- NodeList childNodes = schema.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node childNode = childNodes.item(i);
- if (childNode instanceof Element) {
- schema.insertBefore(imp, childNode);
- imp = null;
- break;
- }
- }
- if (imp != null) {
- schema.appendChild(imp);
- }
- }
-
- private void addSchemaExtension(XSDefinition xsDef,
- XmlSchemaCollection schemaCollection,
- WSDLDefinition wsdlDefinition,
- Definition definition) throws WSDLException {
- if (xsDef.getAggregatedDefinitions() != null) {
- for (XSDefinition xsd: xsDef.getAggregatedDefinitions()) {
- addSchemaExtension(xsd, schemaCollection, wsdlDefinition, definition);
- }
- } else {
- String nsURI = xsDef.getNamespace();
- Document document = xsDef.getDocument();
- if (document == null) {
- try {
- NamespaceMap prefixMap = new NamespaceMap();
- prefixMap.add("xs", SCHEMA_NS);
- prefixMap.add("tns", nsURI);
- XmlSchema schemaDef = xsDef.getSchema();
- schemaDef.setNamespaceContext(prefixMap);
- Document[] docs = schemaDef.getAllSchemas();
- document = docs[docs.length-1];
- document.setDocumentURI(xsDef.getLocation().toString());
- xsDef.setDocument(document);
- } catch (XmlSchemaException e) {
- throw new RuntimeException(e);
- }
- }
- loadXSD(schemaCollection, xsDef);
- wsdlDefinition.getXmlSchemas().add(xsDef);
- Element schema = document.getDocumentElement();
- Schema schemaExt = createSchemaExt(definition);
- schemaExt.setDocumentBaseURI(document.getDocumentURI());
- schemaExt.setElement(schema);
- }
- }
-
- private static void loadXSD(XmlSchemaCollection schemaCollection, XSDefinition definition) {
- if (definition.getSchema() != null) {
- return;
- }
- if (definition.getDocument() != null) {
- String uri = null;
- if (definition.getLocation() != null) {
- uri = definition.getLocation().toString();
- }
- XmlSchema schema = schemaCollection.read(definition.getDocument(), uri, null);
- if (definition.getSchemaCollection() == null) {
- definition.setSchemaCollection(schemaCollection);
- }
- if (definition.getSchema() == null) {
- definition.setSchema(schema);
- }
- }
- }
-
- public Schema createSchemaExt(Definition definition) throws WSDLException {
- Types types = definition.getTypes();
- if (types == null) {
- types = definition.createTypes();
- definition.setTypes(types);
- }
-
- Schema schemaExt = createSchema(definition);
- types.addExtensibilityElement(schemaExt);
-
- return schemaExt;
- }
-
- public Schema createSchema(Definition definition) throws WSDLException {
- return (Schema)definition.getExtensionRegistry().createExtension(Types.class, SCHEMA_QNAME);
- }
-
- private DocumentBuilderFactory documentBuilderFactory;
-
- public Document createDocument() {
- Document document;
- try {
- if (documentBuilderFactory == null) {
- documentBuilderFactory = DocumentBuilderFactory.newInstance();
- documentBuilderFactory.setNamespaceAware(true);
- }
- document = documentBuilderFactory.newDocumentBuilder().newDocument();
- } catch (ParserConfigurationException ex) {
- throw new WSDLGenerationException(ex);
- }
- // document.setDocumentURI("http://");
- return document;
- }
-
- protected QName getQName(Interface interfaze) {
- JavaInterface iface = (JavaInterface)interfaze;
- QName qname = iface.getQName();
- if (qname != null) {
- return qname;
- } else {
- Class<?> javaClass = iface.getJavaClass();
- return new QName(JavaXMLMapper.getNamespace(javaClass), javaClass.getSimpleName(), "tns");
- }
- }
-
- public javax.wsdl.Operation generateOperation(Definition definition,
- Operation op,
- Map<String, XMLTypeHelper> helpers,
- Map<QName, List<ElementInfo>> wrappers)
- throws WSDLException {
- javax.wsdl.Operation operation = definition.createOperation();
- operation.setName(op.getName());
- operation.setUndefined(false);
-
- Input input = definition.createInput();
- Message inputMsg = definition.createMessage();
- String namespaceURI = definition.getQName().getNamespaceURI();
- QName inputMsgName = new QName(namespaceURI, op.getName());
- inputMsg.setQName(inputMsgName);
- inputMsg.setUndefined(false);
- definition.addMessage(inputMsg);
-
- List<ElementInfo> elements = null;
- // FIXME: By default, java interface is mapped to doc-lit-wrapper style WSDL
- if (op.getWrapper() != null) {
- // Generate doc-lit-wrapper style
- inputMsg.addPart(generateWrapperPart(definition, op, helpers, wrappers, true));
- } else {
- // Bare style
- int i = 0;
- for (DataType d : op.getInputType().getLogical()) {
- inputMsg.addPart(generatePart(definition, d, "arg" + i));
- elements = new ArrayList<ElementInfo>();
- ElementInfo element = getElementInfo(d.getPhysical(), d, null, helpers);
- elements.add(element);
- QName elementName = ((XMLType)d.getLogical()).getElementName();
- wrappers.put(elementName, elements);
- i++;
- }
- }
- input.setMessage(inputMsg);
- operation.setInput(input);
-
- if (!op.isNonBlocking()) {
- Output output = definition.createOutput();
- Message outputMsg = definition.createMessage();
- QName outputMsgName = new QName(namespaceURI, op.getName() + "Response");
- outputMsg.setQName(outputMsgName);
- outputMsg.setUndefined(false);
- definition.addMessage(outputMsg);
-
- if (op.getWrapper() != null) {
- outputMsg.addPart(generateWrapperPart(definition, op, helpers, wrappers, false));
- } else {
- DataType outputType = op.getOutputType();
- outputMsg.addPart(generatePart(definition, outputType, "return"));
- if (outputType != null) {
- elements = new ArrayList<ElementInfo>();
- ElementInfo element = getElementInfo(outputType.getPhysical(), outputType, null, helpers);
- elements.add(element);
- QName elementName = ((XMLType)outputType.getLogical()).getElementName();
- wrappers.put(elementName, elements);
- }
- }
- output.setMessage(outputMsg);
-
- operation.setOutput(output);
- operation.setStyle(OperationType.REQUEST_RESPONSE);
- } else {
- operation.setStyle(OperationType.ONE_WAY);
- }
-
- for (DataType<DataType> faultType: op.getFaultTypes()) {
- Fault fault = definition.createFault();
- QName faultName = ((XMLType)faultType.getLogical().getLogical()).getElementName();
- fault.setName(faultName.getLocalPart());
- Message faultMsg = definition.getMessage(faultName);
- if (faultMsg == null) {
- faultMsg = definition.createMessage();
- faultMsg.setQName(faultName);
- faultMsg.setUndefined(false);
- definition.addMessage(faultMsg);
- faultMsg.addPart(generatePart(definition, faultType.getLogical(), faultName.getLocalPart()));
- }
- fault.setMessage(faultMsg);
- operation.addFault(fault);
- if (faultType.getLogical().getPhysical() != faultType.getPhysical()) {
- // create special wrapper for type indirection to real fault bean
- DataType logical = faultType.getLogical();
- elements = new ArrayList<ElementInfo>();
- elements.add(getElementInfo(logical.getPhysical(), logical, null, helpers));
- } else {
- // convert synthesized fault bean to a wrapper type
- for (DataType<XMLType> propDT: op.getFaultBeans().get(faultName)) {
- XMLType logical = propDT.getLogical();
- elements = new ArrayList<ElementInfo>();
- elements.add(getElementInfo(propDT.getPhysical(), propDT, logical.getElementName(), helpers));
- }
- }
- wrappers.put(faultName, elements);
- }
-
- operation.setUndefined(false);
- return operation;
- }
-
- public Part generatePart(Definition definition, DataType arg, String partName) {
- Part part = definition.createPart();
- part.setName(partName);
- if (arg != null && arg.getLogical() instanceof XMLType) {
- XMLType xmlType = (XMLType)arg.getLogical();
- QName elementName = xmlType.getElementName();
- part.setElementName(elementName);
- addNamespace(definition, elementName);
- if (xmlType.getElementName() == null) {
- QName typeName = xmlType.getTypeName();
- part.setTypeName(typeName);
- addNamespace(definition, typeName);
- }
- }
- return part;
- }
-
- public Part generateWrapperPart(Definition definition,
- Operation operation,
- Map<String, XMLTypeHelper> helpers,
- Map<QName, List<ElementInfo>> wrappers,
- boolean input) throws WSDLException {
- Part part = definition.createPart();
- String partName = input ? operation.getName() : (operation.getName() + "Response");
- part.setName(partName);
- WrapperInfo opWrapper = operation.getWrapper();
- if (opWrapper != null) {
- ElementInfo elementInfo =
- input ? opWrapper.getInputWrapperElement() : opWrapper.getOutputWrapperElement();
- List<ElementInfo> elements =
- input ? opWrapper.getInputChildElements() : opWrapper.getOutputChildElements();
- QName wrapperName = elementInfo.getQName();
- part.setElementName(wrapperName);
- addNamespace(definition, wrapperName);
- wrappers.put(wrapperName, elements);
-
- // FIXME: [rfeng] Ideally, we should try to register the wrappers only. But we are
- // expriencing the problem that we cannot handle XSD imports
- /*
- Class<?> wrapperClass = input ? opWrapper.getInputWrapperClass() : opWrapper.getOutputWrapperClass();
- DataType wrapperDT = input ? opWrapper.getInputWrapperType() : opWrapper.getOutputWrapperType();
- if (wrapperClass != null) {
- getElementInfo(wrapperClass, wrapperDT, wrapperName, helpers);
- return part;
- }
- */
-
- Method method = ((JavaOperation)operation).getJavaMethod();
- if (input) {
- Class<?>[] paramTypes = method.getParameterTypes();
- for (int i = 0; i < paramTypes.length; i++) {
- DataType dataType = operation.getInputType().getLogical().get(i);
- elements.set(i, getElementInfo(paramTypes[i], dataType, elements.get(i).getQName(), helpers));
- }
- } else {
- Class<?> returnType = method.getReturnType();
- if (returnType != Void.TYPE) {
- DataType dataType = operation.getOutputType();
- elements.set(0, getElementInfo(returnType, dataType, elements.get(0).getQName(), helpers));
- }
- }
- }
- return part;
- }
-
- private ElementInfo getElementInfo(Class javaType,
- DataType dataType,
- QName name,
- Map<String, XMLTypeHelper> helpers) {
- String db = dataType.getDataBinding();
- while ("java:array".equals(db)) {
- dataType = (DataType)dataType.getLogical();
- db = dataType.getDataBinding();
- }
- XMLTypeHelper helper = helpers.get(db);
- if (helper == null) {
- DataBinding dataBinding = dataBindings.getDataBinding(db);
- if (dataBinding == null) {
- QName element = name;
- if (element == null || dataType.getLogical() instanceof XMLType) {
- XMLType xmlType = (XMLType)dataType.getLogical();
- if (xmlType.getElementName() != null) {
- element = xmlType.getElementName();
- }
- }
- return new ElementInfo(element, new TypeInfo(ANYTYPE_QNAME, false, null));
- // throw new ServiceRuntimeException("No data binding for " + db);
- }
-
- helper = dataBinding.getXMLTypeHelper();
- if (helper == null) {
- // Default to JAXB
- helper = helpers.get(JAXBDataBinding.NAME);
- if (helper == null) {
- helper = dataBindings.getDataBinding(JAXBDataBinding.NAME).getXMLTypeHelper();
- helpers.put(JAXBDataBinding.NAME, helper);
- }
- }
- helpers.put(db, helper);
- }
- TypeInfo typeInfo = helper.getTypeInfo(javaType.isArray() ? javaType.getComponentType() : javaType,
- dataType.getLogical());
- ElementInfo element = new ElementInfo(name, typeInfo);
- element.setMany(byte[].class != javaType && javaType.isArray());
- element.setNillable(!javaType.isPrimitive());
- return element;
- }
-
- private static void addNamespace(Definition definition, QName name) {
- String namespace = name.getNamespaceURI();
- if (definition.getPrefix(namespace) == null) {
- definition.addNamespace("ns" + definition.getNamespaces().size(), namespace);
- }
- }
-
- /*
- // currently not using the next three methods
- public XmlSchemaType getXmlSchemaType(DataType type) {
- return null;
- }
-
- // FIXME: WE need to add databinding-specific Java2XSD generation
- public Element generateXSD(DataType dataType) {
- DataBinding dataBinding = dataBindings.getDataBinding(dataType.getDataBinding());
- if (dataBinding != null) {
- // return dataBinding.generateSchema(dataType);
- }
- return null;
- }
-
- public void generateWrapperElements(Operation op) {
- XmlSchemaCollection collection = new XmlSchemaCollection();
- String ns = getQName(op.getInterface()).getNamespaceURI();
- XmlSchema schema = new XmlSchema(ns, collection);
- schema.setAttributeFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
- schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
-
- XmlSchemaElement inputElement = new XmlSchemaElement();
- inputElement.setQName(new QName(ns, op.getName()));
- XmlSchemaComplexType inputType = new XmlSchemaComplexType(schema);
- inputType.setName("");
- XmlSchemaSequence inputSeq = new XmlSchemaSequence();
- inputType.setParticle(inputSeq);
- List<DataType> argTypes = op.getInputType().getLogical();
- for (DataType argType : argTypes) {
- XmlSchemaElement child = new XmlSchemaElement();
- Object logical = argType.getLogical();
- if (logical instanceof XMLType) {
- child.setName(((XMLType)logical).getElementName().getLocalPart());
- XmlSchemaType type = getXmlSchemaType(argType);
- child.setType(type);
- }
- inputSeq.getItems().add(child);
- }
- inputElement.setType(inputType);
-
- XmlSchemaElement outputElement = new XmlSchemaElement();
- outputElement.setQName(new QName(ns, op.getName() + "Response"));
- XmlSchemaComplexType outputType = new XmlSchemaComplexType(schema);
- outputType.setName("");
- XmlSchemaSequence outputSeq = new XmlSchemaSequence();
- outputType.setParticle(outputSeq);
- DataType returnType = op.getOutputType();
- XmlSchemaElement child = new XmlSchemaElement();
- Object logical = returnType.getLogical();
- if (logical instanceof XMLType) {
- child.setName(((XMLType)logical).getElementName().getLocalPart());
- XmlSchemaType type = getXmlSchemaType(returnType);
- child.setType(type);
- }
- outputSeq.getItems().add(child);
- outputElement.setType(outputType);
-
- schema.getElements().add(inputElement.getQName(), inputElement);
- schema.getElements().add(outputElement.getQName(), outputElement);
-
- }
- */
-
- public WSDLFactory getFactory() {
- return factory;
- }
-
- public void setFactory(WSDLFactory factory) {
- this.factory = factory;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
deleted file mode 100644
index d0b79f9b0e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.wsdlgen;
-
-import java.util.Iterator;
-
-import javax.wsdl.Binding;
-import javax.wsdl.BindingFault;
-import javax.wsdl.BindingInput;
-import javax.wsdl.BindingOperation;
-import javax.wsdl.BindingOutput;
-import javax.wsdl.Definition;
-import javax.wsdl.Fault;
-import javax.wsdl.Input;
-import javax.wsdl.Operation;
-import javax.wsdl.Output;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.Types;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap.SOAPBinding;
-import javax.wsdl.extensions.soap.SOAPBody;
-import javax.wsdl.extensions.soap.SOAPFault;
-import javax.wsdl.extensions.soap.SOAPOperation;
-import javax.wsdl.extensions.soap12.SOAP12Address;
-import javax.wsdl.extensions.soap12.SOAP12Binding;
-import javax.wsdl.extensions.soap12.SOAP12Body;
-import javax.wsdl.extensions.soap12.SOAP12Fault;
-import javax.wsdl.extensions.soap12.SOAP12Operation;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Element;
-
-/**
- *
- * @version $Rev: 668025 $ $Date: 2008-06-16 01:06:34 +0100 (Mon, 16 Jun 2008) $
- */
-public class WSDLDefinitionGenerator {
- private static final String SOAP_NS = "http://schemas.xmlsoap.org/wsdl/soap/";
- public static final QName SOAP_ADDRESS = new QName(SOAP_NS, "address");
- private static final QName SOAP_BINDING = new QName(SOAP_NS, "binding");
- private static final QName SOAP_BODY = new QName(SOAP_NS, "body");
- private static final QName SOAP_FAULT = new QName(SOAP_NS, "fault");
- private static final QName SOAP_OPERATION = new QName(SOAP_NS, "operation");
- private static final String SOAP12_NS = "http://schemas.xmlsoap.org/wsdl/soap12/";
- public static final QName SOAP12_ADDRESS = new QName(SOAP12_NS, "address");
- private static final QName SOAP12_BINDING = new QName(SOAP12_NS, "binding");
- private static final QName SOAP12_BODY = new QName(SOAP12_NS, "body");
- private static final QName SOAP12_FAULT = new QName(SOAP12_NS, "fault");
- private static final QName SOAP12_OPERATION = new QName(SOAP12_NS, "operation");
-
- private static final String BINDING_SUFFIX = "Binding";
- private static final String SERVICE_SUFFIX = "Service";
- private static final String PORT_SUFFIX = "Port";
-
- private boolean requiresSOAP12;
- private QName soapAddress;
- private QName soapBinding;
- private QName soapBody;
- private QName soapFault;
- private QName soapOperation;
-
- public WSDLDefinitionGenerator(boolean requiresSOAP12) {
- super();
- this.requiresSOAP12 = requiresSOAP12;
- soapAddress = requiresSOAP12 ? SOAP12_ADDRESS : SOAP_ADDRESS;
- soapBinding = requiresSOAP12 ? SOAP12_BINDING : SOAP_BINDING;
- soapBody = requiresSOAP12 ? SOAP12_BODY : SOAP_BODY;
- soapFault = requiresSOAP12 ? SOAP12_FAULT : SOAP_FAULT;
- soapOperation = requiresSOAP12 ? SOAP12_OPERATION : SOAP_OPERATION;
- }
-
- public Definition cloneDefinition(WSDLFactory factory, Definition definition) throws WSDLException {
- Element root = definition.getDocumentationElement();
- root = (Element)root.cloneNode(true);
- WSDLReader reader = factory.newWSDLReader();
- return reader.readWSDL(definition.getDocumentBaseURI(), root);
- }
-
- public Types createTypes(Definition definition) {
- Types types = definition.createTypes();
- definition.setTypes(types);
- return types;
- }
-
- public Binding createBinding(Definition definition, PortType portType) {
- try {
- Binding binding = definition.createBinding();
- binding.setPortType(portType);
- configureBinding(definition, binding, portType);
- ExtensibilityElement bindingExtension =
- definition.getExtensionRegistry().createExtension(Binding.class, soapBinding);
- if (requiresSOAP12) {
- ((SOAP12Binding)bindingExtension).setStyle("document");
- ((SOAP12Binding)bindingExtension).setTransportURI("http://schemas.xmlsoap.org/soap/http");
- } else {
- ((SOAPBinding)bindingExtension).setStyle("document");
- ((SOAPBinding)bindingExtension).setTransportURI("http://schemas.xmlsoap.org/soap/http");
- }
- binding.addExtensibilityElement(bindingExtension);
- return binding;
- } catch (WSDLException e) {
- throw new WSDLGenerationException(e);
- }
- }
-
- protected void configureBinding(Definition definition, Binding binding, PortType portType) throws WSDLException {
- QName portTypeName = portType.getQName();
- if (portTypeName != null) {
- // Choose <porttype>Binding if available. If this name is in use, insert
- // separating underscores until there is no clash.
- for (String suffix = BINDING_SUFFIX; ; suffix = "_" + suffix) {
- QName name = new QName(definition.getTargetNamespace(), portTypeName.getLocalPart() + suffix);
- if (definition.getBinding(name) == null) {
- binding.setQName(name);
- break;
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- public void createBindingOperations(Definition definition, Binding binding, PortType portType) {
- try {
- for (Iterator oi = portType.getOperations().iterator(); oi.hasNext();) {
- Operation operation = (Operation)oi.next();
- BindingOperation bindingOperation =
- createBindingOperation(definition, operation, "urn:" + operation.getName());
- binding.addBindingOperation(bindingOperation);
- }
- } catch (WSDLException e) {
- throw new WSDLGenerationException(e);
- }
- }
-
- @SuppressWarnings("unchecked")
- public BindingOperation createBindingOperation(Definition definition, Operation operation, String action)
- throws WSDLException {
- BindingOperation bindingOperation = definition.createBindingOperation();
- bindingOperation.setOperation(operation);
- configureBindingOperation(bindingOperation, operation);
- ExtensibilityElement operationExtension =
- definition.getExtensionRegistry().createExtension(BindingOperation.class, soapOperation);
- if (requiresSOAP12) {
- ((SOAP12Operation)operationExtension).setSoapActionURI(action);
- } else {
- ((SOAPOperation)operationExtension).setSoapActionURI(action);
- }
- bindingOperation.addExtensibilityElement(operationExtension);
- if (operation.getInput() != null) {
- BindingInput bindingInput = definition.createBindingInput();
- configureBindingInput(bindingInput, operation.getInput());
- ExtensibilityElement inputExtension =
- definition.getExtensionRegistry().createExtension(BindingInput.class, soapBody);
- if (requiresSOAP12) {
- ((SOAP12Body)inputExtension).setUse("literal");
- } else {
- ((SOAPBody)inputExtension).setUse("literal");
- }
- bindingInput.addExtensibilityElement(inputExtension);
- bindingOperation.setBindingInput(bindingInput);
- }
- if (operation.getOutput() != null) {
- BindingOutput bindingOutput = definition.createBindingOutput();
- configureBindingOutput(bindingOutput, operation.getOutput());
- ExtensibilityElement outputExtension =
- definition.getExtensionRegistry().createExtension(BindingOutput.class, soapBody);
- if (requiresSOAP12) {
- ((SOAP12Body)outputExtension).setUse("literal");
- } else {
- ((SOAPBody)outputExtension).setUse("literal");
- }
- bindingOutput.addExtensibilityElement(outputExtension);
- bindingOperation.setBindingOutput(bindingOutput);
- }
- for (Iterator fi = operation.getFaults().values().iterator(); fi.hasNext();) {
- Fault fault = (Fault)fi.next();
- BindingFault bindingFault = definition.createBindingFault();
- ExtensibilityElement faultExtension =
- definition.getExtensionRegistry().createExtension(BindingFault.class, soapFault);
- configureBindingFault(bindingFault, faultExtension, fault);
- bindingFault.addExtensibilityElement(faultExtension);
- bindingOperation.addBindingFault(bindingFault);
- }
- return bindingOperation;
- }
-
- protected void configureBindingOperation(BindingOperation bindingOperation, Operation operation)
- throws WSDLException {
- bindingOperation.setName(operation.getName());
- }
-
- protected void configureBindingInput(BindingInput bindingInput, Input input) throws WSDLException {
- bindingInput.setName(input.getName());
- }
-
- protected void configureBindingOutput(BindingOutput bindingOutput, Output output) throws WSDLException {
- bindingOutput.setName(output.getName());
- }
-
- protected void configureBindingFault(BindingFault bindingFault,
- ExtensibilityElement faultExtension,
- Fault fault)
- throws WSDLException {
- String faultName = fault.getName();
- bindingFault.setName(faultName);
- if (requiresSOAP12) {
- ((SOAP12Fault)faultExtension).setName(faultName);
- ((SOAP12Fault)faultExtension).setUse("literal");
- } else {
- ((SOAPFault)faultExtension).setName(faultName);
- ((SOAPFault)faultExtension).setUse("literal");
- }
- }
-
- public Service createService(Definition definition, PortType portType) {
- try {
- Service service = definition.createService();
- configureService(definition, service, portType);
- // createPort(definition, binding, service);
- definition.addService(service);
- return service;
- } catch (WSDLException e) {
- throw new WSDLGenerationException(e);
- }
- }
-
- public Service createService(Definition definition, Binding binding) {
- try {
- Service service = definition.createService();
- configureService(definition, service, binding.getPortType());
- // createPort(definition, binding, service);
- definition.addService(service);
- return service;
- } catch (WSDLException e) {
- throw new WSDLGenerationException(e);
- }
- }
-
- protected void configureService(Definition definition, Service service, PortType portType) throws WSDLException {
- QName portTypeName = portType.getQName();
- if (portTypeName != null) {
- // Choose <porttype>Service if available. If this name is in use, insert
- // separating underscores until there is no clash.
- for (String suffix = SERVICE_SUFFIX; ; suffix = "_" + suffix) {
- QName name = new QName(definition.getTargetNamespace(), portTypeName.getLocalPart() + suffix);
- if (definition.getService(name) == null) {
- service.setQName(name);
- break;
- }
- }
- }
- }
-
- public Port createPort(Definition definition, Binding binding, Service service, String uri) {
- try {
- Port port = definition.createPort();
- port.setBinding(binding);
- configurePort(port, binding);
- if (uri != null) {
- ExtensibilityElement portExtension =
- definition.getExtensionRegistry().createExtension(Port.class, soapAddress);
- if (requiresSOAP12) {
- ((SOAP12Address)portExtension).setLocationURI(uri);
- } else {
- ((SOAPAddress)portExtension).setLocationURI(uri);
- }
- port.addExtensibilityElement(portExtension);
- }
- service.addPort(port);
- return port;
- } catch (WSDLException e) {
- throw new WSDLGenerationException(e);
- }
- }
-
- protected void configurePort(Port port, Binding binding) throws WSDLException {
- if (binding.getPortType() != null && binding.getPortType().getQName() != null) {
- port.setName(binding.getPortType().getQName().getLocalPart() + PORT_SUFFIX);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLGenerationException.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLGenerationException.java
deleted file mode 100644
index 1a9b26d618..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLGenerationException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.wsdlgen;
-
-import org.apache.tuscany.sca.monitor.Problem;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-public class WSDLGenerationException extends ServiceRuntimeException {
- private static final long serialVersionUID = 1L;
- private Problem problem;
-
- public WSDLGenerationException() {
- super();
- }
-
- public WSDLGenerationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public WSDLGenerationException(String message) {
- super(message);
- }
-
- public WSDLGenerationException(Throwable cause) {
- super(cause);
- }
-
- public WSDLGenerationException(String message, Throwable cause, Problem problem) {
- super(message, cause);
- this.problem = problem;
- }
-
- public Problem getProblem() {
- return problem;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java
deleted file mode 100644
index b74358a0a1..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.wsdlgen;
-
-//FIXME: trim the import list down to what's really needed
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap.SOAPBinding;
-import javax.wsdl.extensions.soap12.SOAP12Address;
-import javax.wsdl.extensions.soap12.SOAP12Binding;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLWriter;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * WSDLServiceGenerator generates a binding WSDL service document.
- *
- * @version $Rev$ $Date$
- */
-public class WSDLServiceGenerator {
- // the following switch is temporary for debugging
- public static boolean printWSDL; // external code sets this to print generated WSDL
-
- private static final Logger logger = Logger.getLogger(WSDLServiceGenerator.class.getName());
- private static final QName TRANSPORT_JMS_QUALIFIED_INTENT =
- new QName("http://www.osoa.org/xmlns/sca/1.0", "transport.jms");
- private static final String DEFAULT_QUEUE_CONNECTION_FACTORY = "TuscanyQueueConnectionFactory";
- private static final String ADDRESS = "Address";
-
- private WSDLServiceGenerator() {
- // this class has static methods only and cannot be instantiated
- }
-
- /**
- * Log a warning message.
- * @param problem
- */
- private static void logWarning(Problem problem) {
- Logger problemLogger = Logger.getLogger(problem.getSourceClassName(), problem.getBundleName());
- if (problemLogger != null){
- problemLogger.logp(Level.WARNING, problem.getSourceClassName(), null, problem.getMessageId(), problem.getMessageParams());
- } else {
- logger.severe("Can't get logger " + problem.getSourceClassName()+ " with bundle " + problem.getBundleName());
- }
- }
-
- /**
- * Report a warning.
- * @param message
- * @param binding
- * @param parameters
- */
- private static void warning(Monitor monitor, String message, WebServiceBinding wsBinding, String... messageParameters) {
- Problem problem = monitor.createProblem(WSDLServiceGenerator.class.getName(), "wsdlgen-validation-messages", Severity.WARNING, wsBinding, message, (Object[])messageParameters);
- if (monitor != null) {
- monitor.problem(problem);
- } else {
- logWarning(problem);
- }
- }
-
- /**
- * Report an error.
- * @param message
- * @param binding
- * @param parameters
- */
- private static void error(Monitor monitor, String message, WebServiceBinding wsBinding, String... messageParameters) {
- Problem problem = monitor.createProblem(WSDLServiceGenerator.class.getName(), "wsdlgen-validation-messages", Severity.ERROR, wsBinding, message, (Object[])messageParameters);
- if (monitor != null) {
- monitor.problem(problem);
- } else {
- throw new WSDLGenerationException(problem.toString(), null, problem);
- }
- }
-
- /**
- * Generate a suitably configured WSDL definition
- */
- protected static Definition configureWSDLDefinition(WebServiceBinding wsBinding,
- Component component,
- AbstractContract contract,
- Monitor monitor) {
-
- //[nash] changes to the builder sequence avoid calling this for a CompositeService
- assert !(contract instanceof CompositeService);
- /*
- // For every promoted composite service, the underlying component
- // gets a copy of the service with the name prefixed by "$promoted$."
- String contractName = (contract instanceof CompositeService ? "$promoted$." : "") + contract.getName();
- */
- String contractName = contract.getName();
-
- List<Port> ports = new ArrayList<Port>();
- WSDLDefinition wsdlDefinition = wsBinding.getWSDLDefinition();
- if (wsdlDefinition == null) {
- error(monitor, "NoWsdlInterface", wsBinding, component.getName(), contract.getName());
- return null;
- }
- Definition def = wsdlDefinition.getDefinition();
- if (wsdlDefinition.getBinding() == null) {
- // The WSDL document was provided by the user. Generate a new
- // WSDL document with imports from the user-provided document.
- WSDLFactory factory = null;
- try {
- factory = WSDLFactory.newInstance();
- } catch (WSDLException e) {
- throw new WSDLGenerationException(e);
- }
- Definition newDef = factory.newDefinition();
-
- // Construct a target namespace from the base URI of the user's
- // WSDL document (is this what we should be using?) and a path
- // computed according to the SCA Web Service binding spec.
- String nsName = component.getName() + "/" + contractName;
- String namespaceURI = null;
- try {
- URI userTNS = new URI(def.getTargetNamespace());
- namespaceURI = userTNS.resolve("/" + nsName).toString();
- } catch (URISyntaxException e1) {
- throw new WSDLGenerationException(e1);
- } catch (IllegalArgumentException e2) {
- throw new WSDLGenerationException(e2);
- }
-
- // set name and targetNamespace attributes on the definition
- String defsName = component.getName() + "." + contractName;
- newDef.setQName(new QName(namespaceURI, defsName));
- newDef.setTargetNamespace(namespaceURI);
- newDef.addNamespace("tns", namespaceURI);
-
- // set wsdl namespace prefix on the definition
- newDef.addNamespace("wsdl", "http://schemas.xmlsoap.org/wsdl/");
-
- // import the service or reference interface portType
- List<WSDLDefinition> imports = new ArrayList<WSDLDefinition>();
- Interface interfaze = wsBinding.getBindingInterfaceContract().getInterface();
- if (interfaze instanceof WSDLInterface) {
- PortType portType = ((WSDLInterface)interfaze).getPortType();
- boolean ok = importPortType(portType, wsdlDefinition, newDef, imports);
- if (!ok) {
- error(monitor, "PortTypeNotFound", wsBinding, portType.getQName().toString(),
- component.getName(), contract.getName());
- }
- }
-
- // import an existing binding if specified
- Binding binding = wsBinding.getBinding();
- if (binding != null) {
- boolean ok = importBinding(binding, wsdlDefinition, newDef, imports);
- if (ok) {
- boolean ok2 = importPortType(binding.getPortType(), wsdlDefinition, newDef, imports);
- if (!ok2) {
- error(monitor, "PortTypeNotFound", wsBinding, binding.getPortType().getQName().toString(),
- component.getName(), contract.getName());
- }
- } else {
- error(monitor, "BindingNotFound", wsBinding, binding.getQName().toString(),
- component.getName(), contract.getName());
- }
- }
-
- // import bindings and portTypes needed by services and ports
- QName serviceQName = wsBinding.getServiceName();
- String portName = wsBinding.getPortName();
- if (serviceQName != null) {
- Service service = def.getService(serviceQName);
- if (portName != null) {
- Port port = service.getPort(portName);
- Port newPort = copyPort(newDef, port, wsBinding);
- if (newPort != null) {
- importBinding(port.getBinding(), wsdlDefinition, newDef, imports);
- ports.add(newPort);
- } else {
- error(monitor, "InvalidPort", wsBinding, serviceQName.toString(), portName,
- component.getName(), contract.getName());
- }
- } else {
- for (Object port : service.getPorts().values()) {
- Port newPort = copyPort(newDef, (Port)port, wsBinding);
- if (newPort != null) {
- importBinding(((Port)port).getBinding(), wsdlDefinition, newDef, imports);
- ports.add(newPort);
- } else {
- // not an error, just ignore the port
- warning(monitor, "IgnoringPort", wsBinding, serviceQName.toString(), ((Port)port).getName(),
- component.getName(), contract.getName());
- }
- }
- if (ports.size() == 0) {
- error(monitor, "NoValidPorts", wsBinding, serviceQName.toString(),
- component.getName(), contract.getName());
- }
- }
- }
-
- // replace original WSDL definition by the generated definition
- def = newDef;
-
- } else {
- // The WSDL definition was generated by Interface2WSDLGenerator.
- // Reuse it instead of creating a new definition here.
- }
-
- // add a service and ports to the generated definition
- WSDLDefinitionGenerator helper =
- new WSDLDefinitionGenerator(BindingWSDLGenerator.requiresSOAP12(wsBinding));
- WSDLInterface wi = (WSDLInterface)wsBinding.getBindingInterfaceContract().getInterface();
- PortType portType = wi.getPortType();
- Service service = helper.createService(def, portType);
- if (wsBinding.getBinding() == null && ports.size() == 0) {
- Binding binding = helper.createBinding(def, portType);
- if (BindingWSDLGenerator.requiresSOAP12(wsBinding)) {
- def.addNamespace("SOAP12", "http://schemas.xmlsoap.org/wsdl/soap12/");
- } else {
- def.addNamespace("SOAP11", "http://schemas.xmlsoap.org/wsdl/soap/");
- }
- helper.createBindingOperations(def, binding, portType);
- binding.setUndefined(false);
- def.addBinding(binding);
-
- String endpointURI = computeActualURI(wsBinding, null);
- Port port = helper.createPort(def, binding, service, endpointURI);
- wsBinding.setService(service);
- wsBinding.setPort(port);
- } else {
- if (ports.size() > 0) {
- // there are one or more user-specified valid ports
- for (Port port : ports) {
- service.addPort(port);
- }
- if (ports.size() == 1) {
- // only one port, so use it
- wsBinding.setPort(ports.get(0));
- } else {
- // multiple ports, make them all available
- wsBinding.setPort(null);
- }
- } else {
- // no valid user-specified ports, so create a suitably configured port
- String endpointURI = computeActualURI(wsBinding, null);
- Port port = helper.createPort(def, wsBinding.getBinding(), service, endpointURI);
- if (BindingWSDLGenerator.requiresSOAP12(wsBinding)) {
- def.addNamespace("SOAP12", "http://schemas.xmlsoap.org/wsdl/soap12/");
- } else {
- def.addNamespace("SOAP11", "http://schemas.xmlsoap.org/wsdl/soap/");
- }
- wsBinding.setPort(port);
- }
- wsBinding.setService(service);
- }
-
- // for debugging
- if (printWSDL) {
- try {
- System.out.println("Generated WSDL for " + component.getName() + "/" + contractName);
- WSDLWriter writer = javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter();
- writer.writeWSDL(def, System.out);
- } catch (WSDLException e) {
- throw new WSDLGenerationException(e);
- }
- }
-
- return def;
- }
-
- private static boolean importPortType(PortType portType,
- WSDLDefinition wsdlDef,
- Definition newDef,
- List<WSDLDefinition> imports) {
- return addImport(portType.getQName(), PortType.class, wsdlDef, newDef, imports);
- }
-
- private static boolean importBinding(Binding binding,
- WSDLDefinition wsdlDef,
- Definition newDef,
- List<WSDLDefinition> imports) {
- boolean ok = addImport(binding.getQName(), Binding.class, wsdlDef, newDef, imports);
- if (ok) {
- List bindingExtensions = binding.getExtensibilityElements();
- for (final Object extension : bindingExtensions) {
- if (extension instanceof SOAPBinding) {
- newDef.addNamespace("SOAP11", "http://schemas.xmlsoap.org/wsdl/soap/");
- }
- if (extension instanceof SOAP12Binding) {
- newDef.addNamespace("SOAP12", "http://schemas.xmlsoap.org/wsdl/soap12/");
- }
- }
- }
- return ok;
- }
-
- private static boolean addImport(QName name,
- Class type,
- WSDLDefinition wsdlDef,
- Definition newDef,
- List<WSDLDefinition> imports) {
- String namespace = name.getNamespaceURI();
- if (newDef.getImports(namespace) == null) {
- WSDLDefinition impDef = findDefinition(wsdlDef, name, type);
- if (impDef != null) {
- Import imp = newDef.createImport();
- imp.setNamespaceURI(namespace);
- imp.setLocationURI(impDef.getURI().toString());
- imp.setDefinition(impDef.getDefinition());
- newDef.addNamespace("ns" + imports.size(), namespace);
- newDef.addImport(imp);
- imports.add(impDef);
- return true;
- } else {
- // import was not added because element not found
- return false;
- }
- }
- return true;
- }
-
- private static WSDLDefinition findDefinition(WSDLDefinition wsdlDef, QName name, Class type) {
- if (wsdlDef == null || name == null) {
- return wsdlDef;
- }
- if (wsdlDef.getURI() != null) { // not a facade
- Definition def = wsdlDef.getDefinition();
- Map types = type == PortType.class ? def.getPortTypes() : def.getBindings();
- if (types.get(name) != null) {
- return wsdlDef;
- }
- }
- for (WSDLDefinition impDef : wsdlDef.getImportedDefinitions()) {
- WSDLDefinition d = findDefinition(impDef, name, type);
- if (d != null) {
- return d;
- }
- }
- return null;
- }
-
- private static Port copyPort(Definition def, Port port, WebServiceBinding wsBinding) {
- Port newPort = def.createPort();
- newPort.setName(port.getName());
- newPort.setBinding(port.getBinding());
- List portExtensions = port.getExtensibilityElements();
- for (final Object extension : portExtensions) {
- ExtensibilityElement newExt = null;
- if (extension instanceof SOAPAddress) {
- def.addNamespace("SOAP11", "http://schemas.xmlsoap.org/wsdl/soap/");
- try {
- newExt = def.getExtensionRegistry().createExtension(
- Port.class, WSDLDefinitionGenerator.SOAP_ADDRESS);
- } catch (WSDLException e) {
- }
- String uri = computeActualURI(wsBinding, port);
- ((SOAPAddress)newExt).setLocationURI(uri);
- newPort.addExtensibilityElement(newExt);
- } else if (extension instanceof SOAP12Address) {
- def.addNamespace("SOAP12", "http://schemas.xmlsoap.org/wsdl/soap12/");
- try {
- newExt = def.getExtensionRegistry().createExtension(
- Port.class, WSDLDefinitionGenerator.SOAP12_ADDRESS);
- } catch (WSDLException e) {
- }
- String uri = computeActualURI(wsBinding, port);
- ((SOAP12Address)newExt).setLocationURI(uri);
- newPort.addExtensibilityElement(newExt);
- } else {
- // we don't support ports with other extensibility elements such as HTTPAddress
- return null;
- }
- }
- return newPort;
- }
-
- /**
- * Compute the endpoint URI based on section 2.1.1 of the WS binding Specification 1.
- * The URIs in the endpoint(s) of the referenced WSDL, which may be relative
- * 2. The URI specified by the wsa:Address element of the
- * wsa:EndpointReference, which may be relative 3. The explicitly stated URI
- * in the "uri" attribute of the binding.ws element, which may be relative,
- * 4. The implicit URI as defined by in section 1.7 in the SCA Assembly Specification
- * If the <binding.ws> has no wsdlElement but does have a uri attribute then
- * the uri takes precedence over any implicitly used WSDL.
- *
- */
- private static String computeActualURI(WebServiceBinding wsBinding, Port port) {
-
- URI eprURI = null;
- if (wsBinding.getEndPointReference() != null) {
- eprURI = getEPR(wsBinding);
- }
-
- URI wsdlURI = null;
- if (wsBinding.getServiceName() != null && wsBinding.getBindingName() == null) {
- // <binding.ws> explicitly points at a WSDL port, may be a relative URI
- wsdlURI = getEndpoint(port);
- }
-
- // if the WSDL port/endpoint has an absolute URI use that
- if (wsdlURI != null && wsdlURI.isAbsolute()) {
- return wsdlURI.toString();
- }
-
- // if the wsa:EndpointReference has an address element with an absolute URI use that
- if (eprURI != null && eprURI.isAbsolute()) {
- return eprURI.toString();
- }
-
- // either there is no WSDL port endpoint URI or that URI is relative
- String actualURI = wsBinding.getURI();
- if (eprURI != null && eprURI.toString().length() != 0) {
- // there is a relative URI in the binding EPR
- actualURI = actualURI + "/" + eprURI;
- }
-
- if (wsdlURI != null && wsdlURI.toString().length() != 0) {
- // there is a relative URI in the WSDL port
- actualURI = actualURI + "/" + wsdlURI;
- }
-
- if (actualURI != null) {
- actualURI = URI.create(actualURI).normalize().toString();
- }
-
- return actualURI;
- }
-
- private static URI getEPR(WebServiceBinding wsBinding) {
- NodeList nodeList = wsBinding.getEndPointReference().getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node childNode = nodeList.item(i);
- if (childNode instanceof Element && ADDRESS.equals(childNode.getLocalName())) {
- NodeList addrNodes = childNode.getChildNodes();
- for (int j = 0; j < addrNodes.getLength(); j++) {
- Node addrNode = addrNodes.item(j);
- if (addrNode instanceof Text) {
- return URI.create(((Text)addrNode).getWholeText());
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the endpoint of a given port.
- */
- private static URI getEndpoint(Port wsdlPort) {
- if (wsdlPort != null) {
- List<?> wsdlPortExtensions = wsdlPort.getExtensibilityElements();
- for (Object extension : wsdlPortExtensions) {
- if (extension instanceof SOAPAddress) {
- String uri = ((SOAPAddress)extension).getLocationURI();
- return (uri == null || "".equals(uri)) ? null : URI.create(uri);
- }
- if (extension instanceof SOAP12Address) {
- SOAP12Address address = (SOAP12Address)extension;
- String uri = address.getLocationURI();
- return (uri == null || "".equals(uri)) ? null : URI.create(uri);
- }
- }
- }
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/resources/wsdlgen-validation-messages.properties b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/resources/wsdlgen-validation-messages.properties
deleted file mode 100644
index 4bfbdd2901..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/main/resources/wsdlgen-validation-messages.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-WsdlGenProblem = Unable to generate WSDL for {0}/{1}
-WsdlGenException = Exception while generating WSDL for {0}/{1}
-UnexpectedException = Exception thrown was: {0}
-MissingInterfaceContract = No interface contract for {0}/{1}
-InterfaceNotRemotable = Interface not remotable: {0}
-IgnoringPort = Port {0}/{1} in {2}/{3} is not supported and was ignored
-PortTypeNotFound = PortType {0} in {1}/{2} was not found
-BindingNotFound = Binding {0} in {1}/{2} was not found
-InvalidPort = Port {0}/{1} in {2}/{3} is not supported
-NoValidPorts = No valid ports for service {0} in {1}/{2}
-NoWsdlInterface = No WSDL interface definition for {1}/{2}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/Other.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/Other.java
deleted file mode 100644
index 7e6a1de546..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/Other.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.other;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Other {
- private String name;
-
- public String getName() {
- return name;
- }
- public void setName(String name ) {
- this.name = name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/package-info.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/package-info.java
deleted file mode 100644
index f10a2286e6..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/other/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://other.ws.binding.sca.tuscany.apache.org/")
-package org.apache.tuscany.sca.binding.ws.other;
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java
deleted file mode 100644
index c9bfce5865..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.wsdlgen;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.databinding.processor.DataBindingJavaInterfaceProcessor;
-import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSFaultExceptionMapper;
-import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor;
-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.xsd.XSDFactory;
-import org.apache.tuscany.sca.xsd.xml.XSDModelResolver;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class BindingWSDLGeneratorTestCase extends TestCase {
-
- public void testCreateWSDLInterfaceContract() throws InvalidInterfaceException {
- org.apache.tuscany.sca.core.FactoryExtensionPoint modelFactories = new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry());
- WSDLFactory wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
- XSDFactory xsdFactory = modelFactories.getFactory(XSDFactory.class);
- JavaInterfaceFactory factory = new DefaultJavaInterfaceFactory();
- JavaInterfaceContract javaIC = factory.createJavaInterfaceContract();
- JavaInterface iface = factory.createJavaInterface(HelloWorld.class);
- DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint();
- JAXWSFaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, null);
- new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, null).visitInterface(iface);
- new DataBindingJavaInterfaceProcessor(dataBindings).visitInterface(iface);
- javaIC.setInterface(iface);
- WSDLInterfaceContract wsdlIC = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, null);
- assertNotNull(wsdlIC);
- WSDLInterface wsdlInterface = (WSDLInterface)wsdlIC.getInterface();
- assertNotNull(wsdlInterface);
- assertEquals(1, wsdlInterface.getOperations().size());
- assertEquals("sayHello", wsdlInterface.getOperations().get(0).getName());
- assertNotNull(wsdlInterface.getPortType());
-
- JavaInterfaceContract javaIC2 = factory.createJavaInterfaceContract();
- JavaInterface iface2 = factory.createJavaInterface(TestJavaInterface.class);
- new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, null).visitInterface(iface2);
- new DataBindingJavaInterfaceProcessor(dataBindings).visitInterface(iface2);
- javaIC2.setInterface(iface2);
- WSDLInterfaceContract wsdlIC2 = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC2, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, null);
- assertNotNull(wsdlIC2);
- }
-
-}
-
-@Remotable
-interface HelloWorld {
- String sayHello(String s);
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java
deleted file mode 100644
index 670c3a4003..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.wsdlgen;
-
-import java.io.StringWriter;
-
-import javax.wsdl.Definition;
-import javax.wsdl.xml.WSDLWriter;
-
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.databinding.processor.DataBindingJavaInterfaceProcessor;
-import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSFaultExceptionMapper;
-import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor;
-import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
-import org.apache.tuscany.sca.xsd.DefaultXSDFactory;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-import org.apache.tuscany.sca.xsd.xml.XSDModelResolver;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class Interface2WSDLGeneratorTestCase {
-
- @Test
- public void testGenerate() throws Exception {
- JavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory();
- JavaInterface iface = iFactory.createJavaInterface(TestJavaInterface.class);
- DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint();
- JAXWSFaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, null);
- new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, null).visitInterface(iface);
- new DataBindingJavaInterfaceProcessor(dataBindings).visitInterface(iface);
- DefaultFactoryExtensionPoint modelFactories = new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry());
- WSDLFactory wFactory = new DefaultWSDLFactory(modelFactories);
- WSDLDefinition wsdlDefinition = wFactory.createWSDLDefinition();
- XSDFactory factory = new DefaultXSDFactory();
- Interface2WSDLGenerator generator = new Interface2WSDLGenerator(false, new XSDModelResolver(null, null), dataBindings, factory, null);
- Definition definition = generator.generate(iface, wsdlDefinition);
-
- // print the generated WSDL file and inline schemas
- WSDLWriter writer = generator.getFactory().newWSDLWriter();
- StringWriter sw = new StringWriter();
- writer.writeWSDL(definition, sw);
- System.out.println(sw.toString());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestException.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestException.java
deleted file mode 100644
index 1e4f802e01..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.wsdlgen;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class TestException extends Exception {
-
- private String userdata;
-
- public TestException(String message) {
- super(message);
- }
-
- public TestException(String message, String userdata) {
- super(message);
- this.userdata = userdata;
- }
-
- public String getUserdata() {
- return userdata;
- }
-
- public void setUserdata(String userdata) {
- this.userdata = userdata;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFault.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFault.java
deleted file mode 100644
index da2c285bac..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFault.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.wsdlgen;
-
-import javax.xml.ws.WebFault;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-@WebFault(faultBean="org.apache.tuscany.sca.binding.ws.wsdlgen.TestFaultBean")
-public class TestFault extends Exception {
-
- private TestFaultBean bean;
-
- public TestFault(TestFaultBean bean, String message) {
- super(message);
- this.bean = bean;
- }
-
- public TestFault(TestFaultBean bean, String message, Throwable cause) {
- super(message, cause);
- this.bean = bean;
- }
-
- public TestFaultBean getFaultInfo() {
- return bean;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFaultBean.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFaultBean.java
deleted file mode 100644
index 64cce0e49d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestFaultBean.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.wsdlgen;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class TestFaultBean {
- private String lastName;
- private String firstName;
- private float age;
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public float getAge() {
- return age;
- }
-
- public void setAge(float age) {
- this.age = age;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaClass.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaClass.java
deleted file mode 100644
index 3fd7361ae1..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaClass.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.wsdlgen;
-import org.apache.tuscany.sca.binding.ws.other.Other;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class TestJavaClass {
- public Other other;
- public String name;
- public int number;
- public float balance;
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaInterface.java b/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaInterface.java
deleted file mode 100644
index 5278a55d8a..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/TestJavaInterface.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.wsdlgen;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-
-import org.oasisopen.sca.annotation.OneWay;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-@WebService
-public interface TestJavaInterface {
- String m1(String str);
-
- @OneWay
- @WebMethod
- void m2(int i);
-
- @WebMethod
- String m3();
-
- void m4();
-
- @WebMethod
- String m5(String str, int i);
-
- @WebMethod(exclude = true)
- void dummy();
-
- @WebMethod
- void m6(TestJavaClass info) throws TestException;
-
- @WebMethod
- void m7(TestJavaClass info) throws TestFault;
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/LICENSE b/tags/java/sca/2.0-M1/modules/binding-ws-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/binding-ws-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index 2ae04552b1..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,37 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.binding.ws.xml;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA WS Binding XML Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397333296
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA WS Binding XML Model
-Import-Package: javax.wsdl,
- javax.xml.namespace,
- javax.xml.parsers,
- javax.xml.stream,
- javax.xml.transform,
- javax.xml.transform.dom,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.builder;version="2.0.0",
- org.apache.tuscany.sca.assembly.xml;version="2.0.0",
- org.apache.tuscany.sca.binding.ws;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.wsdlgen,
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.wsdl;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.xsd;version="2.0.0",
- org.w3c.dom
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.ws.xml
-Bundle-DocURL: http://www.apache.org/
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/NOTICE b/tags/java/sca/2.0-M1/modules/binding-ws-xml/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/pom.xml b/tags/java/sca/2.0-M1/modules/binding-ws-xml/pom.xml
deleted file mode 100644
index 3e6bd251cb..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/pom.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-ws-xml</artifactId>
- <name>Apache Tuscany SCA WS Binding XML Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java
deleted file mode 100644
index f2376231ab..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.xml;
-
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
-import org.apache.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.builder.BindingBuilder;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A factory for the calculated WSDL document needed by Web Service bindings.
- *
- * @version $Rev$ $Date$
- */
-public class BindingBuilderImpl implements BindingBuilder {
-
- private ExtensionPointRegistry extensionPoints;
-
- public BindingBuilderImpl(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
- }
-
- /**
- * Create a calculated WSDL document and save it in the Web Service binding.
- */
- public void build(Component component, AbstractContract contract, Binding binding, Monitor monitor) {
- BindingWSDLGenerator.generateWSDL(component, contract, (WebServiceBinding)binding, extensionPoints, monitor);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/EndPointReferenceHelper.java b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/EndPointReferenceHelper.java
deleted file mode 100644
index 9051dc0af7..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/EndPointReferenceHelper.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.xml;
-
-import static javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.dom.DOMSource;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Helper methods to read and write a wsa:endpointReference
- * TODO: almost direct copy of code for Assembly properties
- * must be able to move to a common utility
- *
- * @version $Rev$ $Date$
- */
-public class EndPointReferenceHelper {
-
- /**
- * Read a wsa:endpointReference into a DOM Element
- */
- public static Element readEndPointReference(XMLStreamReader reader) {
- try {
-
- return loadElement(reader);
-
- } catch (XMLStreamException e) {
- throw new RuntimeException(e);
- } catch (ParserConfigurationException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Write a wsa:endpointReference from a DOM Element
- */
- public static void writeEndPointReference(Element element, XMLStreamWriter writer) {
- try {
-
- saveElement(element, writer);
-
- } catch (XMLStreamException e) {
- throw new RuntimeException(e);
- }
- }
-
- private static Element loadElement(XMLStreamReader reader) throws XMLStreamException, ParserConfigurationException {
- Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- Node root = document;
- Node current = root;
- while (true) {
- switch (reader.getEventType()) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- Element child = createElement(document, name);
-
- // push the new element and make it the current one
- current.appendChild(child);
- current = child;
-
- int count = reader.getNamespaceCount();
- for (int i = 0; i < count; i++) {
- String prefix = reader.getNamespacePrefix(i);
- String ns = reader.getNamespaceURI(i);
- declareNamespace(child, prefix, ns);
- }
-
- if(!"".equals(name.getNamespaceURI()))
- declareNamespace(child, name.getPrefix(), name.getNamespaceURI());
-
- // add the attributes for this element
- count = reader.getAttributeCount();
- for (int i = 0; i < count; i++) {
- String ns = reader.getAttributeNamespace(i);
- String prefix = reader.getAttributePrefix(i);
- String qname = reader.getAttributeLocalName(i);
- String value = reader.getAttributeValue(i);
- if (prefix != null && prefix.length() != 0) {
- qname = prefix + ":" + qname;
- }
- child.setAttributeNS(ns, qname, value);
- if (ns != null) {
- declareNamespace(child, prefix, ns);
- }
- }
-
- break;
- case XMLStreamConstants.CDATA:
- current.appendChild(document.createCDATASection(reader.getText()));
- break;
- case XMLStreamConstants.CHARACTERS:
- current.appendChild(document.createTextNode(reader.getText()));
- break;
- case XMLStreamConstants.END_ELEMENT:
- // if we are back at the root then we are done
- if ("EndpointReference".equals(reader.getName().getLocalPart())) {
- return document.getDocumentElement();
- }
-
- // pop the element off the stack
- current = current.getParentNode();
- }
- if ( reader.hasNext()) reader.next();
- }
- }
-
- private static Element createElement(Document document, QName name) {
- String prefix = name.getPrefix();
- String qname =
- (prefix != null && prefix.length() > 0) ? prefix + ":" + name.getLocalPart() : name.getLocalPart();
- return document.createElementNS(name.getNamespaceURI(), qname);
- }
-
- private static void declareNamespace(Element element, String prefix, String ns) {
- if (ns == null) {
- ns = "";
- }
- if (prefix == null) {
- prefix = "";
- }
- String qname = null;
- if ("".equals(prefix)) {
- qname = "xmlns";
- } else {
- qname = "xmlns:" + prefix;
- }
- Node node = element;
- boolean declared = false;
- while (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
- NamedNodeMap attrs = node.getAttributes();
- if (attrs == null) {
- break;
- }
- Node attr = attrs.getNamedItem(qname);
- if (attr != null) {
- declared = ns.equals(attr.getNodeValue());
- break;
- }
- node = node.getParentNode();
- }
- if (!declared) {
- org.w3c.dom.Attr attr = element.getOwnerDocument().createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, qname);
- attr.setValue(ns);
- element.setAttributeNodeNS(attr);
- }
- }
-
- private static void saveElement(Element element, XMLStreamWriter writer) throws XMLStreamException{
-
- XMLStreamReader reader =
- XMLInputFactory.newInstance().createXMLStreamReader(new DOMSource(element));
-
- while (reader.hasNext()) {
- switch (reader.next()) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- writer.writeStartElement(name.getPrefix(), name.getLocalPart(), name.getNamespaceURI());
-
- int namespaces = reader.getNamespaceCount();
- for (int i = 0; i < namespaces; i++) {
- String prefix = reader.getNamespacePrefix(i);
- String ns = reader.getNamespaceURI(i);
- writer.writeNamespace(prefix, ns);
- }
-
- if (!"".equals(name.getNamespaceURI())) {
- writer.writeNamespace(name.getPrefix(), name.getNamespaceURI());
- }
-
- // add the attributes for this element
- namespaces = reader.getAttributeCount();
- for (int i = 0; i < namespaces; i++) {
- String ns = reader.getAttributeNamespace(i);
- String prefix = reader.getAttributePrefix(i);
- String qname = reader.getAttributeLocalName(i);
- String value = reader.getAttributeValue(i);
-
- writer.writeAttribute(prefix, ns, qname, value);
- }
-
- break;
- case XMLStreamConstants.CDATA:
- writer.writeCData(reader.getText());
- break;
- case XMLStreamConstants.CHARACTERS:
- writer.writeCharacters(reader.getText());
- break;
- case XMLStreamConstants.END_ELEMENT:
- writer.writeEndElement();
- break;
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
deleted file mode 100644
index 23322e822e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.Map;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.xml.ConfiguredOperationProcessor;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-import org.apache.tuscany.sca.binding.ws.DefaultWebServiceBindingFactory;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
-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.core.UtilityExtensionPoint;
-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.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * This is the StAXArtifactProcessor for the Web Services Binding.
- *
- * @version $Rev$ $Date$
- */
-public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServiceBinding>, WebServiceConstants {
-
- private ExtensionPointRegistry extensionPoints;
- private WSDLFactory wsdlFactory;
- private WebServiceBindingFactory wsFactory;
- private PolicyFactory policyFactory;
- private PolicyAttachPointProcessor policyProcessor;
- private IntentAttachPointTypeFactory intentAttachPointTypeFactory;
- private ConfiguredOperationProcessor configuredOperationProcessor;
- private Monitor monitor;
-
- public WebServiceBindingProcessor(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.wsFactory = new DefaultWebServiceBindingFactory();
- this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
- this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- this.intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- if (monitorFactory != null) {
- this.monitor = monitorFactory.createMonitor();
- }
- this.configuredOperationProcessor = new ConfiguredOperationProcessor(modelFactories, this.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(), "binding-wsxml-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(), "binding-wsxml-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public WebServiceBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Read a <binding.ws>
- WebServiceBinding wsBinding = wsFactory.createWebServiceBinding();
- /*IntentAttachPointType bindingType = intentAttachPointTypeFactory.createBindingType();
- bindingType.setName(getArtifactType());
- bindingType.setUnresolved(true);
- ((PolicySetAttachPoint)wsBinding).setType(bindingType);*/
- wsBinding.setUnresolved(true);
- wsBinding.setBuilder(new BindingBuilderImpl(extensionPoints));
-
- // Read policies
- policyProcessor.readPolicies(wsBinding, reader);
-
- // Read the binding name
- String name = reader.getAttributeValue(null, NAME);
- if (name != null) {
- wsBinding.setName(name);
- }
-
- // Read URI
- String uri = reader.getAttributeValue(null, URI);
- if (uri != null) {
- wsBinding.setURI(uri);
- }
-
- // Read a qname in the form:
- // namespace#wsdl.???(name)
- Boolean wsdlElementIsBinding = null;
- String wsdlElement = reader.getAttributeValue(null, WSDL_ELEMENT);
- if (wsdlElement != null) {
- int index = wsdlElement.indexOf('#');
- if (index == -1) {
- error("InvalidWsdlElementAttr", reader, wsdlElement);
- //throw new ContributionReadException("Invalid WebService binding wsdlElement attribute: " + wsdlElement);
- return wsBinding;
- }
- String namespace = wsdlElement.substring(0, index);
- wsBinding.setNamespace(namespace);
- String localName = wsdlElement.substring(index + 1);
- if (localName.startsWith("wsdl.service")) {
-
- // Read a wsdl.service
- localName = localName.substring("wsdl.service(".length(), localName.length() - 1);
- wsBinding.setServiceName(new QName(namespace, localName));
-
- } else if (localName.startsWith("wsdl.port")) {
-
- // Read a wsdl.port
- localName = localName.substring("wsdl.port(".length(), localName.length() - 1);
- int s = localName.indexOf('/');
- if (s == -1) {
- error("InvalidWsdlElementAttr", reader, wsdlElement);
- //throw new ContributionReadException("Invalid WebService binding wsdlElement attribute: " + wsdlElement);
- } else {
- wsBinding.setServiceName(new QName(namespace, localName.substring(0, s)));
- wsBinding.setPortName(localName.substring(s + 1));
- }
- } else if (localName.startsWith("wsdl.endpoint")) {
-
- // Read a wsdl.endpoint
- localName = localName.substring("wsdl.endpoint(".length(), localName.length() - 1);
- int s = localName.indexOf('/');
- if (s == -1) {
- error("InvalidWsdlElementAttr", reader, wsdlElement);
- //throw new ContributionReadException("Invalid WebService binding wsdlElement attribute: " + wsdlElement);
- } else {
- wsBinding.setServiceName(new QName(namespace, localName.substring(0, s)));
- wsBinding.setEndpointName(localName.substring(s + 1));
- }
- } else if (localName.startsWith("wsdl.binding")) {
-
- // Read a wsdl.binding
- localName = localName.substring("wsdl.binding(".length(), localName.length() - 1);
- wsBinding.setBindingName(new QName(namespace, localName));
-
- wsdlElementIsBinding = true;
-
- } else {
- error("InvalidWsdlElementAttr", reader, wsdlElement);
- //throw new ContributionReadException("Invalid WebService binding wsdlElement attribute: " + wsdlElement);
- }
- }
-
- // Read wsdlLocation
- wsBinding.setLocation(reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION));
-
- ConfiguredOperation confOp = null;
- // Skip to end element
- while (reader.hasNext()) {
- int event = reader.next();
- switch (event) {
- case START_ELEMENT: {
- if (END_POINT_REFERENCE.equals(reader.getName().getLocalPart())) {
- if (wsdlElement != null && (wsdlElementIsBinding == null || !wsdlElementIsBinding)) {
- error("MustUseWsdlBinding", reader, wsdlElement);
- throw new ContributionReadException(wsdlElement + " must use wsdl.binding when using wsa:EndpointReference");
- }
- wsBinding.setEndPointReference(EndPointReferenceHelper.readEndPointReference(reader));
- } else if (Constants.OPERATION_QNAME.equals(reader.getName())) {
- confOp = configuredOperationProcessor.read(reader);
- if (confOp != null) {
- ((OperationsConfigurator)wsBinding).getConfiguredOperations().add(confOp);
- }
- }
- }
- break;
-
- }
-
- if (event == END_ELEMENT && BINDING_WS_QNAME.equals(reader.getName())) {
- break;
- }
- }
- return wsBinding;
- }
-
- protected void processEndPointReference(XMLStreamReader reader, WebServiceBinding wsBinding) {
- }
-
- public void write(WebServiceBinding wsBinding, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
-
- // Write a <binding.ws>
- policyProcessor.writePolicyPrefixes(wsBinding, writer);
- writer.writeStartElement(Constants.SCA10_NS, BINDING_WS);
- policyProcessor.writePolicyAttributes(wsBinding, writer);
-
- // Write binding name
- if (wsBinding.getName() != null) {
- writer.writeAttribute(NAME, wsBinding.getName());
- }
-
- // Write binding URI
- if (wsBinding.getURI() != null) {
- writer.writeAttribute(URI, wsBinding.getURI());
- }
-
- // Write wsdlElement attribute
- if (wsBinding.getPortName() != null) {
-
- // Write namespace#wsdl.port(service/port)
- String wsdlElement =
- wsBinding.getServiceName().getNamespaceURI() + "#wsdl.port("
- + wsBinding.getServiceName().getLocalPart()
- + "/"
- + wsBinding.getPortName()
- + ")";
- writer.writeAttribute(WSDL_ELEMENT, wsdlElement);
-
- } else if (wsBinding.getEndpointName() != null) {
-
- // Write namespace#wsdl.endpoint(service/endpoint)
- String wsdlElement =
- wsBinding.getServiceName().getNamespaceURI() + "#wsdl.endpoint("
- + wsBinding.getServiceName().getLocalPart()
- + "/"
- + wsBinding.getEndpointName()
- + ")";
- writer.writeAttribute(WSDL_ELEMENT, wsdlElement);
-
- } else if (wsBinding.getBindingName() != null) {
-
- // Write namespace#wsdl.binding(binding)
- String wsdlElement =
- wsBinding.getBindingName().getNamespaceURI() + "#wsdl.binding("
- + wsBinding.getBindingName().getLocalPart()
- + ")";
- writer.writeAttribute(WSDL_ELEMENT, wsdlElement);
-
- } else if (wsBinding.getServiceName() != null) {
-
- // Write namespace#wsdl.service(service)
- String wsdlElement =
- wsBinding.getServiceName().getNamespaceURI() + "#wsdl.service("
- + wsBinding.getServiceName().getLocalPart()
- + ")";
- writer.writeAttribute(WSDL_ELEMENT, wsdlElement);
- }
-
- // Write location
- if (wsBinding.getLocation() != null) {
- writer.writeAttribute(WSDLI_NS, WSDL_LOCATION, wsBinding.getLocation());
- }
-
- if (wsBinding.getEndPointReference() != null) {
- EndPointReferenceHelper.writeEndPointReference(wsBinding.getEndPointReference(), writer);
- }
-
- writer.writeEndElement();
- }
-
- public void resolve(WebServiceBinding model, ModelResolver resolver) throws ContributionResolveException {
-
- if (model == null || !model.isUnresolved())
- return;
-
- WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition();
- wsdlDefinition.setUnresolved(true);
- wsdlDefinition.setNamespace(model.getNamespace());
- 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);
- model.setDefinition(wsdlDefinition);
- if (model.getBindingName() != null) {
- WSDLObject<Binding> binding = wsdlDefinition.getWSDLObject(Binding.class, model.getBindingName());
- if (binding != null) {
- wsdlDefinition.setDefinition(binding.getDefinition());
- model.setBinding(binding.getElement());
- } else {
- warning("WsdlBindingDoesNotMatch", wsdlDefinition, model.getBindingName());
- }
- }
- if (model.getServiceName() != null) {
- WSDLObject<Service> service = wsdlDefinition.getWSDLObject(Service.class, model.getServiceName());
- if (service != null) {
- wsdlDefinition.setDefinition(service.getDefinition());
- model.setService(service.getElement());
- if (model.getPortName() != null) {
- Port port = service.getElement().getPort(model.getPortName());
- if (port != null) {
- model.setPort(port);
- model.setBinding(port.getBinding());
- } else {
- warning("WsdlPortTypeDoesNotMatch", wsdlDefinition, model.getPortName());
- }
- }
- } else {
- warning("WsdlServiceDoesNotMatch", wsdlDefinition, model.getServiceName());
- }
- }
-
- PortType portType = getPortType(model);
- if (portType != null) {
- WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
- WSDLInterface wsdlInterface = null;
- try {
- wsdlInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition, resolver);
- } catch (InvalidInterfaceException e) {
- warning("InvalidInterfaceException", wsdlFactory, model.getName());
- }
- interfaceContract.setInterface(wsdlInterface);
- model.setBindingInterfaceContract(interfaceContract);
- }
- }
- policyProcessor.resolvePolicies(model, resolver);
- OperationsConfigurator opCongigurator = (OperationsConfigurator)model;
- for (ConfiguredOperation confOp : opCongigurator.getConfiguredOperations()) {
- policyProcessor.resolvePolicies(confOp, resolver);
- }
- }
-
- private PortType getPortType(WebServiceBinding model) {
- PortType portType = null;
- if (model.getPort() != null) {
- portType = model.getPort().getBinding().getPortType();
- } else if (model.getEndpoint() != null) {
- portType = model.getPort().getBinding().getPortType();
- } else if (model.getBinding() != null) {
- portType = model.getBinding().getPortType();
- } else if (model.getService() != null) {
- // FIXME: How to find the compatible port?
- Map ports = model.getService().getPorts();
- if (!ports.isEmpty()) {
- Port port = (Port)ports.values().iterator().next();
- portType = port.getBinding().getPortType();
- }
- }
- return portType;
- }
-
- public QName getArtifactType() {
- return WebServiceConstants.BINDING_WS_QNAME;
- }
-
- public Class<WebServiceBinding> getModelType() {
- return WebServiceBinding.class;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java
deleted file mode 100644
index 03c84a6b41..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.xml;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.xml.Constants;
-
-/**
- * Constants for the Web Services Binding.
- *
- * @version $Rev$ $Date$
- */
-public interface WebServiceConstants {
-
- String BINDING_WS = "binding.ws";
- QName BINDING_WS_QNAME = new QName(Constants.SCA10_NS, BINDING_WS);
- String WSDL_ELEMENT = "wsdlElement";
- QName WSDL_ELEMENT_QNAME = new QName(Constants.SCA10_NS, WSDL_ELEMENT);
- String WSDL_LOCATION = "wsdlLocation";
- String WSDLI_NS = "http://www.w3.org/2004/08/wsdl-instance";
- QName WSDL_LOCATION_QNAME = new QName(WSDLI_NS, WSDL_LOCATION);
- String NAME = "name";
- String URI = "uri";
- String END_POINT_REFERENCE = "EndpointReference";
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index cb982e8647..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.binding.ws.xml.WebServiceBindingProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#binding.ws,model=org.apache.tuscany.sca.binding.ws.WebServiceBinding
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties
deleted file mode 100644
index 2dfa5e6133..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-InvalidWsdlElementAttr = Invalid WebService binding wsdlElement attribute: {0}
-MustUseWsdlBinding = {0} must use wsdl.binding when using wsa:EndpointReference
-InvalidInterfaceException = Exception creating interface from WSDL for binding: {0}
-WsdlBindingDoesNotMatch = The #wsdl.binding({0}) does not match with the WSDL Definitions
-WsdlServiceDoesNotMatch = The #wsdl.service({0}) does not match with the WSDL Definitions
-WsdlPortTypeDoesNotMatch = The #wsdl.port({0}) does not match with the WSDL Definitions
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java
deleted file mode 100644
index 550593f515..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.fail;
-
-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.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-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.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 {
- 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");
- }
-
- @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 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);
- }
-
- @Test
- public void testReadPolicies() throws Exception {
- InputStream is = getClass().getResourceAsStream("PoliciedCalculator.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
-
- compositeBuilder.build(composite, null, null);
-
- assertEquals(((OperationsConfigurator)composite.getServices().get(0).getBindings().get(0))
- .getConfiguredOperations().get(0).getRequiredIntents().size(), 2);
- }
-
- /**
- * This test makes sure that an exception is thrown when a bad wsdlElement is present along with EndpointReference.
- *
- * Ref: Web Service Binding Specification v1.0 - Sec 2.1 - Lines 61 to 65.
- * When an EndpointReference is present along with the wsdlElement attribute on the parent element, the wsdlElement attribute value MUST
- * be of the 'Binding' form.
- */
- @Test
- public void testReadBadWsdlElement() throws Exception {
- InputStream is = getClass().getResourceAsStream("Calculator-bad-wsdlElement.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- try {
- staxProcessor.read(reader);
- fail("ContributionReadException expected.");
- } catch(ContributionReadException e) {
- // Expected
- assertNotSame(-1, e.getMessage().indexOf("must use wsdl.binding when using wsa:EndpointReference"));
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java
deleted file mode 100644
index 2b3f314fb1..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.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.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.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test reading/write WSDL interfaces.
- *
- * @version $Rev$ $Date$
- */
-public class WriteTestCase {
-
- private static XMLInputFactory inputFactory;
- private static XMLOutputFactory outputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
-
- @BeforeClass
- public static 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 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));
- System.out.println(bos.toString());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite
deleted file mode 100644
index d8d1b3401e..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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: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/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite
deleted file mode 100644
index f7460813cd..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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: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)"/>
- <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)"/>
- <binding.ws wsdlElement="http://sample/calculator#wsdl.binding(CalculatorBinding)">
- <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 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/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType
deleted file mode 100644
index 959802af43..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance">
-
- <service name="CalculatorService">
- <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"/>
- <binding.ws uri="http://localhost:8085/Calculator" wsdlElement="http://sample/calculator#wsdl.service(CalculatorService)"/>
- <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>
-
- <reference name="divideService">
- <interface.wsdl interface="http://sample/calculator#wsdl.interface(Divide)"/>
- <binding.ws uri="tempuri.org" wsdlElement="http://sample/calculator#wsdl.service(DivideService)"/>
- <binding.ws uri="tempuri.org" wsdlElement="http://sample/calculator#wsdl.binding(DivideBinding)"/>
- <binding.ws uri="tempuri.org" wsdlElement="http://sample/calculator#wsdl.port(DivideService/DividePort)"/>
- <binding.ws uri="tempuri.org" wsdlElement="http://sample/calculator#wsdl.endpoint(DivideService/DivideEndpoint)"/>
- <binding.ws>
- <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
- <wsa:Address>myURI</wsa:Address>
- </wsa:EndpointReference>
- </binding.ws>
- </reference>
-
-</componentType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite
deleted file mode 100644
index 37c80aa910..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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: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/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl
deleted file mode 100644
index 5e8e5dad0d..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl
deleted file mode 100644
index ad81fc7867..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd
deleted file mode 100644
index 241ec15d36..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl
deleted file mode 100644
index 39cd5547d9..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl
deleted file mode 100644
index 8e26f7b4b5..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd
deleted file mode 100644
index c2210f4a94..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl
deleted file mode 100644
index 529b395fd5..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl b/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl
deleted file mode 100644
index 666a7e4069..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl
+++ /dev/null
@@ -1,76 +0,0 @@
-<?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/tags/java/sca/2.0-M1/modules/binding-ws/LICENSE b/tags/java/sca/2.0-M1/modules/binding-ws/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/binding-ws/META-INF/MANIFEST.MF
deleted file mode 100644
index 789734ec98..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,33 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.binding.ws;version="2.0.0";
- uses:="org.apache.tuscany.sca.assembly,
- org.apache.tuscany.sca.interfacedef.wsdl,
- org.apache.tuscany.sca.assembly.builder,
- org.apache.tuscany.sca.interfacedef,
- org.w3c.dom,
- javax.wsdl,
- javax.xml.namespace",
- org.apache.tuscany.sca.binding.ws.addressing;version="2.0.0";uses:="javax.xml.namespace"
-Private-Package: org.apache.tuscany.sca.binding.ws.impl;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA WS Binding Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397286828
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA WS Binding Model
-Import-Package: javax.wsdl,
- javax.xml.namespace,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.builder;version="2.0.0",
- org.apache.tuscany.sca.binding.ws;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.addressing;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.wsdl;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.w3c.dom
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.ws
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws/NOTICE b/tags/java/sca/2.0-M1/modules/binding-ws/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws/pom.xml b/tags/java/sca/2.0-M1/modules/binding-ws/pom.xml
deleted file mode 100644
index 3418d788b9..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-ws</artifactId>
- <name>Apache Tuscany SCA WS Binding Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>wsdl4j</groupId>
- <artifactId>wsdl4j</artifactId>
- <version>1.6.2</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/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java b/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java
deleted file mode 100644
index 2ccaa5dc58..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws;
-
-import org.apache.tuscany.sca.binding.ws.impl.WebServiceBindingFactoryImpl;
-
-/**
- * A factory for the Web Service binding model.
- *
- * @version $Rev$ $Date$
- */
-@Deprecated
-public class DefaultWebServiceBindingFactory extends WebServiceBindingFactoryImpl implements WebServiceBindingFactory {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java b/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java
deleted file mode 100644
index 0d07a55a14..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.builder.BindingBuilderExtension;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.w3c.dom.Element;
-
-
-/**
- * Represents a WebService binding.
- *
- * @version $Rev$ $Date$
- */
-public interface WebServiceBinding extends Binding, BindingBuilderExtension {
-
- /**
- * Sets the WSDL location.
- * @param location the WSDL location
- */
- void setLocation(String location);
-
- /**
- * Returns the WSDL location
- * @return the WSDL location
- */
- String getLocation();
-
- /**
- * Returns the name of the WSDL service.
- *
- * @return the name of the WSDL service
- */
- QName getServiceName();
-
- /**
- * Sets the name of the WSDL service.
- *
- * @param serviceName the name of the WSDL service
- */
- void setServiceName(QName serviceName);
-
- /**
- * Returns the name of the WSDL port.
- *
- * @return the name of the WSDL port
- */
- String getPortName();
-
- /**
- * Sets the name of the WSDL port.
- *
- * @param portName the name of the WSDL port
- */
- void setPortName(String portName);
-
- /**
- * Returns the name of the WSDL binding.
- *
- * @return the name of the WSDL binding
- */
- QName getBindingName();
-
- /**
- * Sets the name of the WSDL binding.
- *
- * @param bindingName the name of the WSDL binding
- */
- void setBindingName(QName bindingName);
-
- /**
- * Returns the name of the WSDL endpoint.
- *
- * @return the name of the WSDL endpoint
- */
- String getEndpointName();
-
- /**
- * Sets the name of the WSDL endpoint.
- *
- * @param endpointName the name of the WSDL endpoint
- */
- void setEndpointName(String endpointName);
-
- /**
- * Returns the WSDL service
- * @return the WSDL service
- */
- Service getService();
-
- /**
- * Sets the WSDL service.
- * @param service the WSDL service
- */
- void setService(Service service);
-
- /**
- * Returns the WSDL port
- * @return the WSDL port
- */
- Port getPort();
-
- /**
- * Sets the WSDL endpoint
- * @param endpoint the WSDL endpoint
- */
- void setEndpoint(Port endpoint);
-
- /**
- * Returns the WSDL endpoint
- * @return the WSDL endpoint
- */
- Port getEndpoint();
-
- /**
- * Sets the WSDL port
- * @param port the WSDL port
- */
- void setPort(Port port);
-
- /**
- * Returns the WSDL binding.
- * @return the WSDL binding
- */
- javax.wsdl.Binding getBinding();
-
- /**
- * Sets the WSDL binding
- * @param binding the WSDL binding
- */
- void setBinding(javax.wsdl.Binding binding);
-
- /**
- * Returns the WSDL definition.
- * @return the WSDL definition
- */
- WSDLDefinition getWSDLDefinition();
-
- /**
- * Sets the WSDL definition.
- * @param wsdlDefinition the WSDL definition
- */
- void setDefinition(WSDLDefinition wsdlDefinition);
-
- /**
- * Returns the WSDL namespace.
- * @return the WSDL namespace
- */
- String getNamespace();
-
- /**
- * Sets the WSDL namespace
- * @param namespace the WSDL namespace
- */
- void setNamespace(String namespace);
-
- /**
- * Returns true if the model element is unresolved.
- *
- * @return true if the model element is unresolved.
- */
- boolean isUnresolved();
-
- /**
- * Sets whether the model element is unresolved.
- *
- * @param unresolved whether the model element is unresolved
- */
- void setUnresolved(boolean unresolved);
-
- InterfaceContract getBindingInterfaceContract();
-
- void setBindingInterfaceContract(InterfaceContract bindingInterfaceContract);
-
- Element getEndPointReference();
-
- void setEndPointReference(Element element);
-
- /**
- * Returns the generated WSDL definitions document.
- * @return the generated WSDL definitions document
- */
- Definition getWSDLDocument();
-
- /**
- * Sets the generated WSDL definitions document.
- * @param definition the generated WSDL definitions document
- */
- void setWSDLDocument(Definition definition);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java b/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java
deleted file mode 100644
index 1ad38c69e4..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws;
-
-/**
- * Factory for the Web Service binding model.
- *
- * @version $Rev$ $Date$
- */
-public interface WebServiceBindingFactory {
-
- /**
- * Creates a new WebService binding.
- *
- * @return a new WebService binding
- */
- WebServiceBinding createWebServiceBinding();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/addressing/EndPointReference.java b/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/addressing/EndPointReference.java
deleted file mode 100644
index a13584a3c2..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/addressing/EndPointReference.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.addressing;
-
-import java.net.URI;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-/**
- * Defines a model for WS-Addressing
- * &lt;wsa:EndpointReference&gt;
- * &lt;wsa:Address&gt;xs:anyURI&lt;/wsa:Address&gt;
- * &lt;wsa:ReferenceProperties&gt;... &lt;/wsa:ReferenceProperties&gt; ?
- * &lt;wsa:ReferenceParameters&gt;... &lt;/wsa:ReferenceParameters&gt; ?
- * &lt;wsa:PortType&gt;xs:QName&lt;/wsa:PortType&gt; ?
- * &lt;wsa:ServiceName PortName="xs:NCName"?&gt;xs:QName&lt;/wsa:ServiceName&gt; ?
- * &lt;wsp:Policy&gt; ... &lt;/wsp:Policy&gt;*
- * &lt;/wsa:EndpointReference&gt;
- * @version $Rev$ $Date$
- */
-public interface EndPointReference {
- URI getAddress();
-
- void setAddress(URI address);
-
- QName getPortType();
-
- void setPortType(QName portType);
-
- QName getServiceName();
-
- void setServiceName(QName serviceName);
-
- QName getPortName();
-
- void setPortName(QName portName);
-
- List<Object> getReferenceProperties();
-
- List<Object> getReferenceParameters();
-
- List<Object> getPolicies();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java b/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java
deleted file mode 100644
index 055e2012dc..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.impl;
-
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
-
-/**
- * A factory for the WSDL model.
- *
- * @version $Rev$ $Date$
- */
-public class WebServiceBindingFactoryImpl implements WebServiceBindingFactory {
-
- public WebServiceBinding createWebServiceBinding() {
- return new WebServiceBindingImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java b/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java
deleted file mode 100644
index bfc3765f4b..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.Extensible;
-import org.apache.tuscany.sca.assembly.Extension;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.builder.BindingBuilder;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.w3c.dom.Element;
-
-/**
- * Represents a WebService binding.
- *
- * @version $Rev$ $Date$
- */
-class WebServiceBindingImpl implements WebServiceBinding, PolicySetAttachPoint, Extensible, OperationsConfigurator {
- private String name;
- private String uri;
- private boolean unresolved;
- private List<Object> extensions = new ArrayList<Object>();
- private List<Extension> attributeExtensions = new ArrayList<Extension>();
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private IntentAttachPointType intentAttachPointType;
- private List<ConfiguredOperation> configuredOperations = new ArrayList<ConfiguredOperation>();
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
- private String location;
- private Binding binding;
- private Service service;
- private Port port;
- private Port endpoint;
- private QName bindingName;
- private String portName;
- private QName serviceName;
- private String endpointName;
- private WSDLDefinition wsdlDefinition;
- private String wsdlNamespace;
- private InterfaceContract bindingInterfaceContract;
- private Element endPointReference;
- private Definition generatedWSDLDocument;
- private BindingBuilder builder;
-
- protected WebServiceBindingImpl() {
- }
-
- public String getName() {
- return name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public List<Object> getExtensions() {
- return extensions;
- }
-
- public List<Extension> getAttributeExtensions() {
- return attributeExtensions;
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public Binding getBinding() {
- if (binding == null) {
- if (getWSDLDefinition() != null && wsdlDefinition.getBinding() != null) {
- binding = wsdlDefinition.getBinding();
- }
- }
- return binding;
- }
-
- public QName getBindingName() {
- if (isUnresolved()) {
- return bindingName;
- } else if (binding != null) {
- return binding.getQName();
- } else {
- return null;
- }
- }
-
- public String getEndpointName() {
- if (isUnresolved()) {
- return endpointName;
- } else if (endpoint != null) {
- //TODO support WSDL 2.0
- return endpoint.getName();
- } else {
- return null;
- }
- }
-
- public Port getEndpoint() {
- return endpoint;
- }
-
- public Port getPort() {
- return port;
- }
-
- public String getPortName() {
- if (isUnresolved()) {
- return portName;
- } else if (port != null) {
- return port.getName();
- } else {
- return null;
- }
- }
-
- public Service getService() {
- return service;
- }
-
- public QName getServiceName() {
- if (isUnresolved()) {
- return serviceName;
- } else if (service != null) {
- return service.getQName();
- } else {
- return null;
- }
- }
-
- public void setBinding(Binding binding) {
- this.binding = binding;
- }
-
- public void setBindingName(QName bindingName) {
- if (!isUnresolved()) {
- throw new IllegalStateException();
- }
- this.bindingName = bindingName;
- }
-
- public void setEndpoint(Port endpoint) {
- this.endpoint = endpoint;
- }
-
- public void setEndpointName(String endpointName) {
- if (!isUnresolved()) {
- throw new IllegalStateException();
- }
- this.endpointName = endpointName;
- }
-
- public void setPort(Port port) {
- this.port = port;
- }
-
- public void setPortName(String portName) {
- if (!isUnresolved()) {
- throw new IllegalStateException();
- }
- this.portName = portName;
- }
-
- public void setService(Service service) {
- this.service = service;
- }
-
- public void setServiceName(QName serviceName) {
- if (!isUnresolved()) {
- throw new IllegalStateException();
- }
- this.serviceName = serviceName;
- }
-
- public WSDLDefinition getWSDLDefinition() {
- if (wsdlDefinition == null) {
- Interface iface = bindingInterfaceContract.getInterface();
- if (iface instanceof WSDLInterface) {
- wsdlDefinition = ((WSDLInterface) iface).getWsdlDefinition();
- }
- }
- return wsdlDefinition;
- }
-
- public void setDefinition(WSDLDefinition wsdlDefinition) {
- this.wsdlDefinition = wsdlDefinition;
- }
-
- public String getNamespace() {
- return wsdlNamespace;
- }
-
- public void setNamespace(String namespace) {
- this.wsdlNamespace = namespace;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return bindingInterfaceContract;
- }
-
- public void setBindingInterfaceContract(InterfaceContract bindingInterfaceContract) {
- this.bindingInterfaceContract = bindingInterfaceContract;
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- public IntentAttachPointType getType() {
- return intentAttachPointType;
- }
-
- public void setType(IntentAttachPointType intentAttachPointType) {
- this.intentAttachPointType = intentAttachPointType;
- }
-
- public Element getEndPointReference() {
- return endPointReference;
- }
-
- public void setEndPointReference(Element epr) {
- this.endPointReference = epr;
- }
-
- public Definition getWSDLDocument() {
- return generatedWSDLDocument;
- }
-
- public void setWSDLDocument(Definition definition) {
- this.generatedWSDLDocument = definition;
- }
-
- public BindingBuilder getBuilder() {
- return builder;
- }
-
- public void setBuilder(BindingBuilder builder) {
- this.builder = builder;
- }
-
- public void setPolicySets(List<PolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void setRequiredIntents(List<Intent> intents) {
- this.requiredIntents = intents;
- }
-
- public List<ConfiguredOperation> getConfiguredOperations() {
- return configuredOperations;
- }
-
- public void setConfiguredOperations(List<ConfiguredOperation> configuredOperations) {
- this.configuredOperations = configuredOperations;
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory b/tags/java/sca/2.0-M1/modules/binding-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory
deleted file mode 100644
index 6d50a24b93..0000000000
--- a/tags/java/sca/2.0-M1/modules/binding-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the model factory
-org.apache.tuscany.sca.binding.ws.impl.WebServiceBindingFactoryImpl \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/LICENSE b/tags/java/sca/2.0-M1/modules/contribution-java/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/contribution-java/META-INF/MANIFEST.MF
deleted file mode 100644
index 89e805d0d1..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,28 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.contribution.java;uses:="org.ap
- ache.tuscany.sca.contribution";version="2.0.0"
-Private-Package: org.apache.tuscany.sca.contribution.java.impl;version
- ="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Java Import/Export Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-DynamicImport-Package: org.apache.tuscany.sca.contribution.osgi.impl
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397112984
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Java Import/Export Model
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.java;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.extensibility;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.contribution.java
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/NOTICE b/tags/java/sca/2.0-M1/modules/contribution-java/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/pom.xml b/tags/java/sca/2.0-M1/modules/contribution-java/pom.xml
deleted file mode 100644
index e54ab762ad..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-contribution-java</artifactId>
- <name>Apache Tuscany SCA Contribution Java Import/Export Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/DefaultJavaImportExportFactory.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/DefaultJavaImportExportFactory.java
deleted file mode 100644
index 886c61c00a..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/DefaultJavaImportExportFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java;
-
-import org.apache.tuscany.sca.contribution.java.impl.JavaImportExportFactoryImpl;
-
-/**
- * Default Java Import/Export Factory implementation
- *
- * @version $Rev$ $Date$
- */
-public class DefaultJavaImportExportFactory extends JavaImportExportFactoryImpl implements JavaImportExportFactory {
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaExport.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaExport.java
deleted file mode 100644
index 41e93ec148..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaExport.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java;
-
-import org.apache.tuscany.sca.contribution.Export;
-
-/**
- * Base Java Export model interface
- *
- * @version $Rev$ $Date$
- */
-public interface JavaExport extends Export {
- /**
- * Get java package that identifies the import
- *
- * @return The package name
- */
- String getPackage();
-
- /**
- * Set java package that identifies the import
- *
- * @param packageName The package name
- */
- void setPackage(String packageName);
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImport.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImport.java
deleted file mode 100644
index d3568f6283..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImport.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java;
-
-import org.apache.tuscany.sca.contribution.Import;
-
-/**
- * Base Java Import model interface
- *
- * @version $Rev$ $Date$
- */
-public interface JavaImport extends Import {
-
- /**
- * Get the location used to resolve the definitions for this import
- *
- * @return The import location
- */
- String getLocation();
-
- /**
- * Set the location used to resolve the definitions for this import
- *
- * @param location The import location
- */
- void setLocation(String location);
-
- /**
- * Get java package that identifies the import
- *
- * @return The package name
- */
- String getPackage();
-
- /**
- * Set java package that identifies the import
- *
- * @param packageName The package name
- */
- void setPackage(String packageName);
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java
deleted file mode 100644
index af2ca9cd57..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.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/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java
deleted file mode 100644
index 135b3fbb69..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.DefaultDelegatingModelResolver;
-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.
- *
- * @version $Rev$ $Date$
- */
-public class ClassLoaderModelResolver extends URLClassLoader implements ModelResolver {
- private Contribution contribution;
- private Map<String, ModelResolver> importResolvers = new HashMap<String, ModelResolver>();
-
- private static ClassLoader parentClassLoader() {
- ClassLoader parentClassLoader = ServiceDiscovery.getInstance().getServiceDiscoverer().getClass().getClassLoader();
- return parentClassLoader;
- }
-
- public ClassLoaderModelResolver(final Contribution contribution, FactoryExtensionPoint modelFactories) throws MalformedURLException {
- super(new URL[] {new URL(contribution.getLocation())}, parentClassLoader());
- this.contribution = contribution;
-
- // Index Java import resolvers by package name
- Map<String, List<ModelResolver>> resolverMap = new HashMap<String, List<ModelResolver>>();
- for (Import import_: this.contribution.getImports()) {
- if (import_ instanceof JavaImport) {
- JavaImport javaImport = (JavaImport)import_;
- List<ModelResolver> resolvers = resolverMap.get(javaImport.getPackage());
- if (resolvers == null) {
- resolvers = new ArrayList<ModelResolver>();
- resolverMap.put(javaImport.getPackage(), resolvers);
- }
- resolvers.add(javaImport.getModelResolver());
- }
- }
-
- // Create a delegating model resolver for each imported package
- for (Map.Entry<String, List<ModelResolver>> entry: resolverMap.entrySet()) {
- importResolvers.put(entry.getKey(), new DefaultDelegatingModelResolver(entry.getValue()));
- }
- }
-
- 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) {
- if (!(unresolved instanceof ClassReference)) {
- return unresolved;
- }
-
- try {
-
- // Load the class and return a class reference for it
- String className = ((ClassReference)unresolved).getClassName();
- Class<?> clazz = Class.forName(className, true, this);
- return modelClass.cast(new ClassReference(clazz));
-
- } catch (ClassNotFoundException e) {
- return unresolved;
- } catch (NoClassDefFoundError e) {
- return unresolved;
- }
- }
-
- @Override
- public URL findResource(String name) {
-
- //TODO delegate to the Java import resolvers
-
- URL url = super.findResource(name);
- return url;
- }
-
- @Override
- public Enumeration<URL> findResources(String name) throws IOException {
-
- //TODO delegate to the Java import resolvers
- //Enumeration<URL> importedResources;
-
- Enumeration<URL> resources = super.findResources(name);
- List<URL> allResources = new ArrayList<URL>();
- //for (; importedResources.hasMoreElements(); ) {
- // allResources.add(importedResources.nextElement());
- //}
- for (; resources.hasMoreElements(); ) {
- allResources.add(resources.nextElement());
- }
- return Collections.enumeration(allResources);
- }
-
- @Override
- protected Class<?> findClass(String name) throws ClassNotFoundException {
-
- // Extract the package name
- int d = name.lastIndexOf('.');
- String packageName;
- if (d != -1) {
- packageName = name.substring(0, d);
- } else {
- packageName = null;
- }
-
- // First try to load the class using the Java import resolvers
- ModelResolver importResolver = importResolvers.get(packageName);
- if (importResolver != null) {
- ClassReference classReference = importResolver.resolveModel(ClassReference.class, new ClassReference(name));
- if (!classReference.isUnresolved()) {
- return classReference.getJavaClass();
- }
- }
-
- // Next, try to load the class from the current contribution
- Class<?> clazz = super.findClass(name);
- return clazz;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java
deleted file mode 100644
index 6dacecb5ac..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.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.
- *
- * @version $Rev: 557916 $ $Date: 2007-07-20 01:04:40 -0700 (Fri, 20 Jul 2007) $
- */
-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/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoader.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoader.java
deleted file mode 100644
index 008bfec31a..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoader.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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()));
- } catch (MalformedURLException 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/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportImpl.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportImpl.java
deleted file mode 100644
index f35f35ac4c..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportImpl.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import org.apache.tuscany.sca.contribution.java.JavaExport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * Implementation of a Java Import model
- *
- * @version $Rev$ $Date$
- */
-public class JavaExportImpl implements JavaExport {
- private ModelResolver modelResolver;
-
- /**
- * Java package being exported
- */
- private String packageName;
-
- public JavaExportImpl() {
- super();
- }
-
- public String getPackage() {
- return this.packageName;
- }
-
- public void setPackage(String packageName) {
- this.packageName = packageName;
- }
-
- public ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportModelResolver.java
deleted file mode 100644
index 8d5412f6d7..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportModelResolver.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import org.apache.tuscany.sca.contribution.java.JavaExport;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * A model resolver for Java exports.
- *
- * @version $Rev$ $Date$
- */
-public class JavaExportModelResolver implements ModelResolver {
-
- private JavaExport export;
- private ModelResolver resolver;
-
- public JavaExportModelResolver(JavaExport export, ModelResolver resolver) {
- this.export = export;
- this.resolver = resolver;
- }
-
- 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) {
- if (!(unresolved instanceof ClassReference)) {
- return unresolved;
- }
-
- // Filter package name
- ClassReference classReference = (ClassReference)unresolved;
- String className = classReference.getClassName();
- int d = className.lastIndexOf('.');
- String packageName;
- if (d != -1) {
- packageName = className.substring(0, d);
- } else {
- packageName = "";
- }
- if (export.getPackage().equals(packageName)) {
-
- // Package matches the exported package, delegate to the
- // contribution's resolver
- return resolver.resolveModel(modelClass, unresolved);
- } else {
-
- // Package is not exported, return the unresolved object
- return unresolved;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessor.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessor.java
deleted file mode 100644
index 0560d54a39..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessor.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 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.java.JavaExport;
-import org.apache.tuscany.sca.contribution.java.JavaImportExportFactory;
-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.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Artifact processor for Java Export
- *
- * @version $Rev$ $Date$
- */
-public class JavaExportProcessor implements StAXArtifactProcessor<JavaExport> {
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
-
- private static final QName EXPORT_JAVA = new QName(SCA10_NS, "export.java");
-
- private static final String PACKAGE = "package";
-
- private final JavaImportExportFactory factory;
- private final Monitor monitor;
-
- public JavaExportProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- super();
- this.factory = modelFactories.getFactory(JavaImportExportFactory.class);
- this.monitor = monitor;
- }
-
- /**
- * 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(), "contribution-java-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return EXPORT_JAVA;
- }
-
- public Class<JavaExport> getModelType() {
- return JavaExport.class;
- }
-
- /**
- * Process <export package=""/>
- */
- public JavaExport read(XMLStreamReader reader) throws ContributionReadException {
- JavaExport javaExport = this.factory.createJavaExport();
- QName element = null;
-
- try {
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- element = reader.getName();
-
- // Read <export.java>
- if (EXPORT_JAVA.equals(element)) {
- String packageName = reader.getAttributeValue(null, PACKAGE);
- if (packageName == null) {
- error("AttributePackageMissing", reader);
- //throw new ContributionReadException("Attribute 'package' is missing");
- } else
- javaExport.setPackage(packageName);
- }
- break;
- case XMLStreamConstants.END_ELEMENT:
- if (EXPORT_JAVA.equals(reader.getName())) {
- return javaExport;
- }
- break;
- }
-
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- }
- catch (XMLStreamException e) {
- ContributionReadException ex = new ContributionReadException(e);
- error("XMLStreamException", reader, ex);
- }
-
- return javaExport;
- }
-
- public void write(JavaExport javaExport, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <export.java>
- writer.writeStartElement(EXPORT_JAVA.getNamespaceURI(), EXPORT_JAVA.getLocalPart());
-
- if (javaExport.getPackage() != null) {
- writer.writeAttribute(PACKAGE, javaExport.getPackage());
- }
-
- writer.writeEndElement();
- }
-
- public void resolve(JavaExport javaExport, ModelResolver resolver) throws ContributionResolveException {
-
- if (javaExport.getPackage() != null)
- // Initialize the export resolver
- javaExport.setModelResolver(new JavaExportModelResolver(javaExport, resolver));
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java
deleted file mode 100644
index e5dc397f4e..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.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/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportImpl.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportImpl.java
deleted file mode 100644
index cc18d5f798..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.java.JavaExport;
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * Implementation of a Java Import model
- *
- * @version $Rev$ $Date$
- */
-public class JavaImportImpl implements JavaImport {
- private ModelResolver modelResolver;
- private List<Contribution> contributions;
- /**
- * Java package name being imported
- */
- private String packageName;
- /**
- * Contribution URI where the artifact is imported from
- */
- private String location;
-
- public JavaImportImpl() {
- super();
- }
-
- public String getLocation() {
- return this.location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public String getPackage() {
- return this.packageName;
- }
-
- public void setPackage(String packageName) {
- this.packageName = packageName;
- }
-
- public ModelResolver getModelResolver() {
- return this.modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
- public List<Contribution> getExportContributions() {
- return contributions;
- }
-
- public void setExportContributions(List<Contribution> contributions) {
- this.contributions = contributions;
- }
-
- /**
- * Match a JavaImport to a given JavaExport based on :
- * location is not provided
- * import and export packages match
- */
- public boolean match(Export export) {
- if(export instanceof JavaExport) {
- JavaExport javaExport = (JavaExport)export;
- String exportedPackage = javaExport.getPackage();
- if (packageName.equals(exportedPackage)) {
- return true;
- } else {
- if (packageName.endsWith(".*")) {
- String prefix = packageName.substring(0, packageName.length() - 1);
- if (exportedPackage.startsWith(prefix)) {
- return true;
- }
- }
- }
- }
-
- return false;
- }
-
- @Override
- public String toString() {
- return String.valueOf(packageName);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportModelResolver.java
deleted file mode 100644
index 484eddd222..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportModelResolver.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * A JavaImport specific model resolver. This model resolver is temporary
- * and provides the ContributionClassLoader with the list of exporting
- * contributions that it currently needs.
- *
- * FIXME Remove this class after the ContributionClassLoader is simplified
- * and cleaned up.
- *
- * @version $Rev$ $Date$
- */
-public class JavaImportModelResolver implements ModelResolver {
-
- private ModelResolver modelResolver;
- private List<Contribution> contributions;
-
- public JavaImportModelResolver(List<Contribution> contributions, ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- this.contributions = contributions;
- }
-
- public List<Contribution> getExportContributions() {
- return contributions;
- }
-
- public void addModel(Object resolved) {
- modelResolver.addModel(resolved);
- }
-
- public Object removeModel(Object resolved) {
- return modelResolver.removeModel(resolved);
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- return modelResolver.resolveModel(modelClass, unresolved);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java
deleted file mode 100644
index 199941ef0d..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-import org.apache.tuscany.sca.contribution.java.JavaImportExportFactory;
-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.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Artifact Processor for Java Imports
- *
- * @version $Rev$ $Date$
- */
-public class JavaImportProcessor implements StAXArtifactProcessor<JavaImport> {
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
-
- private static final QName IMPORT_JAVA = new QName(SCA10_NS, "import.java");
-
- private static final String PACKAGE = "package";
- private static final String LOCATION = "location";
-
- private final JavaImportExportFactory factory;
- private final Monitor monitor;
-
- public JavaImportProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- super();
- this.factory = modelFactories.getFactory(JavaImportExportFactory.class);
- this.monitor = monitor;
- }
-
- /**
- * 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(), "contribution-java-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return IMPORT_JAVA;
- }
-
- public Class<JavaImport> getModelType() {
- return JavaImport.class;
- }
-
- /**
- * Process <import.java package="" location=""/>
- */
- public JavaImport read(XMLStreamReader reader) throws ContributionReadException {
- JavaImport javaImport = this.factory.createJavaImport();
- QName element = null;
-
- try {
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- element = reader.getName();
-
- // Read <import.java>
- if (IMPORT_JAVA.equals(element)) {
- String packageName = reader.getAttributeValue(null, PACKAGE);
- if (packageName == null) {
- error("AttributePackageMissing", reader);
- //throw new ContributionReadException("Attribute 'package' is missing");
- } else
- javaImport.setPackage(packageName);
-
- String location = reader.getAttributeValue(null, LOCATION);
- javaImport.setLocation(location);
- }
- break;
- case XMLStreamConstants.END_ELEMENT:
- if (IMPORT_JAVA.equals(reader.getName())) {
- return javaImport;
- }
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- }
- catch (XMLStreamException e) {
- ContributionReadException ex = new ContributionReadException(e);
- error("XMLStreamException", reader, ex);
- }
-
- return javaImport;
- }
-
- public void write(JavaImport javaImport, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <import.java>
- writer.writeStartElement(IMPORT_JAVA.getNamespaceURI(), IMPORT_JAVA.getLocalPart());
-
- if (javaImport.getPackage() != null) {
- writer.writeAttribute(PACKAGE, javaImport.getPackage());
- }
- if (javaImport.getLocation() != null) {
- writer.writeAttribute(LOCATION, javaImport.getLocation());
- }
-
- writer.writeEndElement();
- }
-
-
- public void resolve(JavaImport model, ModelResolver resolver) throws ContributionResolveException {
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.java.JavaImportExportFactory b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.java.JavaImportExportFactory
deleted file mode 100644
index a293330a57..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.java.JavaImportExportFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.java.impl.JavaImportExportFactoryImpl
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index ac1fa9aade..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.java.impl.JavaImportProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#import.java,model=org.apache.tuscany.sca.contribution.java.JavaImport
-org.apache.tuscany.sca.contribution.java.impl.JavaExportProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#export.java,model=org.apache.tuscany.sca.contribution.java.JavaExport
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
deleted file mode 100644
index c69eb40636..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.java.impl.ClassReferenceModelResolver;model=org.apache.tuscany.sca.contribution.resolver.ClassReference
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/contribution-java-validation-messages.properties b/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/contribution-java-validation-messages.properties
deleted file mode 100644
index 09fc3e9fff..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/main/resources/contribution-java-validation-messages.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-AttributePackageMissing = Attribute 'package' is missing
-XMLStreamException = XMLStreamException occured due to : {0}
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java
deleted file mode 100644
index 68a2c771cf..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java
+++ /dev/null
@@ -1,75 +0,0 @@
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.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);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoaderTestCase.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoaderTestCase.java
deleted file mode 100644
index 779c00f71c..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoaderTestCase.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.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/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessorTestCase.java
deleted file mode 100644
index a91996b0c1..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaExportProcessorTestCase.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.contribution.java.JavaExport;
-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.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test JavaExportProcessorTestCase
- *
- * @version $Rev$ $Date$
- */
-public class JavaExportProcessorTestCase {
-
- private static final String VALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<export.java xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\" package=\"org.apache.tuscany.sca.contribution.java\"/>";
-
- private static final String INVALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<export.java xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"/>";
-
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static Monitor monitor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactory();
- if (monitorFactory != null) {
- monitor = monitorFactory.createMonitor();
- utilities.addUtility(monitorFactory);
- }
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
- }
-
- /**
- * Test loading a valid export element from a contribution metadata stream
- * @throws Exception
- */
- @Test
- public void testLoad() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
- JavaExport javaExport = (JavaExport)staxProcessor.read(reader);
- Assert.assertEquals("org.apache.tuscany.sca.contribution.java", javaExport.getPackage());
- }
-
- /**
- * Test loading an INVALID export element from a contribution metadata stream
- * @throws Exception
- */
- @Test
- public void testLoadInvalid() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(INVALID_XML));
- /*try {
- staxProcessor.read(reader);
- fail("readerException should have been thrown");
- } catch (ContributionReadException e) {
- assertTrue(true);
- }*/
- staxProcessor.read(reader);
- Problem problem = monitor.getLastProblem();
- assertNotNull(problem);
- assertEquals("AttributePackageMissing", problem.getMessageId());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessorTestCase.java
deleted file mode 100644
index 290656c3fa..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/test/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessorTestCase.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-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.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test JavaImportProcessorTestCase
- *
- * @version $Rev$ $Date$
- */
-public class JavaImportProcessorTestCase {
-
- private static final String VALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<import.java xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\" package=\"org.apache.tuscany.sca.contribution.java\" location=\"sca://contributions/001\"/>";
-
- private static final String INVALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<import.java xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\" location=\"sca://contributions/001\"/>";
-
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static Monitor monitor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactory();
- if (monitorFactory != null) {
- monitor = monitorFactory.createMonitor();
- utilities.addUtility(monitorFactory);
- }
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
- }
-
- /**
- * Test loading a valid import element from a contribution metadata stream
- * @throws Exception
- */
- @Test
- public void testLoad() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
- JavaImport javaImport = (JavaImport)staxProcessor.read(reader);
-
- assertEquals("org.apache.tuscany.sca.contribution.java", javaImport.getPackage());
- assertEquals("sca://contributions/001", javaImport.getLocation());
- }
-
- /**
- * Test loading a INVALID import element from a contribution metadata stream
- * @throws Exception
- */
- @Test
- public void testLoadInvalid() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(INVALID_XML));
- /*try {
- staxProcessor.read(reader);
- fail("readerException should have been thrown");
- } catch (ContributionReadException e) {
- assertTrue(true);
- }*/
- staxProcessor.read(reader);
- Problem problem = monitor.getLastProblem();
- assertNotNull(problem);
- assertEquals("AttributePackageMissing", problem.getMessageId());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-java/src/test/resources/deployables/sample-calculator.jar b/tags/java/sca/2.0-M1/modules/contribution-java/src/test/resources/deployables/sample-calculator.jar
deleted file mode 100644
index 0ca3a1b781..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-java/src/test/resources/deployables/sample-calculator.jar
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/LICENSE b/tags/java/sca/2.0-M1/modules/contribution-namespace/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/contribution-namespace/META-INF/MANIFEST.MF
deleted file mode 100644
index ac9c86fb77..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.contribution.namespace;uses:="o
- rg.apache.tuscany.sca.contribution";version="2.0.0"
-Private-Package: org.apache.tuscany.sca.contribution.namespace.impl;ve
- rsion="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Namespace Import/Export Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397110468
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Namespace Import/Export Model
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.namespace;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.contribution.namespace
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/NOTICE b/tags/java/sca/2.0-M1/modules/contribution-namespace/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/pom.xml b/tags/java/sca/2.0-M1/modules/contribution-namespace/pom.xml
deleted file mode 100644
index 79cbc8ec9f..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <name>Apache Tuscany SCA Contribution Namespace Import/Export Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/DefaultNamespaceImportExportFactory.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/DefaultNamespaceImportExportFactory.java
deleted file mode 100644
index a71fa61a54..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/DefaultNamespaceImportExportFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace;
-
-import org.apache.tuscany.sca.contribution.namespace.impl.NamespaceImportExportFactoryImpl;
-
-/**
- * Default Namespace Import/Export model factory implementation
- *
- * @version $Rev$ $Date$
- */
-public class DefaultNamespaceImportExportFactory extends NamespaceImportExportFactoryImpl implements NamespaceImportExportFactory {
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceExport.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceExport.java
deleted file mode 100644
index c68aee8521..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceExport.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace;
-
-import org.apache.tuscany.sca.contribution.Export;
-
-
-/**
- * The representation of an XML namespace export.
- *
- * @version $Rev$ $Date$
- */
-public interface NamespaceExport extends Export {
-
- /**
- * Get Namespace that identifies the export
- *
- * @return The exported namespace
- */
- String getNamespace();
-
- /**
- * Set Namespace that identifies the export
- *
- * @param namespace The exported namespace
- */
- void setNamespace(String namespace);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImport.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImport.java
deleted file mode 100644
index 8af36d7da0..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImport.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace;
-
-import org.apache.tuscany.sca.contribution.Import;
-
-/**
- * The representation of an XML namespace import.
- *
- * @version $Rev$ $Date$
- */
-public interface NamespaceImport extends Import {
-
- /**
- * Get the location used to resolve the definitions for this import
- *
- * @return The import location
- */
- String getLocation();
-
- /**
- * Set the location used to resolve the definitions for this import
- *
- * @param location The import location
- */
- void setLocation(String location);
-
- /**
- * Get Namespace that identifies the import
- *
- * @return The namespace
- */
- String getNamespace();
-
- /**
- * Set Namespace that identifies the import
- *
- * @param namespace The namespace
- */
- void setNamespace(String namespace);
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImportExportFactory.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImportExportFactory.java
deleted file mode 100644
index cfbac8bb1f..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/NamespaceImportExportFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace;
-
-/**
- * Base Namespace import/export model factory
- *
- * @version $Rev$ $Date$
- */
-public interface NamespaceImportExportFactory {
-
- /**
- * Create a namespace import model object
- *
- * @return The new NamespaceImport model object
- */
- NamespaceImport createNamespaceImport();
-
- /**
- * Create a namespace export model object
- *
- * @return The new NamespaceExport model object
- */
- NamespaceExport createNamespaceExport();
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportImpl.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportImpl.java
deleted file mode 100644
index 8991585d32..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace.impl;
-
-import org.apache.tuscany.sca.contribution.namespace.NamespaceExport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * The representation of an export for the contribution
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceExportImpl implements NamespaceExport {
- private String namespace;
- private ModelResolver modelResolver;
-
- protected NamespaceExportImpl() {
- super();
- }
-
- public String getNamespace() {
- return namespace;
- }
-
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- public ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportModelResolver.java
deleted file mode 100644
index 5c5ae22f77..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportModelResolver.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace.impl;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * A model resolver for namespace exports.
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceExportModelResolver implements ModelResolver {
-
- private ModelResolver resolver;
-
- public NamespaceExportModelResolver(ModelResolver resolver) {
- this.resolver = resolver;
- }
-
- 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) {
-
- // Just delegate to the contribution's model resolver, namespace
- // based filtering is implemented in the model specific model
- // resolver, which know how to get the namespace of the particular
- // type of model that they handle
- return resolver.resolveModel(modelClass, unresolved);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java
deleted file mode 100644
index 01e3140b68..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.namespace.impl;
-
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.namespace.NamespaceExport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
-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.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Artifact processor for Namespace export
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceExportProcessor implements StAXArtifactProcessor<NamespaceExport> {
-
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- private static final QName EXPORT = new QName(SCA10_NS, "export");
- private static final String NAMESPACE = "namespace";
-
- private final NamespaceImportExportFactory factory;
- private final Monitor monitor;
-
- public NamespaceExportProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.factory = modelFactories.getFactory(NamespaceImportExportFactory.class);
- this.monitor = monitor;
- }
-
- /**
- * Report a warning.
- *
- * @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(), "contribution-namespace-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return EXPORT;
- }
-
- public Class<NamespaceExport> getModelType() {
- return NamespaceExport.class;
- }
-
- /**
- * Process <export namespace=""/>
- */
- public NamespaceExport read(XMLStreamReader reader) throws ContributionReadException {
- NamespaceExport namespaceExport = this.factory.createNamespaceExport();
- QName element = null;
-
- try {
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- element = reader.getName();
-
- // Read <export>
- if (EXPORT.equals(element)) {
- String ns = reader.getAttributeValue(null, NAMESPACE);
- if (ns == null) {
- error("AttributeNameSpaceMissing", reader);
- //throw new ContributionReadException("Attribute 'namespace' is missing");
- } else
- namespaceExport.setNamespace(ns);
- }
-
- break;
- case XMLStreamConstants.END_ELEMENT:
- if (EXPORT.equals(reader.getName())) {
- return namespaceExport;
- }
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- }
- catch (XMLStreamException e) {
- ContributionReadException ex = new ContributionReadException(e);
- error("XMLStreamException", reader, ex);
- }
-
- return namespaceExport;
- }
-
- public void write(NamespaceExport namespaceExport, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <export>
- writer.writeStartElement(EXPORT.getNamespaceURI(), EXPORT.getLocalPart());
-
- if (namespaceExport.getNamespace() != null) {
- writer.writeAttribute(NAMESPACE, namespaceExport.getNamespace());
- }
-
- writer.writeEndElement();
- }
-
- public void resolve(NamespaceExport namespaceExport, ModelResolver resolver) throws ContributionResolveException {
-
- if (namespaceExport.getNamespace() != null)
- // Initialize the export's resolver
- namespaceExport.setModelResolver(new NamespaceExportModelResolver(resolver));
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportFactoryImpl.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportFactoryImpl.java
deleted file mode 100644
index 1146e593a9..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportExportFactoryImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace.impl;
-
-import org.apache.tuscany.sca.contribution.namespace.NamespaceExport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
-
-/**
- * Namespace Import/Export model factory implementation
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceImportExportFactoryImpl implements NamespaceImportExportFactory {
-
- public NamespaceImport createNamespaceImport() {
- return new NamespaceImportImpl();
- }
-
- public NamespaceExport createNamespaceExport() {
- return new NamespaceExportImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportImpl.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportImpl.java
deleted file mode 100644
index 6d2a31f702..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportImpl.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace.impl;
-
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceExport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * The representation of an import for the contribution
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceImportImpl implements NamespaceImport {
- private ModelResolver modelResolver;
-
- /**
- * The namespace to be imported
- */
- private String namespace;
- /**
- * Optional location URI pointing to a Contribution that exports the namespace
- */
- private String location;
-
-
- protected NamespaceImportImpl() {
- super();
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public String getNamespace() {
- return namespace;
- }
-
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- public ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
-
- /**
- * Match a NamespaceImport to a given NamespaceExport based on :
- * location is not provided
- * import and export namespaces match
- */
- public boolean match(Export export) {
- if (export instanceof NamespaceExport) {
- if (this.getNamespace().equals(((NamespaceExport)export).getNamespace())) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public String toString() {
- return String.valueOf(namespace);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java
deleted file mode 100644
index 8ed6d1d501..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace.impl;
-
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
-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.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Artifact processor for Namespace import
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceImportProcessor implements StAXArtifactProcessor<NamespaceImport> {
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
-
- private static final QName IMPORT = new QName(SCA10_NS, "import");
-
- private static final String NAMESPACE = "namespace";
- private static final String LOCATION = "location";
-
- private final NamespaceImportExportFactory factory;
- private final Monitor monitor;
-
- public NamespaceImportProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.factory = modelFactories.getFactory(NamespaceImportExportFactory.class);
- this.monitor = monitor;
- }
-
- /**
- * Report a warning.
- *
- * @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(), "contribution-namespace-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public QName getArtifactType() {
- return IMPORT;
- }
-
- public Class<NamespaceImport> getModelType() {
- return NamespaceImport.class;
- }
-
- /**
- * Process <import namespace="" location=""/>
- */
- public NamespaceImport read(XMLStreamReader reader) throws ContributionReadException {
- NamespaceImport namespaceImport = this.factory.createNamespaceImport();
- QName element;
-
- try {
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- element = reader.getName();
-
- // Read <import>
- if (IMPORT.equals(element)) {
- String ns = reader.getAttributeValue(null, NAMESPACE);
- if (ns == null) {
- error("AttributeNameSpaceMissing", reader);
- //throw new ContributionReadException("Attribute 'namespace' is missing");
- } else
- namespaceImport.setNamespace(ns);
-
- String location = reader.getAttributeValue(null, LOCATION);
- if (location != null) {
- namespaceImport.setLocation(location);
- }
- }
- break;
- case XMLStreamConstants.END_ELEMENT:
- if (IMPORT.equals(reader.getName())) {
- return namespaceImport;
- }
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- }
- catch (XMLStreamException e) {
- ContributionReadException ex = new ContributionReadException(e);
- error("XMLStreamException", reader, ex);
- }
-
- return namespaceImport;
- }
-
- public void write(NamespaceImport namespaceImport, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <import>
- writer.writeStartElement(IMPORT.getNamespaceURI(), IMPORT.getLocalPart());
-
- if (namespaceImport.getNamespace() != null) {
- writer.writeAttribute(NAMESPACE, namespaceImport.getNamespace());
- }
- if (namespaceImport.getLocation() != null) {
- writer.writeAttribute(LOCATION, namespaceImport.getLocation());
- }
-
- writer.writeEndElement();
- }
-
-
- public void resolve(NamespaceImport model, ModelResolver resolver) throws ContributionResolveException {
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory
deleted file mode 100644
index 095866fb6f..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.namespace.impl.NamespaceImportExportFactoryImpl
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 86f199368b..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.namespace.impl.NamespaceImportProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#import,model=org.apache.tuscany.sca.contribution.namespace.NamespaceImport
-org.apache.tuscany.sca.contribution.namespace.impl.NamespaceExportProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#export,model=org.apache.tuscany.sca.contribution.namespace.NamespaceExport
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties
deleted file mode 100644
index c1cbd06e7f..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/main/resources/contribution-namespace-validation-messages.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-AttributeNameSpaceMissing = Attribute 'namespace' is missing
-XMLStreamException = XMLStreamException occured due to : {0}
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
deleted file mode 100644
index dc0b05df3c..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.contribution.namespace.NamespaceExport;
-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.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test NamespaceExportProcessorTestCase
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceExportProcessorTestCase {
-
- private static final String VALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>" + "<export xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\" namespace=\"http://foo\"/>";
-
- private static final String INVALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>" + "<export xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\"/>";
-
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static Monitor monitor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactory();
- if (monitorFactory != null) {
- monitor = monitorFactory.createMonitor();
- utilities.addUtility(monitorFactory);
- }
- StAXArtifactProcessorExtensionPoint staxProcessors =
- extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, monitor);
- }
-
- /**
- * Test loading a valid export element from a contribution metadata stream
- * @throws Exception
- */
- @Test
- public void testLoad() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
- NamespaceExport namespaceExport = (NamespaceExport)staxProcessor.read(reader);
- assertEquals("http://foo", namespaceExport.getNamespace());
- }
-
- /**
- * Test loading an INVALID export element from a contribution metadata stream
- * @throws Exception
- */
- @Test
- public void testLoadInvalid() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(INVALID_XML));
- /*try {
- staxProcessor.read(reader);
- fail("readerException should have been thrown");
- } catch (ContributionReadException e) {
- assertTrue(true);
- }*/
- staxProcessor.read(reader);
- Problem problem = monitor.getLastProblem();
- assertNotNull(problem);
- assertEquals("AttributeNameSpaceMissing", problem.getMessageId());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java
deleted file mode 100644
index e3d96dc70f..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.namespace.impl;
-
-
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-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.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test NamespaceImportProcessorTestCase
- *
- * @version $Rev$ $Date$
- */
-public class NamespaceImportProcessorTestCase {
-
- private static final String VALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<import xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\" namespace=\"http://foo\" location=\"sca://contributions/001\"/>";
-
- private static final String INVALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<import xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\" location=\"sca://contributions/001\"/>";
-
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static Monitor monitor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactory();
- if (monitorFactory != null) {
- monitor = monitorFactory.createMonitor();
- utilities.addUtility(monitorFactory);
- }
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, monitor);
- }
-
- /**
- * Test loading a valid import element from a contribution metadata stream
- * @throws Exception
- */
- @Test
- public void testLoad() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
- NamespaceImport namespaceImport = (NamespaceImport)staxProcessor.read(reader);
-
- assertEquals("http://foo", namespaceImport.getNamespace());
- assertEquals("sca://contributions/001", namespaceImport.getLocation());
- }
-
- /**
- * Test loading a INVALID import element from a contribution metadata stream
- * @throws Exception
- */
- @Test
- public void testLoadInvalid() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(INVALID_XML));
- /*try {
- staxProcessor.read(reader);
- fail("readerException should have been thrown");
- } catch (ContributionReadException e) {
- assertTrue(true);
- }*/
- staxProcessor.read(reader);
- Problem problem = monitor.getLastProblem();
- assertNotNull(problem);
- assertEquals("AttributeNameSpaceMissing", problem.getMessageId());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/LICENSE b/tags/java/sca/2.0-M1/modules/contribution-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/contribution-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index d80ced9e24..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,27 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.contribution.processor.xml;ver
- sion="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA XML Contribution Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397199187
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA XML Contribution Model
-Import-Package: javax.xml.namespace,
- javax.xml.parsers,
- javax.xml.stream,
- javax.xml.stream.events,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.w3c.dom
-Bundle-SymbolicName: org.apache.tuscany.sca.contribution.xml
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/NOTICE b/tags/java/sca/2.0-M1/modules/contribution-xml/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/pom.xml b/tags/java/sca/2.0-M1/modules/contribution-xml/pom.xml
deleted file mode 100644
index 7f5dbb7110..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/pom.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-contribution-xml</artifactId>
- <name>Apache Tuscany SCA XML Contribution Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java
deleted file mode 100644
index e27ac9fcab..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor.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.Extension;
-import org.apache.tuscany.sca.assembly.ExtensionFactory;
-import org.apache.tuscany.sca.contribution.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.StAXAttributeProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A Policy Processor used for testing.
- *
- * @version $Rev$ $Date$
- */
-public class AnyAttributeProcessor extends BaseStAXArtifactProcessor implements StAXAttributeProcessor<Extension> {
- private static final QName ANY_ATTRIBUTE = new QName(Constants.XMLSCHEMA_NS, "anyAttribute");
-
- private ExtensionFactory extensionFactory;
-
- public AnyAttributeProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.extensionFactory = modelFactories.getFactory(ExtensionFactory.class);
- }
-
- public QName getArtifactType() {
- return ANY_ATTRIBUTE;
- }
-
- public Class<Extension> getModelType() {
- return Extension.class;
- }
-
- public Extension read(QName attributeName, XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- String attributeValue = reader.getAttributeValue(attributeName.getNamespaceURI(), attributeName.getLocalPart());
- return extensionFactory.createExtension(attributeName, attributeValue, true);
- }
-
- public void write(Extension attributeExtension, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- writer.writeAttribute(attributeExtension.getQName().getPrefix(),
- attributeExtension.getQName().getNamespaceURI(),
- attributeExtension.getQName().getLocalPart(),
- attributeExtension.getValue().toString()); //for extended attributes, we can assume values
- // are just the string representation fo the attribute
- }
-
- public void resolve(Extension arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyElementProcessor.java b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyElementProcessor.java
deleted file mode 100644
index 68c46a2301..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyElementProcessor.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.xml;
-
-import static javax.xml.stream.XMLStreamConstants.CDATA;
-import static javax.xml.stream.XMLStreamConstants.CHARACTERS;
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.events.XMLEvent;
-
-import org.apache.tuscany.sca.contribution.Constants;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-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;
-
-public class AnyElementProcessor implements StAXArtifactProcessor<Object> {
- private static final QName ANY_ELEMENT = new QName(Constants.XMLSCHEMA_NS, "anyElement");
-
- private XMLInputFactory xmlInputFactory;
- @SuppressWarnings("unused")
- private Monitor monitor;
-
-
- public AnyElementProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- xmlInputFactory = modelFactories.getFactory(XMLInputFactory.class);
- this.monitor = monitor;
- }
-
- public QName getArtifactType() {
- return ANY_ELEMENT;
- }
-
- public Class<Object> getModelType() {
- return Object.class;
- }
-
- /**
- * Reads the contetns of the unknown elements and generates a custom
- * implementation of XMLStreamReader i.e. XMLEventsStreamReader
- *
- * @param reader
- * @return
- * @throws XMLStreamException
- */
- @SuppressWarnings("unchecked")
- public Object read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Custom variables
- String currentElement = null;
- List eventsList = new ArrayList();
-
- Map<String, NamespaceContext> eventContext = new HashMap<String, NamespaceContext>();
-
- try {
- // Cast the block of unknown elements into document
- XMLDocumentStreamReader docReader = new XMLDocumentStreamReader(reader);
-
- XMLEventReader xmlEventReader = xmlInputFactory.createXMLEventReader(docReader);
-
- while (xmlEventReader.hasNext()) {
- XMLEvent event = xmlEventReader.nextEvent();
-
- // Populate the eventContext map with the current element's name
- // and corresponding NamesapceContext
- if (currentElement != null && !(eventContext.containsKey(currentElement))) {
- eventContext.put(currentElement, reader.getNamespaceContext());
- }
-
- // Populate the list with the XMLEvents
- eventsList.add(event);
- if (event.isStartElement()) {
- currentElement = reader.getName().getLocalPart();
- }
- if (event.isEndDocument()) {
- return new XMLEventsStreamReader(eventsList, eventContext);
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- /**
- * Writes unknown portions back to the writer
- *
- * @param model
- * @param writer
- */
- public void write(Object model, XMLStreamWriter writer) throws XMLStreamException {
- if (!(model instanceof XMLStreamReader)) {
- return;
- }
- XMLStreamReader reader = (XMLStreamReader)model;
-
- int event = reader.getEventType();
- while (reader.hasNext()) {
- switch (event) {
- case START_ELEMENT:
-
- writer.writeStartElement(reader.getPrefix(), reader.getLocalName(), reader.getNamespaceURI());
- for (int i = 1; i <= reader.getAttributeCount(); i++) {
- writer.writeAttribute(reader.getAttributePrefix(i), reader.getAttributeNamespace(i), reader
- .getAttributeLocalName(i), reader.getAttributeValue(i));
- }
- break;
-
- case CHARACTERS:
- writer.writeCharacters(reader.getText());
- break;
-
- case CDATA:
- writer.writeCData(reader.getText());
- break;
-
- case END_ELEMENT:
- writer.writeEndElement();
- break;
- }
- if (reader.hasNext()) {
- event = reader.next();
- }
- }
- }
-
- public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException {
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java
deleted file mode 100644
index 7e8b3a9d9e..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.xml;
-
-import java.util.NoSuchElementException;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-/**
- * This class is derived from Apache Axis2 class
- * org.apache.axis2.util.StreamWrapper</a>. It's used wrap a XMLStreamReader to
- * 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) $
- */
-public class XMLDocumentStreamReader implements XMLStreamReader {
- private static final int STATE_COMPLETE_AT_NEXT = 2; // The wrapper
- // will produce
- // END_DOCUMENT
-
- private static final int STATE_COMPLETED = 3; // Done
-
- private static final int STATE_INIT = 0; // The wrapper will produce
- // START_DOCUMENT
-
- private static final int STATE_SWITCHED = 1; // The real reader will
- // produce events
-
- private XMLStreamReader realReader;
- private boolean fragment;
- private int level = 0;
-
- private int state = STATE_INIT;
-
- public XMLDocumentStreamReader(XMLStreamReader realReader) {
- if (realReader == null) {
- throw new UnsupportedOperationException("Reader cannot be null");
- }
-
- this.realReader = realReader;
-
- if (realReader instanceof XMLFragmentStreamReader) {
- ((XMLFragmentStreamReader)realReader).init();
- }
-
- // If the real reader is positioned at START_DOCUMENT, always use
- // the real reader
- if (realReader.getEventType() == START_DOCUMENT) {
- fragment = false;
- state = STATE_SWITCHED;
- }
- }
-
- public void close() throws XMLStreamException {
- realReader.close();
- }
-
- public int getAttributeCount() {
- if (isDelegating()) {
- return realReader.getAttributeCount();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeLocalName(int i) {
- if (isDelegating()) {
- return realReader.getAttributeLocalName(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public QName getAttributeName(int i) {
- if (isDelegating()) {
- return realReader.getAttributeName(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeNamespace(int i) {
- if (isDelegating()) {
- return realReader.getAttributeNamespace(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributePrefix(int i) {
- if (isDelegating()) {
- return realReader.getAttributePrefix(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeType(int i) {
- if (isDelegating()) {
- return realReader.getAttributeType(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeValue(int i) {
- if (isDelegating()) {
- return realReader.getAttributeValue(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeValue(String s, String s1) {
- if (isDelegating()) {
- return realReader.getAttributeValue(s, s1);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getCharacterEncodingScheme() {
- return realReader.getCharacterEncodingScheme();
- }
-
- public String getElementText() throws XMLStreamException {
- if (isDelegating()) {
- return realReader.getElementText();
- } else {
- throw new XMLStreamException();
- }
- }
-
- public String getEncoding() {
- return realReader.getEncoding();
- }
-
- public int getEventType() {
- int event = -1;
- switch (state) {
- case STATE_SWITCHED:
- case STATE_COMPLETE_AT_NEXT:
- event = realReader.getEventType();
- break;
- case STATE_INIT:
- event = START_DOCUMENT;
- break;
- case STATE_COMPLETED:
- event = END_DOCUMENT;
- break;
- }
- return event;
- }
-
- public String getLocalName() {
- if (isDelegating()) {
- return realReader.getLocalName();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public Location getLocation() {
- if (isDelegating()) {
- return realReader.getLocation();
- } else {
- return null;
- }
- }
-
- public QName getName() {
- if (isDelegating()) {
- return realReader.getName();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public NamespaceContext getNamespaceContext() {
- return realReader.getNamespaceContext();
- }
-
- public int getNamespaceCount() {
- if (isDelegating()) {
- return realReader.getNamespaceCount();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getNamespacePrefix(int i) {
- if (isDelegating()) {
- return realReader.getNamespacePrefix(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getNamespaceURI() {
- if (isDelegating()) {
- return realReader.getNamespaceURI();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getNamespaceURI(int i) {
- if (isDelegating()) {
- return realReader.getNamespaceURI(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getNamespaceURI(String s) {
- if (isDelegating()) {
- return realReader.getNamespaceURI(s);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getPIData() {
- if (isDelegating()) {
- return realReader.getPIData();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getPITarget() {
- if (isDelegating()) {
- return realReader.getPITarget();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getPrefix() {
- if (isDelegating()) {
- return realReader.getPrefix();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public Object getProperty(String s) throws IllegalArgumentException {
- if (isDelegating()) {
- return realReader.getProperty(s);
- } else {
- throw new IllegalArgumentException();
- }
- }
-
- public String getText() {
- if (isDelegating()) {
- return realReader.getText();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public char[] getTextCharacters() {
- if (isDelegating()) {
- return realReader.getTextCharacters();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
- if (isDelegating()) {
- return realReader.getTextCharacters(i, chars, i1, i2);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextLength() {
- if (isDelegating()) {
- return realReader.getTextLength();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextStart() {
- if (isDelegating()) {
- return realReader.getTextStart();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getVersion() {
- if (isDelegating()) {
- return realReader.getVersion();
- } else {
- return null;
- }
- }
-
- public boolean hasName() {
- if (isDelegating()) {
- return realReader.hasName();
- } else {
- return false;
- }
- }
-
- public boolean hasNext() throws XMLStreamException {
- if (state == STATE_COMPLETE_AT_NEXT) {
- return true;
- } else if (state == STATE_COMPLETED) {
- return false;
- } else if (state == STATE_SWITCHED) {
- return realReader.hasNext();
- } else {
- return true;
- }
- }
-
- public boolean hasText() {
- if (isDelegating()) {
- return realReader.hasText();
- } else {
- return false;
- }
- }
-
- public boolean isAttributeSpecified(int i) {
- if (isDelegating()) {
- return realReader.isAttributeSpecified(i);
- } else {
- return false;
- }
- }
-
- public boolean isCharacters() {
- if (isDelegating()) {
- return realReader.isCharacters();
- } else {
- return false;
- }
- }
-
- private boolean isDelegating() {
- return state == STATE_SWITCHED || state == STATE_COMPLETE_AT_NEXT;
- }
-
- public boolean isEndElement() {
- if (isDelegating()) {
- return realReader.isEndElement();
- } else {
- return false;
- }
- }
-
- public boolean isStandalone() {
- if (isDelegating()) {
- return realReader.isStandalone();
- } else {
- return false;
- }
- }
-
- public boolean isStartElement() {
- if (isDelegating()) {
- return realReader.isStartElement();
- } else {
- return false;
- }
- }
-
- public boolean isWhiteSpace() {
- if (isDelegating()) {
- return realReader.isWhiteSpace();
- } else {
- return false;
- }
- }
-
- public int next() throws XMLStreamException {
- int returnEvent;
-
- switch (state) {
- case STATE_SWITCHED:
- returnEvent = realReader.next();
- if (returnEvent == END_DOCUMENT) {
- state = STATE_COMPLETED;
- } else if (!realReader.hasNext()) {
- state = STATE_COMPLETE_AT_NEXT;
- }
- if (fragment && returnEvent == END_ELEMENT) {
- level--;
- if (level == -1) {
- // We are now at the end of the top-level element in the fragment
- state = STATE_COMPLETE_AT_NEXT;
- }
- }
- if (fragment && returnEvent == START_ELEMENT) {
- level++;
- }
- break;
- case STATE_INIT:
- state = STATE_SWITCHED;
- returnEvent = realReader.getEventType();
- if (returnEvent == START_ELEMENT) {
- // The real reader is positioned at the top-level element in the fragment
- level = 0;
- fragment = true;
- }
- break;
- case STATE_COMPLETE_AT_NEXT:
- state = STATE_COMPLETED;
- returnEvent = END_DOCUMENT;
- break;
- case STATE_COMPLETED:
- // oops - no way we can go beyond this
- throw new NoSuchElementException("End of stream has reached.");
- default:
- throw new UnsupportedOperationException();
- }
-
- return returnEvent;
- }
-
- public int nextTag() throws XMLStreamException {
- if (isDelegating()) {
- int returnEvent = realReader.nextTag();
- if (fragment && returnEvent == END_ELEMENT) {
- level--;
- if (level == 0) {
- // We are now at the end of the top-level element in the fragment
- state = STATE_COMPLETE_AT_NEXT;
- }
- }
- if (fragment && returnEvent == START_ELEMENT) {
- level++;
- }
- return returnEvent;
- } else {
- throw new XMLStreamException();
- }
- }
-
- public void require(int i, String s, String s1) throws XMLStreamException {
- if (isDelegating()) {
- realReader.require(i, s, s1);
- }
- }
-
- public boolean standaloneSet() {
- if (isDelegating()) {
- return realReader.standaloneSet();
- } else {
- return false;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLEventsStreamReader.java b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLEventsStreamReader.java
deleted file mode 100644
index eecdee5ba6..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLEventsStreamReader.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.xml;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.ProcessingInstruction;
-import javax.xml.stream.events.XMLEvent;
-
-
-public class XMLEventsStreamReader implements XMLStreamReader {
-
- @SuppressWarnings("unused")
- private ArrayList<XMLEvent> events = null;
- private HashMap<String, NamespaceContext> eventContext = null;
-
- private int state;
- private java.util.Iterator<XMLEvent> iterator;
- private XMLEvent current;
-
- public XMLEventsStreamReader(List<XMLEvent> events,Map<String, NamespaceContext> map) {
- this.events = (ArrayList<XMLEvent>) events;
- this.eventContext = (HashMap<String, NamespaceContext>) map;
- this.iterator = events.iterator();
- this.current = iterator.next();
- this.state = current.getEventType();
- }
-
- public void close() throws XMLStreamException {
- this.events = null;
- this.eventContext = null;
- this.iterator = null;
- this.current = null;
- }
-
- private void checkElementState() {
- if (getEventType() != START_ELEMENT && getEventType() != END_ELEMENT) {
- throw new IllegalStateException();
- }
- }
-
- @SuppressWarnings("unchecked")
- public int getAttributeCount() {
- checkElementState();
- int count = 0;
- Iterator<Attribute> iterator = current.asStartElement().getAttributes();
- while (iterator.hasNext()) {
- count++;
- iterator.next();
- }
- return count;
- }
-
- /*
- * Custom method to get attribute from the specified index
- */
- @SuppressWarnings("unchecked")
- private Attribute getAttribute(int index) {
- checkElementState();
- int count = 0;
- Attribute attribute = null;
- Iterator<Attribute> iterator = current.asStartElement().getAttributes();
- while (iterator.hasNext()) {
- count++;
- if (count == index) {
- attribute = iterator.next();
- } else {
- iterator.next();
- }
- }
- return attribute;
- }
-
-
- public String getAttributeLocalName(int index) {
- checkElementState();
- return getAttribute(index).getName().getLocalPart();
- }
-
- public QName getAttributeName(int index) {
- checkElementState();
- return getAttribute(index).getName();
- }
-
- public String getAttributeNamespace(int index) {
- checkElementState();
- return getAttributeName(index).getNamespaceURI();
- }
-
- public String getAttributePrefix(int index) {
- checkElementState();
- return getAttributeName(index).getPrefix();
- }
-
- public String getAttributeType(int index) {
- checkElementState();
- return getAttribute(index).getDTDType();
- }
-
- public String getAttributeValue(int index) {
- checkElementState();
- return getAttribute(index).getValue();
- }
-
- @SuppressWarnings("unchecked")
- public String getAttributeValue(String namespaceURI, String localName) {
- checkElementState();
- Iterator<Attribute> iterator = current.asStartElement().getAttributes();
- Attribute attribute;
- while (iterator.hasNext()) {
- attribute = iterator.next();
- if (attribute.getName().getNamespaceURI().equalsIgnoreCase(
- namespaceURI)
- && attribute.getName().getLocalPart().equalsIgnoreCase(
- localName)) {
- return attribute.getValue();
- }
- }
- return null;
-
- }
-
- public String getCharacterEncodingScheme() {
- return "UTF-8";
- }
-
- public String getElementText() throws XMLStreamException {
- checkElementState();
- int eventType = getEventType();
- String elementText = null;
-
- if (eventType == START_ELEMENT) {
- elementText = current.asStartElement().getName().getLocalPart();
- } else if (eventType == END_ELEMENT) {
- elementText = current.asEndElement().getName().getLocalPart();
- }
- return elementText;
- }
-
- public String getEncoding() {
- return "UTF-8";
- }
-
- public int getEventType() {
- return state;
- }
-
- public String getLocalName() {
- checkElementState();
- switch (current.getEventType()) {
- case START_ELEMENT:
- return current.asStartElement().getName().getLocalPart();
- case END_ELEMENT:
- return current.asEndElement().getName().getLocalPart();
- }
- return null;
- }
-
- public Location getLocation() {
- return current.getLocation();
- }
-
- public QName getName() {
- checkElementState();
- switch (current.getEventType()) {
- case START_ELEMENT:
- return current.asStartElement().getName();
- case END_ELEMENT:
- return current.asEndElement().getName();
- }
- return null;
- }
-
- public NamespaceContext getNamespaceContext() {
- checkElementState();
- //return new TuscanyNamespaceContext(eventContext.get(getLocalName()));
- return eventContext.get(getLocalName());
- }
-
- @SuppressWarnings("unchecked")
- public int getNamespaceCount() {
- int count = 0;
- Iterator<Namespace> itr = current.asStartElement().getNamespaces();
- while (itr.hasNext()) {
- count++;
- itr.next();
- }
- return count;
- }
-
- @SuppressWarnings("unchecked")
- public String getNamespacePrefix(int index) {
- Iterator<Namespace> itr = current.asStartElement().getNamespaces();
- int level = 0;
- Namespace ns = null;
- while (itr.hasNext()) {
- ns = itr.next();
- if (level == index) {
- return ns.getPrefix();
- }
- level++;
- }
- return null;
- }
-
- public String getNamespaceURI() {
- checkElementState();
- switch (current.getEventType()) {
- case START_ELEMENT:
- return current.asStartElement().getName().getNamespaceURI();
- case END_ELEMENT:
- return current.asEndElement().getName().getNamespaceURI();
- }
- return null;
- }
-
- public String getNamespaceURI(String prefix) {
- return getNamespaceContext().getNamespaceURI(prefix);
- }
-
- @SuppressWarnings("unchecked")
- public String getNamespaceURI(int index) {
- Iterator<Namespace> itr = current.asStartElement().getNamespaces();
- int level = 0;
- Namespace ns = null;
- while (itr.hasNext()) {
- ns = itr.next();
- if (level == index) {
- return ns.getNamespaceURI();
- }
- level++;
- }
- return null;
- }
-
- public String getPIData() {
- if (current.isProcessingInstruction()) {
- ProcessingInstruction pi = (ProcessingInstruction) current;
- return pi.getData();
- } else {
- throw new IllegalStateException(current.toString());
- }
- }
-
- public String getPITarget() {
- if (current.isProcessingInstruction()) {
- ProcessingInstruction pi = (ProcessingInstruction) current;
- return pi.getTarget();
- } else {
- throw new IllegalStateException(current.toString());
- }
- }
-
- public String getPrefix() {
- checkElementState();
- if (current.isStartElement()) {
- return current.asStartElement().getName().getPrefix();
- }
- return null;
- }
-
- /*
- * FIXME: Implementation pending...
- *
- * @see (non-Javadoc)
- * javax.xml.stream.util.StreamReaderDelegate#getProperty(java.lang.String)
- */
- public Object getProperty(String name) throws IllegalArgumentException {
- // TODO Auto-generated method stub
-
- return null;
- }
-
- public String getText() {
- if (current.isCharacters()) {
- return current.asCharacters().getData();
- } else {
- throw new IllegalStateException(current.toString());
- }
- }
-
- public char[] getTextCharacters() {
- if (current.isCharacters()) {
- return current.asCharacters().getData().toCharArray();
- } else {
- throw new IllegalStateException(current.toString());
- }
- }
-
- /*
- * FIXME: Implementation pending... (non-Javadoc)
- *
- * @see javax.xml.stream.util.StreamReaderDelegate#getTextCharacters(int,
- * char[], int, int)
- */
- public int getTextCharacters(int sourceStart, char[] target,
- int targetStart, int length) throws XMLStreamException {
- // TODO Auto-generated method stub
- return 0;
- }
-
- /*
- * FIXME:Implementaion can be improved (non-Javadoc)
- *
- * @see javax.xml.stream.util.StreamReaderDelegate#getTextLength()
- */
- public int getTextLength() {
- if (current.isCharacters()) {
- return current.asCharacters().getData().length();
- } else {
- throw new IllegalStateException(current.toString());
- }
- }
-
- /*
- * FIXME: Implementation pending... (non-Javadoc)
- *
- * @see javax.xml.stream.util.StreamReaderDelegate#getTextStart()
- */
- public int getTextStart() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- /*
- * FIXME: Implementation pending... (non-Javadoc)
- *
- * @see javax.xml.stream.util.StreamReaderDelegate#getTextStart()
- */
- public String getVersion() {
- // TODO Auto-generated method stub
-
- return null;
- }
-
- public boolean hasName() {
- return false;
- }
-
- public boolean hasNext() throws XMLStreamException {
- return iterator.hasNext() || state != END_DOCUMENT;
-
- }
-
- public boolean hasText() {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * FIXME: Implementation pending... (non-Javadoc)
- *
- * @see javax.xml.stream.util.StreamReaderDelegate#getTextStart()
- */
- public boolean isAttributeSpecified(int index) {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isCharacters() {
- return current.isCharacters();
- }
-
- public boolean isEndElement() {
- return current.isEndElement();
- }
-
- public boolean isStandalone() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isStartElement() {
- return current.isStartElement();
- }
-
- public boolean isWhiteSpace() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public int next() throws XMLStreamException {
- if (!hasNext()) {
- throw new IllegalStateException("No more events");
- }
- if (!iterator.hasNext()) {
- state = END_DOCUMENT;
- current = null;
- return state;
- }
- current = iterator.next();
- state = current.getEventType();
- return state;
- }
-
- public int nextTag() throws XMLStreamException {
- return iterator.next().getEventType();
- }
-
- public void require(int type, String namespaceURI, String localName)
- throws XMLStreamException {
- boolean require = false;
- String uri = getNamespaceURI();
- String name = getLocalName();
- if (state == type && namespaceURI.equals(uri) && localName.equals(name)) {
- require = true;
- }
- if (require != true) {
- throw new XMLStreamException();
- }
- }
-
- public boolean standaloneSet() {
- return false;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLFragmentStreamReader.java b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLFragmentStreamReader.java
deleted file mode 100644
index 66361e1d76..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLFragmentStreamReader.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor.xml;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-
-public interface XMLFragmentStreamReader extends XMLStreamReader {
- QName NIL_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance", "nil", "xsi");
- String NIL_VALUE_TRUE = "true";
-
- /**
- * this will help to handle Text within the current element. user should
- * pass the element text to the property list as this ELEMENT_TEXT as the
- * key. This key deliberately has a space in it so that it is not a valid
- * XML name
- */
- String ELEMENT_TEXT = "Element Text";
-
- /**
- * Extra method to query the state of the pullparser
- */
- boolean isDone();
-
- /**
- * add the parent namespace context to this parser
- */
- void setParentNamespaceContext(NamespaceContext nsContext);
-
- /**
- * Initiate the parser - this will do whatever the needed tasks to initiate
- * the parser and must be called before attempting any specific parsing
- * using this parser
- */
- void init();
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java
deleted file mode 100644
index ff7bf7068a..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.xml;
-
-import javax.xml.stream.XMLInputFactory;
-
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * URLArtifactProcessor that handles sca-contribution-generated.xml files.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionGeneratedMetadataDocumentProcessor extends ContributionMetadataDocumentProcessor {
-
- public ContributionGeneratedMetadataDocumentProcessor(XMLInputFactory inputFactory,
- StAXArtifactProcessor staxProcessor,
- Monitor monitor) {
- super(inputFactory, staxProcessor, monitor);
- }
-
- public ContributionGeneratedMetadataDocumentProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor staxProcessor,
- Monitor monitor) {
- super(modelFactories, staxProcessor, monitor);
- }
-
- @Override
- public String getArtifactType() {
- return "sca-contribution-generated.xml";
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java
deleted file mode 100644
index f080f23797..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.xml;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.contribution.ContributionMetadata;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory;
-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.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * URLArtifactProcessor that handles sca-contribution.xml files.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionMetadataDocumentProcessor implements URLArtifactProcessor<ContributionMetadata>{
- private final StAXArtifactProcessor staxProcessor;
- private final XMLInputFactory inputFactory;
- private final Monitor monitor;
-
- public ContributionMetadataDocumentProcessor(XMLInputFactory inputFactory,
- StAXArtifactProcessor staxProcessor,
- Monitor monitor) {
- this.inputFactory = inputFactory;
- this.staxProcessor = staxProcessor;
- this.monitor = monitor;
- }
-
- public ContributionMetadataDocumentProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor staxProcessor,
- Monitor monitor) {
- this.inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class);
- this.staxProcessor = staxProcessor;
- 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(), "contribution-xml-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- public String getArtifactType() {
- return "sca-contribution.xml";
- }
-
- public Class<ContributionMetadata> getModelType() {
- return ContributionMetadata.class;
- }
-
- public ContributionMetadata read(URL contributionURL, URI uri, URL url) throws ContributionReadException {
- InputStream urlStream = null;
- try {
-
- // Create a stream reader
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- urlStream = connection.getInputStream();
- XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
- reader.nextTag();
-
- // Read the contribution model
- ContributionMetadata contribution = (ContributionMetadata)staxProcessor.read(reader);
-
- return contribution;
-
- } catch (XMLStreamException e) {
- ContributionReadException ex = new ContributionReadException(e);
- error("XMLStreamException", inputFactory, ex);
- throw ex;
- } catch (IOException e) {
- ContributionReadException ex = new ContributionReadException(e);
- error("IOException", inputFactory, ex);
- throw ex;
- } finally {
- try {
- if (urlStream != null) {
- urlStream.close();
- urlStream = null;
- }
- } catch (IOException ioe) {
- //ignore
- }
- }
- }
-
- public void resolve(ContributionMetadata contribution, ModelResolver resolver) throws ContributionResolveException {
- staxProcessor.resolve(contribution, resolver);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessor.java b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessor.java
deleted file mode 100644
index 631308d2f7..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessor.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.xml;
-
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.List;
-
-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.Composite;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.ContributionMetadata;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.Import;
-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.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Processor for contribution metadata
- *
- * @version $Rev$ $Date$
- */
-public class ContributionMetadataProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<ContributionMetadata> {
-
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
-
- private static final QName CONTRIBUTION_QNAME = new QName(SCA10_NS, "contribution");
- private static final QName DEPLOYABLE_QNAME = new QName(SCA10_NS, "deployable");
-
- private final AssemblyFactory assemblyFactory;
- private final ContributionFactory contributionFactory;
-
- private final StAXArtifactProcessor<Object> extensionProcessor;
- private Monitor monitor;
-
- public ContributionMetadataProcessor(AssemblyFactory assemblyFactory,
- ContributionFactory contributionFactory,
- StAXArtifactProcessor<Object> extensionProcessor,
- Monitor monitor) {
- this.assemblyFactory = assemblyFactory;
- this.contributionFactory = contributionFactory;
- this.extensionProcessor = extensionProcessor;
- this.monitor = monitor;
- }
-
- /**
- * 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(), "contribution-xml-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public ContributionMetadataProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor<Object> extensionProcessor,
- Monitor monitor) {
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- this.extensionProcessor = extensionProcessor;
- this.monitor = monitor;
- }
-
-
- public QName getArtifactType() {
- return CONTRIBUTION_QNAME;
- }
-
- public Class<ContributionMetadata> getModelType() {
- return ContributionMetadata.class;
- }
-
- public ContributionMetadata read(XMLStreamReader reader) throws ContributionReadException {
- ContributionMetadata contribution = null;
- QName name = null;
-
- try {
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- name = reader.getName();
-
- if (CONTRIBUTION_QNAME.equals(name)) {
-
- // Read <contribution>
- contribution = this.contributionFactory.createContributionMetadata();
- contribution.setUnresolved(true);
-
- } else if (DEPLOYABLE_QNAME.equals(name)) {
-
- // Read <deployable>
- QName compositeName = getQName(reader, "composite");
- if (compositeName == null) {
- error("AttributeCompositeMissing", reader);
- //throw new ContributionReadException("Attribute 'composite' is missing");
- } else {
- if (contribution != null) {
- Composite composite = assemblyFactory.createComposite();
- composite.setName(compositeName);
- composite.setUnresolved(true);
- contribution.getDeployables().add(composite);
- }
- }
- } else {
-
- // Read an extension element
- Object extension = extensionProcessor.read(reader);
- if (extension != null && contribution != null) {
- if (extension instanceof Import) {
- contribution.getImports().add((Import)extension);
- } else if (extension instanceof Export) {
- contribution.getExports().add((Export)extension);
- }
- }
- }
- break;
-
- case XMLStreamConstants.END_ELEMENT:
- if (CONTRIBUTION_QNAME.equals(reader.getName())) {
- return contribution;
- }
- break;
- }
-
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- }
- catch (XMLStreamException e) {
- ContributionReadException ex = new ContributionReadException(e);
- error("XMLStreamException", reader, ex);
- }
-
- return contribution;
- }
-
- public void write(ContributionMetadata contribution, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <contribution>
- writeStartDocument(writer, CONTRIBUTION_QNAME.getNamespaceURI(), CONTRIBUTION_QNAME.getLocalPart());
-
- // Write <import>
- for (Import imp: contribution.getImports()) {
- extensionProcessor.write(imp, writer);
- }
-
- // Write <export>
- for (Export export: contribution.getExports()) {
- extensionProcessor.write(export, writer);
- }
-
- // Write <deployable>
- for (Composite deployable: contribution.getDeployables()) {
- writeStart(writer, DEPLOYABLE_QNAME.getNamespaceURI(), DEPLOYABLE_QNAME.getLocalPart(),
- new XAttr("composite", deployable.getName()));
- writeEnd(writer);
- }
-
- writeEndDocument(writer);
- }
-
- public void resolve(ContributionMetadata contribution, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve imports and exports
- for (Export export: contribution.getExports()) {
- extensionProcessor.resolve(export, resolver);
- }
- for (Import import_: contribution.getImports()) {
- extensionProcessor.resolve(import_, resolver);
- }
-
- // Resolve deployable composites
- List<Composite> deployables = contribution.getDeployables();
- for (int i = 0, n = deployables.size(); i < n; i++) {
- Composite deployable = deployables.get(i);
- Composite resolved = (Composite)resolver.resolveModel(Composite.class, deployable);
- if (resolved != deployable) {
- deployables.set(i, resolved);
- }
- }
-
- contribution.setUnresolved(false);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionModelResolver.java
deleted file mode 100644
index ddc768b61c..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionModelResolver.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.xml;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-
-/**
- * A Model Resolver for Contribution models.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionModelResolver implements ModelResolver {
-
- private Map<String, Contribution> map = new HashMap<String, Contribution>();
-
- public ContributionModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
- }
-
- public void addModel(Object resolved) {
- Contribution contribution = (Contribution)resolved;
- map.put(contribution.getURI(), contribution);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(((Contribution)resolved).getURI());
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
-
- // Lookup a contribution for the given URI
- String uri = ((Contribution)unresolved).getURI();
- if (uri != null) {
- Contribution resolved = (Contribution) map.get(uri);
- if (resolved != null) {
- return modelClass.cast(resolved);
- }
- return unresolved;
- } else {
-
- // If no URI was specified, just return the first contribution
- if (!map.isEmpty()) {
- Contribution resolved = map.values().iterator().next();
- return modelClass.cast(resolved);
- } else {
- return unresolved;
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index b69ea1e135..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.contribution.xml.ContributionMetadataProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#contribution,model=org.apache.tuscany.sca.contribution.ContributionMetadata
-org.apache.tuscany.sca.contribution.processor.xml.AnyElementProcessor;qname=http://www.w3.org/2001/XMLSchema#anyElement,model=java.lang.Object
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor
deleted file mode 100644
index b4a13295bc..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the attribute processor extension
-org.apache.tuscany.sca.contribution.processor.xml.AnyAttributeProcessor;qname=http://www.w3.org/2001/XMLSchema#anyAttribute,model=org.apache.tuscany.sca.assembly.Extension
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
deleted file mode 100644
index 23adab56b9..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.contribution.xml.ContributionMetadataDocumentProcessor;type=sca-contribution.xml,model=org.apache.tuscany.sca.contribution.ContributionMetadata
-org.apache.tuscany.sca.contribution.xml.ContributionGeneratedMetadataDocumentProcessor;type=sca-contribution-generated.xml
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
deleted file mode 100644
index 68030bf6e6..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.xml.ContributionModelResolver;model=org.apache.tuscany.sca.contribution.Contribution
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties b/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties
deleted file mode 100644
index 4827fd5e94..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/main/resources/contribution-xml-validation-messages.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-XMLStreamException = XMLStreamException occured due to : {0}
-IOException = IOException occured due to : {0}
-AttributeCompositeMissing = Attribute 'composite' is missing
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution-xml/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/contribution-xml/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java
deleted file mode 100644
index ddb660a139..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution-xml/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-
-import javax.xml.namespace.QName;
-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.ContributionMetadata;
-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.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test the contribution metadata processor.
- *
- * @version $Rev$ $Date$
- */
-
-public class ContributionMetadataProcessorTestCase {
-
- private static final String VALID_XML =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<contribution xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\">"
- + "<deployable composite=\"ns:Composite1\"/>"
- + "<deployable composite=\"ns:Composite2\"/>"
- + "</contribution>";
-
- private static final String INVALID_XML =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<contribution xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\">"
- + "<deployable composite=\"ns:Composite1\"/>"
- + "<deployable/>"
- + "</contribution>";
-
- private static XMLInputFactory inputFactory;
- private static XMLOutputFactory outputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static Monitor monitor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
-
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
-
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactory();
- if (monitorFactory != null) {
- monitor = monitorFactory.createMonitor();
- utilities.addUtility(monitorFactory);
- }
- StAXArtifactProcessorExtensionPoint staxProcessors =
- extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- }
-
- @Test
- public void testRead() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
- ContributionMetadata contribution = (ContributionMetadata)staxProcessor.read(reader);
- assertNotNull(contribution);
- assertEquals(2, contribution.getDeployables().size());
- }
-
- @Test
- public void testReadInvalid() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(INVALID_XML));
- /*try {
- staxProcessor.read(reader);
- fail("InvalidException should have been thrown");
- } catch (ContributionReadException e) {
- assertTrue(true);
- }*/
- staxProcessor.read(reader);
- Problem problem = monitor.getLastProblem();
- assertNotNull(problem);
- assertEquals("AttributeCompositeMissing", problem.getMessageId());
- }
-
- @Test
- public void testWrite() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
- ContributionMetadata contribution = (ContributionMetadata)staxProcessor.read(reader);
-
- validateContribution(contribution);
-
- //write the contribution metadata contents
- StringWriter stringWriter = new StringWriter();
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(stringWriter);
- staxProcessor.write(contribution, writer);
- stringWriter.close();
-
- reader = inputFactory.createXMLStreamReader(new StringReader(stringWriter.toString()));
- contribution = (ContributionMetadata)staxProcessor.read(reader);
-
- validateContribution(contribution);
- }
-
- private void validateContribution(ContributionMetadata contribution) {
- QName deployable;
-
- assertNotNull(contribution);
- assertEquals(2, contribution.getDeployables().size());
- deployable = new QName("http://ns", "Composite1");
- assertEquals(deployable, contribution.getDeployables().get(0).getName());
- deployable = new QName("http://ns", "Composite2");
- assertEquals(deployable, contribution.getDeployables().get(1).getName());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/LICENSE b/tags/java/sca/2.0-M1/modules/contribution/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/contribution/META-INF/MANIFEST.MF
deleted file mode 100644
index 171a437842..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,46 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.contribution.scanner;uses:="org
- .apache.tuscany.sca.contribution.processor,org.apache.tuscany.sca.ext
- ensibility";version="2.0.0",org.apache.tuscany.sca.contribution.resolve
- r;uses:="org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.core,
- org.apache.tuscany.sca.contribution,org.apache.tuscany.sca.extensibil
- ity";version="2.0.0",org.apache.tuscany.sca.contribution.processor;uses
- :="org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.core,org.ap
- ache.tuscany.sca.policy,org.apache.tuscany.sca.monitor,org.apache.tus
- cany.sca.extensibility,org.xml.sax,javax.xml.namespace,javax.xml.stre
- am,javax.xml.stream.util,javax.xml.transform,org.apache.tuscany.sca.c
- ontribution.resolver,javax.xml.transform.stream,javax.xml.validation,
- org.xml.sax.helpers";version="2.0.0",org.apache.tuscany.sca.contributio
- n;uses:="org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.contr
- ibution.resolver";version="2.0.0"
-Private-Package: org.apache.tuscany.sca.contribution.impl;version="1.4
- "
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Contribution Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397102546
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Contribution Model
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- javax.xml.stream.util,
- javax.xml.transform,
- javax.xml.transform.stream,
- javax.xml.validation,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.contribution.scanner;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.extensibility;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.xml.sax,
- org.xml.sax.helpers
-Bundle-SymbolicName: org.apache.tuscany.sca.contribution
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution/NOTICE b/tags/java/sca/2.0-M1/modules/contribution/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution/pom.xml b/tags/java/sca/2.0-M1/modules/contribution/pom.xml
deleted file mode 100644
index dce42d9ebd..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/pom.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-contribution</artifactId>
- <name>Apache Tuscany SCA Contribution Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!--
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0-2</version>
- </dependency>
- -->
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- <version>1.0.1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java
deleted file mode 100644
index 7400501d85..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-import org.apache.tuscany.sca.assembly.Base;
-
-
-/**
- * Represents an artifact in an SCA contribution.
- *
- * @version $Rev$ $Date$
- */
-public interface Artifact extends Base {
-
- /**
- * Returns the URI that unique identifies the artifact inside the contribution.
- *
- * @return The artifact URI
- */
- String getURI();
-
- /**
- * Sets the URI that uniquely identifies the artifact inside the contribution.
- *
- * @param uri The artifact URI
- */
- void setURI(String uri);
-
- /**
- * Returns the location of the artifact.
- *
- * @return The artifact location
- */
- String getLocation();
-
- /**
- * Set the location of the artifact.
- *
- * @param location The artifact location
- */
- void setLocation(String location);
-
-
- /**
- * Returns the in-memory model representing the artifact.
- *
- * @return The model object
- */
- Object getModel();
-
- /**
- * Sets the in-memory model representing the artifact.
- *
- * @param model The model object
- */
- void setModel(Object model);
-
- /**
- * Returns the contents of the artifact cached here.
- * @return the contents of the artifact
- */
- byte[] getContents();
-
- /**
- * Sets the contents of the artifact.
- * @param contents the contents of the artifact
- */
- void setContents(byte[] contents);
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Constants.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Constants.java
deleted file mode 100644
index 14131a9806..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Constants.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-/**
- * Constants used in SCA contribution.
- *
- * @version $Rev$ $Date$
- */
-public interface Constants {
- String XMLSCHEMA_NS = "http://www.w3.org/2001/XMLSchema";
-
- String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContentType.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContentType.java
deleted file mode 100644
index 81b0b08b9d..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContentType.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-/**
- * Constants for the main supported contribution package type.
- *
- * @version $Rev$ $Date$
- */
-@Deprecated
-public interface ContentType {
-
- /**
- * Java compressed contribution package
- */
- String JAR = "application/x-compressed";
-
- /**
- * Filesystem folder contribution package
- */
- String FOLDER = "application/vnd.tuscany.folder";
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Contribution.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Contribution.java
deleted file mode 100644
index cdf397a500..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Contribution.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * The representation of an SCA contribution.
- *
- * @version $Rev$ $Date$
- */
-public interface Contribution extends Artifact {
-
- /**
- * Default location of contribution metadata in an SCA contribution.
- */
- String SCA_CONTRIBUTION_META = "META-INF/sca-contribution.xml";
-
- /**
- * Default location of a generated contribution metadata in an SCA contribution.
- */
- String SCA_CONTRIBUTION_GENERATED_META = "META-INF/sca-contribution-generated.xml";
-
- /**
- * Returns a list of exports based on the contribution metadata.
- *
- * @return The list of exports in this contribution
- */
- List<Export> getExports();
-
- /**
- * Returns a list of imports based on the contribution metadata.
- *
- * @return The list of imports in this contribution
- */
- List<Import> getImports();
-
- /**
- * Returns the list of deployable composites in the contribution.
- *
- * @return The list of deployable composites
- */
- List<Composite> getDeployables();
-
- /**
- * Returns the list of artifacts in the contribution.
- *
- * @return The list of artifacts in the contribution
- */
- List<Artifact> getArtifacts();
-
- /**
- * Returns the model resolver for the models representing the artifacts
- * visible in the scope of this contribution.
- *
- * @return The model resolver
- */
- ModelResolver getModelResolver();
-
- /**
- * Sets the model resolver for the models representing the artifacts
- * visible in the scope of this contribution.
- *
- * @param modelResolver The model resolver
- */
- void setModelResolver(ModelResolver modelResolver);
-
- /**
- * Returns the list of contributions that this contribution depends on.
- *
- * @return
- */
- List<Contribution> getDependencies();
-
- /**
- * Returns the ClassLoader used to load classes and resources from
- * this contribution
- *
- * FIXME Remove this, the base contribution model should not depend
- * on Java ClassLoaders.
- *
- * @return The contribution ClassLoader
- */
- ClassLoader getClassLoader();
-
- /**
- * Sets the ClassLoader used to load classes and resources from
- * this contribution
- *
- * FIXME Remove this, the base contribution model should not depend
- * on Java ClassLoaders.
- *
- * @param classLoader the contribution class loader
- */
- void setClassLoader(ClassLoader classLoader);
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java
deleted file mode 100644
index 67c9a05a0b..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-
-/**
- * A factory for the contribution model.
- *
- * @version $Rev$ $Date$
- */
-public interface ContributionFactory {
-
- /**
- * Create a contribution model object
- *
- * @return The new contribution model object
- */
- Contribution createContribution();
-
- /**
- * Create a contribution metadata model object
- *
- * @return The new contribution metadata model object
- */
- ContributionMetadata createContributionMetadata();
-
- /**
- * Create a deployedArtifact model object
- *
- * @return The new deployedArtifact model object
- */
- @Deprecated
- DeployedArtifact createDeployedArtifact();
-
- /**
- * Create an artifact model object
- *
- * @return The new artifact model object
- */
- Artifact createArtifact();
-
- /**
- * Create a default import model object.
- *
- * @return the new default import model object
- */
- DefaultImport createDefaultImport();
-
- /**
- * Create a default export model object.
- *
- * @return the new default export model object
- */
- DefaultExport createDefaultExport();
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionMetadata.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionMetadata.java
deleted file mode 100644
index 4043fb9eda..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionMetadata.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Base;
-import org.apache.tuscany.sca.assembly.Composite;
-
-/**
- * The representation of SCA contribution metadata.
- *
- * @version $Rev$ $Date$
- */
-public interface ContributionMetadata extends Base {
-
- /**
- * Returns a list of exports based on the contribution metadata.
- *
- * @return The list of exports
- */
- List<Export> getExports();
-
- /**
- * Returns a list of imports based on the contribution metadata.
- *
- * @return The list of imports
- */
- List<Import> getImports();
-
- /**
- * Returns the list of deployable based on the contribution metadata.
- *
- * @return The list of deployable composites
- */
- List<Composite> getDeployables();
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultContributionFactory.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultContributionFactory.java
deleted file mode 100644
index 98954c288a..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultContributionFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-import org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl;
-
-
-/**
- * Default implementation of a contribution model factory.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultContributionFactory extends ContributionFactoryImpl {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultExport.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultExport.java
deleted file mode 100644
index b2eddb8336..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultExport.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-
-/**
- * The representation of an export that exports all artifacts in
- * a contribution.
- *
- * @version $Rev$ $Date$
- */
-public interface DefaultExport extends Export {
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultImport.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultImport.java
deleted file mode 100644
index 20798dcd17..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DefaultImport.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-
-/**
- * The representation of a default import that imports artifacts from
- * all contributions.
- *
- * @version $Rev$ $Date$
- */
-public interface DefaultImport extends Import {
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DeployedArtifact.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DeployedArtifact.java
deleted file mode 100644
index ffe190132c..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DeployedArtifact.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-/**
- * Representation of a deployed artifact
- *
- * @version $Rev$ $Date$
- */
-@Deprecated
-public interface DeployedArtifact extends Artifact {
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Export.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Export.java
deleted file mode 100644
index bfa16b1ce3..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Export.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * The representation of an export.
- *
- * @version $Rev$ $Date$
- */
-public interface Export {
-
- /**
- * Returns the model resolver for the models representing artifacts
- * made available by this export.
- *
- * @return The model resolver
- */
- ModelResolver getModelResolver();
-
- /**
- * Sets the model resolver for the models representing artifacts
- * made available by this export.
- *
- * @param modelResolver
- */
- void setModelResolver(ModelResolver modelResolver);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Import.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Import.java
deleted file mode 100644
index 35076f55a7..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Import.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-
-/**
- * The representation of an import.
- *
- * @version $Rev$ $Date$
- */
-public interface Import {
-
- /**
- * Returns the model resolver for the models representing artifacts
- * made available by this import.
- *
- * @return The model resolver
- */
- ModelResolver getModelResolver();
-
- /**
- * Sets the model resolver for the models representing artifacts
- * made available by this import.
- *
- * @param modelResolver The model resolver
- */
- void setModelResolver(ModelResolver modelResolver);
-
- /**
- * Verify that a specific export actually exports what is being imported.
- *
- * @param export The Exported being verified
- * @return true/false
- */
- boolean match(Export export);
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/PackageType.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/PackageType.java
deleted file mode 100644
index 26833bb4c0..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/PackageType.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution;
-
-/**
- * Constants for the main supported contribution package types.
- *
- * @version $Rev$ $Date$
- */
-public interface PackageType {
-
- /**
- * Java compressed contribution package
- */
- String JAR = "application/x-compressed";
-
- /**
- * Zip archive contribution package
- */
- String ZIP = "application/x-compressed";
-
- /**
- * Filesystem folder contribution package
- */
- String FOLDER = "application/vnd.tuscany.folder";
-
-
- String BUNDLE = "application/osgi.bundle";
-
- /**
- * Java EE Web Application Archive
- */
- String WAR = "application/war";
-
- /**
- * Java EE Enterprise Application Archive
- */
- String EAR = "application/ear";
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java
deleted file mode 100644
index 881987f622..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.impl;
-
-import org.apache.tuscany.sca.contribution.Artifact;
-
-
-/**
- * The model representing an artifact in a contribution.
- *
- * @version $Rev$ $Date$
- */
-class ArtifactImpl implements Artifact {
- private String uri;
- private String location;
- private Object model;
- private boolean unresolved;
- private byte[] contents;
-
- ArtifactImpl() {
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public Object getModel() {
- return model;
- }
-
- public void setModel(Object model) {
- this.model = model;
- }
-
- public byte[] getContents() {
- return contents;
- }
-
- public void setContents(byte[] contents) {
- this.contents = contents;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- @Override
- public int hashCode() {
- return uri.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else {
- if (obj instanceof Artifact) {
- return uri.equals(((Artifact)obj).getURI());
- } else {
- return false;
- }
- }
- }
-
- @Override
- public String toString() {
- return "Artifact:" + uri + "\n" +
- "at: " + location;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java
deleted file mode 100644
index c678c2eaef..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.impl;
-
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.ContributionMetadata;
-import org.apache.tuscany.sca.contribution.DefaultExport;
-import org.apache.tuscany.sca.contribution.DefaultImport;
-import org.apache.tuscany.sca.contribution.DeployedArtifact;
-
-
-/**
- * Default implementation of a contribution model factory.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionFactoryImpl implements ContributionFactory {
-
- protected ContributionFactoryImpl() {
- }
-
- public Contribution createContribution() {
- return new ContributionImpl();
- }
-
- public ContributionMetadata createContributionMetadata() {
- return new ContributionMetadataImpl();
- }
-
- public Artifact createArtifact() {
- return new ArtifactImpl();
- }
-
- public DefaultExport createDefaultExport() {
- return new DefaultExportImpl();
- }
-
- public DefaultImport createDefaultImport() {
- return new DefaultImportImpl();
- }
-
- @Deprecated
- public DeployedArtifact createDeployedArtifact() {
- class DeployedArtifactImpl extends ArtifactImpl implements DeployedArtifact {
- }
- return new DeployedArtifactImpl();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java
deleted file mode 100644
index 0b41016caa..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-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;
-
-/**
- * The representation of a deployed contribution
- *
- * @version $Rev$ $Date$
- */
-class ContributionImpl implements Contribution {
- private String uri;
- private String location;
- private Object model;
- private byte[] contents;
- private boolean unresolved;
- private List<Export> exports = new ArrayList<Export>();
- private List<Import> imports = new ArrayList<Import>();
- private List<Composite> deployables = new ArrayList<Composite>();
- private List<Artifact> artifacts = new ArrayList<Artifact>();
- private List<Contribution> dependencies = new ArrayList<Contribution>();
- private ModelResolver modelResolver;
-
- // FIXME remove this dependency on Java ClassLoaders
- private ClassLoader classLoader;
-
- ContributionImpl() {
- }
-
- public String getLocation() {
- return this.location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- //FIXME Remove dependency on Java ClassLoaders
- public ClassLoader getClassLoader() {
- return classLoader;
- }
-
- //FIXME Remove dependency on Java ClassLoaders
- public void setClassLoader(ClassLoader classLoader) {
- this.classLoader = classLoader;
- }
-
-
- public String getURI() {
- return this.uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public Object getModel() {
- return model;
- }
-
- public void setModel(Object model) {
- this.model = model;
- }
-
- public byte[] getContents() {
- return contents;
- }
-
- public void setContents(byte[] contents) {
- this.contents = contents;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
- public List<Contribution> getDependencies() {
- return dependencies;
- }
-
- public List<Export> getExports() {
- return exports;
- }
-
- public List<Import> getImports() {
- return imports;
- }
-
- public List<Composite> getDeployables() {
- return deployables;
- }
-
- public List<Artifact> getArtifacts() {
- return artifacts;
- }
-
- @Override
- public int hashCode() {
- return uri.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else {
- if (obj instanceof Artifact) {
- return uri.equals(((Artifact)obj).getURI());
- } else {
- return false;
- }
- }
- }
-
- @Override
- public String toString() {
- return "Contribution : " + uri + " \n" +
- "from: " + location;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionMetadataImpl.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionMetadataImpl.java
deleted file mode 100644
index 75b12b1260..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionMetadataImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.ContributionMetadata;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.Import;
-
-/**
- * The representation of a deployed contribution
- *
- * @version $Rev$ $Date$
- */
-class ContributionMetadataImpl implements ContributionMetadata {
- private boolean unresolved;
- private List<Export> exports = new ArrayList<Export>();
- private List<Import> imports = new ArrayList<Import>();
- private List<Composite> deployables = new ArrayList<Composite>();
-
- ContributionMetadataImpl() {
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public List<Export> getExports() {
- return exports;
- }
-
- public List<Import> getImports() {
- return imports;
- }
-
- public List<Composite> getDeployables() {
- return deployables;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/DefaultExportImpl.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/DefaultExportImpl.java
deleted file mode 100644
index e67395337a..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/DefaultExportImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.impl;
-
-import org.apache.tuscany.sca.contribution.DefaultExport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * The representation of an export for the contribution
- *
- * @version $Rev$ $Date$
- */
-public class DefaultExportImpl implements DefaultExport {
- private ModelResolver modelResolver;
-
- protected DefaultExportImpl() {
- super();
- }
-
- public ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/DefaultImportImpl.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/DefaultImportImpl.java
deleted file mode 100644
index 17c09f2cbc..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/impl/DefaultImportImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.impl;
-
-import org.apache.tuscany.sca.contribution.DefaultExport;
-import org.apache.tuscany.sca.contribution.DefaultImport;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * The representation of an import for the contribution
- *
- * @version $Rev$ $Date$
- */
-public class DefaultImportImpl implements DefaultImport {
- private ModelResolver modelResolver;
-
- protected DefaultImportImpl() {
- super();
- }
-
- public ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
-
- public boolean match(Export export) {
- if (export instanceof DefaultExport) {
- return true;
- }
- return false;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessor.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessor.java
deleted file mode 100644
index 5be0b188f4..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * Base interface for artifact processors.
- *
- * @version $Rev$ $Date$
- */
-public interface ArtifactProcessor<M> {
-
- /**
- * Resolve references from this model to other models. For example references
- * from a composite to another one, or references from a composite to a WSDL
- * model.
- *
- * @param model The model to resolve
- * @param resolver The resolver to use to resolve referenced models
- */
- void resolve(M model, ModelResolver resolver) throws ContributionResolveException;
-
- /**
- * Returns the type of model handled by this artifact processor.
- *
- * @return The type of model handled by this artifact processor
- */
- Class<M> getModelType();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessorExtensionPoint.java
deleted file mode 100644
index 029df61f0f..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessorExtensionPoint.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-/**
- * An extension point for artifact processors.
- *
- * @version $Rev$ $Date$
- */
-public interface ArtifactProcessorExtensionPoint<P extends ArtifactProcessor> {
-
- /**
- * Add an artifact processor.
- *
- * @param artifactProcessor The artifact processor to add
- */
- void addArtifactProcessor(P artifactProcessor);
-
- /**
- * Remove an artifact processor.
- *
- * @param artifactProcessor The artifact processor to remove
- */
- void removeArtifactProcessor(P artifactProcessor);
-
- /**
- * Returns the processor associated with the given artifact type.
- *
- * @param artifactType An artifact type
- * @return The processor associated with the given artifact type
- */
- P getProcessor(Object artifactType);
-
- /**
- * Returns the processor associated with the given model type.
- *
- * @param modelType A model type
- * @return The processor associated with the given model type
- */
- P getProcessor(Class<?> modelType);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
deleted file mode 100644
index f23797a831..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.NamespaceContext;
-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;
-
-
-/**
- * A base class with utility methods for the other artifact processors in this module.
- *
- * @version $Rev$ $Date$
- */
-public abstract class BaseStAXArtifactProcessor {
-
- /**
- * Returns a QName from a string.
- * @param reader
- * @param value
- * @return
- */
- protected QName getQNameValue(XMLStreamReader reader, String value) {
- if (value != null) {
- int index = value.indexOf(':');
- String prefix = index == -1 ? "" : value.substring(0, index);
- String localName = index == -1 ? value : value.substring(index + 1);
- String ns = reader.getNamespaceContext().getNamespaceURI(prefix);
- if (ns == null) {
- ns = "";
- }
- return new QName(ns, localName, prefix);
- } else {
- return null;
- }
- }
-
- /**
- * Returns the boolean value of an attribute.
- * @param reader
- * @param name
- * @return
- */
- protected boolean getBoolean(XMLStreamReader reader, String name) {
- String value = reader.getAttributeValue(null, name);
- if (value == null) {
- return false;
- }
- return Boolean.valueOf(value);
- }
-
- /**
- * Returns the QName value of an attribute.
- * @param reader
- * @param name
- * @return
- */
- protected QName getQName(XMLStreamReader reader, String name) {
- String qname = reader.getAttributeValue(null, name);
- return getQNameValue(reader, qname);
- }
-
- /**
- * Returns the value of an attribute as a list of QNames.
- * @param reader
- * @param name
- * @return
- */
- protected List<QName> getQNames(XMLStreamReader reader, String name) {
- String value = reader.getAttributeValue(null, name);
- if (value != null) {
- List<QName> qnames = new ArrayList<QName>();
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- qnames.add(getQName(reader, tokens.nextToken()));
- }
- return qnames;
- } else {
- return Collections.emptyList();
- }
- }
-
- /**
- * Returns the string value of an attribute.
- * @param reader
- * @param name
- * @return
- */
- protected String getString(XMLStreamReader reader, String name) {
- return reader.getAttributeValue(null, name);
- }
-
- /**
- * Test if an attribute is explicitly set
- * @param reader
- * @param name
- * @return
- */
- protected boolean isSet(XMLStreamReader reader, String name) {
- return reader.getAttributeValue(null, name) != null;
- }
-
- /**
- * Returns the value of xsi:type attribute
- * @param reader The XML stream reader
- * @return The QName of the type, if the attribute is not present, null is
- * returned.
- */
- protected QName getXSIType(XMLStreamReader reader) {
- String qname = reader.getAttributeValue(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "type");
- return getQNameValue(reader, qname);
- }
-
- /**
- * Parse the next child element.
- * @param reader
- * @return
- * @throws XMLStreamException
- */
- protected boolean nextChildElement(XMLStreamReader reader) throws XMLStreamException {
- while (reader.hasNext()) {
- int event = reader.next();
- if (event == END_ELEMENT) {
- return false;
- }
- if (event == START_ELEMENT) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Advance the stream to the next END_ELEMENT event skipping any nested
- * content.
- * @param reader the reader to advance
- * @throws XMLStreamException if there was a problem reading the stream
- */
- protected void skipToEndElement(XMLStreamReader reader) throws XMLStreamException {
- int depth = 0;
- while (reader.hasNext()) {
- int event = reader.next();
- if (event == XMLStreamConstants.START_ELEMENT) {
- depth++;
- } else if (event == XMLStreamConstants.END_ELEMENT) {
- if (depth == 0) {
- return;
- }
- depth--;
- }
- }
- }
-
- /**
- *
- * @param writer
- * @param uri
- * @throws XMLStreamException
- */
- private String writeElementPrefix(XMLStreamWriter writer, String uri) throws XMLStreamException {
- if (uri == null) {
- return null;
- }
- String prefix = writer.getPrefix(uri);
- if (prefix != null) {
- return null;
- } else {
-
- // Find an available prefix and bind it to the given URI
- NamespaceContext nsc = writer.getNamespaceContext();
- for (int i=1; ; i++) {
- prefix = "ns" + i;
- if (nsc.getNamespaceURI(prefix) == null) {
- break;
- }
- }
- writer.setPrefix(prefix, uri);
- return prefix;
- }
-
- }
-
- /**
- * Start an element.
- * @param uri
- * @param name
- * @param attrs
- * @throws XMLStreamException
- */
- protected void writeStart(XMLStreamWriter writer, String uri, String name, XAttr... attrs) throws XMLStreamException {
- String prefix = writeElementPrefix(writer, uri);
- writer.writeStartElement(uri, name);
- if (prefix != null){
- writer.writeNamespace(prefix,uri);
- }
- writeAttributePrefixes(writer, attrs);
- writeAttributes(writer, attrs);
- }
-
- /**
- * Start an element.
- * @param qname
- * @param attrs
- * @throws XMLStreamException
- */
- protected void writeStart(XMLStreamWriter writer, QName qname, XAttr... attrs) throws XMLStreamException {
- writeStart(writer, qname.getNamespaceURI(), qname.getLocalPart(), attrs);
- }
-
- /**
- * End an element.
- * @param writer
- * @throws XMLStreamException
- */
- protected void writeEnd(XMLStreamWriter writer) throws XMLStreamException {
- writer.writeEndElement();
- }
-
- /**
- * Start a document.
- * @param writer
- * @throws XMLStreamException
- */
- protected void writeStartDocument(XMLStreamWriter writer, String uri, String name, XAttr... attrs) throws XMLStreamException {
- writer.writeStartDocument();
- writer.setDefaultNamespace(uri);
- writeStart(writer, uri, name, attrs);
- writer.writeDefaultNamespace(uri);
- }
-
- /**
- * Start a document.
- * @param writer
- * @param qname
- * @param attrs
- * @throws XMLStreamException
- */
- protected void writeStartDocument(XMLStreamWriter writer, QName qname, XAttr... attrs) throws XMLStreamException {
- writeStartDocument(writer, qname.getNamespaceURI(), qname.getLocalPart(), attrs);
- }
-
- /**
- * End a document.
- * @param writer
- * @throws XMLStreamException
- */
- protected void writeEndDocument(XMLStreamWriter writer) throws XMLStreamException {
- writer.writeEndDocument();
- }
-
- /**
- * Write attributes to the current element.
- * @param writer
- * @param attrs
- * @throws XMLStreamException
- */
- protected void writeAttributes(XMLStreamWriter writer, XAttr... attrs) throws XMLStreamException {
- for (XAttr attr : attrs) {
- if (attr != null)
- attr.write(writer);
- }
- }
-
- /**
- * Write attribute prefixes to the current element.
- * @param writer
- * @param attrs
- * @throws XMLStreamException
- */
- protected void writeAttributePrefixes(XMLStreamWriter writer, XAttr... attrs) throws XMLStreamException {
- for (XAttr attr : attrs) {
- if (attr != null)
- attr.writePrefix(writer);
- }
- }
-
- /**
- * Represents an XML attribute that needs to be written to a document.
- */
- public static class XAttr {
-
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
-
- private String uri = SCA10_NS;
- private String name;
- private Object value;
-
- public XAttr(String uri, String name, String value) {
- this.uri = uri;
- this.name = name;
- this.value = value;
- }
-
- public XAttr(String name, String value) {
- this(null, name, value);
- }
-
- public XAttr(String uri, String name, List<?> values) {
- this.uri = uri;
- this.name = name;
- this.value = values;
- }
-
- public XAttr(String name, List<?> values) {
- this(null, name, values);
- }
-
- public XAttr(String uri, String name, Boolean value) {
- this.uri = uri;
- this.name = name;
- this.value = value;
- }
-
- public XAttr(String name, Boolean value) {
- this(null, name, value);
- }
-
- public XAttr(String uri, String name, Integer value) {
- this.uri = uri;
- this.name = name;
- this.value = value;
- }
-
- public XAttr(String name, Integer value) {
- this(null, name, value);
- }
-
- public XAttr(String uri, String name, Double value) {
- this.uri = uri;
- this.name = name;
- this.value = value;
- }
-
- public XAttr(String name, Double value) {
- this(null, name, value);
- }
-
- public XAttr(String uri, String name, QName value) {
- this.uri = uri;
- this.name = name;
- this.value = value;
- }
-
- public XAttr(String name, QName value) {
- this(null, name, value);
- }
-
- /**
- * Writes a string from a QName and registers a prefix for its namespace.
- * @param reader
- * @param value
- * @return
- */
- private String writeQNameValue(XMLStreamWriter writer, QName qname) throws XMLStreamException {
- if (qname != null) {
- String prefix = qname.getPrefix();
- String uri = qname.getNamespaceURI();
- prefix = writer.getPrefix(uri);
- if (prefix != null) {
-
- // Use the prefix already bound to the given URI
- if (prefix.length() > 0) {
- return prefix + ":" + qname.getLocalPart();
- } else {
-
- // Empty prefix, just return the local part of the given qname
- return qname.getLocalPart();
- }
-
- } else {
-
- // Find an available prefix and bind it to the given URI
- NamespaceContext nsc = writer.getNamespaceContext();
- for (int i=1; ; i++) {
- prefix = "ns" + i;
- if (nsc.getNamespaceURI(prefix) == null) {
- break;
- }
- }
- writer.setPrefix(prefix, uri);
- writer.writeNamespace(prefix, uri);
- return prefix + ":" + qname.getLocalPart();
- }
- } else {
- return null;
- }
- }
-
- /**
- * Registers a prefix for the namespace of a QName.
- * @param reader
- * @param value
- * @return
- */
- private void writeQNamePrefix(XMLStreamWriter writer, QName qname) throws XMLStreamException {
- if (qname != null) {
- String prefix = qname.getPrefix();
- String uri = qname.getNamespaceURI();
- prefix = writer.getPrefix(uri);
- if (prefix != null) {
- return;
- } else {
-
- // Find an available prefix and bind it to the given URI
- NamespaceContext nsc = writer.getNamespaceContext();
- for (int i=1; ; i++) {
- prefix = "ns" + i;
- if (nsc.getNamespaceURI(prefix) == null) {
- break;
- }
- }
- writer.setPrefix(prefix, uri);
- writer.writeNamespace(prefix, uri);
- }
- }
- }
-
- /**
- * Write to document
- * @param writer
- * @throws XMLStreamException
- */
- public void write(XMLStreamWriter writer) throws XMLStreamException {
- String str;
- if (value instanceof QName) {
-
- // Write a QName
- str = writeQNameValue(writer, (QName)value);
-
- } else if (value instanceof List) {
-
- // Write a list of values
- List<?> values = (List<?>)value;
- if (values.isEmpty()) {
- return;
- }
- StringBuffer buffer = new StringBuffer();
- for (Object v: values) {
- if (v == null) {
- // Skip null values
- continue;
- }
-
- if (v instanceof XAttr) {
- // Write an XAttr value
- ((XAttr)v).write(writer);
- continue;
- }
-
- if (buffer.length() != 0) {
- buffer.append(' ');
- }
- if (v instanceof QName) {
- // Write a QName value
- buffer.append(writeQNameValue(writer, (QName)v));
- } else {
- // Write value as a string
- buffer.append(String.valueOf(v));
- }
- }
- str = buffer.toString();
-
- } else {
-
- // Write a string
- if (value == null) {
- return;
- }
- str = String.valueOf(value);
- }
- if (str.length() == 0) {
- return;
- }
-
- // Write the attribute
- if (uri != null && !uri.equals(SCA10_NS)) {
- writer.writeAttribute(uri, name, str);
- } else {
- writer.writeAttribute(name,str);
- }
- }
-
- /**
- * Registers a prefix for the namespace of a QName or list of QNames
- * @param writer
- * @throws XMLStreamException
- */
- public void writePrefix(XMLStreamWriter writer) throws XMLStreamException {
- if (value instanceof QName) {
-
- // Write prefix for a single QName value
- writeQNamePrefix(writer, (QName)value);
-
- } else if (value instanceof List) {
-
- // Write prefixes for a list of values
- for (Object v: (List<?>)value) {
- if (v instanceof QName) {
- // Write prefix for a QName value
- writeQNamePrefix(writer, (QName)v);
-
- } else if (v instanceof XAttr) {
- // Write prefix for an XAttr value
- ((XAttr)v).writePrefix(writer);
- }
- }
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionException.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionException.java
deleted file mode 100644
index 3b99eba586..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-/**
- * Base class for exceptions raised by contribution services.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionException extends Exception {
-
- private static final long serialVersionUID = 4432880414927652578L;
-
- protected ContributionException() {
- super();
- }
-
- protected ContributionException(String message) {
- super(message);
- }
-
- protected ContributionException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ContributionException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionReadException.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionReadException.java
deleted file mode 100644
index 6fd7d0c91e..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionReadException.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-
-/**
- * Denotes an exception while reading artifacts inside an SCA contribution.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionReadException extends ContributionException {
- public static final int UNDEFINED = -1;
- private static final long serialVersionUID = -7459051598906813461L;
- private String resourceURI;
- private int line = UNDEFINED;
- private int column = UNDEFINED;
-
- public ContributionReadException(String message) {
- super(message);
- }
-
- public ContributionReadException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ContributionReadException(Throwable cause) {
- super(cause);
- }
-
- /**
- * Returns the location of the resource that was being read.
- *
- * @return the location of the resource that was being read
- */
- public String getResourceURI() {
- return resourceURI;
- }
-
- /**
- * Sets the location of the resource that was being read.
- *
- * @param resourceURI the location of the resource that was being read
- */
- public void setResourceURI(String resourceURI) {
- this.resourceURI = resourceURI;
- }
-
- /**
- * Returns the line inside the resource that was being read.
- * @return the line inside the resource that was being read
- */
- public int getLine() {
- return line;
- }
-
- /**
- * Sets the line inside the resource that was being read.
- * @param line the line inside the resource that was being read
- */
- public void setLine(int line) {
- this.line = line;
- }
-
- /**
- * Returns the column inside the resource that was being read.
- * @return the column inside the resource that was being read
- */
- public int getColumn() {
- return column;
- }
-
- /**
- * Sets the column inside the resource that was being read.
- * @param column the column inside the resource that was being read
- */
- public void setColumn(int column) {
- this.column = column;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionResolveException.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionResolveException.java
deleted file mode 100644
index fe1a09d398..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionResolveException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-
-/**
- * Denotes a problem while resolving models inside an SCA contribution.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionResolveException extends ContributionException {
- private static final long serialVersionUID = -7459051598906813461L;
-
- public ContributionResolveException(String message) {
- super(message);
- }
-
- public ContributionResolveException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ContributionResolveException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionRuntimeException.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionRuntimeException.java
deleted file mode 100644
index 0039dd9f8b..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionRuntimeException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-/**
- * Base class for runtime exceptions raised by contribution services.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionRuntimeException extends RuntimeException {
- private static final long serialVersionUID = 7711215366287498896L;
-
- protected ContributionRuntimeException() {
- super();
- }
-
- protected ContributionRuntimeException(String message) {
- super(message);
- }
-
- protected ContributionRuntimeException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ContributionRuntimeException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionWriteException.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionWriteException.java
deleted file mode 100644
index 286c9dc791..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionWriteException.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-
-
-/**
- * Denotes an exception while writing artifacts inside an SCA contribution.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionWriteException extends ContributionException {
- private static final long serialVersionUID = -7459051598906813461L;
- private String resourceURI;
-
- public ContributionWriteException(String message) {
- super(message);
- }
-
- public ContributionWriteException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ContributionWriteException(Throwable cause) {
- super(cause);
- }
-
- /**
- * Returns the location of the resource that was being written.
- *
- * @return the location of the resource that was being written
- */
- public String getResourceURI() {
- return resourceURI;
- }
-
- /**
- * Sets the location of the resource that was being written.
- *
- * @param resourceURI the location of the resource that was being written
- */
- public void setResourceURI(String resourceURI) {
- this.resourceURI = resourceURI;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java
deleted file mode 100644
index 3c67a8c550..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The default implementation of an artifact processor extension point.
- *
- * @version $Rev$ $Date$
- */
-abstract class DefaultArtifactProcessorExtensionPoint<P> {
- protected final Map<Object, P> processorsByArtifactType = new HashMap<Object, P>();
- protected final Map<Class<?>, P> processorsByModelType = new HashMap<Class<?>, P>();
-
- /**
- * Constructs a new loader registry.
- */
- DefaultArtifactProcessorExtensionPoint() {
- }
-
- /**
- * Returns the processor associated with the given artifact type.
- *
- * @param artifactType An artifact type
- * @return The processor associated with the given artifact type
- */
- public P getProcessor(Object artifactType) {
- return processorsByArtifactType.get(artifactType);
- }
-
- /**
- * Returns the processor associated with the given model type.
- *
- * @param modelType A model type
- * @return The processor associated with the given model type
- */
- public P getProcessor(Class<?> modelType) {
- Class<?>[] classes = modelType.getInterfaces();
- for (Class<?> c : classes) {
- P processor = processorsByModelType.get(c);
- if (processor != null) {
- return processor;
- }
- }
- return processorsByModelType.get(modelType);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java
deleted file mode 100644
index ef23778ea3..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.util.Map;
-import java.util.Set;
-
-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 javax.xml.stream.XMLStreamWriter;
-
-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.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * The default implementation of an extension point for StAX artifact processors.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultStAXArtifactProcessorExtensionPoint extends
- DefaultArtifactProcessorExtensionPoint<StAXArtifactProcessor> implements StAXArtifactProcessorExtensionPoint {
-
- private ExtensionPointRegistry extensionPoints;
- private FactoryExtensionPoint modelFactories;
- private MonitorFactory monitorFactory;
- private boolean loaded;
- private StAXArtifactProcessor<Object> extensibleStAXProcessor;
- private StAXAttributeProcessor<Object> extensibleStAXAttributeProcessor;
- private Monitor monitor = null;
-
- /**
- * Constructs a new extension point.
- */
- public DefaultStAXArtifactProcessorExtensionPoint(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
- this.modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- XMLOutputFactory outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
- UtilityExtensionPoint utilities = this.extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- if (monitorFactory != null)
- this.monitor = monitorFactory.createMonitor();
- this.extensibleStAXProcessor = new ExtensibleStAXArtifactProcessor(this, inputFactory, outputFactory, this.monitor);
-
- StAXAttributeProcessorExtensionPoint attributeExtensionPoint = extensionPoints.getExtensionPoint(StAXAttributeProcessorExtensionPoint.class);
- this.extensibleStAXAttributeProcessor = new ExtensibleStAXAttributeProcessor(attributeExtensionPoint ,inputFactory, outputFactory, this.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(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- public void addArtifactProcessor(StAXArtifactProcessor artifactProcessor) {
- if (artifactProcessor.getArtifactType() != null) {
- processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor);
- }
- if (artifactProcessor.getModelType() != null) {
- processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor);
- }
- }
-
- public void removeArtifactProcessor(StAXArtifactProcessor artifactProcessor) {
- if (artifactProcessor.getArtifactType() != null) {
- processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType());
- }
- if (artifactProcessor.getModelType() != null) {
- processorsByModelType.remove(artifactProcessor.getModelType());
- }
- }
-
- @Override
- public StAXArtifactProcessor getProcessor(Class<?> modelType) {
- loadArtifactProcessors();
- return super.getProcessor(modelType);
- }
-
- @Override
- public StAXArtifactProcessor getProcessor(Object artifactType) {
- loadArtifactProcessors();
- return super.getProcessor(artifactType);
- }
-
- /**
- * Returns a QName object from a QName expressed as {ns}name
- * or ns#name.
- *
- * @param qname
- * @return
- */
- private static QName getQName(String qname) {
- if (qname == null) {
- return null;
- }
- qname = qname.trim();
- if (qname.startsWith("{")) {
- int h = qname.indexOf('}');
- if (h != -1) {
- return new QName(qname.substring(1, h), qname.substring(h + 1));
- }
- } else {
- int h = qname.indexOf('#');
- if (h != -1) {
- return new QName(qname.substring(0, h), qname.substring(h + 1));
- }
- }
- throw new IllegalArgumentException("Invalid qname: "+qname);
- }
-
- /**
- * Lazily load artifact processors registered in the extension point.
- */
- private void loadArtifactProcessors() {
- if (loaded)
- return;
-
- // Get the processor service declarations
- Set<ServiceDeclaration> processorDeclarations;
- try {
- processorDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(StAXArtifactProcessor.class.getName());
- } catch (IOException e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", extensibleStAXProcessor, ie);
- throw ie;
- }
-
- for (ServiceDeclaration processorDeclaration : processorDeclarations) {
- Map<String, String> attributes = processorDeclaration.getAttributes();
-
- // Load a StAX artifact processor
-
- // Get the model QName
- QName artifactType = getQName(attributes.get("qname"));
-
- // Get the model class name
- String modelTypeName = attributes.get("model");
-
- // Get the model factory class name
- String factoryName = attributes.get("factory");
-
- // Create a processor wrapper and register it
- StAXArtifactProcessor processor =
- new LazyStAXArtifactProcessor(artifactType, modelTypeName, factoryName,
- processorDeclaration, extensionPoints, modelFactories,
- extensibleStAXProcessor,extensibleStAXAttributeProcessor, monitor);
- addArtifactProcessor(processor);
- }
-
- loaded = true;
- }
-
- /**
- * A wrapper around an Artifact processor class allowing lazy loading and
- * initialization of artifact processors.
- */
- private static class LazyStAXArtifactProcessor implements StAXArtifactProcessor {
-
- private ExtensionPointRegistry extensionPoints;
- private QName artifactType;
- private String modelTypeName;
- private String factoryName;
- private ServiceDeclaration processorDeclaration;
- private StAXArtifactProcessor processor;
- private Class<?> modelType;
- private StAXArtifactProcessor<Object> extensionProcessor;
- private StAXAttributeProcessor<Object> extensionAttributeProcessor;
- private Monitor monitor;
-
- LazyStAXArtifactProcessor(QName artifactType,
- String modelTypeName,
- String factoryName,
- ServiceDeclaration processorDeclaration,
- ExtensionPointRegistry extensionPoints,
- FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor<Object> extensionProcessor,
- StAXAttributeProcessor<Object> extensionAttributeProcessor,
- Monitor monitor) {
-
- this.extensionPoints = extensionPoints;
- this.artifactType = artifactType;
- this.modelTypeName = modelTypeName;
- this.factoryName = factoryName;
- this.processorDeclaration = processorDeclaration;
- this.extensionProcessor = extensionProcessor;
- this.extensionAttributeProcessor = extensionAttributeProcessor;
- this.monitor = monitor;
- }
-
- public QName getArtifactType() {
- return artifactType;
- }
-
- private void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- @SuppressWarnings("unchecked")
- private StAXArtifactProcessor getProcessor() {
- if (processor == null) {
-
- if (processorDeclaration.getClassName()
- .equals("org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor")) {
-
- // Specific initialization for the DefaultBeanModelProcessor
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- try {
- Class<StAXArtifactProcessor> processorClass =
- (Class<StAXArtifactProcessor>)processorDeclaration.loadClass();
- Object modelFactory;
- if (factoryName != null) {
- Class<?> factoryClass = (Class<?>)processorDeclaration.loadClass(factoryName);
- modelFactory = modelFactories.getFactory(factoryClass);
- } else {
- modelFactory = null;
- }
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(FactoryExtensionPoint.class,
- QName.class,
- Class.class,
- Object.class,
- Monitor.class);
- processor =
- constructor.newInstance(modelFactories,
- artifactType,
- getModelType(),
- modelFactory,
- monitor);
- } catch (Exception e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", processor, ie);
- throw ie;
- }
- } else {
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
-
- // Load and instantiate the processor class
- try {
- Class<StAXArtifactProcessor> processorClass =
- (Class<StAXArtifactProcessor>)processorDeclaration.loadClass();
- try {
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(FactoryExtensionPoint.class, Monitor.class);
- processor = constructor.newInstance(modelFactories, monitor);
- } catch (NoSuchMethodException e) {
- try {
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(ExtensionPointRegistry.class, Monitor.class);
- processor = constructor.newInstance(extensionPoints, monitor);
- } catch (NoSuchMethodException e1) {
- try {
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class, Monitor.class);
- processor = constructor.newInstance(modelFactories, extensionProcessor, monitor);
- } catch (NoSuchMethodException e2) {
- try {
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class, StAXAttributeProcessor.class, Monitor.class);
- processor = constructor.newInstance(modelFactories, extensionProcessor, extensionAttributeProcessor, monitor);
- } catch (NoSuchMethodException e2a) {
- try {
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class, Monitor.class);
- processor = constructor.newInstance(extensionPoints, extensionProcessor, monitor);
- } catch (NoSuchMethodException e3) {
- try {
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class, StAXAttributeProcessor.class, Monitor.class);
- processor = constructor.newInstance(extensionPoints, extensionProcessor, extensionAttributeProcessor, monitor);
- } catch (NoSuchMethodException e3a) {
-
- try {
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(FactoryExtensionPoint.class);
- processor = constructor.newInstance(modelFactories);
- } catch (NoSuchMethodException e4) {
- try {
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(ExtensionPointRegistry.class);
- processor = constructor.newInstance(extensionPoints);
- } catch (NoSuchMethodException e4a) {
- try {
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class);
- processor = constructor.newInstance(modelFactories, extensionProcessor);
- } catch (NoSuchMethodException e5) {
- Constructor<StAXArtifactProcessor> constructor =
- processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class);
- processor = constructor.newInstance(extensionPoints, extensionProcessor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- } catch (Exception e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", processor, ie);
- throw ie;
- }
- }
- }
- return processor;
- }
-
- public Object read(XMLStreamReader inputSource) throws ContributionReadException, XMLStreamException {
- return getProcessor().read(inputSource);
- }
-
- @SuppressWarnings("unchecked")
- public void write(Object model, XMLStreamWriter outputSource) throws ContributionWriteException,
- XMLStreamException {
- getProcessor().write(model, outputSource);
- }
-
- public Class<?> getModelType() {
- if (modelTypeName != null && modelType == null) {
- try {
- modelType = processorDeclaration.loadClass(modelTypeName);
- } catch (Exception e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", processorDeclaration, ie);
- throw ie;
- }
- }
- return modelType;
- }
-
- @SuppressWarnings("unchecked")
- public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException {
- getProcessor().resolve(model, resolver);
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXAttributeProcessorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXAttributeProcessorExtensionPoint.java
deleted file mode 100644
index bd38a609a6..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXAttributeProcessorExtensionPoint.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.util.Map;
-import java.util.Set;
-
-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 javax.xml.stream.XMLStreamWriter;
-
-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.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * The default implementation of an extension point for StAX artifact processors.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultStAXAttributeProcessorExtensionPoint extends
- DefaultArtifactProcessorExtensionPoint<StAXAttributeProcessor> implements StAXAttributeProcessorExtensionPoint {
-
- private ExtensionPointRegistry extensionPoints;
- private FactoryExtensionPoint modelFactories;
- private StAXAttributeProcessor<Object> extensibleStAXAttributeProcessor;
- private boolean loaded;
- private Monitor monitor = null;
-
- /**
- * Constructs a new extension point.
- */
- public DefaultStAXAttributeProcessorExtensionPoint(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
- this.modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- XMLOutputFactory outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
- UtilityExtensionPoint utilities = this.extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- if (monitorFactory != null) {
- this.monitor = monitorFactory.createMonitor();
- }
- this.extensibleStAXAttributeProcessor = new ExtensibleStAXAttributeProcessor(this, inputFactory, outputFactory, this.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(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- public void addArtifactProcessor(StAXAttributeProcessor artifactProcessor) {
- if (artifactProcessor.getArtifactType() != null) {
- processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor);
- }
- if (artifactProcessor.getModelType() != null) {
- processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor);
- }
- }
-
- public void removeArtifactProcessor(StAXAttributeProcessor artifactProcessor) {
- if (artifactProcessor.getArtifactType() != null) {
- processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType());
- }
- if (artifactProcessor.getModelType() != null) {
- processorsByModelType.remove(artifactProcessor.getModelType());
- }
- }
-
- @Override
- public StAXAttributeProcessor getProcessor(Class<?> modelType) {
- loadArtifactProcessors();
- return super.getProcessor(modelType);
- }
-
- @Override
- public StAXAttributeProcessor getProcessor(Object artifactType) {
- loadArtifactProcessors();
- return super.getProcessor(artifactType);
- }
-
- /**
- * Returns a QName object from a QName expressed as {ns}name
- * or ns#name.
- *
- * @param qname
- * @return
- */
- private static QName getQName(String qname) {
- if (qname == null) {
- return null;
- }
- qname = qname.trim();
- if (qname.startsWith("{")) {
- int h = qname.indexOf('}');
- if (h != -1) {
- return new QName(qname.substring(1, h), qname.substring(h + 1));
- }
- } else {
- int h = qname.indexOf('#');
- if (h != -1) {
- return new QName(qname.substring(0, h), qname.substring(h + 1));
- }
- }
- throw new IllegalArgumentException("Invalid qname: "+qname);
- }
-
- /**
- * Lazily load artifact processors registered in the extension point.
- */
- private void loadArtifactProcessors() {
- if (loaded)
- return;
-
- // Get the processor service declarations
- Set<ServiceDeclaration> processorDeclarations;
- try {
- processorDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(StAXAttributeProcessor.class.getName());
- } catch (IOException e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", extensibleStAXAttributeProcessor, ie);
- throw ie;
- }
-
- for (ServiceDeclaration processorDeclaration : processorDeclarations) {
- Map<String, String> attributes = processorDeclaration.getAttributes();
-
- // Load a StAX artifact processor
-
- // Get the model QName
- QName artifactType = getQName(attributes.get("qname"));
-
- // Get the model class name
- String modelTypeName = attributes.get("model");
-
- // Get the model factory class name
- String factoryName = attributes.get("factory");
-
- // Create a processor wrapper and register it
- StAXAttributeProcessor processor =
- new LazyStAXAttributeProcessor(artifactType, modelTypeName, factoryName,
- processorDeclaration, extensionPoints, modelFactories,
- extensibleStAXAttributeProcessor, monitor);
- addArtifactProcessor(processor);
- }
-
- loaded = true;
- }
-
- /**
- * A wrapper around an Artifact processor class allowing lazy loading and
- * initialization of artifact processors.
- */
- private static class LazyStAXAttributeProcessor implements StAXAttributeProcessor {
-
- private ExtensionPointRegistry extensionPoints;
- private QName artifactType;
- private String modelTypeName;
- private String factoryName;
- private ServiceDeclaration processorDeclaration;
- private StAXAttributeProcessor processor;
- private Class<?> modelType;
- private StAXAttributeProcessor<Object> extensionProcessor;
- private Monitor monitor;
-
- LazyStAXAttributeProcessor(QName artifactType,
- String modelTypeName,
- String factoryName,
- ServiceDeclaration processorDeclaration,
- ExtensionPointRegistry extensionPoints,
- FactoryExtensionPoint modelFactories,
- StAXAttributeProcessor<Object> extensionProcessor,
- Monitor monitor) {
-
- this.extensionPoints = extensionPoints;
- this.artifactType = artifactType;
- this.modelTypeName = modelTypeName;
- this.factoryName = factoryName;
- this.processorDeclaration = processorDeclaration;
- this.extensionProcessor = extensionProcessor;
- this.monitor = monitor;
- }
-
- public QName getArtifactType() {
- return artifactType;
- }
-
- private void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- @SuppressWarnings("unchecked")
- private StAXAttributeProcessor getProcessor() {
- if (processor == null) {
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
-
- // Load and instantiate the processor class
- try {
- Class<StAXAttributeProcessor> processorClass =
- (Class<StAXAttributeProcessor>)processorDeclaration.loadClass();
- try {
- Constructor<StAXAttributeProcessor> constructor =
- processorClass.getConstructor(FactoryExtensionPoint.class, Monitor.class);
- processor = constructor.newInstance(modelFactories, monitor);
- } catch (NoSuchMethodException e) {
- try {
- Constructor<StAXAttributeProcessor> constructor =
- processorClass.getConstructor(ExtensionPointRegistry.class, Monitor.class);
- processor = constructor.newInstance(extensionPoints, monitor);
- } catch (NoSuchMethodException e1) {
- try {
- Constructor<StAXAttributeProcessor> constructor =
- processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class, Monitor.class);
- processor = constructor.newInstance(modelFactories, extensionProcessor, monitor);
- } catch (NoSuchMethodException e2) {
- try {
- Constructor<StAXAttributeProcessor> constructor =
- processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class, Monitor.class);
- processor = constructor.newInstance(extensionPoints, extensionProcessor, monitor);
- } catch (NoSuchMethodException e3) {
- try {
- Constructor<StAXAttributeProcessor> constructor =
- processorClass.getConstructor(FactoryExtensionPoint.class);
- processor = constructor.newInstance(modelFactories);
- } catch (NoSuchMethodException e4) {
- try {
- Constructor<StAXAttributeProcessor> constructor =
- processorClass.getConstructor(ExtensionPointRegistry.class);
- processor = constructor.newInstance(extensionPoints);
- } catch (NoSuchMethodException e4a) {
- try {
- Constructor<StAXAttributeProcessor> constructor =
- processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class);
- processor = constructor.newInstance(modelFactories, extensionProcessor);
- } catch (NoSuchMethodException e5) {
- Constructor<StAXAttributeProcessor> constructor =
- processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class);
- processor = constructor.newInstance(extensionPoints, extensionProcessor);
- }
- }
- }
- }
- }
- }
- }
- } catch (Exception e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", processor, ie);
- throw ie;
- }
-
- }
- return processor;
- }
-
- public Object read(QName attributeName, XMLStreamReader inputSource) throws ContributionReadException, XMLStreamException {
- return getProcessor().read(attributeName, inputSource);
- }
-
- @SuppressWarnings("unchecked")
- public void write(Object model, XMLStreamWriter outputSource) throws ContributionWriteException, XMLStreamException {
- getProcessor().write(model, outputSource);
- }
-
- public Class<?> getModelType() {
- if (modelTypeName != null && modelType == null) {
- try {
- modelType = processorDeclaration.loadClass(modelTypeName);
- } catch (Exception e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", processorDeclaration, ie);
- throw ie;
- }
- }
- return modelType;
- }
-
- @SuppressWarnings("unchecked")
- public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException {
- getProcessor().resolve(model, resolver);
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java
deleted file mode 100644
index 402d4aa151..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.net.URI;
-import java.net.URL;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-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.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-
-/**
- * The default implementation of a URL artifact processor extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultURLArtifactProcessorExtensionPoint
- extends DefaultArtifactProcessorExtensionPoint<URLArtifactProcessor>
- implements URLArtifactProcessorExtensionPoint {
-
- private ExtensionPointRegistry extensionPoints;
- private StAXArtifactProcessor<?> staxProcessor;
- private boolean loaded;
- private Monitor monitor = null;
-
- /**
- * Constructs a new extension point.
- */
- public DefaultURLArtifactProcessorExtensionPoint(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
- FactoryExtensionPoint modelFactories = this.extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- XMLOutputFactory outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
- UtilityExtensionPoint utilities = this.extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- if (monitorFactory != null)
- this.monitor = monitorFactory.createMonitor();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, this.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(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- public void addArtifactProcessor(URLArtifactProcessor artifactProcessor) {
- if (artifactProcessor.getArtifactType() != null) {
- processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor);
- }
- if (artifactProcessor.getModelType() != null) {
- processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor);
- }
- }
-
- public void removeArtifactProcessor(URLArtifactProcessor artifactProcessor) {
- if (artifactProcessor.getArtifactType() != null) {
- processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType());
- }
- if (artifactProcessor.getModelType() != null) {
- processorsByModelType.remove(artifactProcessor.getModelType());
- }
- }
-
- @Override
- public URLArtifactProcessor getProcessor(Class<?> modelType) {
- loadProcessors();
- return super.getProcessor(modelType);
- }
-
- @Override
- public URLArtifactProcessor getProcessor(Object artifactType) {
- loadProcessors();
- return super.getProcessor(artifactType);
- }
-
- /**
- * Lazily load artifact processors registered in the extension point.
- */
- private void loadProcessors() {
- if (loaded)
- return;
-
- // Get the processor service declarations
- Set<ServiceDeclaration> processorDeclarations;
- try {
- processorDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(URLArtifactProcessor.class.getName());
- } catch (IOException e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", staxProcessor, ie);
- throw ie;
- }
-
- for (ServiceDeclaration processorDeclaration: processorDeclarations) {
- Map<String, String> attributes = processorDeclaration.getAttributes();
- // Load a URL artifact processor
- String artifactType = attributes.get("type");
- String modelTypeName = attributes.get("model");
-
- // Create a processor wrapper and register it
- URLArtifactProcessor processor = new LazyURLArtifactProcessor(artifactType, modelTypeName,
- processorDeclaration, extensionPoints, staxProcessor, monitor);
- addArtifactProcessor(processor);
- }
-
- loaded = true;
- }
-
- /**
- * A wrapper around an Artifact processor class allowing lazy loading and
- * initialization of artifact processors.
- */
- private static class LazyURLArtifactProcessor implements URLArtifactProcessor {
-
- private ExtensionPointRegistry extensionPoints;
- private String artifactType;
- private String modelTypeName;
- private ServiceDeclaration processorDeclaration;
- private URLArtifactProcessor processor;
- private Class<?> modelType;
- private StAXArtifactProcessor<?> staxProcessor;
- private Monitor monitor;
-
- LazyURLArtifactProcessor(String artifactType,
- String modelTypeName,
- ServiceDeclaration processorDeclaration,
- ExtensionPointRegistry extensionPoints,
- StAXArtifactProcessor<?> staxProcessor,
- Monitor monitor) {
- this.artifactType = artifactType;
- this.modelTypeName = modelTypeName;
- this.processorDeclaration = processorDeclaration;
- this.extensionPoints = extensionPoints;
- this.staxProcessor = staxProcessor;
- this.monitor = monitor;
- }
-
- public String getArtifactType() {
- return artifactType;
- }
-
- private void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- @SuppressWarnings("unchecked")
- private URLArtifactProcessor getProcessor() {
- if (processor == null) {
- try {
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- Class<URLArtifactProcessor> processorClass = (Class<URLArtifactProcessor>)processorDeclaration.loadClass();
- try {
- Constructor<URLArtifactProcessor> constructor = processorClass.getConstructor(FactoryExtensionPoint.class, Monitor.class);
- processor = constructor.newInstance(modelFactories, monitor);
- } catch (NoSuchMethodException e) {
- try {
- Constructor<URLArtifactProcessor> constructor = processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class, Monitor.class);
- processor = constructor.newInstance(modelFactories, staxProcessor, monitor);
- } catch (NoSuchMethodException e2) {
- Constructor<URLArtifactProcessor> constructor = processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class, Monitor.class);
- processor = constructor.newInstance(extensionPoints, staxProcessor, monitor);
- }
- }
- } catch (Exception e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", processor, ie);
- throw ie;
- }
- }
- return processor;
- }
-
- public Object read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
- return getProcessor().read(contributionURL, artifactURI, artifactURL);
- }
-
- public Class<?> getModelType() {
- if (modelTypeName != null && modelType == null) {
- try {
- modelType = processorDeclaration.loadClass(modelTypeName);
- } catch (ClassNotFoundException e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", processorDeclaration, ie);
- throw ie;
- }
- }
- return modelType;
- }
-
- @SuppressWarnings("unchecked")
- public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException {
- getProcessor().resolve(model, resolver);
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java
deleted file mode 100644
index 9258a837d8..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidatingXMLInputFactory.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URL;
-import java.net.URLConnection;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.List;
-
-import javax.xml.XMLConstants;
-import javax.xml.stream.EventFilter;
-import javax.xml.stream.StreamFilter;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLReporter;
-import javax.xml.stream.XMLResolver;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.util.XMLEventAllocator;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-
-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.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * Default implementation of an XMLInputFactory that creates validating
- * XMLStreamReaders.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultValidatingXMLInputFactory extends ValidatingXMLInputFactory {
-
- private XMLInputFactory inputFactory;
- private ValidationSchemaExtensionPoint schemas;
- private Monitor monitor;
- private boolean initialized;
- private boolean hasSchemas;
- private Schema aggregatedSchema;
-
- public DefaultValidatingXMLInputFactory(ExtensionPointRegistry registry) {
- FactoryExtensionPoint factoryExtensionPoint = registry.getExtensionPoint(FactoryExtensionPoint.class);
- XMLInputFactory factory = factoryExtensionPoint.getFactory(XMLInputFactory.class);
- this.inputFactory = factory;
- this.schemas = registry.getExtensionPoint(ValidationSchemaExtensionPoint.class);
- this.monitor =
- registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(MonitorFactory.class).createMonitor();
- }
-
- /**
- * Constructs a new XMLInputFactory.
- *
- * @param inputFactory
- * @param schemas
- */
- public DefaultValidatingXMLInputFactory(XMLInputFactory inputFactory, ValidationSchemaExtensionPoint schemas, Monitor monitor) {
- this.inputFactory = inputFactory;
- this.schemas = schemas;
- 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(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- /**
- * Initialize the registered schemas and create an aggregated schema for
- * validation.
- */
- private void initializeSchemas() {
- if (initialized) {
- return;
- }
- initialized = true;
-
- // Load the XSDs registered in the validation schema extension point
- try {
- List<String> uris = schemas.getSchemas();
- int n = uris.size();
- if (n ==0) {
- return;
- } else {
- hasSchemas = true;
- }
- final Source[] sources = new Source[n];
- for (int i =0; i < n; i++) {
- final String uri = uris.get(i);
- // Allow privileged access to open URL stream. Requires FilePermission in security policy.
- final URL url = new URL( uri );
- InputStream urlStream;
- try {
- urlStream = AccessController.doPrivileged(new PrivilegedExceptionAction<InputStream>() {
- public InputStream run() throws IOException {
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- return connection.getInputStream();
- }
- });
- } catch (PrivilegedActionException e) {
- error("PrivilegedActionException", url, (IOException)e.getException());
- throw (IOException)e.getException();
- }
- sources[i] = new StreamSource(urlStream, uri);
- }
-
- // Create an aggregated validation schemas from all the XSDs
- final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- // Allow privileged access to check files. Requires FilePermission
- // in security policy.
- try {
- aggregatedSchema = AccessController.doPrivileged(new PrivilegedExceptionAction<Schema>() {
- public Schema run() throws SAXException {
- return schemaFactory.newSchema(sources);
- }
- });
- } catch (PrivilegedActionException e) {
- error("PrivilegedActionException", schemaFactory, (SAXException)e.getException());
- throw (SAXException)e.getException();
- }
-
- } catch (Error e) {
- // FIXME Log this, some old JDKs don't support XMLSchema validation
- //e.printStackTrace();
- } catch (SAXParseException e) {
- IllegalStateException ie = new IllegalStateException(e);
- error("IllegalStateException", schemas, ie);
- throw ie;
- } catch (Exception e) {
- //FIXME Log this, some old JDKs don't support XMLSchema validation
- e.printStackTrace();
- }
- }
-
- @Override
- public XMLEventReader createFilteredReader(XMLEventReader arg0, EventFilter arg1) throws XMLStreamException {
- return inputFactory.createFilteredReader(arg0, arg1);
- }
-
- @Override
- public XMLStreamReader createFilteredReader(XMLStreamReader arg0, StreamFilter arg1) throws XMLStreamException {
- return inputFactory.createFilteredReader(arg0, arg1);
- }
-
- @Override
- public XMLEventReader createXMLEventReader(InputStream arg0, String arg1) throws XMLStreamException {
- return inputFactory.createXMLEventReader(arg0, arg1);
- }
-
- @Override
- public XMLEventReader createXMLEventReader(InputStream arg0) throws XMLStreamException {
- return inputFactory.createXMLEventReader(arg0);
- }
-
- @Override
- public XMLEventReader createXMLEventReader(Reader arg0) throws XMLStreamException {
- return inputFactory.createXMLEventReader(arg0);
- }
-
- @Override
- public XMLEventReader createXMLEventReader(Source arg0) throws XMLStreamException {
- return inputFactory.createXMLEventReader(arg0);
- }
-
- @Override
- public XMLEventReader createXMLEventReader(String arg0, InputStream arg1) throws XMLStreamException {
- return inputFactory.createXMLEventReader(arg0, arg1);
- }
-
- @Override
- public XMLEventReader createXMLEventReader(String arg0, Reader arg1) throws XMLStreamException {
- return inputFactory.createXMLEventReader(arg0, arg1);
- }
-
- @Override
- public XMLEventReader createXMLEventReader(XMLStreamReader arg0) throws XMLStreamException {
- return inputFactory.createXMLEventReader(arg0);
- }
-
- @Override
- public XMLStreamReader createXMLStreamReader(InputStream arg0, String arg1) throws XMLStreamException {
- initializeSchemas();
- if (hasSchemas) {
- return new ValidatingXMLStreamReader(inputFactory.createXMLStreamReader(arg0, arg1), aggregatedSchema, monitor);
- }else {
- return inputFactory.createXMLStreamReader(arg0, arg1);
- }
- }
-
- @Override
- public XMLStreamReader createXMLStreamReader(InputStream arg0) throws XMLStreamException {
- initializeSchemas();
- if (hasSchemas) {
- return new ValidatingXMLStreamReader(inputFactory.createXMLStreamReader(arg0), aggregatedSchema, monitor);
- } else {
- return inputFactory.createXMLStreamReader(arg0);
- }
- }
-
- @Override
- public XMLStreamReader createXMLStreamReader(Reader arg0) throws XMLStreamException {
- initializeSchemas();
- if (hasSchemas) {
- return new ValidatingXMLStreamReader(inputFactory.createXMLStreamReader(arg0), aggregatedSchema, monitor);
- } else {
- return inputFactory.createXMLStreamReader(arg0);
- }
- }
-
- @Override
- public XMLStreamReader createXMLStreamReader(Source arg0) throws XMLStreamException {
- initializeSchemas();
- if (hasSchemas) {
- return new ValidatingXMLStreamReader(inputFactory.createXMLStreamReader(arg0), aggregatedSchema, monitor);
- } else {
- return inputFactory.createXMLStreamReader(arg0);
- }
- }
-
- @Override
- public XMLStreamReader createXMLStreamReader(String arg0, InputStream arg1) throws XMLStreamException {
- initializeSchemas();
- if (hasSchemas) {
- return new ValidatingXMLStreamReader(inputFactory.createXMLStreamReader(arg0, arg1), aggregatedSchema, monitor);
- } else {
- return inputFactory.createXMLStreamReader(arg0, arg1);
- }
- }
-
- @Override
- public XMLStreamReader createXMLStreamReader(String arg0, Reader arg1) throws XMLStreamException {
- initializeSchemas();
- if (hasSchemas) {
- return new ValidatingXMLStreamReader(inputFactory.createXMLStreamReader(arg0, arg1), aggregatedSchema, monitor);
- } else {
- return inputFactory.createXMLStreamReader(arg0, arg1);
- }
- }
-
- @Override
- public XMLEventAllocator getEventAllocator() {
- return inputFactory.getEventAllocator();
- }
-
- @Override
- public Object getProperty(String arg0) throws IllegalArgumentException {
- return inputFactory.getProperty(arg0);
- }
-
- @Override
- public XMLReporter getXMLReporter() {
- return inputFactory.getXMLReporter();
- }
-
- @Override
- public XMLResolver getXMLResolver() {
- return inputFactory.getXMLResolver();
- }
-
- @Override
- public boolean isPropertySupported(String arg0) {
- return inputFactory.isPropertySupported(arg0);
- }
-
- @Override
- public void setEventAllocator(XMLEventAllocator arg0) {
- inputFactory.setEventAllocator(arg0);
- }
-
- @Override
- public void setProperty(String arg0, Object arg1) throws IllegalArgumentException {
- inputFactory.setProperty(arg0, arg1);
- }
-
- @Override
- public void setXMLReporter(XMLReporter arg0) {
- inputFactory.setXMLReporter(arg0);
- }
-
- @Override
- public void setXMLResolver(XMLResolver arg0) {
- inputFactory.setXMLResolver(arg0);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidationSchemaExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidationSchemaExtensionPoint.java
deleted file mode 100644
index a6631f498e..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultValidationSchemaExtensionPoint.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * Default implementation of an extension point for XML schemas.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultValidationSchemaExtensionPoint implements ValidationSchemaExtensionPoint {
-
- private List<String> schemas = new ArrayList<String>();
- private boolean loaded;
-
- public void addSchema(String uri) {
- schemas.add(uri);
- }
-
- public void removeSchema(String uri) {
- schemas.remove(uri);
- }
-
- /**
- * Load schema declarations from META-INF/services/
- * org.apache.tuscany.sca.contribution.processor.ValidationSchema files
- */
- private void loadSchemas() {
- if (loaded)
- return;
-
- // Get the schema declarations
- Set<ServiceDeclaration> schemaDeclarations;
- try {
- schemaDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations("org.apache.tuscany.sca.contribution.processor.ValidationSchema");
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
-
- // TODO - temp fix to ensure that the schema tuscany-sca.xsd always comes first
- String tuscanyScaXsd = null;
-
- // Find each schema
- for (ServiceDeclaration schemaDeclaration: schemaDeclarations) {
- URL url = schemaDeclaration.getResource(schemaDeclaration.getClassName());
- if (url == null) {
- throw new IllegalArgumentException(new FileNotFoundException(schemaDeclaration.getClassName()));
- }
-
- if (url.toString().contains("tuscany-sca.xsd")){
- tuscanyScaXsd = url.toString();
- } else {
- schemas.add(url.toString());
- }
- }
-
- if (tuscanyScaXsd != null){
- schemas.add(0, tuscanyScaXsd);
- }
-
- loaded = true;
- }
-
- public List<String> getSchemas() {
- loadSchemas();
- return schemas;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java
deleted file mode 100644
index 7578a24ea8..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-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.Constants;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Implementation of an extensible StAX artifact processor.
- *
- * Takes a StAXArtifactProcessorExtensionPoint and delegates to the proper
- * StAXArtifactProcessor by element QName
- *
- * @version $Rev$ $Date$
- */
-public class ExtensibleStAXArtifactProcessor implements StAXArtifactProcessor<Object> {
- private static final Logger logger = Logger.getLogger(ExtensibleStAXArtifactProcessor.class.getName());
-
- private static final QName ANY_ELEMENT = new QName(Constants.XMLSCHEMA_NS, "anyElement");
-
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private StAXArtifactProcessorExtensionPoint processors;
- private Monitor monitor;
-
- /**
- * Constructs a new ExtensibleStAXArtifactProcessor.
- * @param processors
- * @param inputFactory
- * @param outputFactory
- */
- public ExtensibleStAXArtifactProcessor(StAXArtifactProcessorExtensionPoint processors,
- XMLInputFactory inputFactory,
- XMLOutputFactory outputFactory,
- Monitor monitor) {
- super();
- this.processors = processors;
- this.inputFactory = inputFactory;
- this.outputFactory = outputFactory;
- if (this.outputFactory != null) {
- this.outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.TRUE);
- }
- 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(), "contribution-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(), "contribution-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(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
-
- public Object read(XMLStreamReader source) throws ContributionReadException, XMLStreamException {
-
- // Delegate to the processor associated with the element QName
- int event = source.getEventType();
- if (event == XMLStreamConstants.START_DOCUMENT) {
- source.nextTag();
- }
- QName name = source.getName();
- StAXArtifactProcessor<?> processor = (StAXArtifactProcessor<?>)processors.getProcessor(name);
- if (processor == null) {
- Location location = source.getLocation();
- if (logger.isLoggable(Level.WARNING)) {
- logger.warning("Element " + name + " cannot be processed. (" + location + ")");
- }
- warning("ElementCannotBeProcessed", processors, name, location);
-
- StAXArtifactProcessor anyElementProcessor = processors.getProcessor(ANY_ELEMENT);
- if(anyElementProcessor != null) {
- return anyElementProcessor.read(source);
- } else {
- return null;
- }
- }
- return processor.read(source);
- }
-
- @SuppressWarnings("unchecked")
- public void write(Object model, XMLStreamWriter outputSource) throws ContributionWriteException, XMLStreamException {
-
- // Delegate to the processor associated with the model type
- if (model != null) {
- StAXArtifactProcessor processor = processors.getProcessor(model.getClass());
- if (processor != null) {
- processor.write(model, outputSource);
- } else {
- if (logger.isLoggable(Level.WARNING)) {
- logger.warning("No StAX processor is configured to handle " + model.getClass());
- }
- warning("NoStaxProcessor", processors, model.getClass());
- StAXArtifactProcessor anyElementProcessor = processors.getProcessor(ANY_ELEMENT);
- if(anyElementProcessor != null) {
- anyElementProcessor.write(model, outputSource);
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException {
-
- // Delegate to the processor associated with the model type
- if (model != null) {
- StAXArtifactProcessor processor = processors.getProcessor(model.getClass());
- if (processor != null) {
- processor.resolve(model, resolver);
- }
- }
- }
-
- /**
- * Read a model from an InputStream.
- * @param is The artifact InputStream
- * @param type Model type
- * @return The model
- * @throws ContributionReadException
- */
- public <M> M read(InputStream is, Class<M> type) throws ContributionReadException {
- try {
- XMLStreamReader reader;
- try {
- reader = inputFactory.createXMLStreamReader(is);
- try {
- reader.nextTag();
- QName name = reader.getName();
- Object mo = read(reader);
- if (type.isInstance(mo)) {
- return type.cast(mo);
- } else {
- error("UnrecognizedElementException", reader, name);
- UnrecognizedElementException e = new UnrecognizedElementException(name);
- throw e;
- }
- } catch (ContributionReadException e) {
- Location location = reader.getLocation();
- e.setLine(location.getLineNumber());
- e.setColumn(location.getColumnNumber());
- error("ContributionReadException", reader, e);
- throw e;
- } finally {
- try {
- reader.close();
- } catch (XMLStreamException e) {
- // ignore
- }
- }
- } finally {
- try {
- is.close();
- } catch (IOException e) {
- // ignore
- }
- }
- } catch (XMLStreamException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", inputFactory, ce);
- throw ce;
- }
- }
-
- /**
- * Write a model to an OutputStream.
- * @param model
- * @param os
- * @throws ContributionWriteException
- */
- public void write(Object model, OutputStream os) throws ContributionWriteException {
- try {
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(os);
- write(model, writer);
- writer.flush();
- writer.close();
- } catch (XMLStreamException e) {
- ContributionWriteException cw = new ContributionWriteException(e);
- error("ContributionWriteException", outputFactory, cw);
- throw cw;
- }
- }
-
- public QName getArtifactType() {
- return null;
- }
-
- public Class<Object> getModelType() {
- return null;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXAttributeProcessor.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXAttributeProcessor.java
deleted file mode 100644
index c336cb3431..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXAttributeProcessor.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-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.Constants;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Implementation of an extensible StAX attribute processor.
- *
- * Takes a StAXAttributeProcessorExtensionPoint and delegates to the proper
- * StAXAttributeProcessor by attribute QName
- *
- * @version $Rev$ $Date$
- */
-public class ExtensibleStAXAttributeProcessor
- implements StAXAttributeProcessor<Object> {
-
- private static final Logger logger = Logger.getLogger(ExtensibleStAXAttributeProcessor.class.getName());
-
- private static final QName ANY_ATTRIBUTE = new QName(Constants.XMLSCHEMA_NS, "anyAttribute");
-
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private StAXAttributeProcessorExtensionPoint processors;
- private Monitor monitor;
-
- /**
- * Constructs a new ExtensibleStAXArtifactProcessor.
- * @param processors
- * @param inputFactory
- * @param outputFactory
- */
- public ExtensibleStAXAttributeProcessor(StAXAttributeProcessorExtensionPoint processors,
- XMLInputFactory inputFactory,
- XMLOutputFactory outputFactory,
- Monitor monitor) {
- super();
- this.processors = processors;
- this.inputFactory = inputFactory;
- this.outputFactory = outputFactory;
- if (this.outputFactory != null) {
- this.outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.TRUE);
- }
- 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(), "contribution-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(), "contribution-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(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
-
- public Object read(QName attributeName, XMLStreamReader source) throws ContributionReadException, XMLStreamException {
- // Delegate to the processor associated with the attribute QName
- int event = source.getEventType();
- if (event == XMLStreamConstants.START_DOCUMENT) {
- source.nextTag();
- }
-
- StAXAttributeProcessor<?> processor = null;
-
- //lookup for registered attribute processors
- processor = (StAXAttributeProcessor<?>)processors.getProcessor(attributeName);
- if (processor == null) {
- Location location = source.getLocation();
- if (logger.isLoggable(Level.WARNING)) {
- logger.warning("Attribute " + attributeName + " cannot be processed. (" + location + ")");
- }
- warning("AttributeCannotBeProcessed", processors, attributeName, location);
- } else {
- return processor.read(attributeName, source);
- }
-
-
- //handle extension attributes without processors
- processor = (StAXAttributeProcessor<?>)processors.getProcessor(ANY_ATTRIBUTE);
- if (processor == null) {
- Location location = source.getLocation();
- if (logger.isLoggable(Level.WARNING)) {
- logger.warning("Could not find Default Attribute processor !");
- }
- warning("DefaultAttributeProcessorNotAvailable", processors, ANY_ATTRIBUTE, location);
- }
-
- return processor == null ? null : processor.read(attributeName, source);
- }
-
- @SuppressWarnings("unchecked")
- public void write(Object model, XMLStreamWriter outputSource) throws ContributionWriteException, XMLStreamException {
-
- if(model == null) {
- return;
- }
-
- // Delegate to the processor associated with the model type
- StAXAttributeProcessor processor = processors.getProcessor(model.getClass());
- if(processor == null) {
- if (logger.isLoggable(Level.WARNING)) {
- logger.warning("No StAX processor is configured to handle " + model.getClass());
- }
- warning("NoStaxProcessor", processors, model.getClass());
- } else {
- processor.write(model, outputSource);
- return;
- }
-
- //handle extension attributes without processors
- processor = (StAXAttributeProcessor<?>)processors.getProcessor(ANY_ATTRIBUTE);
- if(processor == null) {
- if (logger.isLoggable(Level.WARNING)) {
- logger.warning("No Default StAX processor is configured to handle " + model.getClass());
- }
- warning("NoDefaultStaxProcessor", processors, model.getClass());
- } else {
- processor.write(model, outputSource);
- return;
- }
- }
-
-
-
- @SuppressWarnings("unchecked")
- public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException {
-
- // Delegate to the processor associated with the model type
- if (model != null) {
- StAXAttributeProcessor processor = processors.getProcessor(model.getClass());
- if (processor != null) {
- processor.resolve(model, resolver);
- }
- }
- }
-
- /**
- * Read a model from an InputStream.
- * @param is The artifact InputStream
- * @param type Model type
- * @return The model
- * @throws ContributionReadException
- */
- public <M> M read(InputStream is, Class<M> type) throws ContributionReadException {
- return null;
- }
-
- /**
- * Write a model to an OutputStream.
- * @param model
- * @param os
- * @throws ContributionWriteException
- */
- public void write(Object model, OutputStream os) throws ContributionWriteException {
- try {
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(os);
- write(model, writer);
- writer.flush();
- writer.close();
- } catch (XMLStreamException e) {
- ContributionWriteException cw = new ContributionWriteException(e);
- error("ContributionWriteException", outputFactory, cw);
- throw cw;
- }
- }
-
- public QName getArtifactType() {
- return null;
- }
-
- public Class<Object> getModelType() {
- return null;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java
deleted file mode 100644
index cc31d2e073..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.net.URI;
-import java.net.URL;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * Implementation of an extensible URL artifact processor.
- *
- * Takes a URLArtifactProcessorExtensionPoint and delegates to the proper URLArtifactProcessor
- * by either fileName or fileExtention
- *
- * @version $Rev$ $Date$
- */
-public class ExtensibleURLArtifactProcessor
- implements URLArtifactProcessor<Object> {
-
- private URLArtifactProcessorExtensionPoint processors;
- private Monitor monitor;
-
- /**
- * Constructs a new ExtensibleURLArtifactProcessor.
- *
- * @param processors
- */
- public ExtensibleURLArtifactProcessor(URLArtifactProcessorExtensionPoint processors, Monitor monitor) {
- this.processors = processors;
- this.monitor = monitor;
- }
-
- /**
- * 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(), "contribution-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- @SuppressWarnings("unchecked")
- public Object read(URL contributionURL, URI sourceURI, URL sourceURL) throws ContributionReadException {
- URLArtifactProcessor<Object> processor = null;
-
- // Delegate to the processor associated with file extension
- String fileName = getFileName(sourceURL);
-
- //try to retrieve a processor for the specific filename
- processor = (URLArtifactProcessor<Object>)processors.getProcessor(fileName);
-
- if (processor == null) {
- //try to find my file type (extension)
- String extension = sourceURL.getPath();
-
- int extensionStart = extension.lastIndexOf('.');
- //handle files without extension (e.g NOTICE)
- if (extensionStart > 0) {
- extension = extension.substring(extensionStart);
- processor = (URLArtifactProcessor<Object>)processors.getProcessor(extension);
- }
- }
-
- if (processor == null) {
- return null;
- }
- return processor.read(contributionURL, sourceURI, sourceURL);
- }
-
- @SuppressWarnings("unchecked")
- public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException {
-
- // Delegate to the processor associated with the model type
- if (model != null) {
- URLArtifactProcessor processor = processors.getProcessor(model.getClass());
- if (processor != null) {
- processor.resolve(model, resolver);
- }
- }
- }
-
- public <M> M read(URL contributionURL, URI artifactURI, URL artifactUrl, Class<M> type)
- throws ContributionReadException {
- Object mo = read(contributionURL, artifactURI, artifactUrl);
- if (type.isInstance(mo)) {
- return type.cast(mo);
- } else {
- UnrecognizedElementException e = new UnrecognizedElementException(null);
- e.setResourceURI(artifactURI.toString());
- error("UnrecognizedElementException", processors, artifactURI.toString());
- throw e;
- }
- }
-
- public String getArtifactType() {
- return null;
- }
-
- public Class<Object> getModelType() {
- return null;
- }
-
- /**
- * Returns the file name from a URL.
- * @param url
- * @return
- */
- private static String getFileName(URL url){
- String fileName = url.getPath();
- int pos = fileName.lastIndexOf("/");
-
- return fileName.substring(pos +1);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessor.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessor.java
deleted file mode 100644
index 1bf9b4d494..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessor.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-
-/**
- * An artifact processor that can read models from a StAX XMLStreamReader.
- *
- * @version $Rev$ $Date$
- */
-public interface StAXArtifactProcessor<M> extends ArtifactProcessor<M> {
-
- /**
- * Reads a model from an XMLStreamReader.
- *
- * @param reader The XMLStreamReader
- * @return A model representation of the input.
- */
- M read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException;
-
- /**
- * Writes a model to an XMLStreamWriter.
- *
- * @param model A model representing the source
- * @param writer The XML stream writer
- * @throws ContributionWriteException
- * @throws XMLStreamException
- */
- void write(M model, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException;
-
- /**
- * Returns the type of artifact handled by this artifact processor.
- *
- * @return The type of artifact handled by this artifact processor
- */
- QName getArtifactType();
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java
deleted file mode 100644
index 9700e2bc60..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-/**
- * An extension point for StAX artifact processors.
- *
- * @version $Rev$ $Date$
- */
-public interface StAXArtifactProcessorExtensionPoint extends
- ArtifactProcessorExtensionPoint<StAXArtifactProcessor> {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessor.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessor.java
deleted file mode 100644
index b25bf0d669..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-
-
-/**
- * An artifact processor that can read attributes from a StAX XMLStreamReader.
- *
- * @version $Rev$ $Date$
- */
-public interface StAXAttributeProcessor<M> extends ArtifactProcessor<M>{
-
- /**
- * Reads a model from an XMLStreamReader.
- *
- * @param reader The XMLStreamReader
- * @return A model representation of the input.
- */
- M read(QName attributeName, XMLStreamReader reader) throws ContributionReadException, XMLStreamException;
-
- /**
- * Writes a model to an XMLStreamWriter.
- *
- * @param model A model representing the source
- * @param writer The XML stream writer
- * @throws ContributionWriteException
- * @throws XMLStreamException
- */
- void write(M model, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException;
-
- /**
- * Returns the type of artifact handled by this artifact processor.
- *
- * @return The type of artifact handled by this artifact processor
- */
- QName getArtifactType();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessorExtensionPoint.java
deleted file mode 100644
index ebad243c1c..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessorExtensionPoint.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-/**
- * An extension point for StAX artifact processors.
- *
- * @version $Rev$ $Date$
- */
-public interface StAXAttributeProcessorExtensionPoint extends
- ArtifactProcessorExtensionPoint<StAXAttributeProcessor> {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyNamespaceContext.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyNamespaceContext.java
deleted file mode 100644
index 2ddba7527e..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyNamespaceContext.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Stack;
-
-import javax.xml.namespace.NamespaceContext;
-
-/**
- * Tuscany specialized class to handle NamespaceContext
- *
- */
-public class TuscanyNamespaceContext implements NamespaceContext {
-
- private Stack<List<String>[]> context = null;
-
- public TuscanyNamespaceContext(Stack<List<String>[]> context) {
- this.context = context;
- }
-
- public String getNamespaceURI(String prefix) {
- if (prefix == null) {
- throw new IllegalArgumentException();
- }
- return (String)getResult("getNSUri", prefix);
- }
-
- public String getPrefix(String namespaceURI) {
- if (namespaceURI == null) {
- throw new IllegalArgumentException();
- }
- return (String)getResult("getPrefix", namespaceURI);
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<String> getPrefixes(String namespaceURI) {
- if (namespaceURI == null) {
- throw new IllegalArgumentException();
- }
-
- Iterator<String> iterator = (Iterator<String>)getResult("getPrefixes", namespaceURI);
- return iterator;
- }
-
- /*
- * Generic method to Iterate through the Stack and return required result(s)
- */
- private Object getResult(String operation, String arg) {
-
- List<String>[] contextList = null;
- Iterator<String> prefItr = null;
- Iterator<String> uriItr = null;
-
- List<String> list = new ArrayList<String>();
-
- String toCompare = null;
-
- String tempPrefix = null;
- String tempUri = null;
-
- for (int i = context.size() - 1; i >= 0; i--) {
- contextList = context.get(i);
- prefItr = contextList[0].iterator();
- uriItr = contextList[1].iterator();
- while (uriItr.hasNext()) {
- tempPrefix = prefItr.next();
- tempUri = uriItr.next();
- if (operation.equalsIgnoreCase("getNSUri")) {
- toCompare = tempPrefix;
- } else if (operation.equalsIgnoreCase("getPrefix")) {
- toCompare = tempUri;
- } else if (operation.equalsIgnoreCase("getPrefixes")) {
- toCompare = tempUri;
- }
- if (toCompare != null && arg.equalsIgnoreCase(toCompare)) {
- if (operation.equalsIgnoreCase("getNSUri")) {
- return tempUri;
- } else if (operation.equalsIgnoreCase("getPrefix")) {
- return tempPrefix;
- } else if (operation.equalsIgnoreCase("getPrefixes")) {
- list.add(tempPrefix);
- }
-
- }
- }
- }
-
- if (operation.equalsIgnoreCase("getPrefixes")) {
- return Collections.unmodifiableList(list).iterator();
- }
-
- return null;
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java
deleted file mode 100644
index 3352e76a0d..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Stack;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.util.StreamReaderDelegate;
-
-/*
- * Custom implementaion of the XMLStreamReader to keep track of the namespace context for each element
- */
-public class TuscanyXMLStreamReader extends StreamReaderDelegate implements XMLStreamReader {
-
- Stack<List<String>[]> context = new Stack<List<String>[]>();
-
- List<String>[] contextList;
- List<String> prefixList;
- List<String> uriList;
-
- public TuscanyXMLStreamReader(XMLStreamReader reader) {
- super(reader);
- }
-
- public void pushContext() throws XMLStreamException {
- contextList = new List[2];
- prefixList = new ArrayList<String>();
- uriList = new ArrayList<String>();
- int namespaceCount = this.getNamespaceCount();
- for (int i = 0; i < namespaceCount; i++) {
- prefixList.add(checkString(this.getNamespacePrefix(i)));
- uriList.add(this.getNamespaceURI(i));
- }
- contextList[0] = prefixList;
- contextList[1] = uriList;
- context.push(contextList);
- }
-
- private String checkString(String namespacePrefix) {
- if (namespacePrefix == null) {
- return XMLConstants.DEFAULT_NS_PREFIX;
- } else {
- return namespacePrefix;
- }
- }
-
- public void popContext() throws XMLStreamException {
- context.pop();
- }
-
- /*
- * Overriding the next() method to perform PUSH and POP operations
- * for the NamespaceContext for the current element
- */
-
- @Override
- public int next() throws XMLStreamException {
- // POP the context if the element ends
- if (this.getEventType() == END_ELEMENT) {
- popContext();
- }
-
- //get the next event
- int nextEvent = super.next();
- //PUSH the events info onto the Stack
- if (nextEvent == START_ELEMENT) {
- pushContext();
- }
- return nextEvent;
- }
-
- @Override
- public int nextTag() throws XMLStreamException {
- int event = super.nextTag();
- if (event == START_ELEMENT) {
- pushContext();
- }
- if (event == END_ELEMENT) {
- popContext();
- }
- return event;
- }
-
- @Override
- public NamespaceContext getNamespaceContext() {
- return new TuscanyNamespaceContext((Stack<List<String>[]>)context.clone());
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessor.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessor.java
deleted file mode 100644
index c44ca0c66a..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessor.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.net.URI;
-import java.net.URL;
-
-
-/**
- * An artifact processor that can read models from a URL.
- *
- * @version $Rev$ $Date$
- */
-public interface URLArtifactProcessor<M> extends ArtifactProcessor<M> {
-
- /**
- * Reads a model from a URL.
- *
- * @param contributionURL Contribution location URL
- * @param artifactURI Artifact URI
- * @param artifactURL Artifact location URL
- * @return A model representation of the input.
- */
- M read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException;
-
- /**
- * Returns the type of artifact handled by this artifact processor.
- *
- * @return The type of artifact handled by this artifact processor
- */
- String getArtifactType();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java
deleted file mode 100644
index 7714586951..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-/**
- * An extension point for URL artifact processors.
- *
- * @version $Rev$ $Date$
- */
-public interface URLArtifactProcessorExtensionPoint extends
- ArtifactProcessorExtensionPoint<URLArtifactProcessor> {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnrecognizedElementException.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnrecognizedElementException.java
deleted file mode 100644
index 4c6f0b7282..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnrecognizedElementException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import javax.xml.namespace.QName;
-
-/**
- * Exception that indicates an element was encountered that could not be handled.
- *
- * @version $Rev$ $Date$
- */
-public class UnrecognizedElementException extends ContributionReadException {
- private static final long serialVersionUID = 2549543622209829032L;
- private final QName element;
-
- /**
- * Constructor that indicates which element could not be handled.
- * @param element the element that could not be handled
- */
- public UnrecognizedElementException(QName element) {
- super("Unrecognized element: " + element);
- this.element = element;
- }
-
- /**
- * Returns the element that could not be handled.
- * @return the element that could not be handled.
- */
- public QName getElement() {
- return element;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnsupportedContentTypeException.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnsupportedContentTypeException.java
deleted file mode 100644
index 8a166e42f0..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnsupportedContentTypeException.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-
-/**
- * Exception thrown to indicate that a Content-Type is not supported by this SCA Domain.
- * The Content-Type value supplied will be returned as the message text for this exception.
- *
- * FIXME Don't use as it's deprecated and replaced by UnsupportedPackageTypeException.
- *
- * @version $Rev$ $Date$
- */
-@Deprecated
-public class UnsupportedContentTypeException extends ContributionException {
- private static final long serialVersionUID = -1831797280021355672L;
-
- /**
- * Constructs a new UnsupportedContentTypeException.
- *
- * @param message
- */
- public UnsupportedContentTypeException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnsupportedPackageTypeException.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnsupportedPackageTypeException.java
deleted file mode 100644
index ce94cef6a0..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/UnsupportedPackageTypeException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-
-/**
- * Exception thrown to indicate that a Content-Type is not supported by this SCA Domain.
- * The Content-Type value supplied will be returned as the message text for this exception.
- *
- * @version $Rev$ $Date$
- */
-public class UnsupportedPackageTypeException extends ContributionException {
- private static final long serialVersionUID = -1831797280021355672L;
-
- /**
- * Constructs a new UnsupportedPackageTypeException.
- *
- * @param message
- */
- public UnsupportedPackageTypeException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java
deleted file mode 100644
index c0eef5a7a8..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLInputFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-import javax.xml.stream.XMLInputFactory;
-
-/**
- * Base marker class for validating XML input factories.
- *
- * @version $Rev$ $Date$
- */
-public abstract class ValidatingXMLInputFactory extends XMLInputFactory {
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLStreamReader.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLStreamReader.java
deleted file mode 100644
index 3f5582d4e7..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidatingXMLStreamReader.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.util.logging.Logger;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.validation.Schema;
-import javax.xml.validation.ValidatorHandler;
-
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.xml.sax.Attributes;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- *
- * A validating XMLStreamReader that reports XMLSchema validation errors.
- *
- * @version $Rev$ $Date$
- */
-class ValidatingXMLStreamReader extends TuscanyXMLStreamReader implements XMLStreamReader {
-
- private static final Logger logger = Logger.getLogger(ValidatingXMLStreamReader.class.getName());
-
- private int level;
- private ValidatorHandler handler;
- private final Monitor monitor;
-
- /**
- * Constructs a new ValidatingXMLStreamReader.
- *
- * @param reader
- * @param schema
- * @throws XMLStreamException
- */
- ValidatingXMLStreamReader(XMLStreamReader reader, Schema schema, Monitor monitor) throws XMLStreamException {
- super(reader);
- this.monitor = monitor;
- if (schema == null) {
- return;
- }
-
- handler = schema.newValidatorHandler();
- handler.setDocumentLocator(new LocatorAdapter());
- try {
- handler.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
- } catch (SAXException e) {
- XMLStreamException xse = new XMLStreamException(e);
- error("XMLStreamException", handler, xse);
- throw xse;
- }
-
- // These validation errors are just warnings for us as we want to support
- // running from an XML document with XSD validation errors, as long as we can
- // get the metadata we need from the document
- handler.setErrorHandler(new ErrorHandler() {
- private String getMessage(SAXParseException e) {
- return "XMLSchema validation problem in: " + e.getSystemId() + ", line: " + e.getLineNumber() + ", column: " + e.getColumnNumber() + "\n" + e.getMessage();
- }
-
- public void error(SAXParseException exception) throws SAXException {
- if (ValidatingXMLStreamReader.this.monitor == null)
- logger.warning(getMessage(exception));
- else
- ValidatingXMLStreamReader.this.error("SchemaError", ValidatingXMLStreamReader.this.getClass(), exception.getSystemId(),
- exception.getLineNumber(), exception.getColumnNumber(), exception.getMessage());
- }
-
- public void fatalError(SAXParseException exception) throws SAXException {
- if (ValidatingXMLStreamReader.this.monitor == null)
- logger.warning(getMessage(exception));
- else
- ValidatingXMLStreamReader.this.error("SchemaFatalError", ValidatingXMLStreamReader.this.getClass(), exception.getSystemId(),
- exception.getLineNumber(), exception.getColumnNumber(), exception.getMessage());
- }
-
- public void warning(SAXParseException exception) throws SAXException {
- if (ValidatingXMLStreamReader.this.monitor == null)
- logger.warning(getMessage(exception));
- else
- ValidatingXMLStreamReader.this.warning("SchemaWarning", ValidatingXMLStreamReader.this.getClass(), exception.getSystemId(),
- exception.getLineNumber(), exception.getColumnNumber(), exception.getMessage());
- }
- });
- }
-
- /**
- * 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(), "contribution-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(), "contribution-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- @Override
- public int next() throws XMLStreamException {
- if (handler == null) {
- return super.next();
- }
-
- int event = super.next();
- try {
- switch (event) {
- case XMLStreamConstants.START_DOCUMENT:
- level++;
- handler.startDocument();
- break;
- case XMLStreamConstants.START_ELEMENT:
- level++;
- handleStartElement();
- break;
- case XMLStreamConstants.PROCESSING_INSTRUCTION:
- handler.processingInstruction(super.getPITarget(), super.getPIData());
- break;
- case XMLStreamConstants.CHARACTERS:
- case XMLStreamConstants.CDATA:
- case XMLStreamConstants.SPACE:
- case XMLStreamConstants.ENTITY_REFERENCE:
- handler.characters(super.getTextCharacters(), super.getTextStart(), super.getTextLength());
- break;
- case XMLStreamConstants.END_ELEMENT:
- handleEndElement();
- level--;
- break;
- case XMLStreamConstants.END_DOCUMENT:
- handler.endDocument();
- break;
- }
- } catch (SAXException e) {
- XMLStreamException xse = new XMLStreamException(e.getMessage(), e);
- error("XMLStreamException", handler, xse);
- throw xse;
- }
- return event;
- }
-
- @Override
- public int nextTag() throws XMLStreamException {
- if (handler == null) {
- return super.nextTag();
- }
-
- for (;;) {
- int event = super.getEventType();
- try {
- switch (event) {
- case XMLStreamConstants.START_DOCUMENT:
- level++;
- handler.startDocument();
- break;
- case XMLStreamConstants.START_ELEMENT:
- level++;
- handleStartElement();
- pushContext();
- return event;
- case XMLStreamConstants.PROCESSING_INSTRUCTION:
- handler.processingInstruction(super.getPITarget(), super.getPIData());
- break;
- case XMLStreamConstants.CHARACTERS:
- case XMLStreamConstants.CDATA:
- case XMLStreamConstants.SPACE:
- case XMLStreamConstants.ENTITY_REFERENCE:
- handler.characters(super.getTextCharacters(), super.getTextStart(), super.getTextLength());
- break;
- case XMLStreamConstants.END_ELEMENT:
- handleEndElement();
- level--;
- popContext();
- return event;
- case XMLStreamConstants.END_DOCUMENT:
- handler.endDocument();
- return event;
- }
- } catch (SAXException e) {
- XMLStreamException xse = new XMLStreamException(e);
- error("XMLStreamException", handler, xse);
- throw xse;
- }
- super.next();
- }
- }
-
- @Override
- public String getElementText() throws XMLStreamException {
- if (handler == null) {
- return super.getElementText();
- }
-
- if (getEventType() != XMLStreamConstants.START_ELEMENT) {
- return super.getElementText();
- }
- StringBuffer text = new StringBuffer();
-
- for (;;) {
- int event = next();
- switch (event) {
- case XMLStreamConstants.END_ELEMENT:
- return text.toString();
-
- case XMLStreamConstants.COMMENT:
- case XMLStreamConstants.PROCESSING_INSTRUCTION:
- continue;
-
- case CHARACTERS:
- case CDATA:
- case SPACE:
- case ENTITY_REFERENCE:
- text.append(getText());
- break;
-
- default:
- break;
- }
- }
- }
-
- @Override
- public NamespaceContext getNamespaceContext(){
- return super.getNamespaceContext();
- }
-
- /**
- * Handle a start element event.
- *
- * @throws SAXException
- */
- private void handleStartElement() throws SAXException {
-
- // send startPrefixMapping events immediately before startElement event
- int nsCount = super.getNamespaceCount();
- for (int i = 0; i < nsCount; i++) {
- String prefix = super.getNamespacePrefix(i);
- if (prefix == null) { // true for default namespace
- prefix = "";
- }
- handler.startPrefixMapping(prefix, super.getNamespaceURI(i));
- }
-
- // fire startElement
- QName qname = super.getName();
- String prefix = qname.getPrefix();
- String rawname;
- if (prefix == null || prefix.length() == 0) {
- rawname = qname.getLocalPart();
- } else {
- rawname = prefix + ':' + qname.getLocalPart();
- }
- Attributes attrs = getAttributes();
- handler.startElement(qname.getNamespaceURI(), qname.getLocalPart(), rawname, attrs);
- }
-
- /**
- * Handle an endElement event.
- *
- * @throws SAXException
- */
- private void handleEndElement() throws SAXException {
-
- // fire endElement
- QName qname = super.getName();
- handler.endElement(qname.getNamespaceURI(), qname.getLocalPart(), qname.toString());
-
- // send endPrefixMapping events immediately after endElement event
- // we send them in the opposite order to that returned but this is not
- // actually required by SAX
- int nsCount = super.getNamespaceCount();
- for (int i = nsCount - 1; i >= 0; i--) {
- String prefix = super.getNamespacePrefix(i);
- if (prefix == null) { // true for default namespace
- prefix = "";
- }
- handler.endPrefixMapping(prefix);
- }
- }
-
- /**
- * Get the attributes associated with the current START_ELEMENT event.
- *
- * @return the StAX attributes converted to org.xml.sax.Attributes
- */
- private Attributes getAttributes() {
- AttributesImpl attrs = new AttributesImpl();
-
- // add namespace declarations
- for (int i = 0; i < super.getNamespaceCount(); i++) {
- String prefix = super.getNamespacePrefix(i);
- String uri = super.getNamespaceURI(i);
- if (prefix == null) {
- attrs.addAttribute("", "", "xmlns", "CDATA", uri);
- } else {
- attrs.addAttribute("", "", "xmlns:" + prefix, "CDATA", uri);
- }
- }
-
- // Regular attributes
- for (int i = 0; i < super.getAttributeCount(); i++) {
- String uri = super.getAttributeNamespace(i);
- if (uri == null) {
- uri = "";
- }
- String localName = super.getAttributeLocalName(i);
- String prefix = super.getAttributePrefix(i);
- String qname;
- if (prefix == null || prefix.length() == 0) {
- qname = localName;
- } else {
- qname = prefix + ':' + localName;
- }
- String type = super.getAttributeType(i);
- String value = super.getAttributeValue(i);
-
- attrs.addAttribute(uri, localName, qname, type, value);
- }
-
- return attrs;
- }
-
- /**
- * Adapter for mapping Locator information.
- */
- private final class LocatorAdapter implements Locator {
-
- private LocatorAdapter() {
- }
-
- public int getColumnNumber() {
- Location location = getLocation();
- return location == null ? 0 : location.getColumnNumber();
- }
-
- public int getLineNumber() {
- Location location = getLocation();
- return location == null ? 0 : location.getLineNumber();
- }
-
- public String getPublicId() {
- Location location = getLocation();
- return location == null ? "" : location.getPublicId();
- }
-
- public String getSystemId() {
- Location location = getLocation();
- return location == null ? "" : location.getSystemId();
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidationSchemaExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidationSchemaExtensionPoint.java
deleted file mode 100644
index cc3bb59a5b..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ValidationSchemaExtensionPoint.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-import java.util.List;
-
-
-/**
- * An extension point for XML schemas used for validation.
- *
- * @version $Rev$ $Date$
- */
-public interface ValidationSchemaExtensionPoint {
-
- /**
- * Add a schema.
- *
- * @param uri the URI of the schema
- */
- void addSchema(String uri);
-
- /**
- * Remove a schema.
- *
- * @param uri the URI of the schema
- */
- void removeSchema(String uri);
-
- /**
- * Returns the list of schemas registered in the extension point.
- * @return the list of schemas
- */
- List<String> getSchemas();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java
deleted file mode 100644
index f3555ee71e..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-import java.lang.ref.WeakReference;
-
-import org.apache.tuscany.sca.assembly.Base;
-
-/**
- * A weak reference to a class, which should be used to register classes
- * with an ArtifactResolver and resolve these classes later.
- *
- * FIXME The core contribution model should not have dependencies on classes
- * and ClassLoaders. This should move to the Java import support module.
- *
- * @version $Rev$ $Date$
- */
-public class ClassReference implements Base {
-
- private WeakReference<Class<?>> clazz;
- private String className;
-
- /**
- * Constructs a new ClassReference.
- *
- * @param clazz The class reference
- */
- public ClassReference(Class<?> clazz) {
- this.clazz = new WeakReference<Class<?>>(clazz);
- this.className = clazz.getName();
- }
-
- /**
- * Constructs a new ClassReference.
- *
- * @param className The class name
- */
- public ClassReference(String className) {
- this.className = className;
- }
-
- /**
- * Get the referenced class.
- *
- * @return The referenced class
- */
- public Class<?> getJavaClass() {
- if (clazz != null) {
- return clazz.get();
- } else {
- return null;
- }
- }
-
- /**
- * Get the referenced class name.
- *
- * @return The class name
- */
- public String getClassName() {
- return className;
- }
-
- public boolean isUnresolved() {
- return clazz == null;
- }
-
- public void setUnresolved(boolean unresolved) {
- throw new IllegalStateException();
- }
-
- @Override
- public int hashCode() {
- return className.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else {
- if (obj instanceof ClassReference) {
- return className.equals(((ClassReference)obj).className);
- } else {
- return false;
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultDelegatingModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultDelegatingModelResolver.java
deleted file mode 100644
index 13c622adf0..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultDelegatingModelResolver.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Base;
-
-/**
- * A model resolver implementation that delegates to a list of model resolvers.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultDelegatingModelResolver implements ModelResolver {
-
- private List<ModelResolver> resolvers;
-
- public DefaultDelegatingModelResolver(List<ModelResolver> resolvers) {
- this.resolvers = resolvers;
- }
-
- 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 resolvers
- for (ModelResolver resolver: resolvers) {
-
- Object resolved = resolver.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/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportAllModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportAllModelResolver.java
deleted file mode 100644
index c6facd2b02..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportAllModelResolver.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportModelResolver.java
deleted file mode 100644
index 9ae57c41d0..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportModelResolver.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Base;
-import org.apache.tuscany.sca.contribution.Export;
-
-/**
- * A model resolver implementation that delegates to a list of exports.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultImportModelResolver implements ModelResolver {
-
- private List<Export> exports;
-
- public DefaultImportModelResolver(List<Export> exports) {
- this.exports = exports;
- }
-
- 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 exports
- for (Export export: exports) {
-
- 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/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolver.java
deleted file mode 100644
index 1803315e2e..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolver.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.DefaultImport;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-
-/**
- * A default implementation of a model resolver based on a map.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultModelResolver implements ModelResolver {
-
- private Contribution contribution;
- private Map<Object, Object> map = new HashMap<Object, Object>();
-
- public DefaultModelResolver() {
- }
-
- public DefaultModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- Object resolved = map.get(unresolved);
- if (resolved != null) {
-
- // Return the resolved object
- return modelClass.cast(resolved);
-
- } else {
-
- // by default try and resolve through a default import
- // if there is one.
- if (contribution != null){
- for (Import _import : contribution.getImports()){
- if (_import instanceof DefaultImport){
- resolved = _import.getModelResolver().resolveModel(modelClass, unresolved);
- if (resolved != unresolved){
- return modelClass.cast(resolved);
- }
- }
- }
- }
-
- // Return the unresolved object
- return unresolved;
- }
- }
-
- public void addModel(Object resolved) {
- map.put(resolved, resolved);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(resolved);
- }
-
- // FIXME: TUSCANY-2499: temporarily give access to the models to get the jms binding
- // use of definitions.xml working while the definitions.xml processing is being refactored
- public Map<Object, Object> getModels() {
- return map;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolverExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolverExtensionPoint.java
deleted file mode 100644
index 878a2efdab..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolverExtensionPoint.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.resolver;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-
-/**
- * The default implementation of a model resolver extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultModelResolverExtensionPoint implements ModelResolverExtensionPoint {
-
- private final Map<Class<?>, Class<? extends ModelResolver>> resolvers = new HashMap<Class<?>, Class<? extends ModelResolver>>();
- private Map<String, ServiceDeclaration> loadedResolvers;
-
- /**
- * Constructs a new DefaultModelResolverExtensionPoint.
- */
- public DefaultModelResolverExtensionPoint() {
- }
-
- public void addResolver(Class<?> modelType, Class<? extends ModelResolver> resolver) {
- resolvers.put(modelType, resolver);
- }
-
- public void removeResolver(Class<?> modelType) {
- resolvers.remove(modelType);
- }
-
- @SuppressWarnings("unchecked")
- public Class<? extends ModelResolver> getResolver(Class<?> modelType) {
- loadModelResolvers();
-
- Class<?>[] classes = modelType.getInterfaces();
- for (Class<?> c : classes) {
- Class<? extends ModelResolver> resolver = resolvers.get(c);
- if (resolver == null) {
- ServiceDeclaration resolverClass = loadedResolvers.get(c.getName());
- if (resolverClass != null) {
- try {
- return (Class<? extends ModelResolver>)resolverClass.loadClass();
- } catch (ClassNotFoundException e) {
- throw new IllegalArgumentException(e);
- }
- }
- } else {
- return resolver;
- }
- }
-
- Class<? extends ModelResolver > resolver = resolvers.get(modelType);
- if (resolver == null) {
- ServiceDeclaration resolverClass = loadedResolvers.get(modelType.getName());
- if (resolverClass != null) {
- try {
- return (Class<? extends ModelResolver>)resolverClass.loadClass();
- } catch (ClassNotFoundException e) {
- throw new IllegalArgumentException(e);
- }
- }
- }
- return resolver;
- }
-
- /**
- * Dynamically load model resolvers declared under META-INF/services
- */
- private void loadModelResolvers() {
- if (loadedResolvers != null)
- return;
- loadedResolvers = new HashMap<String, ServiceDeclaration>();
-
- // Get the model resolver service declarations
- Set<ServiceDeclaration> modelResolverDeclarations;
- try {
- modelResolverDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(ModelResolver.class.getName());
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
-
- // Load model resolvers
- for (ServiceDeclaration modelResolverDeclaration: modelResolverDeclarations) {
- Map<String, String> attributes = modelResolverDeclaration.getAttributes();
- String model = attributes.get("model");
-
- loadedResolvers.put(model, modelResolverDeclaration);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ExtensibleModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ExtensibleModelResolver.java
deleted file mode 100644
index b48742bcae..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ExtensibleModelResolver.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-import java.lang.reflect.Constructor;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-
-/**
- * An implementation of an extensible model resolver which delegates to the
- * proper resolver extension based on the class of the model to resolve.
- *
- * @version $Rev$ $Date$
- */
-public class ExtensibleModelResolver implements ModelResolver {
- private final ModelResolverExtensionPoint resolverExtensions;
- private final FactoryExtensionPoint modelFactories;
- private final Contribution contribution;
- private ModelResolver defaultResolver;
- private final Map<Class<?>, ModelResolver> resolversByModelType = new HashMap<Class<?>, ModelResolver>();
- private final Map<Class<?>, ModelResolver> resolversByImplementationClass = new HashMap<Class<?>, ModelResolver>();
- private Map<Object, Object> map = new HashMap<Object, Object>();
- private Object lastUnresolved;
-
- /**
- * Constructs an extensible model resolver
- *
- * @param contribution
- * @param resolverExtensions
- * @param modelFactories
- * @param defaultResolver
- */
- @Deprecated
- public ExtensibleModelResolver(Contribution contribution,
- ModelResolverExtensionPoint resolverExtensions,
- FactoryExtensionPoint modelFactories,
- ModelResolver defaultResolver) {
- this.contribution = contribution;
- this.resolverExtensions = resolverExtensions;
- this.modelFactories = modelFactories;
- //FIXME Remove this default resolver, this is currently used to resolve policy declarations
- // but they should be handled by the contribution import/export mechanism instead of this
- // defaultResolver hack.
- this.defaultResolver = defaultResolver;
- }
-
- /**
- * Constructs an extensible model resolver
- *
- * @param resolverExtensions
- * @param contribution
- * @param modelFactories
- */
- public ExtensibleModelResolver(Contribution contribution,
- ModelResolverExtensionPoint resolverExtensions,
- FactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- this.resolverExtensions = resolverExtensions;
- this.modelFactories = modelFactories;
- }
-
- /**
- * Returns the proper resolver instance based on the interfaces of the model
- * If one is not available on the registry, instantiate on demand
- *
- * @param modelType
- * @return
- */
- private ModelResolver getModelResolverInstance(Class<?> modelType) {
- // Look up a model resolver instance for the model class or
- // each implemented interface
- Class<?>[] interfaces = modelType.getInterfaces();
- Class<?>[] classes = new Class<?>[interfaces.length + 1];
- classes[0] = modelType;
- if (interfaces.length != 0) {
- System.arraycopy(interfaces, 0, classes, 1, interfaces.length);
- }
- for (Class<?> c : classes) {
-
- // Look up an existing model resolver instance
- ModelResolver resolverInstance = resolversByModelType.get(c);
- if (resolverInstance != null) {
- return resolverInstance;
- }
-
- // We don't have an instance, lookup a model resolver class
- // and instantiate it
- Class<? extends ModelResolver> resolverClass = resolverExtensions.getResolver(c);
- if (resolverClass != null) {
-
- // Construct the model resolver instance and cache it
- resolverInstance = resolversByImplementationClass.get(resolverClass);
- if (resolverInstance != null) {
- resolversByModelType.put(c, resolverInstance);
- return resolverInstance;
- }
- try {
- Constructor<? extends ModelResolver> constructor =
- resolverClass
- .getConstructor(new Class[] {Contribution.class, FactoryExtensionPoint.class});
- if (constructor != null) {
-
- resolverInstance = constructor.newInstance(contribution, modelFactories);
- resolversByImplementationClass.put(resolverClass, resolverInstance);
- resolversByModelType.put(c, resolverInstance);
- return resolverInstance;
- }
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- }
-
- return null;
- }
-
- public void addModel(Object resolved) {
- ModelResolver resolver = getModelResolverInstance(resolved.getClass());
- if (resolver != null) {
- resolver.addModel(resolved);
- } else {
- map.put(resolved, resolved);
- }
- }
-
- public Object removeModel(Object resolved) {
- ModelResolver resolver = getModelResolverInstance(resolved.getClass());
- if (resolver != null) {
- return resolver.removeModel(resolved);
- } else {
- return map.remove(resolved);
- }
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- // Protect against dependency cycles causing infinite recursion
- // Save the current unresolved object and check later if we are trying
- // to resolve the same object again
- if (unresolved == lastUnresolved) {
- return unresolved;
- }
- lastUnresolved = unresolved;
-
- ModelResolver resolver = getModelResolverInstance(unresolved.getClass());
- if (resolver != null) {
- Object resolved = resolver.resolveModel(modelClass, unresolved);
- if (resolved != null && resolved != unresolved) {
- lastUnresolved = null;
- return modelClass.cast(resolved);
- }
- } else {
- //FIXME Remove this default resolver, this is currently used to resolve policy declarations
- // but they should be handled by the contribution import/export mechanism instead of this
- // defaultResolver hack.
- if (defaultResolver != null) {
- Object resolved = defaultResolver.resolveModel(modelClass, unresolved);
- if (resolved != null && resolved != unresolved) {
- lastUnresolved = null;
- return modelClass.cast(resolved);
- }
- }
-
- Object resolved = map.get(unresolved);
- if (resolved != null) {
- // Return the resolved object
- lastUnresolved = null;
- return modelClass.cast(resolved);
- }
- }
-
- return unresolved;
- }
-
- // FIXME: TUSCANY-2499: temporarily give access to the defaultResolver to get the jms binding
- // use of definitions.xml working while the definitions.xml processing is being refactored
- public ModelResolver getDefaultModelResolver() {
- return defaultResolver;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolver.java
deleted file mode 100644
index 2831bebbc4..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolver.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-/**
- * A model resolver, responsible for resolving models in the scope of an
- * SCA contribution.
- *
- * SCA Assemblies reference artifacts of a wide variety of types. These
- * include:
- * <ul>
- * <li> Reference from one SCA composite to another SCA composite
- * <li> Reference to PolicySet files
- * <li> Reference to interface definition files, either WSDL or Java interfaces
- * <li> Reference to XSD files
- * <li> Reference to any of a wide variety of implementation artifact files,
- * including Java classes, BPEL scripts, C++ DLLs and classes, PHP scripts
- * </ul>
- *
- * In the SCA assemblies, these various artifacts are referenced using either
- * QNames or logical URIs. Model resolvers are used to resolve these references
- * and get the in-memory models representing the referenced artifacts.
- *
- * @version $Rev$ $Date$
- */
-public interface ModelResolver {
-
- /**
- * Resolve the model representing an artifact.
- *
- * @param modelClass the type of artifact
- * @param unresolved the unresolved model
- * @return the resolved model
- */
- <T> T resolveModel(Class<T> modelClass, T unresolved);
-
- /**
- * Add a resolved model.
- *
- * @param resolved The model
- */
- void addModel(Object resolved);
-
- /**
- * Remove a resolved model.
- *
- * @param resolved
- * @return The removed model, or null if the model was not removed
- */
- Object removeModel(Object resolved);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolverExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolverExtensionPoint.java
deleted file mode 100644
index 4a25059792..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolverExtensionPoint.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-
-/**
- * An extension point for model resolvers
- *
- * @version $Rev$ $Date$
- */
-public interface ModelResolverExtensionPoint {
-
- /**
- * Register a model resolver class using the model type as the key
- *
- * @param modelType The model type
- * @param resolver The model resolver Class
- */
- void addResolver(Class<?> modelType, Class <? extends ModelResolver> resolver);
-
- /**
- * Remove the model resolver class for a specific model type
- *
- * @param modelType The model type
- */
- void removeResolver(Class<?> modelType);
-
- /**
- * Retrieve a model resolver class for a specific model type
- *
- * @param modelType The model artifact type
- * @return The model resolver Class
- */
- Class <? extends ModelResolver> getResolver(Class<?> modelType);
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResolverExtension.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResolverExtension.java
deleted file mode 100644
index 74f0f2d71d..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResolverExtension.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-/**
- * Extension to assembly model implementations to provide a model resolver.
- *
- * @version $Rev$ $Date$
- */
-public interface ResolverExtension {
-
- /**
- * Returns the model resolver for the models representing the artifacts
- * visible in the scope of this contribution.
- *
- * @return The model resolver
- */
- ModelResolver getModelResolver();
-
- /**
- * Sets the model resolver for the models representing the artifacts
- * visible in the scope of this contribution.
- *
- * @param modelResolver The model resolver
- */
- void setModelResolver(ModelResolver modelResolver);
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResourceReference.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResourceReference.java
deleted file mode 100644
index 2394f4510b..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResourceReference.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-import java.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/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/ContributionScanner.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/ContributionScanner.java
deleted file mode 100644
index f84e336e6d..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/ContributionScanner.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.scanner;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.List;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-
-/**
- * Interface for contribution package scanners
- *
- * Contribution scanners understand the format of the contribution and how to get the
- * artifacts in the contribution.
- *
- * @version $Rev$ $Date$
- */
-public interface ContributionScanner {
-
- /**
- * Returns the type of package supported by this package scanner.
- *
- * @return the package type
- */
- String getContributionType();
-
- /**
- * Returns a list of artifacts in the contribution.
- *
- * @param contributionURL Contribution URL
- * @return List of artifact URIs
- * @throws ContributionReadException
- * @throws IOException
- */
- List<String> getArtifacts(URL contributionURL) throws ContributionReadException;
-
- /**
- * Return the URL for an artifact in the contribution.
- *
- * This is needed for archives such as jar files that have specific URL schemes
- * for the artifacts they contain.
- *
- * @param contributionURL Contribution URL
- * @param artifact The relative URI for the artifact
- * @throws ContributionReadException
- * @return The artifact URL
- */
- URL getArtifactURL(URL contributionURL, String artifact) throws ContributionReadException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/ContributionScannerExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/ContributionScannerExtensionPoint.java
deleted file mode 100644
index 1ca9def4ea..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/ContributionScannerExtensionPoint.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.scanner;
-
-/**
- * An extension point for contribution scanners
- *
- * @version $Rev$ $Date$
- */
-public interface ContributionScannerExtensionPoint {
-
- /**
- * Add a ContributionScanner using the contribution type as the key.
- *
- * @param scanner The contribution scanner
- */
- void addContributionScanner(ContributionScanner scanner);
-
- /**
- * Remove a ContributionScanner.
- *
- * @param scanner The contribution scanner
- */
- void removeContributionScanner(ContributionScanner scanner);
-
- /**
- * Returns the ContributionScanner for the given contribution type.
- *
- * @param contributionType The contribution type
- * @return The contribution scanner
- */
- ContributionScanner getContributionScanner(String contributionType);
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/DefaultContributionScannerExtensionPoint.java b/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/DefaultContributionScannerExtensionPoint.java
deleted file mode 100644
index cf3c77d5eb..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/DefaultContributionScannerExtensionPoint.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.scanner;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * Default implementation of a contribution scanner extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultContributionScannerExtensionPoint implements ContributionScannerExtensionPoint {
-
- private Map<String, ContributionScanner> scanners = new HashMap<String, ContributionScanner>();
- private boolean loaded;
-
- public DefaultContributionScannerExtensionPoint() {
- }
-
- public void addContributionScanner(ContributionScanner scanner) {
- scanners.put(scanner.getContributionType(), scanner);
- }
-
- public void removeContributionScanner(ContributionScanner scanner) {
- scanners.remove(scanner.getContributionType());
- }
-
- public ContributionScanner getContributionScanner(String contentType) {
- loadScanners();
- return scanners.get(contentType);
- }
-
- private void loadScanners() {
- if (loaded)
- return;
-
- // Get the scanner service declarations
- Set<ServiceDeclaration> scannerDeclarations;
- try {
- scannerDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(ContributionScanner.class.getName());
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
-
- for (ServiceDeclaration scannerDeclaration: scannerDeclarations) {
- Map<String, String> attributes = scannerDeclaration.getAttributes();
-
- // Load a URL artifact scanner
- String contributionType = attributes.get("type");
-
- // Create a scanner wrapper and register it
- ContributionScanner scanner = new LazyContributionScanner(contributionType, scannerDeclaration);
- addContributionScanner(scanner);
- }
-
- loaded = true;
- }
-
- /**
- * A facade for contribution scanners.
- */
- private static class LazyContributionScanner implements ContributionScanner {
-
- private ServiceDeclaration scannerDeclaration;
- private String contributionType;
- private ContributionScanner scanner;
-
- private LazyContributionScanner(String contributionType, ServiceDeclaration scannerDeclaration) {
- this.scannerDeclaration = scannerDeclaration;
- this.contributionType = contributionType;
- }
-
- public URL getArtifactURL(URL contributionSourceURL, String artifact) throws ContributionReadException {
- return getScanner().getArtifactURL(contributionSourceURL, artifact);
- }
-
- public List<String> getArtifacts(URL contributionSourceURL) throws ContributionReadException {
- return getScanner().getArtifacts(contributionSourceURL);
- }
-
- public String getContributionType() {
- return contributionType;
- }
-
- private ContributionScanner getScanner() {
- if (scanner == null) {
- try {
- Class<ContributionScanner> scannerClass = (Class<ContributionScanner>)scannerDeclaration.loadClass();
- Constructor<ContributionScanner> constructor = scannerClass.getConstructor();
- scanner = constructor.newInstance();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return scanner;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.ContributionFactory b/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.ContributionFactory
deleted file mode 100644
index bcc346d9f8..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.ContributionFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.DefaultContributionFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ContributionPostProcessorExtensionPoint b/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ContributionPostProcessorExtensionPoint
deleted file mode 100644
index 9e6433ba6c..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ContributionPostProcessorExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.processor.DefaultContributionPostProcessorExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint b/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint
deleted file mode 100644
index 8ea5fc0a7e..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessorExtensionPoint b/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessorExtensionPoint
deleted file mode 100644
index 607725bcfe..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessorExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.processor.DefaultStAXAttributeProcessorExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint b/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint
deleted file mode 100644
index 9d78ca93d0..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProcessorExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory b/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory
deleted file mode 100644
index f2856cb259..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT 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.tuscany.sca.contribution.processor.DefaultValidatingXMLInputFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint b/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint
deleted file mode 100644
index ae6e876df6..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.processor.DefaultValidationSchemaExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint b/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint
deleted file mode 100644
index 4bb65e55e7..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.resolver.DefaultModelResolverExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.scanner.ContributionScannerExtensionPoint b/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.scanner.ContributionScannerExtensionPoint
deleted file mode 100644
index 727f8f6ce7..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.scanner.ContributionScannerExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.scanner.DefaultContributionScannerExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/contribution-validation-messages.properties b/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/contribution-validation-messages.properties
deleted file mode 100644
index 4f9f85048e..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/main/resources/contribution-validation-messages.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-SchemaError = XMLSchema validation error occured in: {0} ,line = {1}, column = {2}, Message = {3}
-SchemaFatalError = XMLSchema validation fatal error occured in: {0} ,line = {1}, column = {2}, Message = {3}
-SchemaWarning = XMLSchema validation warning occured in: {0} ,line = {1}, column = {2}, Message = {3}
-UnsupportedPackageTypeException = Unsupported contribution package type: {0}
-ElementCannotBeProcessed = Element {0} cannot be processed. ({1})
-AttributeCannotBeProcessed = Attribute {0} cannot be processed. ({1})
-NoStaxProcessor = No StAX processor is configured to handle {0}
-ContributionWriteException = ContributionWriteException occured due to :
-ContributionReadException = ContributionReadException occured due to :
-UnrecognizedElementException = Unrecognized Element : {0}
-IllegalArgumentException = Invalid qname: {0}
-PrivilegedActionException = PrivilegedActionException occured due to :
-AttributeCannotBeProcessed = Attribute {0} cannot be processed. ({1})
-
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/processor/URLartifactProcessorExtensionPointTestCase.java b/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/processor/URLartifactProcessorExtensionPointTestCase.java
deleted file mode 100644
index 3b99cc0312..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/processor/URLartifactProcessorExtensionPointTestCase.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.net.URI;
-import java.net.URL;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * URL Artifact Processor Extension Point test case
- * Verifies the right registration and lookup for processors that handle filename and file types
- *
- * @version $Rev$ $Date$
- */
-public class URLartifactProcessorExtensionPointTestCase {
-
- private static URLArtifactProcessorExtensionPoint artifactProcessors;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- artifactProcessors = new DefaultURLArtifactProcessorExtensionPoint(extensionPoints);
- artifactProcessors.addArtifactProcessor(new FileTypeArtifactProcessor());
- artifactProcessors.addArtifactProcessor(new FileNameArtifactProcessor());
- }
-
- @Test
- public final void testFileTypeProcessor() {
- assertNotNull(artifactProcessors.getProcessor(".m1"));
- }
-
- @Test
- public final void testFileNameProcessor() {
- assertNotNull(artifactProcessors.getProcessor("file.m2"));
-
- }
-
- /**
- * Internal mock classes
- *
- */
-
- private class M1 {
- }
-
- private class M2 {
- }
-
- private static class FileTypeArtifactProcessor implements URLArtifactProcessor<M1> {
- public FileTypeArtifactProcessor() {
- }
-
- public M1 read(URL contributionURL, URI uri, URL url) throws ContributionReadException {
- return null;
- }
-
- public void resolve(M1 m1, ModelResolver resolver) throws ContributionResolveException {
- }
-
- public String getArtifactType() {
- return ".m1";
- }
-
- public Class<M1> getModelType() {
- return M1.class;
- }
- }
-
- private static class FileNameArtifactProcessor implements URLArtifactProcessor<M2> {
- public FileNameArtifactProcessor() {
- }
-
- public M2 read(URL contributionURL, URI uri, URL url) throws ContributionReadException {
- return null;
- }
-
- public void resolve(M2 m2, ModelResolver resolver) throws ContributionResolveException {
- }
-
- public String getArtifactType() {
- return "file.m2";
- }
-
- public Class<M2> getModelType() {
- return M2.class;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolverTestCase.java b/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolverTestCase.java
deleted file mode 100644
index b778167217..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/DefaultModelResolverTestCase.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-import static org.junit.Assert.assertTrue;
-
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.DefaultContributionFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test the default model resolver implementation.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultModelResolverTestCase {
-
- private ModelResolver resolver;
- private ContributionFactory factory;
-
- @Before
- public void setUp() throws Exception {
- resolver = new DefaultModelResolver();
- factory = new DefaultContributionFactory();
- }
-
- @Test
- public void testResolved() {
- Model a = new Model("a");
- resolver.addModel(a);
- Model x = new Model("a");
- x = resolver.resolveModel(Model.class, x);
- assertTrue(x == a);
- }
-
- @Test
- public void testUnresolved() {
- Model x = new Model("a");
- Model y = resolver.resolveModel(Model.class, x);
- assertTrue(x == y);
- }
-
- @Test
- public void testResolvedArtifact() {
- Artifact artifact = factory.createArtifact();
- artifact.setURI("foo/bar");
- resolver.addModel(artifact);
- Artifact x = factory.createArtifact();
- x.setURI("foo/bar");
- x = resolver.resolveModel(Artifact.class, x);
- assertTrue(x == artifact);
- }
-
- class Model {
- private String name;
-
- Model(String name) {
- this.name = name;
- }
-
- @Override
- public int hashCode() {
- return name.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- return name.equals(((Model)obj).name);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/ExtensibleModelResolverTestCase.java b/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/ExtensibleModelResolverTestCase.java
deleted file mode 100644
index 2422c8fb94..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/ExtensibleModelResolverTestCase.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* 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 static org.junit.Assert.assertTrue;
-
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.DefaultContributionFactory;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test DefaultArtifactResolver.
- *
- * @version $Rev$ $Date$
- */
-public class ExtensibleModelResolverTestCase {
- private ExtensibleModelResolver resolver;
-
- private ContributionFactory factory;
-
- @Before
- public void setUp() throws Exception {
-
- ModelResolverExtensionPoint resolvers = new DefaultModelResolverExtensionPoint();
- resolvers.addResolver(Model.class, TestModelResolver.class);
-
- FactoryExtensionPoint factories = new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry());
-
- resolver = new ExtensibleModelResolver(null, resolvers, factories, null);
-
- factory = new DefaultContributionFactory();
- }
-
- @Test
- public void testResolvedDefault() {
- OtherModel a = new OtherModel("a");
- resolver.addModel(a);
- OtherModel x = new OtherModel("a");
- x = resolver.resolveModel(OtherModel.class, x);
- assertTrue(x == a);
- }
-
- @Test
- public void testResolvedRegisteredClass() {
- Model a = new Model("a");
- resolver.addModel(a);
- Model x = new Model("a");
- x = resolver.resolveModel(Model.class, x);
- assertTrue(x == a);
- }
-
- @Test
- public void testUnresolvedDefault() {
- OtherModel x = new OtherModel("a");
- OtherModel y = resolver.resolveModel(OtherModel.class, x);
- assertTrue(x == y);
- }
-
- @Test
- public void testUnresolved() {
- Model x = new Model("a");
- Model y = resolver.resolveModel(Model.class, x);
- assertTrue(x == y);
- }
-
- @Test
- public void testResolvedArtifact() {
- Artifact artifact = factory.createArtifact();
- artifact.setURI("foo/bar");
- resolver.addModel(artifact);
- Artifact x = factory.createArtifact();
- x.setURI("foo/bar");
- x = resolver.resolveModel(Artifact.class, x);
- assertTrue(x == artifact);
- }
-
- private class Model {
- private String name;
-
- Model(String name) {
- this.name = name;
- }
-
- @Override
- public int hashCode() {
- return name.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- return name.equals(((Model)obj).name);
- }
- }
-
- private class OtherModel {
- private String name;
-
- OtherModel(String name) {
- this.name = name;
- }
-
- @Override
- public int hashCode() {
- return name.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- return name.equals(((OtherModel)obj).name);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/TestModelResolver.java b/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/TestModelResolver.java
deleted file mode 100644
index cd586d3b2c..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/resolver/TestModelResolver.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-
-/**
- * A test implementation of a model resolver, based on a map.
- *
- * @version $Rev$ $Date$
- */
-public class TestModelResolver implements ModelResolver {
-
- private Map<Object, Object> map = new HashMap<Object, Object>();
-
- public TestModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- Object resolved = map.get(unresolved);
- if (resolved != null) {
- // Return the resolved object
- return modelClass.cast(resolved);
- }
- // Return the unresolved object
- return unresolved;
- }
-
- public void addModel(Object resolved) {
- map.put(resolved, resolved);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(resolved);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/deployables/sample-calculator.jar b/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/deployables/sample-calculator.jar
deleted file mode 100644
index 0ca3a1b781..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/deployables/sample-calculator.jar
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/repository/sample-calculator.jar b/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/repository/sample-calculator.jar
deleted file mode 100644
index 9c46c679d2..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/repository/sample-calculator.jar
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/test.composite b/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/test.composite
deleted file mode 100644
index 1e09549194..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/test.composite
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>
- This file just needs to exist
-</composite> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/test.ext b/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/test.ext
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tags/java/sca/2.0-M1/modules/contribution/src/test/resources/test.ext
+++ /dev/null
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/LICENSE b/tags/java/sca/2.0-M1/modules/core-databinding/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/core-databinding/META-INF/MANIFEST.MF
deleted file mode 100644
index 44bf03006e..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,48 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.core.databinding.module;versio
- n="2.0.0",org.apache.tuscany.sca.core.databinding.processor;version="2.0.0",
- org.apache.tuscany.sca.core.databinding.transformers;version="2.0.0"
- ,org.apache.tuscany.sca.core.databinding.wire;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Core/DataBinding Integration
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397235359
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Core/DataBinding Integration
-Import-Package: javax.xml.bind.annotation.adapters,
- javax.xml.namespace,
- javax.xml.stream,
- javax.xml.transform,
- javax.xml.transform.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.core.context;version="2.0.0",
- org.apache.tuscany.sca.databinding;version="2.0.0",
- org.apache.tuscany.sca.databinding.annotation;version="2.0.0",
- org.apache.tuscany.sca.databinding.impl;version="2.0.0",
- org.apache.tuscany.sca.databinding.javabeans;version="2.0.0",
- org.apache.tuscany.sca.databinding.jaxb;version="2.0.0",
- org.apache.tuscany.sca.databinding.xml;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.introspect;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.jaxws;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.apache.tuscany.sca.xsd;version="2.0.0",
-
- org.oasisopen.sca;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0",
- org.w3c.dom;resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.core.databinding
-Bundle-DocURL: http://www.apache.org/
-Export-Package: org.apache.tuscany.sca.core.databinding.processor;
- version="2.0.0";uses:="org.w3c.dom"
-
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/NOTICE b/tags/java/sca/2.0-M1/modules/core-databinding/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/pom.xml b/tags/java/sca/2.0-M1/modules/core-databinding/pom.xml
deleted file mode 100644
index 32ea3997b7..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/pom.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <packaging>jar</packaging>
- <name>Apache Tuscany SCA Core/DataBinding Integration</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-jaxws</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <scope>runtime</scope>
- <version>3.2.4</version>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java
deleted file mode 100644
index 885a9390d8..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.databinding.module;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.core.databinding.processor.DataBindingJavaInterfaceProcessor;
-import org.apache.tuscany.sca.core.databinding.transformers.Array2ArrayTransformer;
-import org.apache.tuscany.sca.core.databinding.transformers.CallableReferenceXMLAdapter;
-import org.apache.tuscany.sca.core.databinding.transformers.Exception2ExceptionTransformer;
-import org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer;
-import org.apache.tuscany.sca.core.databinding.transformers.Output2OutputTransformer;
-import org.apache.tuscany.sca.core.databinding.wire.DataBindingRuntimeWireProcessor;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.impl.Group2GroupTransformer;
-import org.apache.tuscany.sca.databinding.impl.MediatorImpl;
-import org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSFaultExceptionMapper;
-import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor;
-import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint;
-import org.oasisopen.sca.CallableReference;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DataBindingModuleActivator implements ModuleActivator {
-
- public void start(ExtensionPointRegistry registry) {
- DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class);
- TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class);
-
- XMLAdapterExtensionPoint xmlAdapterExtensionPoint = registry.getExtensionPoint(XMLAdapterExtensionPoint.class);
- xmlAdapterExtensionPoint.addAdapter(CallableReference.class, CallableReferenceXMLAdapter.class);
- FaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, xmlAdapterExtensionPoint);
-
- MediatorImpl mediator = new MediatorImpl(dataBindings, transformers);
- Input2InputTransformer input2InputTransformer = new Input2InputTransformer();
- input2InputTransformer.setMediator(mediator);
- transformers.addTransformer(input2InputTransformer, true);
-
- Output2OutputTransformer output2OutputTransformer = new Output2OutputTransformer();
- output2OutputTransformer.setMediator(mediator);
- transformers.addTransformer(output2OutputTransformer, true);
-
- Exception2ExceptionTransformer exception2ExceptionTransformer = new Exception2ExceptionTransformer(mediator, faultExceptionMapper);
- transformers.addTransformer(exception2ExceptionTransformer, false);
-
- Array2ArrayTransformer array2ArrayTransformer = new Array2ArrayTransformer();
- array2ArrayTransformer.setMediator(mediator);
- transformers.addTransformer(array2ArrayTransformer, true);
-
- Group2GroupTransformer group2GroupTransformer = new Group2GroupTransformer();
- group2GroupTransformer.setMediator(mediator);
- transformers.addTransformer(group2GroupTransformer, true);
-
-// dataBindings.addDataBinding(new CallableReferenceDataBinding());
-// transformers.addTransformer(new CallableReference2XMLStreamReader(), true);
-// transformers.addTransformer(new XMLStreamReader2CallableReference(), false);
-
- FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
- JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
-
- // [rfeng] The JAX-WS processor should come before the Databinding processor to make sure @WebService
- // is honored as Remoteable
- javaFactory.addInterfaceVisitor(new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, xmlAdapterExtensionPoint));
-
- javaFactory.addInterfaceVisitor(new DataBindingJavaInterfaceProcessor(dataBindings));
-
- RuntimeWireProcessorExtensionPoint wireProcessorExtensionPoint = registry.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class);
- if (wireProcessorExtensionPoint != null) {
- wireProcessorExtensionPoint.addWireProcessor(new DataBindingRuntimeWireProcessor(mediator, dataBindings, faultExceptionMapper));
- }
-
- }
-
- public void stop(ExtensionPointRegistry registry) {
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java
deleted file mode 100644
index e182b472d4..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.databinding.processor;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.databinding.annotation.DataBinding;
-import org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding;
-import org.apache.tuscany.sca.databinding.javabeans.SimpleJavaDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-
-/**
- * The databinding annotation processor for java interfaces
- *
- * @version $Rev$ $Date$
- */
-public class DataBindingJavaInterfaceProcessor implements JavaInterfaceVisitor {
- private static final String JAXB_DATABINDING = "javax.xml.bind.JAXBElement";
- private DataBindingExtensionPoint dataBindingRegistry;
-
- public DataBindingJavaInterfaceProcessor(DataBindingExtensionPoint dataBindingRegistry) {
- super();
- this.dataBindingRegistry = dataBindingRegistry;
- }
-
- public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException {
- if (!javaInterface.isRemotable()) {
- return;
- }
- List<Operation> operations = javaInterface.getOperations();
- processInterface(javaInterface, operations);
- }
-
- private void processInterface(JavaInterface javaInterface, List<Operation> operations) {
- Class<?> clazz = javaInterface.getJavaClass();
- DataBinding dataBinding = clazz.getAnnotation(DataBinding.class);
- String dataBindingId = null;
- boolean wrapperStyle = false;
- if (dataBinding != null) {
- dataBindingId = dataBinding.value();
- wrapperStyle = dataBinding.wrapped();
- }
-
- Map<String, Operation> opMap = new HashMap<String, Operation>();
- for (Operation op : javaInterface.getOperations()) {
- opMap.put(op.getName(), op);
- // In the case of @WebMethod, the method name can be different from the operation name
- if (op instanceof JavaOperation) {
- opMap.put(((JavaOperation)op).getJavaMethod().getName(), op);
- }
- if (dataBindingId != null) {
- op.setDataBinding(dataBindingId);
- op.setWrapperStyle(wrapperStyle);
- }
- }
- for (Method method : clazz.getMethods()) {
- if (method.getDeclaringClass() == Object.class) {
- continue;
- }
- Operation operation = opMap.get(method.getName());
- if (operation == null) { // @WebMethod exclude=true
- continue;
- }
- DataBinding methodDataBinding = clazz.getAnnotation(DataBinding.class);
- if (methodDataBinding == null) {
- methodDataBinding = dataBinding;
- }
- dataBindingId = null;
- wrapperStyle = false;
- if (dataBinding != null) {
- dataBindingId = dataBinding.value();
- wrapperStyle = dataBinding.wrapped();
- operation.setDataBinding(dataBindingId);
- operation.setWrapperStyle(wrapperStyle);
- }
-
- // FIXME: We need a better way to identify simple java types
- int i = 0;
- for (org.apache.tuscany.sca.interfacedef.DataType<?> d : operation.getInputType().getLogical()) {
- if (d.getDataBinding() == null) {
- d.setDataBinding(dataBindingId);
- }
- for (Annotation a : method.getParameterAnnotations()[i]) {
- if (a.annotationType() == org.apache.tuscany.sca.databinding.annotation.DataType.class) {
- String value = ((org.apache.tuscany.sca.databinding.annotation.DataType)a).value();
- d.setDataBinding(value);
- }
- }
- dataBindingRegistry.introspectType(d, operation);
- i++;
- }
- if (operation.getOutputType() != null) {
- DataType<?> d = operation.getOutputType();
- if (d.getDataBinding() == null) {
- d.setDataBinding(dataBindingId);
- }
- org.apache.tuscany.sca.databinding.annotation.DataType dt =
- method.getAnnotation(org.apache.tuscany.sca.databinding.annotation.DataType.class);
- if (dt != null) {
- d.setDataBinding(dt.value());
- }
- dataBindingRegistry.introspectType(d, operation);
- }
- for (org.apache.tuscany.sca.interfacedef.DataType<?> d : operation.getFaultTypes()) {
- if (d.getDataBinding() == null) {
- d.setDataBinding(dataBindingId);
- }
- // TODO: Handle exceptions
- dataBindingRegistry.introspectType(d, operation);
- }
-
- // JIRA: TUSCANY-842
- String db = operation.getDataBinding();
- if (db == null || JAXB_DATABINDING.equals(db)) {
- assignOperationDataBinding(operation);
- db = operation.getDataBinding();
- }
-
- // Introspect the wrapper data type
- if (operation.getWrapper() != null) {
- org.apache.tuscany.sca.databinding.DataBinding dbObj =
- dataBindingRegistry.getDataBinding(db);
- WrapperHandler handler = dbObj == null ? null : dbObj.getWrapperHandler();
- if (handler != null) {
- WrapperInfo wrapper = operation.getWrapper();
- wrapper.setInputWrapperType(handler.getWrapperType(operation, true));
- wrapper.setOutputWrapperType(handler.getWrapperType(operation, false));
- }
- if (dbObj != null && handler == null) {
- // To avoid JAXB wrapper bean generation
- WrapperInfo wrapper = operation.getWrapper();
- wrapper.setInputWrapperType(null);
- wrapper.setOutputWrapperType(null);
- }
- }
- }
- }
-
- /*
- * Assigns an operation DB if one of the input types, output type, fault types has a non-default DB.
- * However, if two of the input types, output type, fault types have two different non-default DBs
- * ( e.g. SDO and JAXB), then we do nothing to the operation DB.
- *
- * The method logic assumes the JavaBeans DataBinding is the default
- */
- private void assignOperationDataBinding(Operation operation) {
-
- Set<String> dbs = new HashSet<String>();
-
- // Can't use DataType<?> since operation.getInputType() returns: DataType<List<DataType>>
- List<DataType> opDataTypes = new LinkedList<DataType>();
-
- opDataTypes.addAll(operation.getInputType().getLogical());
- opDataTypes.add(operation.getOutputType());
- for (DataType<DataType> ft : operation.getFaultTypes()) {
- opDataTypes.add(ft.getLogical());
- }
-
- for (DataType<?> d : opDataTypes) {
- if (d != null) {
- String dataBinding = d.getDataBinding();
- if ("java:array".equals(dataBinding)) {
- dataBinding = ((DataType)d.getLogical()).getDataBinding();
- }
- if (dataBinding != null) {
- dbs.add(dataBinding);
- }
- }
- }
-
- dbs.remove(JavaBeansDataBinding.NAME);
- dbs.remove(SimpleJavaDataBinding.NAME);
-
- if (dbs.size() == 1) {
- operation.setDataBinding(dbs.iterator().next());
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Array2ArrayTransformer.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Array2ArrayTransformer.java
deleted file mode 100644
index 427e0b254a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Array2ArrayTransformer.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.databinding.transformers;
-
-import java.lang.reflect.Array;
-
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * This is a special transformer to transform the output from one IDL to the
- * other one
- *
- * @version $Rev$ $Date$
- */
-public class Array2ArrayTransformer extends BaseTransformer<Object, Object> implements PullTransformer<Object, Object> {
-
- protected Mediator mediator;
-
- public Array2ArrayTransformer() {
- super();
- }
-
- /**
- * @param mediator the mediator to set
- */
- @Reference
- public void setMediator(Mediator mediator) {
- this.mediator = mediator;
- }
-
- @Override
- public String getSourceDataBinding() {
- return "java:array";
- }
-
- @Override
- public String getTargetDataBinding() {
- return "java:array";
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getSourceType()
- */
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getTargetType()
- */
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.Transformer#getWeight()
- */
- @Override
- public int getWeight() {
- return 10;
- }
-
- @SuppressWarnings("unchecked")
- public Object transform(Object array, TransformationContext context) {
- try {
- if (array == null) {
- return null;
- }
- DataType<DataType> sourceType = context.getSourceDataType();
- DataType<DataType> targetType = context.getTargetDataType();
- int length = Array.getLength(array);
- Object targetArray = Array.newInstance(targetType.getPhysical().getComponentType(), length);
- for (int i = 0; i < length; i++) {
- Object sourceItem = Array.get(array, i);
- Object targetItem =
- mediator.mediate(sourceItem, sourceType.getLogical(), targetType.getLogical(), context
- .getMetadata());
- Array.set(targetArray, i, targetItem);
- }
- return targetArray;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReference2XMLStreamReader.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReference2XMLStreamReader.java
deleted file mode 100644
index 4267b1e347..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReference2XMLStreamReader.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.databinding.transformers;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.core.context.CallableReferenceExt;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.xml.StAXHelper;
-import org.oasisopen.sca.CallableReference;
-
-public class CallableReference2XMLStreamReader extends BaseTransformer<CallableReference, XMLStreamReader> implements
- PullTransformer<CallableReference, XMLStreamReader> {
-
- @Override
- protected Class<CallableReference> getSourceType() {
- return CallableReference.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- public XMLStreamReader transform(CallableReference source, TransformationContext context) {
- try {
- if (source != null) {
- if (source instanceof CallableReferenceExt) {
- XMLStreamReader xmlReader = ((CallableReferenceExt)source).getXMLReader();
- if (xmlReader != null) {
- return xmlReader;
- } else {
- String xmlString = ((CallableReferenceExt)source).toXMLString();
-
- // remove "<?xml...?>" processing instruction and wrap with a top-level element
- return StAXHelper.createXMLStreamReader("<reference xmlns=\"http://callable\">"
- + xmlString.substring(xmlString.indexOf("?>") + 2)
- + "</reference>");
- }
- } else {
- throw new TransformationException("Unrecognized transformation source object");
- }
- } else {
- return null;
- }
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceDataBinding.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceDataBinding.java
deleted file mode 100644
index 97e16da273..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceDataBinding.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.databinding.transformers;
-
-import org.apache.tuscany.sca.databinding.XMLTypeHelper;
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.oasisopen.sca.CallableReference;
-
-public class CallableReferenceDataBinding extends BaseDataBinding {
-
- public static final String NAME = CallableReference.class.getName();
-
- private CallableReferenceTypeHelper xmlTypeHelper;
-
- public CallableReferenceDataBinding() {
- super(NAME, CallableReference.class);
- this.xmlTypeHelper = new CallableReferenceTypeHelper();
- }
-
- @Override
- public XMLTypeHelper getXMLTypeHelper() {
- return xmlTypeHelper;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceTypeHelper.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceTypeHelper.java
deleted file mode 100644
index 97629ea7b5..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceTypeHelper.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.databinding.transformers;
-
-import java.beans.Introspector;
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.databinding.XMLTypeHelper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class CallableReferenceTypeHelper implements XMLTypeHelper {
- private static final String SCHEMA_NS = "http://www.w3.org/2001/XMLSchema";
- private static final String ANYTYPE_NAME = "anyType";
- private static final QName ANYTYPE_QNAME = new QName(SCHEMA_NS, ANYTYPE_NAME);
-
- public CallableReferenceTypeHelper() {
- super();
- }
-
- public TypeInfo getTypeInfo(Class javaType, Object logical) {
- QName xmlType = JavaXMLMapper.getXMLType(javaType);
- if (xmlType != null) {
- return new TypeInfo(xmlType, true, null);
- } else if (javaType.isInterface()) {
- return new TypeInfo(ANYTYPE_QNAME, true, null);
- } else {
- if (logical instanceof XMLType) {
- xmlType = ((XMLType)logical).getTypeName();
- }
- if (xmlType == null) {
- xmlType = new QName(Introspector.decapitalize(javaType.getSimpleName()));
- }
- return new TypeInfo(xmlType, false, null);
- }
- }
-
- public List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver, Interface intf) {
- return new ArrayList<XSDefinition>();
- }
-
- public List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver, List<DataType> dataTypes) {
- return new ArrayList<XSDefinition>();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceXMLAdapter.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceXMLAdapter.java
deleted file mode 100644
index 82853599b5..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/CallableReferenceXMLAdapter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.databinding.transformers;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.xml.Node2XMLStreamReader;
-import org.apache.tuscany.sca.databinding.xml.XMLStreamReader2Node;
-import org.oasisopen.sca.CallableReference;
-import org.w3c.dom.Element;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CallableReferenceXMLAdapter extends XmlAdapter<Element, CallableReference> {
-
- @Override
- public CallableReference unmarshal(Element v) throws Exception {
- Node2XMLStreamReader tf = new Node2XMLStreamReader();
- XMLStreamReader reader = tf.transform(v, null);
- XMLStreamReader2CallableReference t2 = new XMLStreamReader2CallableReference();
- return t2.transform(reader, null);
- }
-
- @Override
- public Element marshal(CallableReference v) throws Exception {
- CallableReference2XMLStreamReader t = new CallableReference2XMLStreamReader();
- XMLStreamReader reader = t.transform(v, null);
- XMLStreamReader2Node t2 = new XMLStreamReader2Node();
- return (Element) t2.transform(reader, null);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Exception2ExceptionTransformer.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Exception2ExceptionTransformer.java
deleted file mode 100644
index 6e2e714bdb..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Exception2ExceptionTransformer.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.databinding.transformers;
-
-import org.apache.tuscany.sca.databinding.DataBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper;
-
-/**
- * This is a special transformer to transform the exception from one IDL to the
- * other one
- *
- * @version $Rev$ $Date$
- */
-public class Exception2ExceptionTransformer extends BaseTransformer<Throwable, Throwable> implements
- PullTransformer<Throwable, Throwable> {
-
- protected Mediator mediator;
- protected FaultExceptionMapper faultExceptionMapper;
-
- public Exception2ExceptionTransformer(Mediator mediator, FaultExceptionMapper faultExceptionMapper) {
- super();
- this.mediator = mediator;
- this.faultExceptionMapper = faultExceptionMapper;
- }
-
- public Exception2ExceptionTransformer() {
- super();
- }
-
- @Override
- public String getSourceDataBinding() {
- return DataBinding.IDL_FAULT;
- }
-
- @Override
- public String getTargetDataBinding() {
- return DataBinding.IDL_FAULT;
- }
-
- /**
- * @param mediator the mediator to set
- */
- public void setMediator(Mediator mediator) {
- this.mediator = mediator;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getSourceType()
- */
- @Override
- protected Class<Throwable> getSourceType() {
- return Throwable.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getTargetType()
- */
- @Override
- protected Class<Throwable> getTargetType() {
- return Throwable.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.Transformer#getWeight()
- */
- @Override
- public int getWeight() {
- return 10000;
- }
-
- @SuppressWarnings("unchecked")
- public Throwable transform(Throwable source, TransformationContext context) {
- DataType<DataType> sourceType = context.getSourceDataType();
-
- DataType<DataType> targetType = context.getTargetDataType();
-
- Object sourceFaultInfo = faultExceptionMapper.getFaultInfo(source, sourceType.getLogical().getPhysical(), context.getSourceOperation());
- Object targetFaultInfo =
- mediator.mediate(sourceFaultInfo, sourceType.getLogical(), targetType.getLogical(), context.getMetadata());
-
- Throwable targetException =
- faultExceptionMapper.wrapFaultInfo(targetType, source.getMessage(), targetFaultInfo, source.getCause(), context.getTargetOperation());
-
- // FIXME
- return targetException == null ? source : targetException;
-
- }
-
- public void setFaultExceptionMapper(FaultExceptionMapper faultExceptionMapper) {
- this.faultExceptionMapper = faultExceptionMapper;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java
deleted file mode 100644
index b05f0cc238..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.databinding.transformers;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.databinding.DataBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * This is a special transformer to transform the input from one IDL to the
- * other one
- *
- * @version $Rev$ $Date$
- */
-public class Input2InputTransformer extends BaseTransformer<Object[], Object[]> implements
- PullTransformer<Object[], Object[]> {
- private static final Logger logger = Logger.getLogger(Input2InputTransformer.class.getName());
-
- protected Mediator mediator;
-
- public Input2InputTransformer() {
- super();
- }
-
- @Override
- public String getSourceDataBinding() {
- return DataBinding.IDL_INPUT;
- }
-
- @Override
- public String getTargetDataBinding() {
- return DataBinding.IDL_INPUT;
- }
-
- /**
- * @param mediator the mediator to set
- */
- @Reference
- public void setMediator(Mediator mediator) {
- this.mediator = mediator;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getSourceType()
- */
- @Override
- protected Class<Object[]> getSourceType() {
- return Object[].class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getTargetType()
- */
- @Override
- protected Class<Object[]> getTargetType() {
- return Object[].class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.Transformer#getWeight()
- */
- @Override
- public int getWeight() {
- return 10000;
- }
-
- /**
- * Match the structure of the wrapper element. If it matches, then we can do
- * wrapper to wrapper transformation. Otherwise, we do child to child.
- * @param w1
- * @param w2
- * @return
- */
- private boolean matches(WrapperInfo w1, WrapperInfo w2) {
- if (w1 == null || w2 == null) {
- return false;
- }
- if (!w1.getInputWrapperElement().equals(w2.getInputWrapperElement())) {
- return false;
- }
-
- // Compare the child elements
- List<ElementInfo> list1 = w1.getInputChildElements();
- List<ElementInfo> list2 = w2.getInputChildElements();
- if (list1.size() != list2.size()) {
- return false;
- }
- // FXIME: [rfeng] At this point, the J2W generates local elments under the namespace
- // of the interface instead of "". We only compare the local parts only to work around
- // the namespace mismatch
- for (int i = 0; i < list1.size(); i++) {
- String n1 = list1.get(i).getQName().getLocalPart();
- String n2 = list2.get(i).getQName().getLocalPart();
- if (!n1.equals(n2)) {
- return false;
- }
- }
- return true;
- }
-
- @SuppressWarnings("unchecked")
- public Object[] transform(Object[] source, TransformationContext context) {
- // Check if the source operation is wrapped
- DataType<List<DataType>> sourceType = context.getSourceDataType();
- Operation sourceOp = context.getSourceOperation();
- boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle() && sourceOp.getWrapper() != null;
- boolean sourceBare = sourceOp != null && !sourceOp.isWrapperStyle() && sourceOp.getWrapper() == null;
-
- // Find the wrapper handler for source data
- WrapperHandler sourceWrapperHandler = null;
- String sourceDataBinding = getDataBinding(sourceOp);
- sourceWrapperHandler = getWrapperHandler(sourceDataBinding, sourceWrapped);
-
- // Check if the target operation is wrapped
- DataType<List<DataType>> targetType = context.getTargetDataType();
- Operation targetOp = (Operation)context.getTargetOperation();
- boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle() && targetOp.getWrapper() != null;
- boolean targetBare = targetOp != null && !targetOp.isWrapperStyle() && targetOp.getWrapper() == null;
-
- // Find the wrapper handler for target data
- WrapperHandler targetWrapperHandler = null;
- String targetDataBinding = getDataBinding(targetOp);
- targetWrapperHandler = getWrapperHandler(targetDataBinding, targetWrapped);
-
- if ((!sourceWrapped && !sourceBare) && targetWrapped) {
- // Unwrapped --> Wrapped
- WrapperInfo wrapper = targetOp.getWrapper();
- // ElementInfo wrapperElement = wrapper.getInputWrapperElement();
-
- // Class<?> targetWrapperClass = wrapper != null ? wrapper.getInputWrapperClass() : null;
-
- if (source == null) {
- // Empty child elements
- Object targetWrapper = targetWrapperHandler.create(targetOp, true);
- return new Object[] {targetWrapper};
- }
-
- // If the source can be wrapped, wrapped it first
- if (sourceWrapperHandler != null) {
- WrapperInfo sourceWrapperInfo = sourceOp.getWrapper();
- DataType sourceWrapperType = sourceWrapperInfo != null ? sourceWrapperInfo.getInputWrapperType() : null;
-
- // We only do wrapper to wrapper transformation if the source has a wrapper and both sides
- // match by XML structure
- if (sourceWrapperType != null && matches(sourceOp.getWrapper(), targetOp.getWrapper())) {
- Class<?> sourceWrapperClass = sourceWrapperType.getPhysical();
-
- // Create the source wrapper
- Object sourceWrapper = sourceWrapperHandler.create(sourceOp, true);
-
- // Populate the source wrapper
- if (sourceWrapper != null) {
- sourceWrapperHandler.setChildren(sourceWrapper,
- source,
- sourceOp,
- true);
-
- // Transform the data from source wrapper to target wrapper
- Object targetWrapper =
- mediator.mediate(sourceWrapper, sourceWrapperType, targetType.getLogical().get(0), context
- .getMetadata());
- return new Object[] {targetWrapper};
- }
- }
- }
- // Fall back to child by child transformation
- Object targetWrapper = targetWrapperHandler.create(targetOp, true);
- List<DataType> argTypes = wrapper.getUnwrappedInputType().getLogical();
- Object[] targetChildren = new Object[source.length];
- for (int i = 0; i < source.length; i++) {
- // ElementInfo argElement = wrapper.getInputChildElements().get(i);
- DataType<XMLType> argType = argTypes.get(i);
- targetChildren[i] =
- mediator.mediate(source[i], sourceType.getLogical().get(i), argType, context.getMetadata());
- }
- targetWrapperHandler.setChildren(targetWrapper,
- targetChildren,
- targetOp,
- true);
- return new Object[] {targetWrapper};
-
- } else if (sourceWrapped && (!targetWrapped && !targetBare)) {
- // Wrapped to Unwrapped
- Object sourceWrapper = source[0];
- Object[] target = null;
-
- // List<ElementInfo> childElements = sourceOp.getWrapper().getInputChildElements();
- if (targetWrapperHandler != null) {
- // ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement();
- // FIXME: This is a workaround for the wsdless support as it passes in child elements
- // under the wrapper that only matches by position
- if (sourceWrapperHandler.isInstance(sourceWrapper, sourceOp, true)) {
-
- WrapperInfo targetWrapperInfo = targetOp.getWrapper();
- DataType targetWrapperType =
- targetWrapperInfo != null ? targetWrapperInfo.getInputWrapperType() : null;
- if (targetWrapperType != null && matches(sourceOp.getWrapper(), targetOp.getWrapper())) {
- Object targetWrapper =
- mediator.mediate(sourceWrapper, sourceType.getLogical().get(0), targetWrapperType, context
- .getMetadata());
- target = targetWrapperHandler.getChildren(targetWrapper, targetOp, true).toArray();
- return target;
- }
- }
- }
- Object[] sourceChildren = sourceWrapperHandler.getChildren(sourceWrapper, sourceOp, true).toArray();
- target = new Object[sourceChildren.length];
- for (int i = 0; i < sourceChildren.length; i++) {
- DataType<XMLType> childType = sourceOp.getWrapper().getUnwrappedInputType().getLogical().get(i);
- target[i] =
- mediator.mediate(sourceChildren[i], childType, targetType.getLogical().get(i), context
- .getMetadata());
- }
- return target;
- } else {
- // Assuming wrapper to wrapper conversion can be handled here as well
- Object[] newArgs = new Object[source.length];
- for (int i = 0; i < source.length; i++) {
- Object child =
- mediator.mediate(source[i], sourceType.getLogical().get(i), targetType.getLogical().get(i), context
- .getMetadata());
- newArgs[i] = child;
- }
- return newArgs;
- }
- }
-
- private WrapperHandler getWrapperHandler(String dataBindingId, boolean required) {
- WrapperHandler wrapperHandler = null;
- if (dataBindingId != null) {
- DataBinding dataBinding = mediator.getDataBindings().getDataBinding(dataBindingId);
- wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler();
- }
- if (wrapperHandler == null && required) {
- throw new TransformationException("No wrapper handler is provided for databinding: " + dataBindingId);
- }
- return wrapperHandler;
- }
-
- private String getDataBinding(Operation operation) {
- WrapperInfo wrapper = operation.getWrapper();
- if (wrapper != null) {
- return wrapper.getDataBinding();
- } else {
- return null;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java
deleted file mode 100644
index d5ba528475..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.databinding.transformers;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.databinding.DataBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * This is a special transformer to transform the output from one IDL to the
- * other one
- *
- * @version $Rev$ $Date$
- */
-public class Output2OutputTransformer extends BaseTransformer<Object, Object> implements
- PullTransformer<Object, Object> {
-
- protected Mediator mediator;
-
- /**
- * @param wrapperHandler
- */
- public Output2OutputTransformer() {
- super();
- }
-
- /**
- * @param mediator the mediator to set
- */
- @Reference
- public void setMediator(Mediator mediator) {
- this.mediator = mediator;
- }
-
- @Override
- public String getSourceDataBinding() {
- return DataBinding.IDL_OUTPUT;
- }
-
- @Override
- public String getTargetDataBinding() {
- return DataBinding.IDL_OUTPUT;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getSourceType()
- */
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getTargetType()
- */
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.Transformer#getWeight()
- */
- @Override
- public int getWeight() {
- return 10;
- }
-
- private String getDataBinding(Operation operation) {
- WrapperInfo wrapper = operation.getWrapper();
- if (wrapper != null) {
- return wrapper.getDataBinding();
- } else {
- return null;
- }
- }
-
- private WrapperHandler getWrapperHandler(String dataBindingId, boolean required) {
- WrapperHandler wrapperHandler = null;
- if (dataBindingId != null) {
- DataBinding dataBinding = mediator.getDataBindings().getDataBinding(dataBindingId);
- wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler();
- }
- if (wrapperHandler == null && required) {
- throw new TransformationException("No wrapper handler is provided for databinding: " + dataBindingId);
- }
- return wrapperHandler;
- }
-
- /**
- * Match the structure of the wrapper element. If it matches, then we can do
- * wrapper to wrapper transformation. Otherwise, we do child to child.
- * @param w1
- * @param w2
- * @return
- */
- private boolean matches(WrapperInfo w1, WrapperInfo w2) {
- if (w1 == null || w2 == null) {
- return false;
- }
- if (!w1.getOutputWrapperElement().equals(w2.getOutputWrapperElement())) {
- return false;
- }
-
- // Compare the child elements
- List<ElementInfo> list1 = w1.getOutputChildElements();
- List<ElementInfo> list2 = w2.getOutputChildElements();
- if (list1.size() != list2.size()) {
- return false;
- }
- // FXIME: [rfeng] At this point, the J2W generates local elments under the namespace
- // of the interface instead of "". We only compare the local parts only to work around
- // the namespace mismatch
- for (int i = 0; i < list1.size(); i++) {
- String n1 = list1.get(i).getQName().getLocalPart();
- String n2 = list2.get(i).getQName().getLocalPart();
- if (!n1.equals(n2)) {
- return false;
- }
- }
- return true;
- }
-
- @SuppressWarnings("unchecked")
- public Object transform(Object response, TransformationContext context) {
- try {
- DataType<DataType> sourceType = context.getSourceDataType();
- Operation sourceOp = context.getSourceOperation();
- boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle() && sourceOp.getWrapper() != null;
- boolean sourceBare = sourceOp != null && !sourceOp.isWrapperStyle() && sourceOp.getWrapper() == null;
-
- WrapperHandler sourceWrapperHandler = null;
- String sourceDataBinding = getDataBinding(sourceOp);
- sourceWrapperHandler = getWrapperHandler(sourceDataBinding, sourceWrapped);
-
- DataType<DataType> targetType = context.getTargetDataType();
- Operation targetOp = (Operation)context.getTargetOperation();
- boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle() && targetOp.getWrapper() != null;
- boolean targetBare = targetOp != null && !targetOp.isWrapperStyle() && targetOp.getWrapper() == null;
-
- WrapperHandler targetWrapperHandler = null;
- String targetDataBinding = getDataBinding(targetOp);
- targetWrapperHandler = getWrapperHandler(targetDataBinding, targetWrapped);
-
- if ((!sourceWrapped &&!sourceBare) && targetWrapped) {
- // Unwrapped --> Wrapped
- WrapperInfo wrapper = targetOp.getWrapper();
- ElementInfo wrapperElement = wrapper.getOutputWrapperElement();
- List<ElementInfo> childElements = wrapper.getOutputChildElements();
- Class<?> targetWrapperClass = wrapper != null ? wrapper.getOutputWrapperClass() : null;
-
- // If the source can be wrapped, wrapped it first
- if (sourceWrapperHandler != null) {
- WrapperInfo sourceWrapperInfo = sourceOp.getWrapper();
- DataType sourceWrapperType =
- sourceWrapperInfo != null ? sourceWrapperInfo.getOutputWrapperType() : null;
-
- if (sourceWrapperType != null && matches(sourceOp.getWrapper(), targetOp.getWrapper())) {
- Class<?> sourceWrapperClass = sourceWrapperType.getPhysical();
-
- Object sourceWrapper = sourceWrapperHandler.create(sourceOp, false);
- if (sourceWrapper != null) {
- if (!childElements.isEmpty()) {
- // Set the return value
- sourceWrapperHandler.setChildren(sourceWrapper,
- new Object[] {response},
- sourceOp,
- false);
- }
- Object targetWrapper =
- mediator.mediate(sourceWrapper, sourceWrapperType, targetType.getLogical(), context
- .getMetadata());
- return targetWrapper;
- }
- }
- }
- Object targetWrapper = targetWrapperHandler.create(targetOp, false);
-
- if (childElements.isEmpty()) {
- // void output
- return targetWrapper;
- }
-
- DataType<XMLType> argType = wrapper.getUnwrappedOutputType();
- Object child = response;
- child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata());
- targetWrapperHandler.setChildren(targetWrapper, new Object[] {child}, targetOp, false);
- return targetWrapper;
- } else if (sourceWrapped && (!targetWrapped && !targetBare)) {
- // Wrapped to Unwrapped
- Object sourceWrapper = response;
- List<ElementInfo> childElements = sourceOp.getWrapper().getOutputChildElements();
- if (childElements.isEmpty()) {
- // The void output
- return null;
- }
- if (targetWrapperHandler != null) {
- ElementInfo wrapperElement = sourceOp.getWrapper().getOutputWrapperElement();
-
- // FIXME: This is a workaround for the wsdless support as it passes in child elements
- // under the wrapper that only matches by position
- if (sourceWrapperHandler.isInstance(sourceWrapper, sourceOp, false)) {
-
- WrapperInfo targetWrapperInfo = targetOp.getWrapper();
- DataType targetWrapperType =
- targetWrapperInfo != null ? targetWrapperInfo.getOutputWrapperType() : null;
-
- if (targetWrapperType != null && matches(sourceOp.getWrapper(), targetOp.getWrapper())) {
- Object targetWrapper =
- mediator.mediate(sourceWrapper, sourceType.getLogical(), targetWrapperType, context
- .getMetadata());
- return targetWrapperHandler.getChildren(targetWrapper, targetOp, false).get(0);
- }
- }
- }
- Object child = sourceWrapperHandler.getChildren(sourceWrapper, sourceOp, false).get(0);
- DataType<?> childType = sourceOp.getWrapper().getUnwrappedOutputType();
- return mediator.mediate(child, childType, targetType.getLogical(), context.getMetadata());
- } else {
- // FIXME: Do we want to handle wrapped to wrapped?
- return mediator.mediate(response, sourceType.getLogical(), targetType.getLogical(), context
- .getMetadata());
- }
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/XMLStreamReader2CallableReference.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/XMLStreamReader2CallableReference.java
deleted file mode 100644
index cf68b55fe6..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/XMLStreamReader2CallableReference.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.databinding.transformers;
-
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.lang.reflect.Constructor;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.core.context.CallableReferenceExt;
-import org.apache.tuscany.sca.core.context.ServiceReferenceExt;
-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.oasisopen.sca.CallableReference;
-
-@SuppressWarnings("unchecked")
-public class XMLStreamReader2CallableReference extends BaseTransformer<XMLStreamReader, CallableReference>
- implements PullTransformer<XMLStreamReader, CallableReference> {
-
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- private static final String COMPOSITE = "composite";
- private static final QName COMPOSITE_QNAME = new QName(SCA10_NS, COMPOSITE);
-
- public CallableReference transform(XMLStreamReader source, TransformationContext context) {
- try {
- if (source != null) {
- skipTopLevelElement(source);
- Class refType =
- context == null ? CallableReferenceExt.class : context.getTargetDataType().getPhysical();
- Class implType;
- if (refType.isAssignableFrom(CallableReferenceExt.class)) {
- implType = CallableReferenceExt.class;
- } else if (refType.isAssignableFrom(ServiceReferenceExt.class)) {
- implType = ServiceReferenceExt.class;
- } else {
- throw new TransformationException("Unrecognized transformation target type");
- }
- Constructor constructor = implType.getConstructor(new Class[] {XMLStreamReader.class});
- return (CallableReference)constructor.newInstance(new Object[] {source});
- } else {
- return null;
- }
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- /*
- * Step over top-level element added by CallableReference2XMLStreamReader
- */
- private void skipTopLevelElement(XMLStreamReader source) throws XMLStreamException {
- while (source.hasNext()) {
- int event = source.getEventType();
- if (event == START_ELEMENT) {
- QName name = source.getName();
- if (COMPOSITE_QNAME.equals(name)) {
- return;
- }
- }
- source.next();
- }
- throw new TransformationException("<composite> element not found");
- }
-
- @Override
- protected Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- @Override
- protected Class<CallableReference> getTargetType() {
- return CallableReference.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java
deleted file mode 100644
index b41c7fb012..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.databinding.wire;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.apache.tuscany.sca.runtime.RuntimeWireProcessor;
-
-/**
- * This processor is responsible to add an interceptor to invocation chain if
- * the source and target operations have different databinding requirements
- *
- * @version $Rev$ $Date$
- */
-public class DataBindingRuntimeWireProcessor implements RuntimeWireProcessor {
- private Mediator mediator;
- private DataBindingExtensionPoint dataBindings;
- private FaultExceptionMapper faultExceptionMapper;
-
- public DataBindingRuntimeWireProcessor(Mediator mediator,
- DataBindingExtensionPoint dataBindings,
- FaultExceptionMapper faultExceptionMapper) {
- super();
- this.mediator = mediator;
- this.dataBindings = dataBindings;
- this.faultExceptionMapper = faultExceptionMapper;
- }
-
- public boolean isTransformationRequired(DataType source, DataType target) {
- if (source == null || target == null) { // void return type
- return false;
- }
- if (source == target) {
- return false;
- }
-
- // Output type can be null
- if (source == null && target == null) {
- return false;
- } else if (source == null || target == null) {
- return true;
- }
- String sourceDataBinding = source.getDataBinding();
- String targetDataBinding = target.getDataBinding();
- if (sourceDataBinding == targetDataBinding) {
- return false;
- }
- if (sourceDataBinding == null || targetDataBinding == null) {
- // TODO: If any of the databinding is null, then no transformation
- return false;
- }
- return !sourceDataBinding.equals(targetDataBinding);
- }
-
- public boolean isTransformationRequired(Operation source, Operation target) {
- if (source == target) {
- return false;
- }
-
- if (source.isWrapperStyle() != target.isWrapperStyle()) {
- return true;
- }
-
- // Check output type
- DataType sourceOutputType = source.getOutputType();
- DataType targetOutputType = target.getOutputType();
-
- // Note the target output type is now the source for checking
- // compatibility
- if (isTransformationRequired(targetOutputType, sourceOutputType)) {
- return true;
- }
-
- List<DataType> sourceInputType = source.getInputType().getLogical();
- List<DataType> targetInputType = target.getInputType().getLogical();
-
- int size = sourceInputType.size();
- if (size != targetInputType.size()) {
- // TUSCANY-1682: The wrapper style may have different arguments
- return true;
- }
- for (int i = 0; i < size; i++) {
- if (isTransformationRequired(sourceInputType.get(i), targetInputType.get(i))) {
- return true;
- }
- }
-
- return false;
- }
-
- private boolean isTransformationRequired(InterfaceContract sourceContract,
- Operation sourceOperation,
- InterfaceContract targetContract,
- Operation targetOperation) {
- if (targetContract == null) {
- targetContract = sourceContract;
- }
- if (sourceContract == targetContract) {
- return false;
- }
- return isTransformationRequired(sourceOperation, targetOperation);
- }
-
- public void process(RuntimeWire wire) {
- InterfaceContract sourceContract = wire.getSource().getInterfaceContract();
- InterfaceContract targetContract = wire.getTarget().getInterfaceContract();
- if (targetContract == null) {
- targetContract = sourceContract;
- }
-
- if (!sourceContract.getInterface().isRemotable()) {
- return;
- }
- List<InvocationChain> chains = wire.getInvocationChains();
- for (InvocationChain chain : chains) {
- Operation sourceOperation = chain.getSourceOperation();
- Operation targetOperation = chain.getTargetOperation();
-
- Interceptor interceptor = null;
- if (isTransformationRequired(sourceContract, sourceOperation, targetContract, targetOperation)) {
- // Add the interceptor to the source side because multiple
- // references can be wired to the same service
- interceptor =
- new DataTransformationInterceptor(wire, sourceOperation, targetOperation, mediator,
- faultExceptionMapper);
- } else {
- // assume pass-by-values copies are required if interfaces are remotable and there is no data binding
- // transformation, i.e. a transformation will result in a copy so another pass-by-value copy is unnecessary
- if (!isOnMessage(targetOperation) && isRemotable(chain, sourceOperation, targetOperation)) {
- interceptor =
- new PassByValueInterceptor(dataBindings, faultExceptionMapper, chain, targetOperation);
- }
- }
- if (interceptor != null) {
- String phase =
- (wire.getSource().getContract() instanceof ComponentReference) ? Phase.REFERENCE_INTERFACE
- : Phase.SERVICE_INTERFACE;
- chain.addInterceptor(phase, interceptor);
- }
- }
-
- }
-
- /**
- * FIXME: TUSCANY-2586, temporary work around till the JIRA is fixed to prevent
- * the PassByValueInterceptor being used for services when the binding protocol
- * doesn't need the copies done.
- */
- protected boolean isOnMessage(Operation op) {
- return "onMessage".equals(op.getName());
- }
-
- /**
- * Pass-by-value copies are required if the interfaces are remotable unless the
- * implementation uses the @AllowsPassByReference annotation.
- */
- protected boolean isRemotable(InvocationChain chain, Operation sourceOperation, Operation targetOperation) {
- if (!sourceOperation.getInterface().isRemotable()) {
- return false;
- }
- if (!targetOperation.getInterface().isRemotable()) {
- return false;
- }
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java
deleted file mode 100644
index 20dcb1b94a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.databinding.wire;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.DataBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.FaultException;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * An interceptor to transform data across databindings on the wire
- *
- * @version $Rev$ $Date$
- */
-public class DataTransformationInterceptor implements Interceptor, DataExchangeSemantics {
- private Invoker next;
-
- private Operation sourceOperation;
-
- private Operation targetOperation;
- private RuntimeWire wire;
- private Mediator mediator;
- private FaultExceptionMapper faultExceptionMapper;
-
- public DataTransformationInterceptor(RuntimeWire wire,
- Operation sourceOperation,
- Operation targetOperation,
- Mediator mediator,
- FaultExceptionMapper faultExceptionMapper) {
- super();
- this.sourceOperation = sourceOperation;
- this.targetOperation = targetOperation;
- this.mediator = mediator;
- this.wire = wire;
- this.faultExceptionMapper = faultExceptionMapper;
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public Message invoke(Message msg) {
- Object input = transform(msg.getBody(), sourceOperation.getInputType(), targetOperation.getInputType(), false);
- msg.setBody(input);
- Message resultMsg = next.invoke(msg);
- Object result = resultMsg.getBody();
- if (sourceOperation.isNonBlocking()) {
- // Not to reset the message body
- return resultMsg;
- }
-
- // FIXME: Should we fix the Operation model so that getOutputType
- // returns DataType<DataType<T>>?
- DataType<DataType> targetType =
- new DataTypeImpl<DataType>(DataBinding.IDL_OUTPUT, Object.class, targetOperation.getOutputType());
-
- DataType<DataType> sourceType =
- new DataTypeImpl<DataType>(DataBinding.IDL_OUTPUT, Object.class, sourceOperation.getOutputType());
-
- if (resultMsg.isFault()) {
-
- // FIXME: We need to figure out what fault type it is and then
- // transform it
- // back the source fault type
- // throw new InvocationRuntimeException((Throwable) result);
-
- if ((result instanceof Exception) && !(result instanceof RuntimeException)) {
- // FIXME: How to match fault data to a fault type for the
- // operation?
-
- // If the result is from an InvocationTargetException look at
- // the actual cause.
- if (result instanceof InvocationTargetException) {
- result = ((InvocationTargetException)result).getCause();
- }
- DataType targetDataType = null;
- for (DataType exType : targetOperation.getFaultTypes()) {
- if (((Class)exType.getPhysical()).isInstance(result)) {
- if (result instanceof FaultException) {
- DataType faultType = (DataType)exType.getLogical();
- if (((FaultException)result).isMatchingType(faultType.getLogical())) {
- targetDataType = exType;
- break;
- }
- } else {
- targetDataType = exType;
- break;
- }
- }
- }
-
- /*
- if (targetDataType == null) {
- // Not a business exception
- return resultMsg;
- }
- */
-
- DataType targetFaultType = getFaultType(targetDataType);
- if (targetFaultType == null) {
- // No matching fault type, it's a system exception
- Throwable cause = (Throwable) result;
- throw new ServiceRuntimeException(cause);
- }
-
- // FIXME: How to match a source fault type to a target fault
- // type?
- DataType sourceDataType = null;
- DataType sourceFaultType = null;
- for (DataType exType : sourceOperation.getFaultTypes()) {
- DataType faultType = getFaultType(exType);
- // Match by the QName (XSD element) of the fault type
- if (faultType != null && typesMatch(targetFaultType.getLogical(), faultType.getLogical())) {
- sourceDataType = exType;
- sourceFaultType = faultType;
- break;
- }
- }
-
- if (sourceFaultType == null) {
- // No matching fault type, it's a system exception
- Throwable cause = (Throwable) result;
- throw new ServiceRuntimeException(cause);
- }
-
- Object newResult =
- transformException(result, targetDataType, sourceDataType, targetFaultType, sourceFaultType);
- if (newResult != result) {
- resultMsg.setFaultBody(newResult);
- }
- }
-
- } else {
- assert !(result instanceof Throwable) : "Expected messages that are not throwable " + result;
-
- Object newResult = transform(result, targetType, sourceType, true);
- if (newResult != result) {
- resultMsg.setBody(newResult);
- }
- }
-
- return resultMsg;
- }
-
- private Object transform(Object source, DataType sourceType, DataType targetType, boolean isResponse) {
- if (sourceType == targetType || (sourceType != null && sourceType.equals(targetType))) {
- return source;
- }
- Map<String, Object> metadata = new HashMap<String, Object>();
- metadata.put("source.operation", isResponse ? targetOperation : sourceOperation);
- metadata.put("target.operation", isResponse ? sourceOperation : targetOperation);
- metadata.put("wire", wire);
- return mediator.mediate(source, sourceType, targetType, metadata);
- }
-
- private DataType getFaultType(DataType exceptionType) {
- return exceptionType == null ? null : (DataType)exceptionType.getLogical();
- }
-
- private boolean typesMatch(Object first, Object second) {
- if (first.equals(second)) {
- return true;
- }
- if (first instanceof XMLType && second instanceof XMLType) {
- XMLType t1 = (XMLType)first;
- XMLType t2 = (XMLType)second;
- // TUSCANY-2113, we should compare element names only
- return matches(t1.getElementName(), t2.getElementName());
- }
- return false;
- }
-
- /**
- * @param qn1
- * @param qn2
- */
- private boolean matches(QName qn1, QName qn2) {
- if (qn1 == qn2) {
- return true;
- }
- if (qn1 == null || qn2 == null) {
- return false;
- }
- String ns1 = qn1.getNamespaceURI();
- String ns2 = qn2.getNamespaceURI();
- String e1 = qn1.getLocalPart();
- String e2 = qn2.getLocalPart();
- if (e1.equals(e2) && (ns1.equals(ns2) || ns1.equals(ns2 + "/") || ns2.equals(ns1 + "/"))) {
- // Tolerating the trailing / which is required by JAX-WS java package --> xml ns mapping
- return true;
- }
- return false;
- }
-
- /**
- * @param source The source exception
- * @param sourceExType The data type for the source exception
- * @param targetExType The data type for the target exception
- * @param sourceType The fault type for the source
- * @param targetType The fault type for the target
- * @return
- */
- private Object transformException(Object source,
- DataType sourceExType,
- DataType targetExType,
- DataType sourceType,
- DataType targetType) {
- if (sourceType == targetType || (sourceType != null && sourceType.equals(targetType))) {
- return source;
- }
- Map<String, Object> metadata = new HashMap<String, Object>();
- metadata.put("source.operation", targetOperation);
- metadata.put("target.operation", sourceOperation);
- metadata.put("wire", wire);
- DataType<DataType> eSourceDataType =
- new DataTypeImpl<DataType>("idl:fault", sourceExType.getPhysical(), sourceType);
- DataType<DataType> eTargetDataType =
- new DataTypeImpl<DataType>("idl:fault", targetExType.getPhysical(), targetType);
-
- return mediator.mediate(source, eSourceDataType, eTargetDataType, metadata);
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-
- public boolean allowsPassByReference() {
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java
deleted file mode 100644
index 1ff8d86f45..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.databinding.wire;
-
-import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.util.IdentityHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.DataBinding;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding;
-import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Implementation of an interceptor that enforces pass-by-value semantics
- * on operation invocations by copying the operation input and output data.
- *
- * @version $Rev$ $Date$
- */
-public class PassByValueInterceptor implements Interceptor {
-
- private DataBindingExtensionPoint dataBindings;
- private FaultExceptionMapper faultExceptionMapper;
-
- private DataBinding[] inputDataBindings;
- private DataBinding outputDataBinding;
- private DataBinding javaBeanDataBinding;
- private DataBinding jaxbDataBinding;
- private Operation operation;
- private Invoker nextInvoker;
- private InvocationChain chain;
-
- /**
- * Constructs a new PassByValueInterceptor.
- * @param dataBindings databinding extension point
- * @param operation the intercepted operation
- */
- public PassByValueInterceptor(DataBindingExtensionPoint dataBindings,
- FaultExceptionMapper faultExceptionMapper,
- InvocationChain chain,
- Operation operation) {
- this.chain = chain;
- this.operation = operation;
-
- // Cache data bindings to use
- this.dataBindings = dataBindings;
- this.faultExceptionMapper = faultExceptionMapper;
-
- jaxbDataBinding = dataBindings.getDataBinding(JAXBDataBinding.NAME);
- javaBeanDataBinding = dataBindings.getDataBinding(JavaBeansDataBinding.NAME);
-
- // Determine the input databindings
- if (operation.getInputType() != null) {
- List<DataType> inputTypes = operation.getInputType().getLogical();
- inputDataBindings = new DataBinding[inputTypes.size()];
- int i = 0;
- for (DataType inputType : inputTypes) {
- String id = inputType.getDataBinding();
- inputDataBindings[i++] = dataBindings.getDataBinding(id);
- }
- }
-
- // Determine the output databinding
- if (operation.getOutputType() != null) {
- String id = operation.getOutputType().getDataBinding();
- outputDataBinding = dataBindings.getDataBinding(id);
- }
- }
-
- public Message invoke(Message msg) {
- if (chain.allowsPassByReference()) {
- return nextInvoker.invoke(msg);
- }
-
- msg.setBody(copy((Object[])msg.getBody(), inputDataBindings, operation.getInputType().getLogical()));
-
- Message resultMsg = nextInvoker.invoke(msg);
-
- if (!msg.isFault() && operation.getOutputType() != null) {
- resultMsg.setBody(copy(resultMsg.getBody(), outputDataBinding, operation.getOutputType()));
- }
-
- if (msg.isFault()) {
- msg.setFaultBody(copyFault(msg.getBody()));
- }
- return resultMsg;
- }
-
- private Object copyFault(Object fault) {
- if (faultExceptionMapper == null) {
- return fault;
- }
- for (DataType et : operation.getFaultTypes()) {
- if (et.getPhysical().isInstance(fault)) {
- Throwable ex = (Throwable)fault;
- DataType<DataType> exType =
- new DataTypeImpl<DataType>(ex.getClass(), new DataTypeImpl<XMLType>(ex.getClass(), XMLType.UNKNOWN));
- faultExceptionMapper.introspectFaultDataType(exType, operation, false);
- DataType faultType = exType.getLogical();
- Object faultInfo = faultExceptionMapper.getFaultInfo(ex, faultType.getPhysical(), operation);
- faultInfo = copy(faultInfo, dataBindings.getDataBinding(faultType.getDataBinding()), faultType);
- fault = faultExceptionMapper.wrapFaultInfo(exType, ex.getMessage(), faultInfo, ex.getCause(), operation);
- return fault;
- }
- }
- return fault;
- }
-
- /**
- * Copy an array of data objects passed to an operation
- * @param data array of objects to copy
- * @return the copy
- */
- private Object[] copy(Object[] data, DataBinding[] dataBindings, List<DataType> dataTypes) {
- if (data == null) {
- return null;
- }
- Object[] copy = new Object[data.length];
- Map<Object, Object> map = new IdentityHashMap<Object, Object>();
- for (int i = 0; i < data.length; i++) {
- Object arg = data[i];
- if (arg == null) {
- copy[i] = null;
- } else {
- Object copiedArg = map.get(arg);
- if (copiedArg != null) {
- copy[i] = copiedArg;
- } else {
- copiedArg = copy(arg, dataBindings[i], dataTypes.get(i));
- map.put(arg, copiedArg);
- copy[i] = copiedArg;
- }
- }
- }
- return copy;
- }
-
- /**
- * Copy data using the specified databinding.
- * @param data input data
- * @param dataBinding databinding to use
- * @param dataType TODO
- * @return a copy of the data
- */
- private Object copy(Object data, DataBinding dataBinding, DataType dataType) {
- if (data == null) {
- return null;
- }
- Class<?> clazz = data.getClass();
- if (String.class == clazz || clazz.isPrimitive()
- || Number.class.isAssignableFrom(clazz)
- || Boolean.class.isAssignableFrom(clazz)
- || Character.class.isAssignableFrom(clazz)
- || Byte.class.isAssignableFrom(clazz)
- || URI.class == clazz
- || UUID.class == clazz
- || QName.class == clazz) {
- // Immutable classes
- return data;
- }
- // If no databinding was specified, introspect the given arg to
- // determine its databinding
- if (dataBinding == null) {
- dataType = dataBindings.introspectType(data, operation);
- if (dataType != null) {
- String db = dataType.getDataBinding();
- dataBinding = dataBindings.getDataBinding(db);
- if (dataBinding == null && db != null) {
- return data;
- }
- }
- if (dataBinding == null) {
-
- // Default to the JavaBean databinding
- dataBinding = javaBeanDataBinding;
- }
- }
-
- // Use the JAXB databinding to copy non-Serializable data
- if (dataBinding == javaBeanDataBinding) {
-
- // If the input data is an array containing non Serializable elements
- // use JAXB
- clazz = data.getClass();
- if (clazz.isArray()) {
- if (Array.getLength(data) != 0) {
- Object element = Array.get(data, 0);
- if (element != null && !(element instanceof Serializable)) {
- dataBinding = jaxbDataBinding;
- }
- }
- } else {
-
- // If the input data is not Serializable use JAXB
- if (!(data instanceof Serializable)) {
- dataBinding = jaxbDataBinding;
- }
-
- if (data instanceof Cloneable) {
- Method clone;
- try {
- clone = data.getClass().getMethod("clone", (Class[])null);
- try {
- return clone.invoke(data, (Object[])null);
- } catch (InvocationTargetException e) {
- if (e.getTargetException() instanceof CloneNotSupportedException) {
- // Ignore
- } else {
- throw new ServiceRuntimeException(e);
- }
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- } catch (NoSuchMethodException e) {
- // Ignore it
- }
- }
- }
- }
-
- Object copy = dataBinding.copy(data, dataType, operation);
- return copy;
- }
-
- public Invoker getNext() {
- return nextInvoker;
- }
-
- public void setNext(Invoker next) {
- this.nextInvoker = next;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/tags/java/sca/2.0-M1/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index baba638c9b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# Implementation class for the ExtensionActivator
-org.apache.tuscany.sca.core.databinding.module.DataBindingModuleActivator
diff --git a/tags/java/sca/2.0-M1/modules/core-databinding/src/test/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/core-databinding/src/test/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java
deleted file mode 100644
index 1905cfb217..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-databinding/src/test/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.databinding.processor;
-
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.annotation.DataBinding;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Remotable;
-import org.w3c.dom.Node;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DataBindingJavaInterfaceProcessorTestCase {
-
- /**
- * @throws InvalidServiceContractException
- */
- @Test
- public final void testVisitInterface() throws InvalidInterfaceException {
- DataBindingExtensionPoint registry = new DefaultDataBindingExtensionPoint();
- DataBindingJavaInterfaceProcessor processor = new DataBindingJavaInterfaceProcessor(registry);
- JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
-
- JavaInterface contract = javaFactory.createJavaInterface();
- contract.setJavaClass(MockInterface.class);
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- interfaceContract.setInterface(contract);
- Operation operation = newOperation("call");
- Operation operation1 = newOperation("call1");
- contract.getOperations().add(operation);
- contract.getOperations().add(operation1);
- contract.setRemotable(true);
- processor.visitInterface(contract);
- }
-
- @DataBinding("org.w3c.dom.Node")
- @Remotable
- public static interface MockInterface {
- Node call(Node msg);
-
- @DataBinding("xml:string")
- String call1(String msg);
- }
-
- private static Operation newOperation(String name) {
- Operation operation = new OperationImpl();
- operation.setName(name);
- return operation;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/LICENSE b/tags/java/sca/2.0-M1/modules/core-spi/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/core-spi/META-INF/MANIFEST.MF
deleted file mode 100644
index 286ee65ecc..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,45 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.invocation;uses:="org.apache.tu
- scany.sca.runtime,org.apache.tuscany.sca.interfacedef";version="2.0.0",
- org.apache.tuscany.sca.runtime;uses:="org.apache.tuscany.sca.invocati
- on,org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.endpointres
- olver,org.apache.tuscany.sca.provider,org.oasisopen.sca,org.apache.tuscany
- .sca.interfacedef";version="2.0.0",org.apache.tuscany.sca.context;uses:
- ="org.apache.tuscany.sca.runtime,org.apache.tuscany.sca.assembly,org.
- apache.tuscany.sca.core,org.oasisopen.sca,org.apache.tuscany.sca.extensibi
- lity";version="2.0.0",org.apache.tuscany.sca.provider;uses:="org.apache
- .tuscany.sca.invocation,org.apache.tuscany.sca.runtime,org.apache.tus
- cany.sca.assembly,org.apache.tuscany.sca.definitions,org.apache.tusca
- ny.sca.core,org.apache.tuscany.sca.interfacedef,org.apache.tuscany.sc
- a.extensibility";version="2.0.0",org.apache.tuscany.sca.endpointresolve
- r;uses:="org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.core,
- org.apache.tuscany.sca.extensibility";version="2.0.0",org.apache.tuscan
- y.sca.work;version="2.0.0",org.apache.tuscany.sca.management;uses:="org
- .apache.tuscany.sca.runtime";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Core SPI
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397108125
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Core SPI
-Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.context;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0",
- org.apache.tuscany.sca.endpointresolver;version="2.0.0",
- org.apache.tuscany.sca.extensibility;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.management;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.apache.tuscany.sca.work;version="2.0.0",
-
- org.oasisopen.sca;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.core.spi
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/NOTICE b/tags/java/sca/2.0-M1/modules/core-spi/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/pom.xml b/tags/java/sca/2.0-M1/modules/core-spi/pom.xml
deleted file mode 100644
index 881e08ec12..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/pom.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-core-spi</artifactId>
- <name>Apache Tuscany SCA Core SPI</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>2.0-M1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/modules/core-spi/src/doc/Context Model.emx b/tags/java/sca/2.0-M1/modules/core-spi/src/doc/Context Model.emx
deleted file mode 100644
index 0445ea5a6b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/doc/Context Model.emx
+++ /dev/null
@@ -1,673 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!--xtools2_universal_type_manager-->
-<uml:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.ibm.com/xtools/1.5.0/Notation" xmlns:uml="http://www.eclipse.org/uml2/1.0.0/UML" xmlns:umlnotation="http://www.ibm.com/xtools/1.5.0/Umlnotation" xmi:id="_al1S8NovEdqRBPR5WyT36A" name="Context Model" appliedProfile="_al1S9NovEdqRBPR5WyT36A _al1S99ovEdqRBPR5WyT36A _al1S-tovEdqRBPR5WyT36A _al1S_dovEdqRBPR5WyT36A _al1TANovEdqRBPR5WyT36A">
- <eAnnotations xmi:id="_al1S8dovEdqRBPR5WyT36A" source="uml2.diagrams" references="_al1S8tovEdqRBPR5WyT36A">
- <contents xmi:type="notation:Diagram" xmi:id="_al1S8tovEdqRBPR5WyT36A" type="Class" name="Main">
- <children xmi:id="_ePDcYdovEdqRBPR5WyT36A" sourceEdges="_Fd3lQdowEdqRBPR5WyT36A _R5Rjwdo1EdqRBPR5WyT36A _pdfmkNo2EdqRBPR5WyT36A" targetEdges="_hmIF4dovEdqRBPR5WyT36A _mu9A4dovEdqRBPR5WyT36A _pe3jwNovEdqRBPR5WyT36A" element="_ePDcYNovEdqRBPR5WyT36A">
- <children xmi:id="_ePJjANovEdqRBPR5WyT36A" type="ImageCompartment" element="_ePDcYNovEdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_ePJjAdovEdqRBPR5WyT36A" width="530" height="530"/>
- </children>
- <children xmi:id="_ePJjAtovEdqRBPR5WyT36A" type="Stereotype" element="_ePDcYNovEdqRBPR5WyT36A"/>
- <children xmi:id="_ePJjA9ovEdqRBPR5WyT36A" type="Kind" element="_ePDcYNovEdqRBPR5WyT36A"/>
- <children xmi:id="_ePJjBNovEdqRBPR5WyT36A" type="Name" element="_ePDcYNovEdqRBPR5WyT36A"/>
- <children xmi:id="_ePJjBdovEdqRBPR5WyT36A" type="AttributeCompartment" element="_ePDcYNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_ePJjBtovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_ePJjB9ovEdqRBPR5WyT36A" type="OperationCompartment" element="_ePDcYNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_ePJjCNovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_ePJjCdovEdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_ePDcYNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_ePJjCtovEdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLClassifierStyle" xmi:id="_ePDcYtovEdqRBPR5WyT36A" showStereotype="Label" useClassifierShape="true"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ePDcY9ovEdqRBPR5WyT36A" x="6693" y="3545"/>
- </children>
- <children xmi:id="_fs1pANovEdqRBPR5WyT36A" sourceEdges="_hmIF4dovEdqRBPR5WyT36A _pe3jwNovEdqRBPR5WyT36A" targetEdges="_xInjYdovEdqRBPR5WyT36A" element="_fsviYNovEdqRBPR5WyT36A">
- <children xmi:id="_fs1pA9ovEdqRBPR5WyT36A" type="ImageCompartment" element="_fsviYNovEdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_fs1pBNovEdqRBPR5WyT36A" width="530" height="530"/>
- </children>
- <children xmi:id="_fs1pBdovEdqRBPR5WyT36A" type="Stereotype" element="_fsviYNovEdqRBPR5WyT36A"/>
- <children xmi:id="_fs1pBtovEdqRBPR5WyT36A" type="Kind" element="_fsviYNovEdqRBPR5WyT36A"/>
- <children xmi:id="_fs1pB9ovEdqRBPR5WyT36A" type="Name" element="_fsviYNovEdqRBPR5WyT36A"/>
- <children xmi:id="_fs1pCNovEdqRBPR5WyT36A" type="AttributeCompartment" element="_fsviYNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_fs1pCdovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_fs1pCtovEdqRBPR5WyT36A" type="OperationCompartment" element="_fsviYNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_fs1pC9ovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_fs1pDNovEdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_fsviYNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_fs1pDdovEdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLClassifierStyle" xmi:id="_fs1pAdovEdqRBPR5WyT36A" showStereotype="Label" useClassifierShape="true"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fs1pAtovEdqRBPR5WyT36A" x="2226" y="8268"/>
- </children>
- <children xmi:id="_ikr_4NovEdqRBPR5WyT36A" sourceEdges="_mu9A4dovEdqRBPR5WyT36A" element="_ikl5QNovEdqRBPR5WyT36A">
- <children xmi:id="_ikr_49ovEdqRBPR5WyT36A" type="ImageCompartment" element="_ikl5QNovEdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_ikr_5NovEdqRBPR5WyT36A" width="530" height="530"/>
- </children>
- <children xmi:id="_ikr_5dovEdqRBPR5WyT36A" type="Stereotype" element="_ikl5QNovEdqRBPR5WyT36A"/>
- <children xmi:id="_ikr_5tovEdqRBPR5WyT36A" type="Kind" element="_ikl5QNovEdqRBPR5WyT36A"/>
- <children xmi:id="_ikr_59ovEdqRBPR5WyT36A" type="Name" element="_ikl5QNovEdqRBPR5WyT36A"/>
- <children xmi:id="_ikr_6NovEdqRBPR5WyT36A" type="AttributeCompartment" element="_ikl5QNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_ikr_6dovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_ikr_6tovEdqRBPR5WyT36A" type="OperationCompartment" element="_ikl5QNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_ikr_69ovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_ikr_7NovEdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_ikl5QNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_ikr_7dovEdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLClassifierStyle" xmi:id="_ikr_4dovEdqRBPR5WyT36A" showStereotype="Label" useClassifierShape="true"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ikr_4tovEdqRBPR5WyT36A" x="9222" y="8268"/>
- </children>
- <children xmi:id="_tZF9odovEdqRBPR5WyT36A" sourceEdges="_xInjYdovEdqRBPR5WyT36A _BkUg0dowEdqRBPR5WyT36A" element="_tZF9oNovEdqRBPR5WyT36A">
- <children xmi:id="_tZF9pNovEdqRBPR5WyT36A" type="ImageCompartment" element="_tZF9oNovEdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_tZF9pdovEdqRBPR5WyT36A" width="530" height="530"/>
- </children>
- <children xmi:id="_tZF9ptovEdqRBPR5WyT36A" type="Stereotype" element="_tZF9oNovEdqRBPR5WyT36A"/>
- <children xmi:id="_tZF9p9ovEdqRBPR5WyT36A" type="Kind" element="_tZF9oNovEdqRBPR5WyT36A"/>
- <children xmi:id="_tZF9qNovEdqRBPR5WyT36A" type="Name" element="_tZF9oNovEdqRBPR5WyT36A"/>
- <children xmi:id="_tZF9qdovEdqRBPR5WyT36A" type="AttributeCompartment" element="_tZF9oNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_tZF9qtovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_tZF9q9ovEdqRBPR5WyT36A" type="OperationCompartment" element="_tZF9oNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_tZF9rNovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_tZF9rdovEdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_tZF9oNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_tZF9rtovEdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLClassifierStyle" xmi:id="_tZF9otovEdqRBPR5WyT36A" showStereotype="Label" useClassifierShape="true"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_tZF9o9ovEdqRBPR5WyT36A" x="2226" y="12084"/>
- </children>
- <children xmi:id="_z_m-oNovEdqRBPR5WyT36A" sourceEdges="_cN4xsdo2EdqRBPR5WyT36A" targetEdges="_3Ic-4NovEdqRBPR5WyT36A _9XeF4tovEdqRBPR5WyT36A _Fd3lQdowEdqRBPR5WyT36A" element="_z_g4ANovEdqRBPR5WyT36A">
- <children xmi:id="_z_m-o9ovEdqRBPR5WyT36A" type="ImageCompartment" element="_z_g4ANovEdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_z_m-pNovEdqRBPR5WyT36A" width="530" height="530"/>
- </children>
- <children xmi:id="_z_m-pdovEdqRBPR5WyT36A" type="Stereotype" element="_z_g4ANovEdqRBPR5WyT36A"/>
- <children xmi:id="_z_m-ptovEdqRBPR5WyT36A" type="Kind" element="_z_g4ANovEdqRBPR5WyT36A"/>
- <children xmi:id="_z_m-p9ovEdqRBPR5WyT36A" type="Name" element="_z_g4ANovEdqRBPR5WyT36A"/>
- <children xmi:id="_z_m-qNovEdqRBPR5WyT36A" type="AttributeCompartment" element="_z_g4ANovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_z_m-qdovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_z_m-qtovEdqRBPR5WyT36A" type="OperationCompartment" element="_z_g4ANovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_z_m-q9ovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_z_m-rNovEdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_z_g4ANovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_z_m-rdovEdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLClassifierStyle" xmi:id="_z_m-odovEdqRBPR5WyT36A" showStereotype="Label" useClassifierShape="true"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_z_m-otovEdqRBPR5WyT36A" x="17172" y="6996"/>
- </children>
- <children xmi:id="_1y-ZsNovEdqRBPR5WyT36A" sourceEdges="_3Ic-4NovEdqRBPR5WyT36A _9-BEUNo2EdqRBPR5WyT36A" targetEdges="_BkUg0dowEdqRBPR5WyT36A" element="_1yyMcNovEdqRBPR5WyT36A">
- <children xmi:id="_1y-Zs9ovEdqRBPR5WyT36A" type="ImageCompartment" element="_1yyMcNovEdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_1y-ZtNovEdqRBPR5WyT36A" width="1320" height="1320"/>
- </children>
- <children xmi:id="_1y-ZtdovEdqRBPR5WyT36A" type="Stereotype" element="_1yyMcNovEdqRBPR5WyT36A"/>
- <children xmi:id="_1y-ZttovEdqRBPR5WyT36A" type="Name" element="_1yyMcNovEdqRBPR5WyT36A"/>
- <children xmi:id="_1y-Zt9ovEdqRBPR5WyT36A" type="AttributeCompartment" element="_1yyMcNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_1y-ZuNovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_1y-ZudovEdqRBPR5WyT36A" type="OperationCompartment" element="_1yyMcNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_1y-ZutovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_1y-Zu9ovEdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_1yyMcNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_1y-ZvNovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_1y-ZvdovEdqRBPR5WyT36A" visible="false" type="StructureCompartment" element="_1yyMcNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLShapeCompartmentStyle" xmi:id="_1y-ZvtovEdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLShapeStyle" xmi:id="_1y-ZsdovEdqRBPR5WyT36A" showStereotype="Label"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1y-ZstovEdqRBPR5WyT36A" x="13992" y="12084"/>
- </children>
- <children xmi:id="_4WSrANovEdqRBPR5WyT36A" sourceEdges="_9XeF4tovEdqRBPR5WyT36A _9PaR4No2EdqRBPR5WyT36A" element="_4WMkYNovEdqRBPR5WyT36A">
- <children xmi:id="_4WSrA9ovEdqRBPR5WyT36A" type="ImageCompartment" element="_4WMkYNovEdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_4WSrBNovEdqRBPR5WyT36A" width="1320" height="1320"/>
- </children>
- <children xmi:id="_4WSrBdovEdqRBPR5WyT36A" type="Stereotype" element="_4WMkYNovEdqRBPR5WyT36A"/>
- <children xmi:id="_4WSrBtovEdqRBPR5WyT36A" type="Name" element="_4WMkYNovEdqRBPR5WyT36A"/>
- <children xmi:id="_4WSrB9ovEdqRBPR5WyT36A" type="AttributeCompartment" element="_4WMkYNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_4WSrCNovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_4WSrCdovEdqRBPR5WyT36A" type="OperationCompartment" element="_4WMkYNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_4WSrCtovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_4WSrC9ovEdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_4WMkYNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_4WSrDNovEdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_4WSrDdovEdqRBPR5WyT36A" visible="false" type="StructureCompartment" element="_4WMkYNovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLShapeCompartmentStyle" xmi:id="_4WSrDtovEdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLShapeStyle" xmi:id="_4WSrAdovEdqRBPR5WyT36A" showStereotype="Label"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_4WSrAtovEdqRBPR5WyT36A" x="19716" y="12084"/>
- </children>
- <children xmi:id="_o2m3oNo0EdqRBPR5WyT36A" targetEdges="_9PaR4No2EdqRBPR5WyT36A _9-BEUNo2EdqRBPR5WyT36A" element="_o2gxANo0EdqRBPR5WyT36A">
- <children xmi:id="_o2m3o9o0EdqRBPR5WyT36A" type="ImageCompartment" element="_o2gxANo0EdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_o2m3pNo0EdqRBPR5WyT36A" width="530" height="530"/>
- </children>
- <children xmi:id="_o2m3pdo0EdqRBPR5WyT36A" type="Stereotype" element="_o2gxANo0EdqRBPR5WyT36A"/>
- <children xmi:id="_o2m3pto0EdqRBPR5WyT36A" type="Kind" element="_o2gxANo0EdqRBPR5WyT36A"/>
- <children xmi:id="_o2m3p9o0EdqRBPR5WyT36A" type="Name" element="_o2gxANo0EdqRBPR5WyT36A"/>
- <children xmi:id="_o2m3qNo0EdqRBPR5WyT36A" type="AttributeCompartment" element="_o2gxANo0EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_o2m3qdo0EdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_o2m3qto0EdqRBPR5WyT36A" type="OperationCompartment" element="_o2gxANo0EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_o2m3q9o0EdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_o2m3rNo0EdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_o2gxANo0EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_o2m3rdo0EdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLClassifierStyle" xmi:id="_o2m3odo0EdqRBPR5WyT36A" showStereotype="Label" useClassifierShape="true"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_o2m3oto0EdqRBPR5WyT36A" x="23532" y="6996"/>
- </children>
- <children xmi:id="_M0FLkNo1EdqRBPR5WyT36A" targetEdges="_R5Rjwdo1EdqRBPR5WyT36A _V7zlEdo1EdqRBPR5WyT36A" element="_Mz_E8No1EdqRBPR5WyT36A">
- <children xmi:id="_M0FLk9o1EdqRBPR5WyT36A" type="ImageCompartment" element="_Mz_E8No1EdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_M0FLlNo1EdqRBPR5WyT36A" width="530" height="530"/>
- </children>
- <children xmi:id="_M0FLldo1EdqRBPR5WyT36A" type="Stereotype" element="_Mz_E8No1EdqRBPR5WyT36A"/>
- <children xmi:id="_M0FLlto1EdqRBPR5WyT36A" type="Kind" element="_Mz_E8No1EdqRBPR5WyT36A"/>
- <children xmi:id="_M0FLl9o1EdqRBPR5WyT36A" type="Name" element="_Mz_E8No1EdqRBPR5WyT36A"/>
- <children xmi:id="_M0FLmNo1EdqRBPR5WyT36A" type="AttributeCompartment" element="_Mz_E8No1EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_M0FLmdo1EdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_M0FLmto1EdqRBPR5WyT36A" type="OperationCompartment" element="_Mz_E8No1EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_M0FLm9o1EdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_M0FLnNo1EdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_Mz_E8No1EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_M0FLndo1EdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLClassifierStyle" xmi:id="_M0FLkdo1EdqRBPR5WyT36A" showStereotype="Label" useClassifierShape="true"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_M0FLkto1EdqRBPR5WyT36A" x="6678" y="318"/>
- </children>
- <children xmi:id="_TJHbANo1EdqRBPR5WyT36A" sourceEdges="_V7zlEdo1EdqRBPR5WyT36A" targetEdges="_cN4xsdo2EdqRBPR5WyT36A" element="_TI7NwNo1EdqRBPR5WyT36A">
- <children xmi:id="_TJHbA9o1EdqRBPR5WyT36A" type="ImageCompartment" element="_TI7NwNo1EdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_TJHbBNo1EdqRBPR5WyT36A" width="530" height="530"/>
- </children>
- <children xmi:id="_TJHbBdo1EdqRBPR5WyT36A" type="Stereotype" element="_TI7NwNo1EdqRBPR5WyT36A"/>
- <children xmi:id="_TJHbBto1EdqRBPR5WyT36A" type="Kind" element="_TI7NwNo1EdqRBPR5WyT36A"/>
- <children xmi:id="_TJHbB9o1EdqRBPR5WyT36A" type="Name" element="_TI7NwNo1EdqRBPR5WyT36A"/>
- <children xmi:id="_TJHbCNo1EdqRBPR5WyT36A" type="AttributeCompartment" element="_TI7NwNo1EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_TJHbCdo1EdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_TJHbCto1EdqRBPR5WyT36A" type="OperationCompartment" element="_TI7NwNo1EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_TJHbC9o1EdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_TJHbDNo1EdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_TI7NwNo1EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_TJHbDdo1EdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLClassifierStyle" xmi:id="_TJHbAdo1EdqRBPR5WyT36A" showStereotype="Label" useClassifierShape="true"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_TJHbAto1EdqRBPR5WyT36A" x="16854" y="318"/>
- </children>
- <styles xmi:type="umlnotation:UMLDiagramStyle" xmi:id="_al1S89ovEdqRBPR5WyT36A"/>
- <edges xmi:id="_hmIF4dovEdqRBPR5WyT36A" element="_hmIF4NovEdqRBPR5WyT36A" source="_fs1pANovEdqRBPR5WyT36A" target="_ePDcYdovEdqRBPR5WyT36A">
- <children xmi:id="_hmIF5NovEdqRBPR5WyT36A" type="NameLabel" element="_hmIF4NovEdqRBPR5WyT36A">
- <children xmi:id="_hmIF5tovEdqRBPR5WyT36A" type="Stereotype" element="_hmIF4NovEdqRBPR5WyT36A"/>
- <children xmi:id="_hmIF59ovEdqRBPR5WyT36A" type="Name" element="_hmIF4NovEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_hmIF5dovEdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_hmIF4tovEdqRBPR5WyT36A" routing="Tree" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_hmIF49ovEdqRBPR5WyT36A" points="[26, -31, -110, 148]$[140, -148, 4, 31]"/>
- </edges>
- <edges xmi:id="_mu9A4dovEdqRBPR5WyT36A" element="_mu9A4NovEdqRBPR5WyT36A" source="_ikr_4NovEdqRBPR5WyT36A" target="_ePDcYdovEdqRBPR5WyT36A">
- <children xmi:id="_mu9A5NovEdqRBPR5WyT36A" type="NameLabel" element="_mu9A4NovEdqRBPR5WyT36A">
- <children xmi:id="_mu9A5tovEdqRBPR5WyT36A" type="Stereotype" element="_mu9A4NovEdqRBPR5WyT36A"/>
- <children xmi:id="_mu9A59ovEdqRBPR5WyT36A" type="Name" element="_mu9A4NovEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_mu9A5dovEdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_mu9A4tovEdqRBPR5WyT36A" routing="Tree" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_mu9A49ovEdqRBPR5WyT36A" points="[-185, -820, 2937, 3916]$[-185, -3042, 2937, 1694]$[-3255, -3042, -133, 1694]$[-3255, -3916, -133, 820]"/>
- </edges>
- <edges xmi:id="_pe3jwNovEdqRBPR5WyT36A" element="_peM1YNovEdqRBPR5WyT36A" source="_fs1pANovEdqRBPR5WyT36A" target="_ePDcYdovEdqRBPR5WyT36A">
- <children xmi:id="_pe3jw9ovEdqRBPR5WyT36A" type="NameLabel" element="_peM1YNovEdqRBPR5WyT36A">
- <children xmi:id="_pe3jxdovEdqRBPR5WyT36A" type="Stereotype" element="_peM1YNovEdqRBPR5WyT36A"/>
- <children xmi:id="_pe3jxtovEdqRBPR5WyT36A" type="Name" element="_peM1YNovEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pe3jxNovEdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_pe3jx9ovEdqRBPR5WyT36A" type="ToMultiplicityLabel" element="_peM1YtovEdqRBPR5WyT36A">
- <children xmi:id="_pe3jydovEdqRBPR5WyT36A" type="ToMultiplicity" element="_peM1YtovEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pe3jyNovEdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_pe3jytovEdqRBPR5WyT36A" type="ToRoleLabel" element="_peM1YtovEdqRBPR5WyT36A">
- <children xmi:id="_pe3jzNovEdqRBPR5WyT36A" type="ToRole" element="_peM1YtovEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pe3jy9ovEdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_pe3jzdovEdqRBPR5WyT36A" type="FromMultiplicityLabel" element="_peM1YdovEdqRBPR5WyT36A">
- <children xmi:id="_pe3jz9ovEdqRBPR5WyT36A" type="FromMultiplicity" element="_peM1YdovEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pe3jztovEdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_pe3j0NovEdqRBPR5WyT36A" type="FromRoleLabel" element="_peM1YdovEdqRBPR5WyT36A">
- <children xmi:id="_pe3j0tovEdqRBPR5WyT36A" type="FromRole" element="_peM1YdovEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pe3j0dovEdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_pe3j09ovEdqRBPR5WyT36A" type="ToQualifierLabel" element="_peM1YtovEdqRBPR5WyT36A">
- <children xmi:id="_pe3j1dovEdqRBPR5WyT36A" type="QualifierCompartment" element="_peM1YtovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_pe3j1tovEdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pe3j1NovEdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_pe3j19ovEdqRBPR5WyT36A" type="FromQualifierLabel" element="_peM1YdovEdqRBPR5WyT36A">
- <children xmi:id="_pe3j2dovEdqRBPR5WyT36A" type="QualifierCompartment" element="_peM1YdovEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_pe3j2tovEdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pe3j2NovEdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_pe3jwdovEdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_pe3jwtovEdqRBPR5WyT36A" points="[-317, -820, -3916, 3916]$[-1931, -4762, -5530, -26]$[2382, -4762, -1217, -26]"/>
- </edges>
- <edges xmi:id="_xInjYdovEdqRBPR5WyT36A" element="_xInjYNovEdqRBPR5WyT36A" source="_tZF9odovEdqRBPR5WyT36A" target="_fs1pANovEdqRBPR5WyT36A">
- <children xmi:id="_xInjZNovEdqRBPR5WyT36A" type="NameLabel" element="_xInjYNovEdqRBPR5WyT36A">
- <children xmi:id="_xInjZtovEdqRBPR5WyT36A" type="Stereotype" element="_xInjYNovEdqRBPR5WyT36A"/>
- <children xmi:id="_xInjZ9ovEdqRBPR5WyT36A" type="Name" element="_xInjYNovEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_xInjZdovEdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_xInjYtovEdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_xInjY9ovEdqRBPR5WyT36A" points="[-4, -31, 1, 113]$[-4, -115, 1, 29]"/>
- </edges>
- <edges xmi:id="_3Ic-4NovEdqRBPR5WyT36A" element="_3IW4QNovEdqRBPR5WyT36A" source="_1y-ZsNovEdqRBPR5WyT36A" target="_z_m-oNovEdqRBPR5WyT36A">
- <children xmi:id="_3Ic-49ovEdqRBPR5WyT36A" type="NameLabel" element="_3IW4QNovEdqRBPR5WyT36A">
- <children xmi:id="_3Ic-5dovEdqRBPR5WyT36A" type="Stereotype" element="_3IW4QNovEdqRBPR5WyT36A"/>
- <children xmi:id="_3Ic-5tovEdqRBPR5WyT36A" type="Name" element="_3IW4QNovEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_3Ic-5NovEdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_3Ic-4dovEdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_3Ic-4tovEdqRBPR5WyT36A" points="[6, -24, -37, 154]$[-22, -170, -65, 8]"/>
- </edges>
- <edges xmi:id="_9XeF4tovEdqRBPR5WyT36A" element="_9XeF4NovEdqRBPR5WyT36A" source="_4WSrANovEdqRBPR5WyT36A" target="_z_m-oNovEdqRBPR5WyT36A">
- <children xmi:id="_9XeF5dovEdqRBPR5WyT36A" type="NameLabel" element="_9XeF4NovEdqRBPR5WyT36A">
- <children xmi:id="_9XeF59ovEdqRBPR5WyT36A" type="Stereotype" element="_9XeF4NovEdqRBPR5WyT36A"/>
- <children xmi:id="_9XeF6NovEdqRBPR5WyT36A" type="Name" element="_9XeF4NovEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9XeF5tovEdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_9XeF49ovEdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_9XeF5NovEdqRBPR5WyT36A" points="[-23, -23, 162, 151]$[-121, -170, 64, 4]"/>
- </edges>
- <edges xmi:id="_BkUg0dowEdqRBPR5WyT36A" element="_Bj8GUNowEdqRBPR5WyT36A" source="_tZF9odovEdqRBPR5WyT36A" target="_1y-ZsNovEdqRBPR5WyT36A">
- <children xmi:id="_BkancNowEdqRBPR5WyT36A" type="NameLabel" element="_Bj8GUNowEdqRBPR5WyT36A">
- <children xmi:id="_BkanctowEdqRBPR5WyT36A" type="Stereotype" element="_Bj8GUNowEdqRBPR5WyT36A"/>
- <children xmi:id="_Bkanc9owEdqRBPR5WyT36A" type="Name" element="_Bj8GUNowEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_BkancdowEdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_BkandNowEdqRBPR5WyT36A" type="ToMultiplicityLabel" element="_Bj8GUtowEdqRBPR5WyT36A">
- <children xmi:id="_BkandtowEdqRBPR5WyT36A" type="ToMultiplicity" element="_Bj8GUtowEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_BkanddowEdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_Bkand9owEdqRBPR5WyT36A" type="ToRoleLabel" element="_Bj8GUtowEdqRBPR5WyT36A">
- <children xmi:id="_BkanedowEdqRBPR5WyT36A" type="ToRole" element="_Bj8GUtowEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_BkaneNowEdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_BkanetowEdqRBPR5WyT36A" type="FromMultiplicityLabel" element="_Bj8GUdowEdqRBPR5WyT36A">
- <children xmi:id="_BkanfNowEdqRBPR5WyT36A" type="FromMultiplicity" element="_Bj8GUdowEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_Bkane9owEdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_BkanfdowEdqRBPR5WyT36A" type="FromRoleLabel" element="_Bj8GUdowEdqRBPR5WyT36A">
- <children xmi:id="_Bkanf9owEdqRBPR5WyT36A" type="FromRole" element="_Bj8GUdowEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_BkanftowEdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_BkangNowEdqRBPR5WyT36A" type="ToQualifierLabel" element="_Bj8GUtowEdqRBPR5WyT36A">
- <children xmi:id="_BkangtowEdqRBPR5WyT36A" type="QualifierCompartment" element="_Bj8GUtowEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_Bkang9owEdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_BkangdowEdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_BkanhNowEdqRBPR5WyT36A" type="FromQualifierLabel" element="_Bj8GUdowEdqRBPR5WyT36A">
- <children xmi:id="_BkanhtowEdqRBPR5WyT36A" type="QualifierCompartment" element="_Bj8GUdowEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_Bkanh9owEdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_BkanhdowEdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_BkUg0towEdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_BkUg09owEdqRBPR5WyT36A" points="[83, -24, -490, 123]$[486, -151, -87, -4]"/>
- </edges>
- <edges xmi:id="_Fd3lQdowEdqRBPR5WyT36A" element="_FdlRYNowEdqRBPR5WyT36A" source="_ePDcYdovEdqRBPR5WyT36A" target="_z_m-oNovEdqRBPR5WyT36A">
- <children xmi:id="_Fd3lRNowEdqRBPR5WyT36A" type="NameLabel" element="_FdlRYNowEdqRBPR5WyT36A">
- <children xmi:id="_Fd3lRtowEdqRBPR5WyT36A" type="Stereotype" element="_FdlRYNowEdqRBPR5WyT36A"/>
- <children xmi:id="_Fd3lR9owEdqRBPR5WyT36A" type="Name" element="_FdlRYNowEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_Fd3lRdowEdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_Fd3lSNowEdqRBPR5WyT36A" type="ToMultiplicityLabel" element="_FdlRYtowEdqRBPR5WyT36A">
- <children xmi:id="_Fd3lStowEdqRBPR5WyT36A" type="ToMultiplicity" element="_FdlRYtowEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_Fd3lSdowEdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_Fd3lS9owEdqRBPR5WyT36A" type="ToRoleLabel" element="_FdlRYtowEdqRBPR5WyT36A">
- <children xmi:id="_Fd3lTdowEdqRBPR5WyT36A" type="ToRole" element="_FdlRYtowEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_Fd3lTNowEdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_Fd3lTtowEdqRBPR5WyT36A" type="FromMultiplicityLabel" element="_FdlRYdowEdqRBPR5WyT36A">
- <children xmi:id="_Fd3lUNowEdqRBPR5WyT36A" type="FromMultiplicity" element="_FdlRYdowEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_Fd3lT9owEdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_Fd3lUdowEdqRBPR5WyT36A" type="FromRoleLabel" element="_FdlRYdowEdqRBPR5WyT36A">
- <children xmi:id="_Fd3lU9owEdqRBPR5WyT36A" type="FromRole" element="_FdlRYdowEdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_Fd3lUtowEdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_Fd3lVNowEdqRBPR5WyT36A" type="ToQualifierLabel" element="_FdlRYtowEdqRBPR5WyT36A">
- <children xmi:id="_Fd3lVtowEdqRBPR5WyT36A" type="QualifierCompartment" element="_FdlRYtowEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_Fd3lV9owEdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_Fd3lVdowEdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_Fd3lWNowEdqRBPR5WyT36A" type="FromQualifierLabel" element="_FdlRYdowEdqRBPR5WyT36A">
- <children xmi:id="_Fd3lWtowEdqRBPR5WyT36A" type="QualifierCompartment" element="_FdlRYdowEdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_Fd3lW9owEdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_Fd3lWdowEdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_Fd3lQtowEdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Fd3lQ9owEdqRBPR5WyT36A" points="[46, -11, -369, -9]$[351, -11, -64, -9]"/>
- </edges>
- <edges xmi:id="_R5Rjwdo1EdqRBPR5WyT36A" element="_R5RjwNo1EdqRBPR5WyT36A" source="_ePDcYdovEdqRBPR5WyT36A" target="_M0FLkNo1EdqRBPR5WyT36A">
- <children xmi:id="_R5RjxNo1EdqRBPR5WyT36A" type="NameLabel" element="_R5RjwNo1EdqRBPR5WyT36A">
- <children xmi:id="_R5Rjxto1EdqRBPR5WyT36A" type="Stereotype" element="_R5RjwNo1EdqRBPR5WyT36A"/>
- <children xmi:id="_R5Rjx9o1EdqRBPR5WyT36A" type="Name" element="_R5RjwNo1EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_R5Rjxdo1EdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_R5Rjwto1EdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_R5Rjw9o1EdqRBPR5WyT36A" points="[-2, -31, -2, 91]$[-2, -91, -2, 31]"/>
- </edges>
- <edges xmi:id="_V7zlEdo1EdqRBPR5WyT36A" element="_V7zlENo1EdqRBPR5WyT36A" source="_TJHbANo1EdqRBPR5WyT36A" target="_M0FLkNo1EdqRBPR5WyT36A">
- <children xmi:id="_V7zlFNo1EdqRBPR5WyT36A" type="NameLabel" element="_V7zlENo1EdqRBPR5WyT36A">
- <children xmi:id="_V7zlFto1EdqRBPR5WyT36A" type="Stereotype" element="_V7zlENo1EdqRBPR5WyT36A"/>
- <children xmi:id="_V7zlF9o1EdqRBPR5WyT36A" type="Name" element="_V7zlENo1EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_V7zlFdo1EdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_V7zlEto1EdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_V7zlE9o1EdqRBPR5WyT36A" points="[-73, 0, 339, 0]$[-457, 0, -45, 0]"/>
- </edges>
- <edges xmi:id="_cN4xsdo2EdqRBPR5WyT36A" targetEdges="_pdfmkNo2EdqRBPR5WyT36A" element="_cNskcNo2EdqRBPR5WyT36A" source="_z_m-oNovEdqRBPR5WyT36A" target="_TJHbANo1EdqRBPR5WyT36A">
- <children xmi:id="_cN4xtNo2EdqRBPR5WyT36A" type="NameLabel" element="_cNskcNo2EdqRBPR5WyT36A">
- <children xmi:id="_cN4xtto2EdqRBPR5WyT36A" type="Stereotype" element="_cNskcNo2EdqRBPR5WyT36A"/>
- <children xmi:id="_cN4xt9o2EdqRBPR5WyT36A" type="Name" element="_cNskcNo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_cN4xtdo2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_cN4xuNo2EdqRBPR5WyT36A" type="ToMultiplicityLabel" element="_cNskcto2EdqRBPR5WyT36A">
- <children xmi:id="_cN4xuto2EdqRBPR5WyT36A" type="ToMultiplicity" element="_cNskcto2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_cN4xudo2EdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_cN4xu9o2EdqRBPR5WyT36A" type="ToRoleLabel" element="_cNskcto2EdqRBPR5WyT36A">
- <children xmi:id="_cN4xvdo2EdqRBPR5WyT36A" type="ToRole" element="_cNskcto2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_cN4xvNo2EdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_cN_fYNo2EdqRBPR5WyT36A" type="FromMultiplicityLabel" element="_cNskcdo2EdqRBPR5WyT36A">
- <children xmi:id="_cN_fYto2EdqRBPR5WyT36A" type="FromMultiplicity" element="_cNskcdo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_cN_fYdo2EdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_cN_fY9o2EdqRBPR5WyT36A" type="FromRoleLabel" element="_cNskcdo2EdqRBPR5WyT36A">
- <children xmi:id="_cN_fZdo2EdqRBPR5WyT36A" type="FromRole" element="_cNskcdo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_cN_fZNo2EdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_cN_fZto2EdqRBPR5WyT36A" type="ToQualifierLabel" element="_cNskcto2EdqRBPR5WyT36A">
- <children xmi:id="_cN_faNo2EdqRBPR5WyT36A" type="QualifierCompartment" element="_cNskcto2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_cN_fado2EdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_cN_fZ9o2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_cN_fato2EdqRBPR5WyT36A" type="FromQualifierLabel" element="_cNskcdo2EdqRBPR5WyT36A">
- <children xmi:id="_cN_fbNo2EdqRBPR5WyT36A" type="QualifierCompartment" element="_cNskcdo2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_cN_fbdo2EdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_cN_fa9o2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_cN4xsto2EdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_cN4xs9o2EdqRBPR5WyT36A" points="[-2, -29, 1, 91]$[26, -89, 29, 31]"/>
- </edges>
- <edges xmi:id="_pdfmkNo2EdqRBPR5WyT36A" element="_pdHMENo2EdqRBPR5WyT36A" source="_ePDcYdovEdqRBPR5WyT36A" target="_cN4xsdo2EdqRBPR5WyT36A">
- <children xmi:id="_pdfml9o2EdqRBPR5WyT36A" type="ToMultiplicityLabel" element="_pdTZUdo2EdqRBPR5WyT36A">
- <children xmi:id="_pdfmmdo2EdqRBPR5WyT36A" type="ToMultiplicity" element="_pdTZUdo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pdfmmNo2EdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_pdfmmto2EdqRBPR5WyT36A" type="ToRoleLabel" element="_pdTZUdo2EdqRBPR5WyT36A">
- <children xmi:id="_pdfmnNo2EdqRBPR5WyT36A" type="ToRole" element="_pdTZUdo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pdfmm9o2EdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_pdfmndo2EdqRBPR5WyT36A" type="FromMultiplicityLabel" element="_pdTZUNo2EdqRBPR5WyT36A">
- <children xmi:id="_pdfmn9o2EdqRBPR5WyT36A" type="FromMultiplicity" element="_pdTZUNo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pdfmnto2EdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_pdfmoNo2EdqRBPR5WyT36A" type="FromRoleLabel" element="_pdTZUNo2EdqRBPR5WyT36A">
- <children xmi:id="_pdfmoto2EdqRBPR5WyT36A" type="FromRole" element="_pdTZUNo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pdfmodo2EdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_pdfmo9o2EdqRBPR5WyT36A" type="ToQualifierLabel" element="_pdTZUdo2EdqRBPR5WyT36A">
- <children xmi:id="_pdfmpdo2EdqRBPR5WyT36A" type="QualifierCompartment" element="_pdTZUdo2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_pdfmpto2EdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pdfmpNo2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_pdfmp9o2EdqRBPR5WyT36A" type="FromQualifierLabel" element="_pdTZUNo2EdqRBPR5WyT36A">
- <children xmi:id="_pdfmqdo2EdqRBPR5WyT36A" type="QualifierCompartment" element="_pdTZUNo2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_pdfmqto2EdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_pdfmqNo2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_pdfmq9o2EdqRBPR5WyT36A" element="_pdHMENo2EdqRBPR5WyT36A">
- <children xmi:id="_pdfmrto2EdqRBPR5WyT36A" type="ImageCompartment" element="_pdHMENo2EdqRBPR5WyT36A">
- <layoutConstraint xmi:type="notation:Size" xmi:id="_pdfmr9o2EdqRBPR5WyT36A" width="1320" height="1320"/>
- </children>
- <children xmi:id="_pdfmsNo2EdqRBPR5WyT36A" type="Stereotype" element="_pdHMENo2EdqRBPR5WyT36A"/>
- <children xmi:id="_pdfmsdo2EdqRBPR5WyT36A" type="Name" element="_pdHMENo2EdqRBPR5WyT36A"/>
- <children xmi:id="_pdfmsto2EdqRBPR5WyT36A" type="AttributeCompartment" element="_pdHMENo2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_pdfms9o2EdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_pdfmtNo2EdqRBPR5WyT36A" type="OperationCompartment" element="_pdHMENo2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_pdfmtdo2EdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_pdfmtto2EdqRBPR5WyT36A" visible="false" type="SignalCompartment" element="_pdHMENo2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_pdfmt9o2EdqRBPR5WyT36A"/>
- </children>
- <children xmi:id="_pdfmuNo2EdqRBPR5WyT36A" visible="false" type="StructureCompartment" element="_pdHMENo2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLShapeCompartmentStyle" xmi:id="_pdfmudo2EdqRBPR5WyT36A"/>
- </children>
- <styles xmi:type="umlnotation:UMLShapeStyle" xmi:id="_pdfmrNo2EdqRBPR5WyT36A" showStereotype="Label"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pdfmrdo2EdqRBPR5WyT36A" y="1323"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_pdfmkdo2EdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_pdfmkto2EdqRBPR5WyT36A" points="[46, 3, -366, 94]$[412, -91, 0, 0]"/>
- <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_pdrz0No2EdqRBPR5WyT36A" id="100"/>
- </edges>
- <edges xmi:id="_9PaR4No2EdqRBPR5WyT36A" element="_9PH-ANo2EdqRBPR5WyT36A" source="_4WSrANovEdqRBPR5WyT36A" target="_o2m3oNo0EdqRBPR5WyT36A">
- <children xmi:id="_9PaR49o2EdqRBPR5WyT36A" type="NameLabel" element="_9PH-ANo2EdqRBPR5WyT36A">
- <children xmi:id="_9PaR5do2EdqRBPR5WyT36A" type="Stereotype" element="_9PH-ANo2EdqRBPR5WyT36A"/>
- <children xmi:id="_9PaR5to2EdqRBPR5WyT36A" type="Name" element="_9PH-ANo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9PaR5No2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_9PaR59o2EdqRBPR5WyT36A" type="ToMultiplicityLabel" element="_9PH-Ato2EdqRBPR5WyT36A">
- <children xmi:id="_9PaR6do2EdqRBPR5WyT36A" type="ToMultiplicity" element="_9PH-Ato2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9PaR6No2EdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_9PaR6to2EdqRBPR5WyT36A" type="ToRoleLabel" element="_9PH-Ato2EdqRBPR5WyT36A">
- <children xmi:id="_9PaR7No2EdqRBPR5WyT36A" type="ToRole" element="_9PH-Ato2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9PaR69o2EdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_9PaR7do2EdqRBPR5WyT36A" type="FromMultiplicityLabel" element="_9PH-Ado2EdqRBPR5WyT36A">
- <children xmi:id="_9PaR79o2EdqRBPR5WyT36A" type="FromMultiplicity" element="_9PH-Ado2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9PaR7to2EdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_9PaR8No2EdqRBPR5WyT36A" type="FromRoleLabel" element="_9PH-Ado2EdqRBPR5WyT36A">
- <children xmi:id="_9PaR8to2EdqRBPR5WyT36A" type="FromRole" element="_9PH-Ado2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9PaR8do2EdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_9PgYgNo2EdqRBPR5WyT36A" type="ToQualifierLabel" element="_9PH-Ato2EdqRBPR5WyT36A">
- <children xmi:id="_9PgYgto2EdqRBPR5WyT36A" type="QualifierCompartment" element="_9PH-Ato2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_9PgYg9o2EdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9PgYgdo2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_9PgYhNo2EdqRBPR5WyT36A" type="FromQualifierLabel" element="_9PH-Ado2EdqRBPR5WyT36A">
- <children xmi:id="_9PgYhto2EdqRBPR5WyT36A" type="QualifierCompartment" element="_9PH-Ado2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_9PgYh9o2EdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9PgYhdo2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_9PaR4do2EdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_9PaR4to2EdqRBPR5WyT36A" points="[12, -24, -94, 162]$[80, -155, -26, 31]"/>
- </edges>
- <edges xmi:id="_9-BEUNo2EdqRBPR5WyT36A" element="_99uwcNo2EdqRBPR5WyT36A" source="_1y-ZsNovEdqRBPR5WyT36A" target="_o2m3oNo0EdqRBPR5WyT36A">
- <children xmi:id="_9-BEU9o2EdqRBPR5WyT36A" type="NameLabel" element="_99uwcNo2EdqRBPR5WyT36A">
- <children xmi:id="_9-HK8No2EdqRBPR5WyT36A" type="Stereotype" element="_99uwcNo2EdqRBPR5WyT36A"/>
- <children xmi:id="_9-HK8do2EdqRBPR5WyT36A" type="Name" element="_99uwcNo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9-BEVNo2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_9-HK8to2EdqRBPR5WyT36A" type="ToMultiplicityLabel" element="_99uwcto2EdqRBPR5WyT36A">
- <children xmi:id="_9-HK9No2EdqRBPR5WyT36A" type="ToMultiplicity" element="_99uwcto2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9-HK89o2EdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_9-HK9do2EdqRBPR5WyT36A" type="ToRoleLabel" element="_99uwcto2EdqRBPR5WyT36A">
- <children xmi:id="_9-HK99o2EdqRBPR5WyT36A" type="ToRole" element="_99uwcto2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9-HK9to2EdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_9-HK-No2EdqRBPR5WyT36A" type="FromMultiplicityLabel" element="_99uwcdo2EdqRBPR5WyT36A">
- <children xmi:id="_9-HK-to2EdqRBPR5WyT36A" type="FromMultiplicity" element="_99uwcdo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9-HK-do2EdqRBPR5WyT36A" y="397"/>
- </children>
- <children xmi:id="_9-HK-9o2EdqRBPR5WyT36A" type="FromRoleLabel" element="_99uwcdo2EdqRBPR5WyT36A">
- <children xmi:id="_9-HK_do2EdqRBPR5WyT36A" type="FromRole" element="_99uwcdo2EdqRBPR5WyT36A"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9-HK_No2EdqRBPR5WyT36A" y="-397"/>
- </children>
- <children xmi:id="_9-HK_to2EdqRBPR5WyT36A" type="ToQualifierLabel" element="_99uwcto2EdqRBPR5WyT36A">
- <children xmi:id="_9-HLANo2EdqRBPR5WyT36A" type="QualifierCompartment" element="_99uwcto2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_9-HLAdo2EdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9-HK_9o2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <children xmi:id="_9-HLAto2EdqRBPR5WyT36A" type="FromQualifierLabel" element="_99uwcdo2EdqRBPR5WyT36A">
- <children xmi:id="_9-HLBNo2EdqRBPR5WyT36A" type="QualifierCompartment" element="_99uwcdo2EdqRBPR5WyT36A">
- <styles xmi:type="umlnotation:UMLListCompartmentStyle" xmi:id="_9-HLBdo2EdqRBPR5WyT36A"/>
- </children>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_9-HLA9o2EdqRBPR5WyT36A" y="-185"/>
- </children>
- <styles xmi:type="umlnotation:UMLConnectorStyle" xmi:id="_9-BEUdo2EdqRBPR5WyT36A" showStereotype="Text"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_9-BEUto2EdqRBPR5WyT36A" points="[49, -24, -290, 162]$[404, -163, 65, 23]"/>
- </edges>
- </contents>
- </eAnnotations>
- <packageImport xmi:type="uml:ProfileApplication" xmi:id="_al1S9NovEdqRBPR5WyT36A">
- <eAnnotations xmi:id="_al1S9dovEdqRBPR5WyT36A" source="attributes">
- <details xmi:id="_al1S9tovEdqRBPR5WyT36A" key="version" value="0"/>
- </eAnnotations>
- <importedPackage xmi:type="uml:Profile" href="pathmap://UML2_PROFILES/Basic.profile.uml2#_6mFRgK86Edih9-GG5afQ0g"/>
- <importedProfile href="pathmap://UML2_PROFILES/Basic.profile.uml2#_6mFRgK86Edih9-GG5afQ0g"/>
- </packageImport>
- <packageImport xmi:type="uml:ProfileApplication" xmi:id="_al1S99ovEdqRBPR5WyT36A">
- <eAnnotations xmi:id="_al1S-NovEdqRBPR5WyT36A" source="attributes">
- <details xmi:id="_al1S-dovEdqRBPR5WyT36A" key="version" value="0"/>
- </eAnnotations>
- <importedPackage xmi:type="uml:Profile" href="pathmap://UML2_PROFILES/Intermediate.profile.uml2#_Cz7csK87Edih9-GG5afQ0g"/>
- <importedProfile href="pathmap://UML2_PROFILES/Intermediate.profile.uml2#_Cz7csK87Edih9-GG5afQ0g"/>
- </packageImport>
- <packageImport xmi:type="uml:ProfileApplication" xmi:id="_al1S-tovEdqRBPR5WyT36A">
- <eAnnotations xmi:id="_al1S-9ovEdqRBPR5WyT36A" source="attributes">
- <details xmi:id="_al1S_NovEdqRBPR5WyT36A" key="version" value="0"/>
- </eAnnotations>
- <importedPackage xmi:type="uml:Profile" href="pathmap://UML2_PROFILES/Complete.profile.uml2#_M7pTkK87Edih9-GG5afQ0g"/>
- <importedProfile href="pathmap://UML2_PROFILES/Complete.profile.uml2#_M7pTkK87Edih9-GG5afQ0g"/>
- </packageImport>
- <packageImport xmi:type="uml:ProfileApplication" xmi:id="_al1S_dovEdqRBPR5WyT36A">
- <eAnnotations xmi:id="_al1S_tovEdqRBPR5WyT36A" source="attributes">
- <details xmi:id="_al1S_9ovEdqRBPR5WyT36A" key="version" value="0"/>
- </eAnnotations>
- <importedPackage xmi:type="uml:Profile" href="pathmap://UML2_MSL_PROFILES/Default.epx#_a_S3wNWLEdiy4IqP8whjFA?Default"/>
- <importedProfile href="pathmap://UML2_MSL_PROFILES/Default.epx#_a_S3wNWLEdiy4IqP8whjFA?Default"/>
- </packageImport>
- <packageImport xmi:type="uml:ProfileApplication" xmi:id="_al1TANovEdqRBPR5WyT36A">
- <eAnnotations xmi:id="_al1TAdovEdqRBPR5WyT36A" source="attributes">
- <details xmi:id="_al1TAtovEdqRBPR5WyT36A" key="version" value="0"/>
- </eAnnotations>
- <importedPackage xmi:type="uml:Profile" href="pathmap://UML2_MSL_PROFILES/Deployment.epx#_vjbuwOvHEdiDX5bji0iVSA?Deployment"/>
- <importedProfile href="pathmap://UML2_MSL_PROFILES/Deployment.epx#_vjbuwOvHEdiDX5bji0iVSA?Deployment"/>
- </packageImport>
- <packageImport xmi:id="_al1TA9ovEdqRBPR5WyT36A">
- <importedPackage xmi:type="uml:Model" href="pathmap://UML2_LIBRARIES/UML2PrimitiveTypes.library.uml2#_EfRZoK86EdieaYgxtVWN8Q"/>
- </packageImport>
- <ownedMember xmi:type="uml:Interface" xmi:id="_ePDcYNovEdqRBPR5WyT36A" name="Context">
- <generalization xmi:id="_R5RjwNo1EdqRBPR5WyT36A" general="_Mz_E8No1EdqRBPR5WyT36A"/>
- <ownedAttribute xmi:id="_FdlRYdowEdqRBPR5WyT36A" name="scopecontext" visibility="private" type="_z_g4ANovEdqRBPR5WyT36A" association="_FdlRYNowEdqRBPR5WyT36A">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_FdlRZNowEdqRBPR5WyT36A" value="1"/>
- <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_FdlRY9owEdqRBPR5WyT36A"/>
- </ownedAttribute>
- </ownedMember>
- <ownedMember xmi:type="uml:Interface" xmi:id="_fsviYNovEdqRBPR5WyT36A" name="CompositeContext">
- <generalization xmi:id="_hmIF4NovEdqRBPR5WyT36A" general="_ePDcYNovEdqRBPR5WyT36A"/>
- <ownedAttribute xmi:id="_peM1YdovEdqRBPR5WyT36A" name="context" visibility="private" type="_ePDcYNovEdqRBPR5WyT36A" association="_peM1YNovEdqRBPR5WyT36A" aggregation="composite">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_peM1ZNovEdqRBPR5WyT36A" value="-1"/>
- <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_peM1Y9ovEdqRBPR5WyT36A"/>
- </ownedAttribute>
- </ownedMember>
- <ownedMember xmi:type="uml:Interface" xmi:id="_ikl5QNovEdqRBPR5WyT36A" name="AtomicContext">
- <generalization xmi:id="_mu9A4NovEdqRBPR5WyT36A" general="_ePDcYNovEdqRBPR5WyT36A"/>
- </ownedMember>
- <ownedMember xmi:type="uml:Association" xmi:id="_peM1YNovEdqRBPR5WyT36A" memberEnd="_peM1YdovEdqRBPR5WyT36A _peM1YtovEdqRBPR5WyT36A">
- <ownedEnd xmi:id="_peM1YtovEdqRBPR5WyT36A" visibility="private" type="_fsviYNovEdqRBPR5WyT36A" association="_peM1YNovEdqRBPR5WyT36A"/>
- </ownedMember>
- <ownedMember xmi:type="uml:Interface" xmi:id="_tZF9oNovEdqRBPR5WyT36A" name="DeploymentContext">
- <generalization xmi:id="_xInjYNovEdqRBPR5WyT36A" general="_fsviYNovEdqRBPR5WyT36A"/>
- <ownedAttribute xmi:id="_Bj8GUdowEdqRBPR5WyT36A" name="modulescopecontext" visibility="private" type="_1yyMcNovEdqRBPR5WyT36A" association="_Bj8GUNowEdqRBPR5WyT36A">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Bj8GVNowEdqRBPR5WyT36A" value="1"/>
- <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Bj8GU9owEdqRBPR5WyT36A"/>
- </ownedAttribute>
- </ownedMember>
- <ownedMember xmi:type="uml:Interface" xmi:id="_z_g4ANovEdqRBPR5WyT36A" name="ScopeContext">
- <ownedAttribute xmi:id="_cNskcdo2EdqRBPR5WyT36A" name="instancewrapper" visibility="private" type="_TI7NwNo1EdqRBPR5WyT36A" association="_cNskcNo2EdqRBPR5WyT36A">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_cNskdNo2EdqRBPR5WyT36A" value="1"/>
- <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_cNskc9o2EdqRBPR5WyT36A"/>
- </ownedAttribute>
- </ownedMember>
- <ownedMember xmi:type="uml:Class" xmi:id="_1yyMcNovEdqRBPR5WyT36A" name="ModuleScopeContext" clientDependency="_3IW4QNovEdqRBPR5WyT36A">
- <implementation xmi:id="_3IW4QNovEdqRBPR5WyT36A" client="_1yyMcNovEdqRBPR5WyT36A" supplier="_z_g4ANovEdqRBPR5WyT36A" realizingClassifier="_z_g4ANovEdqRBPR5WyT36A" contract="_z_g4ANovEdqRBPR5WyT36A">
- <mapping xmi:id="_3IW4QdovEdqRBPR5WyT36A"/>
- </implementation>
- <ownedAttribute xmi:id="_99uwcdo2EdqRBPR5WyT36A" name="scoperegistry" visibility="private" type="_o2gxANo0EdqRBPR5WyT36A" association="_99uwcNo2EdqRBPR5WyT36A">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_99uwdNo2EdqRBPR5WyT36A" value="1"/>
- <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_99uwc9o2EdqRBPR5WyT36A"/>
- </ownedAttribute>
- </ownedMember>
- <ownedMember xmi:type="uml:Class" xmi:id="_4WMkYNovEdqRBPR5WyT36A" name="HTTPSessionScopeContext" clientDependency="_9XeF4NovEdqRBPR5WyT36A">
- <implementation xmi:id="_9XeF4NovEdqRBPR5WyT36A" client="_4WMkYNovEdqRBPR5WyT36A" supplier="_z_g4ANovEdqRBPR5WyT36A" realizingClassifier="_z_g4ANovEdqRBPR5WyT36A" contract="_z_g4ANovEdqRBPR5WyT36A">
- <mapping xmi:id="_9XeF4dovEdqRBPR5WyT36A"/>
- </implementation>
- <ownedAttribute xmi:id="_9PH-Ado2EdqRBPR5WyT36A" name="scoperegistry" visibility="private" type="_o2gxANo0EdqRBPR5WyT36A" association="_9PH-ANo2EdqRBPR5WyT36A">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9PH-BNo2EdqRBPR5WyT36A" value="1"/>
- <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_9PH-A9o2EdqRBPR5WyT36A"/>
- </ownedAttribute>
- </ownedMember>
- <ownedMember xmi:type="uml:Association" xmi:id="_Bj8GUNowEdqRBPR5WyT36A" memberEnd="_Bj8GUdowEdqRBPR5WyT36A _Bj8GUtowEdqRBPR5WyT36A">
- <ownedEnd xmi:id="_Bj8GUtowEdqRBPR5WyT36A" visibility="private" type="_tZF9oNovEdqRBPR5WyT36A" association="_Bj8GUNowEdqRBPR5WyT36A"/>
- </ownedMember>
- <ownedMember xmi:type="uml:Association" xmi:id="_FdlRYNowEdqRBPR5WyT36A" memberEnd="_FdlRYdowEdqRBPR5WyT36A _FdlRYtowEdqRBPR5WyT36A">
- <ownedEnd xmi:id="_FdlRYtowEdqRBPR5WyT36A" visibility="private" type="_ePDcYNovEdqRBPR5WyT36A" association="_FdlRYNowEdqRBPR5WyT36A"/>
- </ownedMember>
- <ownedMember xmi:type="uml:Interface" xmi:id="_o2gxANo0EdqRBPR5WyT36A" name="ScopeRegistry"/>
- <ownedMember xmi:type="uml:Interface" xmi:id="_Mz_E8No1EdqRBPR5WyT36A" name="Lifecycle"/>
- <ownedMember xmi:type="uml:Interface" xmi:id="_TI7NwNo1EdqRBPR5WyT36A" name="InstanceWrapper">
- <generalization xmi:id="_V7zlENo1EdqRBPR5WyT36A" general="_Mz_E8No1EdqRBPR5WyT36A"/>
- </ownedMember>
- <ownedMember xmi:type="uml:Association" xmi:id="_cNskcNo2EdqRBPR5WyT36A" memberEnd="_cNskcdo2EdqRBPR5WyT36A _cNskcto2EdqRBPR5WyT36A">
- <ownedEnd xmi:id="_cNskcto2EdqRBPR5WyT36A" visibility="private" type="_z_g4ANovEdqRBPR5WyT36A" association="_cNskcNo2EdqRBPR5WyT36A"/>
- </ownedMember>
- <ownedMember xmi:type="uml:AssociationClass" xmi:id="_pdHMENo2EdqRBPR5WyT36A" name="AssociationClass1" memberEnd="_pdTZUNo2EdqRBPR5WyT36A _pdTZUdo2EdqRBPR5WyT36A">
- <ownedEnd xmi:id="_pdTZUNo2EdqRBPR5WyT36A" visibility="private" type="_cNskcNo2EdqRBPR5WyT36A" association="_pdHMENo2EdqRBPR5WyT36A"/>
- <ownedEnd xmi:id="_pdTZUdo2EdqRBPR5WyT36A" visibility="private" type="_ePDcYNovEdqRBPR5WyT36A" association="_pdHMENo2EdqRBPR5WyT36A"/>
- </ownedMember>
- <ownedMember xmi:type="uml:Association" xmi:id="_9PH-ANo2EdqRBPR5WyT36A" memberEnd="_9PH-Ado2EdqRBPR5WyT36A _9PH-Ato2EdqRBPR5WyT36A">
- <ownedEnd xmi:id="_9PH-Ato2EdqRBPR5WyT36A" visibility="private" type="_4WMkYNovEdqRBPR5WyT36A" association="_9PH-ANo2EdqRBPR5WyT36A"/>
- </ownedMember>
- <ownedMember xmi:type="uml:Association" xmi:id="_99uwcNo2EdqRBPR5WyT36A" memberEnd="_99uwcdo2EdqRBPR5WyT36A _99uwcto2EdqRBPR5WyT36A">
- <ownedEnd xmi:id="_99uwcto2EdqRBPR5WyT36A" visibility="private" type="_1yyMcNovEdqRBPR5WyT36A" association="_99uwcNo2EdqRBPR5WyT36A"/>
- </ownedMember>
-</uml:Model>
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ComponentContextFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ComponentContextFactory.java
deleted file mode 100644
index 134f49e7b0..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ComponentContextFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.context;
-
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.oasisopen.sca.ComponentContext;
-
-/**
- * Interface implemented by the provider of the ComponentContext.
- *
- * @version $Rev$ $Date$
- */
-public interface ComponentContextFactory {
- /**
- * Create an instance of ComponentContext
- *
- * @param component The runtime component
- * @return An instance of ComponentContext for the component
- */
- ComponentContext createComponentContext(RuntimeComponent component);
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ContextFactoryExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ContextFactoryExtensionPoint.java
deleted file mode 100644
index e92a8f2844..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/ContextFactoryExtensionPoint.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.context;
-
-/**
- * An extension point for context factories.
- *
- * @version $Rev$ $Date$
- */
-public interface ContextFactoryExtensionPoint {
-
- /**
- * Add a context factory extension.
- *
- * @param factory The factory to add
- */
- void addFactory(Object factory);
-
- /**
- * Remove a context factory extension.
- *
- * @param factory The factory to remove
- */
- void removeFactory(Object factory);
-
- /**
- * Get a factory implementing the given interface.
- * @param factoryInterface the lookup key (factory interface)
- * @return The factory
- */
- <T> T getFactory(Class<T> factoryInterface);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java
deleted file mode 100644
index 7a35036f03..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.context;
-
-import java.lang.reflect.Constructor;
-import java.util.HashMap;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * Default implementation of a model factory extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultContextFactoryExtensionPoint implements ContextFactoryExtensionPoint {
-
- /**
- * The Map of Factories that have been registered.
- */
- private HashMap<Class<?>, Object> factories = new HashMap<Class<?>, Object>();
-
- private ExtensionPointRegistry registry;
-
- public DefaultContextFactoryExtensionPoint(ExtensionPointRegistry registry) {
- this.registry = registry;
- }
-
- /**
- * Add a model factory extension.
- *
- * @param factory The factory to add.
- * @throws IllegalArgumentException if factory is null
- */
- public void addFactory(Object factory) throws IllegalArgumentException {
- if (factory == null) {
- throw new IllegalArgumentException("Cannot add null as a factory");
- }
-
- Class<?>[] interfaces = factory.getClass().getInterfaces();
- for (int i = 0; i<interfaces.length; i++) {
- factories.put(interfaces[i], factory);
- }
- }
-
- /**
- * Remove a model factory extension.
- *
- * @param factory The factory to remove
- * @throws IllegalArgumentException if factory is null
- */
- public void removeFactory(Object factory) throws IllegalArgumentException {
- if (factory == null) {
- throw new IllegalArgumentException("Cannot remove null as a factory");
- }
-
- Class<?>[] interfaces = factory.getClass().getInterfaces();
- for (int i = 0; i<interfaces.length; i++) {
- factories.remove(interfaces[i]);
- }
- }
-
- /**
- * Get a factory implementing the given interface.
- *
- * @param factoryInterface The lookup key (factory interface)
- * @return The factory
- */
- public <T> T getFactory(Class<T> factoryInterface) throws IllegalArgumentException {
- if (factoryInterface == null) {
- throw new IllegalArgumentException("Cannot get null as a factory");
- }
-
- Object factory = factories.get(factoryInterface);
- if (factory == null) {
-
- // Dynamically load a factory class declared under META-INF/services
- try {
- ServiceDeclaration factoryDeclaration = ServiceDiscovery.getInstance().getFirstServiceDeclaration(factoryInterface.getName());
- if (factoryDeclaration != null) {
- Class<?> factoryClass = factoryDeclaration.loadClass();
-
- // Default empty constructor
- Constructor<?> constructor = factoryClass.getConstructor(ExtensionPointRegistry.class);
- factory = constructor.newInstance(registry);
-
- // Cache the loaded factory
- addFactory(factory);
- }
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
-
- }
-
- return factoryInterface.cast(factory);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/PropertyValueFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/PropertyValueFactory.java
deleted file mode 100644
index 9766e164b8..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/PropertyValueFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.context;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-
-/**
- * Interface implemented by the provider of the property values
- *
- * @version $Rev$ $Date$
- */
-public interface PropertyValueFactory {
-
- /**
- * This method will create an instance of the value for the specified Property.
- *
- * @param property The Property from which to retrieve the property value
- * @param type The type of the property value being retrieved from the Property
- * @param <B> Type type of the property value being looked up
- *
- * @return the value for the Property
- */
- <B> B createPropertyValue(ComponentProperty property, Class<B> type);
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/RequestContextFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/RequestContextFactory.java
deleted file mode 100644
index d8f15b411c..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/RequestContextFactory.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.context;
-
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.oasisopen.sca.RequestContext;
-
-/**
- * Interface implemented by the provider of the RequestContext.
- *
- * @version $Rev$ $Date$
- */
-public interface RequestContextFactory {
- /**
- * @return An instance of RequestContext for the current invocation
- */
- RequestContext createRequestContext(RuntimeComponent component);
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/DefaultEndpointResolverFactoryExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/DefaultEndpointResolverFactoryExtensionPoint.java
deleted file mode 100644
index 2aea4baa67..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/DefaultEndpointResolverFactoryExtensionPoint.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.endpointresolver;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * Default implementation of a provider factory extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultEndpointResolverFactoryExtensionPoint implements EndpointResolverFactoryExtensionPoint {
-
- private ExtensionPointRegistry registry;
- private final Map<Class<?>, EndpointResolverFactory> endpointResolverFactories = new HashMap<Class<?>, EndpointResolverFactory>();
- private boolean loaded;
-
- /**
- * The default constructor. Does nothing.
- *
- */
- public DefaultEndpointResolverFactoryExtensionPoint(ExtensionPointRegistry registry) {
- this.registry = registry;
- }
-
- /**
- * Add an endpoint resolver factory.
- *
- * @param endpointResolverFactory The resolver factory
- */
- public void addEndpointResolverFactory(EndpointResolverFactory endpointResolverFactory){
- endpointResolverFactories.put(endpointResolverFactory.getModelType(), endpointResolverFactory);
- }
-
- /**
- * Remove a endpoint resolver factory.
- *
- * @param endpointResolverFactory The endpoint resolver factory
- */
- public void removeEndpointResolverFactory(EndpointResolverFactory endpointResolverFactory){
- endpointResolverFactories.remove(endpointResolverFactory.getModelType());
- }
-
- /**
- * Returns the provider factory associated with the given model type.
- * @param modelType A model type
- * @return The provider factory associated with the given model type
- */
- public EndpointResolverFactory getEndpointResolverFactory(Class<?> modelType) {
- loadProviderFactories();
-
- Class<?>[] classes = modelType.getInterfaces();
- for (Class<?> c : classes) {
- EndpointResolverFactory factory = endpointResolverFactories.get(c);
- if (factory != null) {
- return factory;
- }
- }
- return endpointResolverFactories.get(modelType);
- }
-
-
- /**
- * Load provider factories declared under META-INF/services.
- * @param registry
- */
- private void loadProviderFactories() {
- if (loaded)
- return;
-
- // Get the provider factory service declarations
- Set<ServiceDeclaration> factoryDeclarations;
- ServiceDiscovery serviceDiscovery = ServiceDiscovery.getInstance();
- try {
- factoryDeclarations = serviceDiscovery.getServiceDeclarations(EndpointResolverFactory.class.getName());
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
-
- // Get the extension point
- EndpointResolverFactoryExtensionPoint factoryExtensionPoint =
- registry.getExtensionPoint(EndpointResolverFactoryExtensionPoint.class);
- List<EndpointResolverFactory> factories = new ArrayList<EndpointResolverFactory>();
-
- for (ServiceDeclaration factoryDeclaration : factoryDeclarations) {
- Map<String, String> attributes = factoryDeclaration.getAttributes();
-
- // Find the model type that identifies this resolver
- String modelTypeName = attributes.get("model");
-
- // Create a provider factory wrapper and register it
- EndpointResolverFactory factory =
- new LazyEndpointResolverFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addEndpointResolverFactory(factory);
- factories.add(factory);
- }
-
- loaded = true;
- }
-
- /**
- * A wrapper around an endpoint provider factory allowing lazy
- * loading and initialization of endpoint providers.
- */
- private class LazyEndpointResolverFactory implements EndpointResolverFactory {
- private ExtensionPointRegistry registry;
- private String modelTypeName;
- private ServiceDeclaration providerClass;
- private EndpointResolverFactory factory;
- private Class<?> modelType;
-
- private LazyEndpointResolverFactory(ExtensionPointRegistry registry,
- String modelTypeName,
- ServiceDeclaration providerClass) {
- this.registry = registry;
- this.modelTypeName = modelTypeName;
- this.providerClass = providerClass;
- }
-
- @SuppressWarnings("unchecked")
- private EndpointResolverFactory getFactory() {
- if (factory == null) {
- try {
- Class<EndpointResolverFactory> factoryClass = (Class<EndpointResolverFactory>)providerClass.loadClass();
- Constructor<EndpointResolverFactory> constructor =
- factoryClass.getConstructor(ExtensionPointRegistry.class);
- factory = constructor.newInstance(registry);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return factory;
- }
-
- public EndpointResolver createEndpointResolver(Endpoint endpoint, Binding binding) {
- return getFactory().createEndpointResolver(endpoint, binding);
- }
-
- public Class<?> getModelType() {
- if (modelType == null) {
- try {
- modelType = providerClass.loadClass(modelTypeName);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return modelType;
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolver.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolver.java
deleted file mode 100644
index 79a10f6d84..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolver.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.endpointresolver;
-
-
-/**
- * A reference binding implementation can options implement this
- * interface to tie into the Tuscany SCA runtime
- *
- * @version $Rev$ $Date$
- */
-public interface EndpointResolver {
-
- /**
- * This method will be invoked when the endpoint is
- * activated. It gives the resolver the opportunity
- * to do any set up ready for when it is asked to
- * resolve the endpoint when a message arrives
- */
- void start();
-
- /**
- * This method will be invoked when the endpoint is
- * to be resolved. The resolver will attempt to resolve the
- * endpoint against available services. The resolvers extending
- * this interface will provide environment or binding specific
- * resolution processing
- */
- void resolve();
-
- /**
- * This method will be invoked when the endpont is
- * deactivated. It gives the resolver the opportunity
- * to take and required resolver shutdown actions
- */
- void stop();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolverFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolverFactory.java
deleted file mode 100644
index fdd304a9c7..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolverFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.endpointresolver;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Endpoint;
-
-/**
- * A factory for creating the runtime artifacts that resolve endpoints.
- *
- * @version $Rev$ $Date$
- */
-public interface EndpointResolverFactory <M>{
-
- /**
- * Creates a new endpoint resolver for the given component,
- * reference and binding.
- *
- * @param component The runtime component
- * @param reference The reference on the runtime component
- * @param enpoint The endpoint assembly model object
- * @return The endpoint provider
- */
- EndpointResolver createEndpointResolver(Endpoint endpoint, Binding binding);
-
- Class<M> getModelType();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolverFactoryExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolverFactoryExtensionPoint.java
deleted file mode 100644
index 9d5c2e950b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/endpointresolver/EndpointResolverFactoryExtensionPoint.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.endpointresolver;
-
-
-
-/**
- * An extension point for resolver factories. Holds all of the resolver
- * factories from loaded extension points. Allows a resolver factory
- * to be located based on a given model type. Hence the runtime can
- * generate endpoint resolvers from the in memory assembly model.
- *
- * @version $Rev$ $Date$
- */
-public interface EndpointResolverFactoryExtensionPoint {
-
-
- /**
- * Add an endpoint resolver factory.
- *
- * @param endpointResolverFactory The resolver factory
- */
- void addEndpointResolverFactory(EndpointResolverFactory endpointResolverFactory);
-
- /**
- * Remove a endpoint resolver factory.
- *
- * @param endpointResolverFactory The endpoint resolver factory
- */
- void removeEndpointResolverFactory(EndpointResolverFactory endpointResolverFactory);
-
- /**
- * Returns the endpoint resolver factory associated with the given binding type.
- * @param bindingType A binding type
- * @return The endpoint resolver factory associated with the given binding type
- */
- EndpointResolverFactory getEndpointResolverFactory(Class<?> bindingType);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/DataExchangeSemantics.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/DataExchangeSemantics.java
deleted file mode 100644
index 957a15ce8a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/DataExchangeSemantics.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.invocation;
-
-/**
- * An invoker or interceptor can optionally implement this interface to indicate if they can
- * enforce the pass-by-value semantics for an operation on remotable interfaces.
- *
- * @version $Rev$ $Date$
- */
-public interface DataExchangeSemantics {
- /**
- * Indicate if the data can be passed in by reference as they won't be mutated.
- * @return true if pass-by-reference is allowed
- */
- boolean allowsPassByReference();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java
deleted file mode 100644
index a5f221fc11..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.invocation;
-
-/**
- * Synchronous mediation associated with a client- or target- side wire.
- *
- * @version $Rev$ $Date$
- */
-public interface Interceptor extends Invoker {
-
- /**
- * Sets the next invoker
- * @param next The next invoker
- */
- void setNext(Invoker next);
-
- /**
- * Returns the next invoker or null
- * @return The next Invoker
- */
- Invoker getNext();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java
deleted file mode 100644
index 75719bb0cc..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.invocation;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * A wire consists of 1..n invocation chains associated with the operations of its source service contract.
- * <p/>
- * Invocation chains may contain <code>Interceptors</code> that process invocations.
- * <p/>
- * A <code>Message</code> is used to pass data associated with an invocation through the chain.
- *
- * @version $Rev$ $Date$
- */
-public interface InvocationChain {
- /**
- * Returns the target operation for this invocation chain.
- *
- * @return The target operation for this invocation chain
- */
- Operation getTargetOperation();
-
- /**
- * Updates the target operation for this invocation chain.
- *
- * @param operation The new target operation for this invocation chain
- */
- void setTargetOperation(Operation operation);
-
- /**
- * Returns the source operation for this invocation chain.
- *
- * @return The source operation for this invocation chain
- */
- Operation getSourceOperation();
-
- /**
- * Adds an interceptor to the chain. For reference side, it will be added to
- * Phase.REFERENCE. For service side, it will be added to Phase.SERVICE
- *
- * @param interceptor The interceptor to add
- */
- void addInterceptor(Interceptor interceptor);
-
- /**
- * Adds an invoker to the chain
- *
- * @param invoker The invoker to add
- */
- void addInvoker(Invoker invoker);
-
- /**
- * Returns the first invoker in the chain.
- *
- * @return The first invoker in the chain
- */
- Invoker getHeadInvoker();
-
- /**
- * @deprecated This method is not used
- * Returns the last invoker in the chain.
- *
- * @return The last invoker in the chain
- */
- @Deprecated
- Invoker getTailInvoker();
-
- /**
- * @deprecated Please use <code>void addInterceptor(String phase, Interceptor interceptor);</code>
- * Adds an interceptor at the given position in the interceptor stack
- *
- * @param index The position in the interceptor stack to add the interceptor
- * @param interceptor The interceptor to add
- */
- @Deprecated
- void addInterceptor(int index, Interceptor interceptor);
-
- /**
- * Add an interceptor to the given phase
- * @param phase
- * @param interceptor
- */
- void addInterceptor(String phase, Interceptor interceptor);
-
- /**
- * Indicate if the data can be passed in by reference as they won't be mutated.
- * @return true if pass-by-reference is allowed
- */
- boolean allowsPassByReference();
- /**
- * Force the invocation to allow pass-by-reference
- * @param allowsPBR
- */
- void setAllowsPassByReference(boolean allowsPBR);
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java
deleted file mode 100644
index 2748bbed9a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.invocation;
-
-/**
- * Synchronous mediation associated with a client- or target- side wire.
- *
- * @version $Rev$ $Date$
- */
-public interface Invoker {
-
- /**
- * Process a synchronous wire
- *
- * @param msg The request Message for the wire
- * @return The response Message from the wire
- */
- Message invoke(Message msg);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java
deleted file mode 100644
index 938a834c21..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-
-/**
- * Represents a request, response, or exception flowing through a wire
- *
- * @version $Rev $Date$
- */
-public interface Message {
-
- /**
- * Returns the body of the message, which will be the payload or parameters associated with the wire
- * @return The body of the message
- */
- <T> T getBody();
-
- /**
- * Sets the body of the message.
- * @param body The body of the message
- */
- <T> void setBody(T body);
-
- /**
- * Get the end point reference of the source reference
- * @return The end point reference of the reference originating the message
- */
- EndpointReference getFrom();
-
- /**
- * Set the end point reference of the reference originating the message
- * @param from The end point reference of the reference originating the message
- */
- void setFrom(EndpointReference from);
-
- /**
- * Get the end point reference of target service
- * @return The end point reference of the service that the message targets
- */
- EndpointReference getTo();
-
- /**
- * Set the end point reference of target service
- * @param to The end point reference of the service that the message targets
- */
- void setTo(EndpointReference to);
-
- /**
- * Returns the id of the message
- * @return The message Id
- */
- Object getMessageID();
-
- /**
- * Sets the id of the message
- * @param messageId The message ID
- */
- void setMessageID(Object messageId);
-
- /**
- * Determines if the message represents a fault/exception
- *
- * @return true If the message body is a fault object, false if the body is a normal payload
- */
- boolean isFault();
-
- /**
- * Set the message body with a fault object. After this method is called, isFault() returns true.
- *
- * @param fault The fault object represents an exception
- */
- <T> void setFaultBody(T fault);
-
- /**
- * Returns the operation that created the message.
- *
- * @return The operation that created the message
- */
- Operation getOperation();
-
- /**
- * Sets the operation that created the message.
- *
- * @param op The operation that created the message
- */
- void setOperation(Operation op);
-
- /**
- * Returns a list of objects that are contained in the message header
- *
- * @return
- */
- List<Object> getHeaders();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java
deleted file mode 100644
index 38c900e36a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.invocation;
-
-
-/**
- * A factory for messages
- *
- * @version $Rev $Date$
- */
-public interface MessageFactory {
-
- /**
- * Creates a new message.
- *
- * @return The new message
- */
- Message createMessage();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java
deleted file mode 100644
index af8ad6e582..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Phase.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.invocation;
-
-/**
- * Tuscany built-in phases for the invocation chain
- *
- * @version $Rev$ $Date$
- */
-public interface Phase {
- // The first phase for outgoing invocations via a reference
- String REFERENCE = "component.reference";
-
- // data transformation and validation
- String REFERENCE_INTERFACE = "reference.interface";
-
- // reference policy handling
- String REFERENCE_POLICY = "reference.policy";
-
- // reference binding invoker
- String REFERENCE_BINDING = "reference.binding";
-
- String REFERENCE_BINDING_WIREFORMAT = "reference.binding.wireformat";
- String REFERENCE_BINDING_POLICY = "reference.binding.policy";
- String REFERENCE_BINDING_TRANSPORT = "reference.binding.transport";
-
- String SERVICE_BINDING_TRANSPORT = "service.binding.transport";
- String SERVICE_BINDING_OPERATION_SELECTOR = "service.binding.operationselector";
- String SERVICE_BINDING_WIREFORMAT = "service.binding.wireformat";
- String SERVICE_BINDING_POLICY = "service.binding.policy";
-
-
- // The first phase for incoming invocations via a service
- String SERVICE_BINDING = "service.binding";
-
- // service policy handling
- String SERVICE_POLICY = "service.policy";
-
- // data validation and transformation
- String SERVICE_INTERFACE = "service.interface";
-
- // TODO: not sure if we need to have this face
- String SERVICE = "component.service";
-
- // implementation policy handling
- String IMPLEMENTATION_POLICY = "implementation.policy";
-
- // implementation invoker
- String IMPLEMENTATION = "component.implementation";
-
- // String getName();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java
deleted file mode 100644
index 3887db4873..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.management;
-
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * Interface for the management service abstraction. The implementation
- * could be based on a variety of technologies including JMX, WSDM,
- * SNMP etc.
- *
- * @version $Revision$ $Date$
- */
-public interface ManagementService {
-
- /**
- * Registers a component for management.
- *
- * @param name Name of the component.
- * @param component Component to be registered.
- */
- void registerComponent(String name, RuntimeComponent component);
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java
deleted file mode 100644
index 0f6a932c51..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * A factory for creating the runtime artifacts that represent bindings.
- *
- * @version $Rev$ $Date$
- */
-public interface BindingProviderFactory<M extends Binding> extends ProviderFactory<M> {
-
- /**
- * Creates a new reference binding provider for the given component and
- * reference.
- *
- * @param component The runtime component
- * @param reference The reference on the runtime component
- * @param binding The binding assembly model object
- * @return The binding provider
- */
- ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- M binding);
-
- /**
- * Creates a new service binding provider for the given component and
- * service.
- *
- * @param component The runtime component
- * @param service The service on the runtime component
- * @param binding The binding assembly model object
- * @return The binding provider
- */
- ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- M binding);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java
deleted file mode 100644
index 47757bee24..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * Concrete Implementation for the SCADefinitionsProviderExtensionPoint
- *
- * @version $Rev$ $Date$
- */
-public class DefaultDefinitionsProviderExtensionPoint implements
- DefinitionsProviderExtensionPoint {
-
- private ExtensionPointRegistry extensionPointRegistry = null;
-
- private List<DefinitionsProvider> scaDefnsProviders = new ArrayList<DefinitionsProvider>();
-
- public DefaultDefinitionsProviderExtensionPoint(ExtensionPointRegistry extnPtReg) {
- this.extensionPointRegistry = extnPtReg;
- }
-
- public void addDefinitionsProvider(DefinitionsProvider provider) {
- scaDefnsProviders.add(provider);
- }
-
- public void removeDefinitionsProvider(DefinitionsProvider provider) {
- scaDefnsProviders.remove(provider);
- }
-
- public List<DefinitionsProvider> getDefinitionsProviders() {
- if (scaDefnsProviders.isEmpty()) {
- loadProviders();
- }
- return scaDefnsProviders;
- }
-
- private void loadProviders() {
- // Get the provider service declarations
- Set<ServiceDeclaration> defnProviderDecls;
- DefinitionsProvider aProvider = null;
- Class<?> providerClass = null;
- Constructor<?> constructor = null;
-
- try {
- defnProviderDecls =
- ServiceDiscovery.getInstance().getServiceDeclarations(DefinitionsProvider.class.getName());
-
- for (ServiceDeclaration aDefnProviderDecl : defnProviderDecls) {
- providerClass = aDefnProviderDecl.loadClass();
-
- try {
- constructor = providerClass.getConstructor();
- aProvider = (DefinitionsProvider)constructor.newInstance();
- } catch (NoSuchMethodException e1) {
- constructor = providerClass.getConstructor(ExtensionPointRegistry.class);
- aProvider = (DefinitionsProvider)constructor.newInstance(extensionPointRegistry);
- }
-
- scaDefnsProviders.add(aProvider);
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java
deleted file mode 100644
index 5e17737d58..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Default implementation of a provider factory extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultProviderFactoryExtensionPoint implements ProviderFactoryExtensionPoint {
-
- private ExtensionPointRegistry registry;
- private final Map<Class<?>, ProviderFactory> providerFactories = new HashMap<Class<?>, ProviderFactory>();
- private final List<PolicyProviderFactory> policyProviderFactories = new ArrayList<PolicyProviderFactory>();
- private boolean loaded;
-
- /**
- * The default constructor. Does nothing.
- *
- */
- public DefaultProviderFactoryExtensionPoint(ExtensionPointRegistry registry) {
- this.registry = registry;
- }
-
- /**
- * Add a provider factory.
- *
- * @param providerFactory The provider factory
- */
- public void addProviderFactory(ProviderFactory providerFactory) {
- if(providerFactory instanceof PolicyProviderFactory) {
- policyProviderFactories.add((PolicyProviderFactory)providerFactory);
- }
- providerFactories.put(providerFactory.getModelType(), providerFactory);
- }
-
- /**
- * Remove a provider factory.
- *
- * @param providerFactory The provider factory
- */
- public void removeProviderFactory(ProviderFactory providerFactory) {
- if(providerFactory instanceof PolicyProviderFactory) {
- policyProviderFactories.remove((PolicyProviderFactory)providerFactory);
- }
- providerFactories.remove(providerFactory.getModelType());
- }
-
- /**
- * Returns the provider factory associated with the given model type.
- * @param modelType A model type
- * @return The provider factory associated with the given model type
- */
- public ProviderFactory getProviderFactory(Class<?> modelType) {
- loadProviderFactories();
-
- Class<?>[] classes = modelType.getInterfaces();
- for (Class<?> c : classes) {
- ProviderFactory factory = providerFactories.get(c);
- if (factory != null) {
- return factory;
- }
- }
- return providerFactories.get(modelType);
- }
-
- public List<PolicyProviderFactory> getPolicyProviderFactories() {
- loadProviderFactories();
- return policyProviderFactories;
- }
-
- /**
- * Load provider factories declared under META-INF/services.
- * @param registry
- */
- private void loadProviderFactories() {
- if (loaded)
- return;
-
- loadProviderFactories(BindingProviderFactory.class);
- loadProviderFactories(ImplementationProviderFactory.class);
- loadProviderFactories(PolicyProviderFactory.class);
- loadProviderFactories(WireFormatProviderFactory.class);
- loadProviderFactories(OperationSelectorProviderFactory.class);
-
- loaded = true;
- }
-
- /**
- * Load provider factories declared under META-INF/services.
- * @param registry
- * @param factoryClass
- * @return
- */
- private List<ProviderFactory> loadProviderFactories(Class<?> factoryClass) {
-
- // Get the provider factory service declarations
- Set<ServiceDeclaration> factoryDeclarations;
- ServiceDiscovery serviceDiscovery = ServiceDiscovery.getInstance();
- try {
- factoryDeclarations = serviceDiscovery.getServiceDeclarations(factoryClass.getName());
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
-
- // Get the target extension point
- ProviderFactoryExtensionPoint factoryExtensionPoint =
- registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
- List<ProviderFactory> factories = new ArrayList<ProviderFactory>();
-
- for (ServiceDeclaration factoryDeclaration : factoryDeclarations) {
- Map<String, String> attributes = factoryDeclaration.getAttributes();
-
- // Load an implementation provider factory
- if (factoryClass == ImplementationProviderFactory.class) {
- String modelTypeName = attributes.get("model");
-
- // Create a provider factory wrapper and register it
- ImplementationProviderFactory factory =
- new LazyImplementationProviderFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addProviderFactory(factory);
- factories.add(factory);
-
- } else if (factoryClass == BindingProviderFactory.class) {
-
- // Load a binding provider factory
- String modelTypeName = attributes.get("model");
-
- // Create a provider factory wrapper and register it
- BindingProviderFactory factory =
- new LazyBindingProviderFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addProviderFactory(factory);
- factories.add(factory);
- } else if (factoryClass == PolicyProviderFactory.class) {
- // Load a policy provider factory
- String modelTypeName = attributes.get("model");
-
- // Create a provider factory wrapper and register it
- PolicyProviderFactory factory =
- new LazyPolicyProviderFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addProviderFactory(factory);
- factories.add(factory);
- } else if (factoryClass == WireFormatProviderFactory.class) {
-
- // Load a wire format provider factory
- String modelTypeName = attributes.get("model");
-
- // Create a provider factory wrapper and register it
- WireFormatProviderFactory factory =
- new LazyWireFormatProviderFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addProviderFactory(factory);
- factories.add(factory);
- } else if (factoryClass == OperationSelectorProviderFactory.class) {
-
- // Load a wire format provider factory
- String modelTypeName = attributes.get("model");
-
- // Create a provider factory wrapper and register it
- OperationSelectorProviderFactory factory =
- new LazyOperationSelectorProviderFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addProviderFactory(factory);
- factories.add(factory);
- }
- }
- return factories;
- }
-
- /**
- * A wrapper around an implementation provider factory allowing lazy
- * loading and initialization of implementation providers.
- */
- private static class LazyBindingProviderFactory implements BindingProviderFactory {
-
- private ExtensionPointRegistry registry;
- private String modelTypeName;
- private ServiceDeclaration factoryDeclaration;
- private BindingProviderFactory factory;
- private Class<?> modelType;
-
- private LazyBindingProviderFactory(ExtensionPointRegistry registry,
- String modelTypeName,
- ServiceDeclaration factoryDeclaration) {
- this.registry = registry;
- this.modelTypeName = modelTypeName;
- this.factoryDeclaration = factoryDeclaration;
- }
-
- @SuppressWarnings("unchecked")
- private BindingProviderFactory getFactory() {
- if (factory == null) {
- try {
- Class<BindingProviderFactory> factoryClass =
- (Class<BindingProviderFactory>)factoryDeclaration.loadClass();
- Constructor<BindingProviderFactory> constructor =
- factoryClass.getConstructor(ExtensionPointRegistry.class);
- factory = constructor.newInstance(registry);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return factory;
- }
-
- @SuppressWarnings("unchecked")
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- return getFactory().createReferenceBindingProvider(component, reference, binding);
- }
-
- @SuppressWarnings("unchecked")
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding) {
- return getFactory().createServiceBindingProvider(component, service, binding);
- }
-
- public Class<?> getModelType() {
- if (modelType == null) {
- try {
- modelType = factoryDeclaration.loadClass(modelTypeName);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return modelType;
- }
-
- }
-
- /**
- * A wrapper around an implementation provider factory allowing lazy
- * loading and initialization of implementation providers.
- */
- private class LazyImplementationProviderFactory implements ImplementationProviderFactory {
-
- private ExtensionPointRegistry registry;
- private String modelTypeName;
- private ServiceDeclaration providerClass;
- private ImplementationProviderFactory factory;
- private Class<?> modelType;
-
- private LazyImplementationProviderFactory(ExtensionPointRegistry registry,
- String modelTypeName,
- ServiceDeclaration providerClass) {
- this.registry = registry;
- this.modelTypeName = modelTypeName;
- this.providerClass = providerClass;
- }
-
- @SuppressWarnings("unchecked")
- private ImplementationProviderFactory getFactory() {
- if (factory == null) {
- try {
- Class<ImplementationProviderFactory> factoryClass =
- (Class<ImplementationProviderFactory>)providerClass.loadClass();
- Constructor<ImplementationProviderFactory> constructor =
- factoryClass.getConstructor(ExtensionPointRegistry.class);
- factory = constructor.newInstance(registry);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return factory;
- }
-
- @SuppressWarnings("unchecked")
- public ImplementationProvider createImplementationProvider(RuntimeComponent component,
- Implementation Implementation) {
- return getFactory().createImplementationProvider(component, Implementation);
- }
-
- public Class<?> getModelType() {
- if (modelType == null) {
- try {
-
- modelType = providerClass.loadClass(modelTypeName);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return modelType;
- }
-
- }
-
- /**
- * A wrapper around an policy provider factory allowing lazy
- * loading and initialization of policy providers.
- */
- private class LazyPolicyProviderFactory implements PolicyProviderFactory {
- private ExtensionPointRegistry registry;
- private String modelTypeName;
- private ServiceDeclaration providerClass;
- private PolicyProviderFactory factory;
- private Class<?> modelType;
-
- private LazyPolicyProviderFactory(ExtensionPointRegistry registry,
- String modelTypeName,
- ServiceDeclaration providerClass) {
- this.registry = registry;
- this.modelTypeName = modelTypeName;
- this.providerClass = providerClass;
- }
-
- @SuppressWarnings("unchecked")
- private PolicyProviderFactory getFactory() {
- if (factory == null) {
- try {
- Class<PolicyProviderFactory> factoryClass = (Class<PolicyProviderFactory>)providerClass.loadClass();
- Constructor<PolicyProviderFactory> constructor =
- factoryClass.getConstructor(ExtensionPointRegistry.class);
- factory = constructor.newInstance(registry);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return factory;
- }
-
- public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component,
- Implementation implementation) {
- return getFactory().createImplementationPolicyProvider(component, implementation);
- }
-
- public PolicyProvider createReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- return getFactory().createReferencePolicyProvider(component, reference, binding);
- }
-
- public PolicyProvider createServicePolicyProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding) {
- return getFactory().createServicePolicyProvider(component, service, binding);
- }
-
- public Class<?> getModelType() {
- if (modelType == null) {
- try {
- modelType = providerClass.loadClass(modelTypeName);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return modelType;
- }
- }
-
- /**
- * A wrapper around a wire format provider factory allowing lazy
- * loading and initialization of wire format providers.
- */
- private class LazyWireFormatProviderFactory implements WireFormatProviderFactory {
-
- private ExtensionPointRegistry registry;
- private String modelTypeName;
- private ServiceDeclaration providerClass;
- private WireFormatProviderFactory factory;
- private Class<?> modelType;
-
- private LazyWireFormatProviderFactory(ExtensionPointRegistry registry,
- String modelTypeName,
- ServiceDeclaration providerClass) {
- this.registry = registry;
- this.modelTypeName = modelTypeName;
- this.providerClass = providerClass;
- }
-
- @SuppressWarnings("unchecked")
- private WireFormatProviderFactory getFactory() {
- if (factory == null) {
- try {
- Class<WireFormatProviderFactory> factoryClass =
- (Class<WireFormatProviderFactory>)providerClass.loadClass();
- Constructor<WireFormatProviderFactory> constructor =
- factoryClass.getConstructor(ExtensionPointRegistry.class);
- factory = constructor.newInstance(registry);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return factory;
- }
-
- public WireFormatProvider createReferenceWireFormatProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding){
- return getFactory().createReferenceWireFormatProvider(component, reference, binding);
- }
-
- public WireFormatProvider createServiceWireFormatProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding){
- return getFactory().createServiceWireFormatProvider(component, service, binding);
- }
-
- public Class<?> getModelType() {
- if (modelType == null) {
- try {
-
- modelType = providerClass.loadClass(modelTypeName);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return modelType;
- }
- }
-
- /**
- * A wrapper around a operation selector provider factory allowing lazy
- * loading and initialization of operation selector providers.
- */
- private class LazyOperationSelectorProviderFactory implements OperationSelectorProviderFactory {
-
- private ExtensionPointRegistry registry;
- private String modelTypeName;
- private ServiceDeclaration providerClass;
- private OperationSelectorProviderFactory factory;
- private Class<?> modelType;
-
- private LazyOperationSelectorProviderFactory(ExtensionPointRegistry registry,
- String modelTypeName,
- ServiceDeclaration providerClass) {
- this.registry = registry;
- this.modelTypeName = modelTypeName;
- this.providerClass = providerClass;
- }
-
- @SuppressWarnings("unchecked")
- private OperationSelectorProviderFactory getFactory() {
- if (factory == null) {
- try {
- Class<OperationSelectorProviderFactory> factoryClass =
- (Class<OperationSelectorProviderFactory>)providerClass.loadClass();
- Constructor<OperationSelectorProviderFactory> constructor =
- factoryClass.getConstructor(ExtensionPointRegistry.class);
- factory = constructor.newInstance(registry);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return factory;
- }
-
- public OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding){
- return getFactory().createReferenceOperationSelectorProvider(component, reference, binding);
- }
-
- public OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding){
- return getFactory().createServiceOperationSelectorProvider(component, service, binding);
- }
-
- public Class<?> getModelType() {
- if (modelType == null) {
- try {
-
- modelType = providerClass.loadClass(modelTypeName);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return modelType;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProvider.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProvider.java
deleted file mode 100644
index 7871aea07c..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProvider.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.definitions.Definitions;
-
-/**
- * Models a provider of SCA Definitions. Typically SCA Definitions providers
- * may either load a definitions.xml file or create the SCA Definitions model
- * programmatically.
- *
- * @version $Rev$ $Date$
- */
-public interface DefinitionsProvider {
- Definitions getDefinitions() throws DefinitionsProviderException ;
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderException.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderException.java
deleted file mode 100644
index 11464125ad..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DefinitionsProviderException extends Exception {
-
- public DefinitionsProviderException(Throwable e) {
- super(e);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderExtensionPoint.java
deleted file mode 100644
index 61cfbe8536..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderExtensionPoint.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import java.util.List;
-
-/**
- * An extension point for SCA Definitions Providers. SCA Definition providers, load SCA Definitions
- * items that are being specifically contributed by the module that hosts the provider in question.
- *
- * @version $Rev$ $Date$
- */
-public interface DefinitionsProviderExtensionPoint {
-
- void addDefinitionsProvider(DefinitionsProvider provider);
- void removeDefinitionsProvider(DefinitionsProvider provider);
- List<DefinitionsProvider> getDefinitionsProviders();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java
deleted file mode 100644
index 015c673d66..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * A component implementation can implement this interface in order to tie
- * into the Tuscany runtime
- *
- * @version $Rev$ $Date$
- */
-public interface ImplementationProvider {
-
- /**
- * This method will be invoked when the component implementation
- * is activated.
- */
- void start();
-
- /**
- * This method will be invoked when the component implementation
- * is deactivated.
- */
- void stop();
-
- /**
- * Create an invoker for the component implementation in the invocation
- * chain. The invoker will be responsible for calling the implementation
- * logic for the given component.
- *
- * @param service The component service
- * @param operation The operation that the interceptor will handle
- * @return An invoker that handles the invocation logic, null should be
- * returned if no invoker is required
- */
- Invoker createInvoker(RuntimeComponentService service, Operation operation);
-
- /**
- * For bindings that invoke one-way callback operations asynchronously,
- * there is no need to perform a thread switch before calling the invoker.
- * This method indicates whether the binding has this capability.
- *
- * @return true if the callback invoker is able to invoke one-way operations
- * asynchronously, false if all invocations are synchronous
- */
- boolean supportsOneWayInvocation();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java
deleted file mode 100644
index 6a37d1e951..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * An interface for factories that create implementation providers.
- *
- * @version $Rev$ $Date$
- */
-public interface ImplementationProviderFactory<M extends Implementation> extends ProviderFactory<M> {
-
- /**
- * Creates a new implementation provider for the given
- * component.
- *
- * @param component The runtime component
- * @param Implementation The implementation type
- * @return The implementation provider
- */
- ImplementationProvider createImplementationProvider(RuntimeComponent component, M Implementation);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java
deleted file mode 100644
index f385c7dfba..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.invocation.Interceptor;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface OperationSelectorProvider {
- /**
- * Create an interceptor for the operation selector
- * @return An interceptor that realize the policySet
- */
- Interceptor createInterceptor();
-
- /**
- * Get the phase that the interceptor should be added
- * @return The phase that this interceptor belongs to
- */
- String getPhase();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java
deleted file mode 100644
index 183b38cb33..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.OperationSelector;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface OperationSelectorProviderFactory<M extends OperationSelector> extends ProviderFactory<M> {
- /**
- * Create wire format provider for a given reference binding
- * @param component
- * @param reference
- * @param binding
- * @return
- */
- OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding);
-
- /**
- * Create policy provider for a given service binding
- * @param component
- * @param service
- * @param binding
- * @return
- */
- OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding);
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java
deleted file mode 100644
index f2b59a7c54..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-/**
- * This interface can be optionally implemented by the Binding or Implementation providers to
- * indicate if they implement the policies in the binding/implementation provider.
- *
- * @version $Rev$ $Date$
- */
-public interface PolicyImplementor {
- /**
- * Get a list of policy names that are implemented by this policy implementor
- * @return A list of policy names
- */
- List<QName> getImplementedPolicies();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java
deleted file mode 100644
index 644283dea1..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface PolicyProvider {
- /**
- * Create an interceptor for a given operation
- * @param operation
- * @return An interceptor that realize the policySet
- */
- Interceptor createInterceptor(Operation operation);
-
- /**
- * Get the phase that the interceptor should be added
- * @return The phase that this interceptor belongs to
- */
- String getPhase();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java
deleted file mode 100644
index b60a14d2da..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.policy.Policy;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface PolicyProviderFactory<M extends Policy> extends ProviderFactory<M> {
- /**
- * Create policy provider for a given reference binding
- * @param component
- * @param reference
- * @param binding
- * @return
- */
- PolicyProvider createReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding);
-
- /**
- * Create policy provider for a given service binding
- * @param component
- * @param service
- * @param binding
- * @return
- */
- PolicyProvider createServicePolicyProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding);
-
- /**
- * Create policy provider for a given component implementation
- * @param component
- * @param implementation
- * @return
- */
- PolicyProvider createImplementationPolicyProvider(RuntimeComponent component, Implementation implementation);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java
deleted file mode 100644
index 23a48c8e36..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.invocation.Interceptor;
-
-/**
- * TODO RRB experiment
- * This is an experiment extension to try out the request response
- * binding function
- * @version $Rev$ $Date$
- */
-public interface PolicyProviderRRB extends PolicyProvider {
- /**
- * Create a binding interceptor
- * @return An interceptor that realize the policySet
- */
- Interceptor createBindingInterceptor();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java
deleted file mode 100644
index 2102806881..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-/**
- * A factory for runtime providers.
- *
- * @version $Rev$ $Date$
- */
-public interface ProviderFactory<M> {
-
- /**
- * The model type that this factory creates providers for.
- *
- * @return the model type
- */
- Class<M> getModelType();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java
deleted file mode 100644
index d8f9973338..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import java.util.List;
-
-
-/**
- * An extension point for provider factories. Holds all of the provider
- * factories from loaded extension points. Allows a provider factory
- * to be located based on a given model type. Hence the runtime can
- * generate runtime artifacts from the in memory assembly model.
- *
- * @version $Rev$ $Date$
- */
-public interface ProviderFactoryExtensionPoint {
-
-
- /**
- * Add a provider factory.
- *
- * @param providerFactory The provider factory
- */
- void addProviderFactory(ProviderFactory providerFactory);
-
- /**
- * Remove a provider factory.
- *
- * @param providerFactory The provider factory
- */
- void removeProviderFactory(ProviderFactory providerFactory);
-
- /**
- * Returns the provider factory associated with the given model type.
- * @param modelType A model type
- * @return The provider factory associated with the given model type
- */
- ProviderFactory getProviderFactory(Class<?> modelType);
-
- /**
- * Get a list of registered PolicyProviderFactory
- * @return a list of registered PolicyProviderFactory
- */
- List<PolicyProviderFactory> getPolicyProviderFactories();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java
deleted file mode 100644
index b3ab1d8b87..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-
-/**
- * A reference binding implementation can options implement this
- * interface to tie into the Tuscany SCA runtime
- *
- * @version $Rev$ $Date$
- */
-public interface ReferenceBindingProvider {
-
- /**
- * This method will be invoked when the component reference binding is
- * activated.
- */
- void start();
-
- /**
- * This method will be invoked when the component reference binding is
- * deactivated.
- */
- void stop();
-
- /**
- * Create an invoker for the reference binding in the invocation chain. The
- * invoker is responsible for making the outbound invocation over the
- * binding protocol.
- *
- * @param operation The operation that the interceptor will handle
- * @return An invoker that handles the invocation logic, null should be
- * returned if no invoker is required
- */
- Invoker createInvoker(Operation operation);
-
- /**
- * Get the effective interface contract imposed by the binding. For example,
- * it will be interface contract introspected from the WSDL portType used by
- * the endpoint for a WebService binding.
- *
- * @return The effective interface contract, if null is returned, the
- * interface contract for the component reference will be used
- */
- InterfaceContract getBindingInterfaceContract();
-
- /**
- * For bindings that invoke one-way operations asynchronously, there is no
- * need to perform a thread switch before calling the invoker. This method
- * indicates whether the binding has this capability.
- *
- * @return true if the binding invoker is able to invoke one-way operations
- * asynchronously, false if all invocations are synchronous
- */
- boolean supportsOneWayInvocation();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java
deleted file mode 100644
index 3ea9d0ac3c..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * TODO RRB experiment
- * This is an experiment extension to try out the request response
- * binding function
- *
- * @version $Rev$ $Date$
- */
-public interface ReferenceBindingProviderRRB extends ReferenceBindingProvider {
-
- void configureBindingChain(RuntimeWire runtimeWire);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java
deleted file mode 100644
index e15234a549..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-
-/**
- * A service binding can optionally implement this interface to tie
- * into the Tuscany SCA runtime
- *
- * @version $Rev$ $Date$
- */
-public interface ServiceBindingProvider {
- /**
- * This method will be invoked when the component service binding is
- * activated.
- */
- void start();
-
- /**
- * This method will be invoked when the component service binding is
- * deactivated.
- */
- void stop();
-
- /**
- * Get the effective interface contract imposed by the binding. For example,
- * it will be interface contract introspected from the WSDL portType used by
- * the endpoint for a WebService binding.
- *
- * @return The effective interface contract, if null is returned, the
- * interface contract for the component service will be used
- */
- InterfaceContract getBindingInterfaceContract();
-
- /**
- * For bindings that invoke one-way callback operations asynchronously,
- * there is no need to perform a thread switch before calling the invoker.
- * This method indicates whether the binding has this capability.
- *
- * @return true if the callback invoker is able to invoke one-way operations
- * asynchronously, false if all invocations are synchronous
- */
- boolean supportsOneWayInvocation();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java
deleted file mode 100644
index 278bb23e0a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * TODO RRB experiment
- * This is an experiment extension to try out the request response
- * binding function
- *
- * @version $Rev$ $Date$
- */
-public interface ServiceBindingProviderRRB extends ServiceBindingProvider {
-
- void configureBindingChain(RuntimeWire runtimeWire);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java
deleted file mode 100644
index a7bca9afba..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.invocation.Interceptor;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface WireFormatProvider {
-
- /*
- * Return the contract that describes the interface that
- * is providing data to or accepting data from the
- * wire format interceptor. The wire formats job
- * is to translate between this interface contract and the
- * format on the wire
- * @return the wire format interface contract
- */
- InterfaceContract getWireFormatInterfaceContract();
-
- /**
- * Create an interceptor for the wire format
- * @return An interceptor that realize the policySet
- */
- Interceptor createInterceptor();
-
- /**
- * Get the phase that the interceptor should be added
- * @return The phase that this interceptor belongs to
- */
- String getPhase();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java
deleted file mode 100644
index fd748df6ca..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.WireFormat;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface WireFormatProviderFactory<M extends WireFormat> extends ProviderFactory<M> {
- /**
- * Create wire format provider for a given reference binding
- * @param component
- * @param reference
- * @param binding
- * @return
- */
- WireFormatProvider createReferenceWireFormatProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding);
-
- /**
- * Create policy provider for a given service binding
- * @param component
- * @param service
- * @param binding
- * @return
- */
- WireFormatProvider createServiceWireFormatProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding);
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java
deleted file mode 100644
index 851afee3c1..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.runtime;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * The default implementation of a <code>WireProcessorExtensionPoint</code>
- *
- * @version $Rev$ $Date$
- */
-public class DefaultWireProcessorExtensionPoint implements RuntimeWireProcessorExtensionPoint {
-
- /**
- * The list of WireProcessors available to the runtime
- */
- private final List<RuntimeWireProcessor> processors = new ArrayList<RuntimeWireProcessor>();
-
- /**
- * Registers a wire-processor in the runtime
- *
- * @param processor The processor to register
- */
- public void addWireProcessor(RuntimeWireProcessor processor) {
- processors.add(processor);
- }
-
- /**
- * De-registers a wire-processor in the runtime
- *
- * @param processor The processor to de-register
- */
- public void removeWireProcessor(RuntimeWireProcessor processor) {
- processors.remove(processor);
- }
-
- /**
- * Returns a list of registered wire-processors.
- *
- * @return The list of wire processors
- */
- public List<RuntimeWireProcessor> getWireProcessors() {
- return processors;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReference.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReference.java
deleted file mode 100644
index b6fafa5fb6..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReference.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.runtime;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-
-/**
- * The endpoint reference for a component service or reference
- *
- * @version $Rev$ $Date$
- */
-public interface EndpointReference extends Cloneable {
- /**
- * Get the component for the endpoint
- * @return The component, null of the EPR is for a non-SCA service
- */
- RuntimeComponent getComponent();
-
- /**
- * Get the component service or reference for the endpoint
- * @return The component service or reference, null if the EPR is for a non-SCA service
- */
- Contract getContract();
-
- /**
- * Get the binding for the endpoint
- * @return The binding
- */
- Binding getBinding();
-
- /**
- * Get the interface contract for the endpoint
- * @return The interface contract
- */
- InterfaceContract getInterfaceContract();
-
- /**
- * Update the interface contract for the endpoint
- * @param interfaceContract The updated interface contract
- */
- void setInterfaceContract(InterfaceContract interfaceContract);
-
- /**
- * Get the URI for this endpoint
- * @return The URI of the endpoint
- */
- String getURI();
-
- /**
- * Set the URI for this endpoint
- * @param uri The new URI of the endpoint
- */
- void setURI(String uri);
-
- /**
- * Get the callback endpoint for this endpoint
- * @return The callback endpoint for this endpoint
- */
- EndpointReference getCallbackEndpoint();
-
- /**
- * Set the callback endpoint for this endpoint
- * @param callbackEndpoint The new callback endpoint for this endpoint
- */
- void setCallbackEndpoint(EndpointReference callbackEndpoint);
-
- Object clone() throws CloneNotSupportedException;
-
- void setReferenceParameters(ReferenceParameters parameters);
- ReferenceParameters getReferenceParameters();
-
- void mergeEndpoint(EndpointReference epr);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java
deleted file mode 100644
index 0e19538aff..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ReferenceParameters.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.runtime;
-
-/**
- * Parameters for the EndPointReference
- *
- * @version $Rev$ $Date$
- */
-public interface ReferenceParameters extends Cloneable {
- /**
- * Get the callback ID
- * @return the callbackID
- */
- Object getCallbackID();
-
- /**
- * Set the callback ID
- * @param callbackID the callbackID to set
- */
- void setCallbackID(Object callbackID);
-
- /**
- * Get the conversation ID
- * @return the conversationID
- */
- Object getConversationID();
-
- /**
- * Set the conversation ID
- * @param conversationID the conversationID to set
- */
- void setConversationID(Object conversationID);
-
- /**
- * Get the ID for the non-ServiceReference callback object
- * @return
- */
- Object getCallbackObjectID();
-
- /**
- * Set the ID for the non-ServiceReference callback object
- * @param callbackObjectID
- */
- void setCallbackObjectID(Object callbackObjectID);
-
- EndpointReference getCallbackReference();
-
- void setCallbackReference(EndpointReference callback);
-
- Object clone() throws CloneNotSupportedException;
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java
deleted file mode 100644
index 30bba78a40..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.runtime;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-
-/**
- * The runtime component interface. Provides the bridge between the
- * assembly model representation of a component and its runtime
- * realization.
- *
- * @version $Rev$ $Date$
- */
-public interface RuntimeComponent extends Component {
- /**
- * Set the implementation-specific configuration for this component
- * @param implementationProvider The object that manages the component implementation
- */
- void setImplementationProvider(ImplementationProvider implementationProvider);
-
- /**
- * Get the implementation-specific configuration for this component
- * @return The implementation provider for this component
- */
- ImplementationProvider getImplementationProvider();
-
- /**
- * Get the associated component context
- * @return
- */
- RuntimeComponentContext getComponentContext();
-
- /**
- * Set the associated component context
- * @param context
- */
- void setComponentContext(RuntimeComponentContext context);
-
- /**
- * Tests if the RuntimeComponent is started
- * @return true if the RuntimeComponent is started otherwise false
- */
- boolean isStarted();
-
- /**
- * Sets the RuntimeComponent started state
- * @param started the state to set
- */
- void setStarted(boolean started);
-
- /**
- * Add a policy provider to the component
- * @param policyProvider
- */
- void addPolicyProvider(PolicyProvider policyProvider);
-
- /**
- * Get a list of policy providers configured for this component
- * @return
- */
- List<PolicyProvider> getPolicyProviders();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java
deleted file mode 100644
index e63bdf89c7..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentContext.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.runtime;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface RuntimeComponentContext extends ComponentContext {
- /**
- * Activate the reference (creating runtime wires)
- * @param reference
- */
- void start(RuntimeComponentReference reference);
-
- /**
- * Deserialize the component reference
- * @param reader
- * @return A component that contains the reference
- * @throws IOException
- */
- RuntimeComponent read(Reader reader) throws IOException;
-
- /**
- * Serialize the component reference
- * @param reference
- * @param writer
- * @throws IOException
- */
- void write(RuntimeComponentReference reference, Writer writer) throws IOException;
-
- /**
- * Get the CallableReference for a given component reference
- * @param <B>
- * @param businessInterface The business interface
- * @param reference The reference to be wired
- * @param binding The binding to be used, if it's null, either binding.sca or the 1st binding
- * will be selected
- * @return A service reference representing the wire
- */
- <B> ServiceReference<B> getServiceReference(Class<B> businessInterface,
- RuntimeComponentReference reference,
- Binding binding);
-
- /**
- * Bind the reference to a target component/componentService
- * @param <B>
- * @param businessInterface The business interface
- * @param reference The reference to be wired
- * @param component The target component
- * @param service The target component service
- * @return A service reference representing the wire
- */
- <B> ServiceReference<B> getServiceReference(Class<B> businessInterface,
- RuntimeComponentReference reference,
- RuntimeComponent component,
- RuntimeComponentService service);
-
- /**
- * Create a CallableReference for the given component service
- * @param <B>
- * @param businessInterface
- * @param component
- * @param service
- * @return
- */
- <B> CallableReference<B> getCallableReference(Class<B> businessInterface,
- RuntimeComponent component,
- RuntimeComponentService service);
-
- /**
- * @param <B>
- * @param businessInterface
- * @param service
- * @return
- */
- <B> ServiceReference<B> createSelfReference(Class<B> businessInterface, ComponentService service);
-
- ExtensionPointRegistry getExtensionPointRegistry();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java
deleted file mode 100644
index 44ae7f552a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.runtime;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolver;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-
-/**
- * The runtime component reference. Provides the bridge between the
- * assembly model representation of a component reference and its runtime
- * realization
- *
- * @version $Rev$ $Date$
- */
-public interface RuntimeComponentReference extends ComponentReference {
-
- /**
- * Get a list of runtime wires to the reference
- *
- * @return The list of wires
- */
- List<RuntimeWire> getRuntimeWires();
-
- /**
- * Get the runtime wire for the given binding
- * @param binding The assembly model binding
- * @return The runtime wire
- */
- RuntimeWire getRuntimeWire(Binding binding);
-
- /**
- * Returns the reference binding provider associated with this
- * component reference and the given binding.
- *
- * @param binding The assembly model binding
- * @return The runtime reference binding provider
- */
- ReferenceBindingProvider getBindingProvider(Binding binding);
-
- /**
- * Sets the reference binding provider associated with this
- * component reference and the given binding.
- *
- * @param binding The assembly model binding
- * @param bindingProvider The runtime reference binding provider
- */
- void setBindingProvider(Binding binding, ReferenceBindingProvider bindingProvider);
-
- /**
- * Returns the endpoint resolver associated with this
- * component reference and the given endpoint.
- *
- * @param endpont The assembly model endpoint
- * @return The enpoint resolver
- */
- EndpointResolver getEndpointResolver(Endpoint endpoint);
-
- /**
- * Sets the endpoint resolver associated with this
- * component reference and the given endpoint.
- *
- * @param binding The assembly model binding
- * @param bindingProvider The runtime reference binding provider
- */
- void setEndpointResolver(Endpoint endpoint, EndpointResolver endpointResolver);
-
- /**
- * Add a policy provider for the given binding to the reference
- * @param binding The assembly model binding
- * @param policyProvider The policy handler
- */
- void addPolicyProvider(Binding binding, PolicyProvider policyProvider);
-
- /**
- * Get a list of policy providers for the given binding
- * @param binding The assembly model binding
- * @return A list of policy providers for the given binding
- */
- List<PolicyProvider> getPolicyProviders(Binding binding);
-
- /**
- * Get the invoker for the given binding and operation
- * @param binding The assembly model binding
- * @param operation The assembly model operation
- * @return The runtime Invoker
- */
- Invoker getInvoker(Binding binding, Operation operation);
-
- /**
- * Set the owning component
- * @param component
- */
- void setComponent(RuntimeComponent component);
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java
deleted file mode 100644
index 982724d798..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.runtime;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-
-/**
- * The runtime component service. Provides the bridge between the
- * assembly model representation of a component service and its runtime
- * realization
- *
- * @version $Rev$ $Date$
- */
-public interface RuntimeComponentService extends ComponentService {
-
- /**
- * Get a list of runtime wires to the service
- *
- * @return The list of wires
- */
- List<RuntimeWire> getRuntimeWires();
- /**
- * Get the runtime wire for the given binding
- * @param binding The assembly model binding
- * @return The runtime wire
- */
- RuntimeWire getRuntimeWire(Binding binding);
-
- /**
- * Get the callback wires associated with this service
- *
- * @return The list of runtime callback wires
- */
- List<RuntimeWire> getCallbackWires();
-
- /**
- * Returns the service binding provider associated with this
- * component service and the given binding.
- *
- * @param binding The assembly model binding
- * @return The runtime service binding provider
- */
- ServiceBindingProvider getBindingProvider(Binding binding);
-
- /**
- * Returns the service binding provider associated with this
- * component service and the given binding.
- *
- * @param binding
- * @param interfaceContract
- * @return
- */
- RuntimeWire getRuntimeWire(Binding binding, InterfaceContract interfaceContract);
-
- /**
- * Sets the service binding provider associated with this
- * component service and the given binding.
- *
- * @param binding The assembly model binding
- * @param bindingProvider The runtime service binding provider
- */
- void setBindingProvider(Binding binding, ServiceBindingProvider bindingProvider);
-
- /**
- * Get the invoker for the given binding and operation
- * @param binding The assembly model binding
- * @param operation The assembly model operation
- * @return The runtime invoker
- */
- Invoker getInvoker(Binding binding, Operation operation);
-
- /**
- * Get the invoker for the given binding and operation
- * @param binding The assembly model binding
- * @param interfaceContract the client interface contract
- * @param operation The assembly model operation
- * @return The runtime invoker
- */
- Invoker getInvoker(Binding binding, InterfaceContract interfaceContract, Operation operation);
-
- /**
- * Get the invocation chain for the given binding and operation
- * @param binding The assembly model binding
- * @param operation The assembly model operation
- * @return The runtime invocation chain
- */
- InvocationChain getInvocationChain(Binding binding, Operation operation);
-
- /**
- * Get the invocation chain for the given binding and operation
- * @param binding The assembly model binding
- * @param operation The assembly model operation
- * @param interfaceContract the client interface contract
- * @return The runtime invocation chain
- */
- InvocationChain getInvocationChain(Binding binding, InterfaceContract interfaceContract, Operation operation);
-
- /**
- * Add a policy provider for the given binding to the service
- * @param binding The assembly model binding
- * @param policyProvider The policy handler
- */
- void addPolicyProvider(Binding binding, PolicyProvider policyProvider);
-
- /**
- * Get a list of policy providers for the given binding
- * @param binding The assembly model binding
- * @return A list of policy providers for the given binding
- */
- List<PolicyProvider> getPolicyProviders(Binding binding);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java
deleted file mode 100644
index a2e7152202..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.runtime;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Message;
-
-/**
- * The runtime wire interface that connects a component reference to a
- * component service (or an external service) over the selected binding
- *
- * @version $Rev$ $Date$
- */
-public interface RuntimeWire extends Cloneable {
-
- /**
- * Get the source of the wire
- *
- * @return The end point reference of the source
- */
- EndpointReference getSource();
-
- /**
- * Get the target of the wire
- *
- * @return The end point reference of the target
- */
- EndpointReference getTarget();
-
- /**
- * Rebind the runtime wire with the given target
- * @param target The target endpoint reference
- */
- void setTarget(EndpointReference target);
-
- /**
- * Force the invocation chains to be rebuilt
- */
- void rebuild();
-
- /**
- * Returns the invocation chains for service operations associated with the
- * wire
- *
- * @return the invocation chains for service operations associated with the
- * wire
- */
- List<InvocationChain> getInvocationChains();
-
- /**
- * Lookup the invocation chain by operation
- * @param operation The operation
- * @return The invocation chain for the given operation
- */
- InvocationChain getInvocationChain(Operation operation);
-
- /**
- * Get the invocation chain for the binding-specific handling
- * @return
- */
- InvocationChain getBindingInvocationChain();
-
- /**
- * This invoke method assumes that the binding invocation chain is in force
- * and that there will be an operation selector element there to
- * determine which operation to call
- * @param msg The message
- * @return The result
- * @throws InvocationTargetException
- */
- Object invoke(Message msg) throws InvocationTargetException;
-
- /**
- * Invoke an operation with given arguments
- * @param operation The operation
- * @param args The arguments
- * @return The result
- * @throws InvocationTargetException
- */
- Object invoke(Operation operation, Object[] args) throws InvocationTargetException;
-
- /**
- * Invoke an operation with a context message
- * @param operation The operation
- * @param msg The message
- * @return The result
- * @throws InvocationTargetException
- */
- Object invoke(Operation operation, Message msg) throws InvocationTargetException;
-
- /**
- * @return a clone of the runtime wire
- * @throws CloneNotSupportedException
- */
- Object clone() throws CloneNotSupportedException;
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java
deleted file mode 100644
index fbb7aae467..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.runtime;
-
-/**
- * Implementations are called after wires are decorated with policy and before they are connected.
- *
- * @version $Rev$ $Date$
- */
-public interface RuntimeWireProcessor {
-
- /**
- * Process the runtime wire to add interceptors
- *
- * @param wire
- */
- void process(RuntimeWire wire);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java
deleted file mode 100644
index 4b2c71b397..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.runtime;
-
-import java.util.List;
-
-/**
- * Acts as a delegating <code>WireProcessorExtensionPoint</code>, delegating
- * processing of wires after policies have been applied and source and targets
- * have been connected.
- *
- * @version $Rev$ $Date$
- */
-public interface RuntimeWireProcessorExtensionPoint {
-
- /**
- * Registers a wire-processor in the runtime
- *
- * @param processor The processor to register
- */
- void addWireProcessor(RuntimeWireProcessor processor);
-
- /**
- * De-registers a wire-processor in the runtime
- *
- * @param processor The processor to de-register
- */
- void removeWireProcessor(RuntimeWireProcessor processor);
-
- /**
- * Returns a list of registered wire-processors.
- *
- * @return The list of wire processors
- */
- List<RuntimeWireProcessor> getWireProcessors();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java
deleted file mode 100644
index d32af450ff..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.work;
-
-/**
- * A callback interface that can be optionally used for registering
- * interest in status of asynchronously scheduled unit of work.
- *
- * @version $Rev$ $Date$
- */
-public interface NotificationListener<T extends Runnable> {
-
- /**
- * Callback method when the unit of work is accepted.
- *
- * @param work Work that was accepted.
- */
- void workAccepted(T work);
-
- /**
- * Callback method when the unit of work is successfully completed.
- *
- * @param work Work that was successfully completed.
- */
- void workCompleted(T work);
-
- /**
- * Callback when the unit of work is started.
- *
- * @param work Unit of work that was started.
- */
- void workStarted(T work);
-
- /**
- * Callback when the unit of work is rejected.
- *
- * @param work Unit of work that was rejected.
- */
- void workRejected(T work);
-
- /**
- * Callback when the unit of work fails to complete.
- *
- * @param work Unit of work that failed to complete.
- * @param error Error that caused the unit of work to fail.
- */
- void workFailed(T work, Throwable error);
-
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java
deleted file mode 100644
index b1beac78e2..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.work;
-
-/**
- * Defines the contract for scheduling asynchronous units of work.
- *
- * <p>
- * Units of work can be scheduled with an optional <code>NotificationListener</code>.
- * If a notification listener is specified, the caller will be notified regarding the
- * status of the work. The unit of work can either be completed, rejected or completed
- * with an error. If the work completed with an error, the caller is notified with the
- * error details.
- * </p>
- *
- * @version $Rev$ $Date$
- */
-public interface WorkScheduler {
-
- /**
- * Schedules a unit of work for future execution. The notification listener
- * is used to register interest in callbacks regarding the status of the work.
- *
- * @param work The unit of work that needs to be asynchronously executed.
- * @param listener Notification listener for callbacks.
- */
- <T extends Runnable>void scheduleWork(T work, NotificationListener<T> listener);
-
- /**
- * Schedules a unit of work for future execution. The notification listener
- * is used to register interest in callbacks regarding the status of the work.
- *
- * @param work The unit of work that needs to be asynchronously executed.
- */
- <T extends Runnable>void scheduleWork(T work);
-
- /**
- * Destroys the work scheduler
- */
- void destroy();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java b/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java
deleted file mode 100644
index 18ec2dfeaa..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.work;
-
-
-/**
- * Exception thrown by the work scheduler in case of unexpected exceptions.
- *
- * @version $Rev$ $Date$
- *
- * @version $Rev$ $Date$
- */
-public class WorkSchedulerException extends RuntimeException {
- private static final long serialVersionUID = 1L;
-
- /**
- * {@inheritDoc}
- */
- public WorkSchedulerException() {
- super();
- }
-
- /**
- * {@inheritDoc}
- */
- public WorkSchedulerException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * {@inheritDoc}
- */
- public WorkSchedulerException(String message) {
- super(message);
- }
-
- /**
- * {@inheritDoc}
- */
- public WorkSchedulerException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ContextFactoryExtensionPoint b/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ContextFactoryExtensionPoint
deleted file mode 100644
index ddd91bceac..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ContextFactoryExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.context.DefaultContextFactoryExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactoryExtensionPoint b/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactoryExtensionPoint
deleted file mode 100644
index 91839e998f..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactoryExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.endpointresolver.DefaultEndpointResolverFactoryExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProviderExtensionPoint b/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProviderExtensionPoint
deleted file mode 100644
index b7501e854e..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProviderExtensionPoint
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.provider.DefaultDefinitionsProviderExtensionPoint
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint b/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint
deleted file mode 100644
index e9de1f135f..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.provider.DefaultProviderFactoryExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint b/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint
deleted file mode 100644
index 95591dca5d..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.runtime.DefaultWireProcessorExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java b/tags/java/sca/2.0-M1/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java
deleted file mode 100644
index 3a27569a3b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.context;
-
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * This test case will test the class
- * org.apache.tuscany.sca.context.DefaultContextFactoryExtensionPoint
- *
- * $Date$ $Rev$
- */
-public class DefaultContextFactoryExtensionPointTestCase {
-
- /**
- * Tests adding/getting/removing a factory with no interfaces
- */
- @Test
- public void testFactoryWithNoInterfaces() {
- Object factory = new FactoryWithNoInterfaces();
- Class<?>[] ifaces = {};
- addGetRemoveFactory(factory, ifaces);
- }
-
- /**
- * Tests adding/getting/removing a factory with one interface
- */
- @Test
- public void testFactoryWithOneInterface() {
- Object factory = new FactoryWithOneInterface();
- Class<?>[] ifaces = { FactoryOneInterface.class };
- addGetRemoveFactory(factory, ifaces);
- }
-
- /**
- * Tests adding/getting/removing a factory with two interfaces
- */
- @Test
- public void testFactoryWithTwoInterfaces() {
- Object factory = new FactoryWithTwoInterfaces();
- Class<?>[] ifaces = { FactoryTwoInterfacesA.class, FactoryTwoInterfacesB.class };
- addGetRemoveFactory(factory, ifaces);
- }
-
- /**
- * Tests having multiple factories registered
- */
- @Test
- public void testMultipleFactories() {
- // Create new factories
- FactoryWithOneInterface factory1 = new FactoryWithOneInterface();
- FactoryWithTwoInterfaces factory2 = new FactoryWithTwoInterfaces();
-
- ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
-
- // Register the factories
- DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry);
- ctxFactory.addFactory(factory1);
- ctxFactory.addFactory(factory2);
-
- // Re-get each of the factories
- FactoryOneInterface regotFactory1 = ctxFactory.getFactory(FactoryOneInterface.class);
- Assert.assertNotNull(regotFactory1);
- Assert.assertSame(factory1, regotFactory1);
- FactoryTwoInterfacesA regotFactory2A = ctxFactory.getFactory(FactoryTwoInterfacesA.class);
- Assert.assertNotNull(regotFactory2A);
- Assert.assertSame(factory2, regotFactory2A);
- FactoryTwoInterfacesB regotFactory2B = ctxFactory.getFactory(FactoryTwoInterfacesB.class);
- Assert.assertNotNull(regotFactory1);
- Assert.assertSame(factory2, regotFactory2B);
- }
-
- /**
- * Tests passing in null to addFactory()
- */
- @Test
- public void testAddingNullFactory() {
-
- ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
- DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry);
- try {
- ctxFactory.addFactory(null);
- Assert.fail("Should have thrown IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // As expected
- }
- }
-
- /**
- * Test passing in null to removeFactory()
- */
- @Test
- public void testRemovingNullFactory() {
- ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
- DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry);
- try {
- ctxFactory.removeFactory(null);
- Assert.fail("Should have thrown IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // As expected
- }
- }
-
- /**
- * Test passing in null to getFactory()
- */
- @Test
- public void testGetNullFactory() {
- ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
- DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry);
- try {
- ctxFactory.getFactory(null);
- Assert.fail("Should have thrown IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- // As expected
- }
- }
-
- /**
- * Utility method for testing adding and removing a factory
- *
- * @param factory The factory class to test
- * @param factoryInterfaces The list of interfaces implemented by the factory
- */
- private void addGetRemoveFactory(Object factory, Class<?>[] factoryInterfaces) {
- ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
- DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry);
-
- // Make sure factory not already present
- for (Class<?> iface : factoryInterfaces) {
- Assert.assertNull(ctxFactory.getFactory(iface));
- }
-
- // Add the factory
- ctxFactory.addFactory(factory);
-
- // Make sure we can get the factory recently registered factory
- for (Class<?> iface : factoryInterfaces) {
- Object regot = ctxFactory.getFactory(iface);
- Assert.assertNotNull(regot);
- Assert.assertSame(factory, regot);
- }
-
- // Remove the factory
- ctxFactory.removeFactory(factory);
-
- // Make sure factory is no longer registered
- for (Class<?> iface : factoryInterfaces) {
- Assert.assertNull(ctxFactory.getFactory(iface));
- }
- }
-
- /**
- * Simple factory with no interfaces
- */
- private class FactoryWithNoInterfaces {
- }
-
- /**
- * Simple interface for the factory with one interface
- */
- private interface FactoryOneInterface {
- }
-
- /**
- * Simple factory with one interface
- */
- private class FactoryWithOneInterface implements FactoryOneInterface {
- }
-
- /**
- * Simple interface for the factory with two interfaces
- */
- private interface FactoryTwoInterfacesA {
- }
-
- /**
- * Simple interface for the factory with two interfaces
- */
- private interface FactoryTwoInterfacesB {
- }
-
- /**
- * Simple factory with two interfaces
- */
- private class FactoryWithTwoInterfaces implements FactoryTwoInterfacesA, FactoryTwoInterfacesB {
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/LICENSE b/tags/java/sca/2.0-M1/modules/core/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/core/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/core/META-INF/MANIFEST.MF
deleted file mode 100644
index c191526ffe..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,83 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.core.assembly;version="2.0.0";
- uses:="org.apache.tuscany.sca.runtime,
- org.apache.tuscany.sca.assembly,
- org.apache.tuscany.sca.core.context,
- org.apache.tuscany.sca.core.invocation,
- org.apache.tuscany.sca.core.conversation,
- org.apache.tuscany.sca.interfacedef.java",
- org.apache.tuscany.sca.core.context;version="2.0.0";
- uses:="org.apache.tuscany.sca.runtime,
- org.apache.tuscany.sca.assembly,
- org.apache.tuscany.sca.context,
- org.apache.tuscany.sca.core,
- org.apache.tuscany.sca.core.conversation,
- org.apache.tuscany.sca.interfacedef.java,
- org.apache.tuscany.sca.interfacedef,
- javax.xml.stream,
- org.apache.tuscany.sca.core.assembly,
- org.oasisopen.sca,
- org.apache.tuscany.sca.core.invocation",
- org.apache.tuscany.sca.core.conversation;version="2.0.0";uses:="org.apache.tuscany.sca.runtime,org.oasisopen.sca",
- org.apache.tuscany.sca.core.factory;version="2.0.0",
- org.apache.tuscany.sca.core.invocation;version="2.0.0";
- uses:="org.apache.tuscany.sca.runtime,
- org.apache.tuscany.sca.assembly,
- org.apache.tuscany.sca.core,
- org.apache.tuscany.sca.core.conversation,
- org.apache.tuscany.sca.interfacedef,
- org.apache.tuscany.sca.invocation,
- org.apache.tuscany.sca.core.invocation.impl,
- org.apache.tuscany.sca.work,
- org.apache.tuscany.sca.core.factory,
- org.oasisopen.sca",
- org.apache.tuscany.sca.core.scope;version="2.0.0";
- uses:="org.apache.tuscany.sca.runtime,
- org.apache.tuscany.sca.provider,
- org.apache.tuscany.sca.core.scope.impl,
- org.apache.tuscany.sca.core.factory"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Core Runtime
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397162265
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Core Runtime
-Import-Package: javax.naming,
- javax.security.auth,
- javax.xml.namespace,
- javax.xml.stream,
- net.sf.cglib.proxy,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.builder;version="2.0.0",
- org.apache.tuscany.sca.assembly.impl;version="2.0.0",
- org.apache.tuscany.sca.context;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.core.assembly;version="2.0.0",
- org.apache.tuscany.sca.core.context;version="2.0.0",
- org.apache.tuscany.sca.core.conversation;version="2.0.0",
- org.apache.tuscany.sca.core.factory;version="2.0.0",
- org.apache.tuscany.sca.core.invocation;version="2.0.0",
- org.apache.tuscany.sca.core.scope;version="2.0.0",
- org.apache.tuscany.sca.core.wire;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.endpointresolver;version="2.0.0",
- org.apache.tuscany.sca.extensibility;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.apache.tuscany.sca.work;version="2.0.0",
- org.oasisopen.sca;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.core
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/core/NOTICE b/tags/java/sca/2.0-M1/modules/core/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/core/pom.xml b/tags/java/sca/2.0-M1/modules/core/pom.xml
deleted file mode 100644
index 278d187d86..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/pom.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-core</artifactId>
- <name>Apache Tuscany SCA Core Runtime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-java</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- <version>1.0.1</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>
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- <version>2.2</version>
- </dependency>
-
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- <version>3.1</version>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/ActivationException.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/ActivationException.java
deleted file mode 100644
index c86c876075..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/ActivationException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.assembly;
-
-
-/**
- * Denotes an error starting the runtime
- *
- * @version $Rev$ $Date$
- */
-public class ActivationException extends Exception {
- private static final long serialVersionUID = 8612661660934426123L;
-
- public ActivationException(String message) {
- super(message);
- }
-
- public ActivationException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivator.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivator.java
deleted file mode 100644
index 939afa40a8..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivator.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.core.context.CompositeContext;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Start/stop a composite
- *
- * @version $Rev$ $Date$
- */
-public interface CompositeActivator {
- /**
- * Activate a composite
- * @param composite
- */
- void activate(Composite composite) throws ActivationException;
-
- /**
- * Activate a component reference
- * @param component
- * @param ref
- */
- void start(RuntimeComponent component, RuntimeComponentReference ref);
-
- /**
- * Activate a component reference
- * @param component
- * @param ref
- */
- void activate(RuntimeComponent component, RuntimeComponentReference ref);
-
- /**
- * Activate a component reference
- * @param component
- * @param ref
- */
- void activate(RuntimeComponent component, RuntimeComponentService service);
-
- /**
- * De-activate a component reference
- * @param component
- * @param ref
- */
- void deactivate(RuntimeComponent component, RuntimeComponentReference ref);
-
- /**
- * De-activate a component reference
- * @param component
- * @param ref
- */
- void deactivate(RuntimeComponent component, RuntimeComponentService service);
-
- /**
- * Stop a composite
- * @param composite
- */
- void deactivate(Composite composite) throws ActivationException;
-
- /**
- * Start a component
- * @param component
- */
- void start(Component component) throws ActivationException;
-
- /**
- * Stop a component
- * @param component
- */
- void stop(Component component) throws ActivationException;
-
- /**
- * Start components in a composite
- * @param composite
- */
- void start(Composite composite) throws ActivationException;
-
- /**
- * Stop components in a composite
- * @param composite
- */
- void stop(Composite composite) throws ActivationException;
-
- /**
- * Get the component context helper
- * @return
- */
- CompositeContext getCompositeContext();
-
- /**
- * Configure the runtime component with component context
- * @param component
- */
- void configureComponentContext(RuntimeComponent component);
-
- /**
- * Resolve a component by URI in the domain
- * @param componentURI
- * @return
- */
- Component resolve(String componentURI);
-
- /**
- * Set the domain composite
- * @param domainComposite
- */
- void setDomainComposite(Composite domainComposite);
-
- /**
- * Get the domain composite
- * @return
- */
- Composite getDomainComposite();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeAssemblyFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeAssemblyFactory.java
deleted file mode 100644
index 8d8c9d10e8..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeAssemblyFactory.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.assembly;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.core.assembly.impl.EndpointReferenceImpl;
-import org.apache.tuscany.sca.core.assembly.impl.ReferenceParametersImpl;
-import org.apache.tuscany.sca.core.assembly.impl.RuntimeComponentImpl;
-import org.apache.tuscany.sca.core.assembly.impl.RuntimeComponentReferenceImpl;
-import org.apache.tuscany.sca.core.assembly.impl.RuntimeComponentServiceImpl;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * The runtime version of assembly factory
- * @version $Rev$ $Date$
- */
-public class RuntimeAssemblyFactory extends DefaultAssemblyFactory implements AssemblyFactory {
-
- public RuntimeAssemblyFactory() {
- super();
- }
-
- @Override
- public Component createComponent() {
- return new RuntimeComponentImpl();
- }
-
- @Override
- public ComponentReference createComponentReference() {
- return new RuntimeComponentReferenceImpl();
- }
-
- @Override
- public ComponentService createComponentService() {
- return new RuntimeComponentServiceImpl();
- }
-
- // FIXME: [rfeng] We need to find a more consistent story to deal with EPR, EP and CallableReference
- public EndpointReference createEndpointReference(String uri) {
- return new EndpointReferenceImpl(uri);
- }
-
- public EndpointReference createEndpointReference(RuntimeComponent component,
- Contract contract,
- Binding binding,
- InterfaceContract interfaceContract) {
- return new EndpointReferenceImpl(component, contract, binding, interfaceContract);
- }
-
- public ReferenceParameters createReferenceParameters() {
- return new ReferenceParametersImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/CompositeActivatorImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/CompositeActivatorImpl.java
deleted file mode 100644
index 67edf3ab9d..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/CompositeActivatorImpl.java
+++ /dev/null
@@ -1,1072 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.context.ComponentContextFactory;
-import org.apache.tuscany.sca.context.ContextFactoryExtensionPoint;
-import org.apache.tuscany.sca.context.PropertyValueFactory;
-import org.apache.tuscany.sca.context.RequestContextFactory;
-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.core.assembly.ActivationException;
-import org.apache.tuscany.sca.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.core.context.CompositeContext;
-import org.apache.tuscany.sca.core.context.impl.CompositeContextImpl;
-import org.apache.tuscany.sca.core.conversation.ConversationManager;
-import org.apache.tuscany.sca.core.invocation.ExtensibleWireProcessor;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopeRegistry;
-import org.apache.tuscany.sca.core.scope.ScopedRuntimeComponent;
-import org.apache.tuscany.sca.core.scope.impl.ConversationalScopeContainer;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolver;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolverFactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.provider.PolicyProviderFactory;
-import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentContext;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.apache.tuscany.sca.runtime.RuntimeWireProcessor;
-import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint;
-import org.apache.tuscany.sca.work.WorkScheduler;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CompositeActivatorImpl implements CompositeActivator {
- private static final Logger logger = Logger.getLogger(CompositeActivatorImpl.class.getName());
-
- private final AssemblyFactory assemblyFactory;
- private final MessageFactory messageFactory;
- private final InterfaceContractMapper interfaceContractMapper;
- private final ScopeRegistry scopeRegistry;
- private final WorkScheduler workScheduler;
- private final RuntimeWireProcessor wireProcessor;
- private final ProviderFactoryExtensionPoint providerFactories;
- private final EndpointResolverFactoryExtensionPoint endpointResolverFactories;
-
- private final ComponentContextFactory componentContextFactory;
- private final RequestContextFactory requestContextFactory;
- private final ProxyFactory proxyFactory;
- private final JavaInterfaceFactory javaInterfaceFactory;
- private final PropertyValueFactory propertyValueFactory;
-
- private final ConversationManager conversationManager;
-
- private final CompositeContext compositeContext;
-
- private Composite domainComposite;
-
- public CompositeActivatorImpl(ExtensionPointRegistry extensionPoints) {
- this.compositeContext = new CompositeContextImpl(extensionPoints);
- FactoryExtensionPoint factories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
- this.messageFactory = factories.getFactory(MessageFactory.class);
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- this.interfaceContractMapper = utilities.getUtility(InterfaceContractMapper.class);
- this.scopeRegistry = utilities.getUtility(ScopeRegistry.class);
- this.workScheduler = utilities.getUtility(WorkScheduler.class);
- this.wireProcessor = new ExtensibleWireProcessor(extensionPoints.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class));
- this.providerFactories = extensionPoints.getExtensionPoint(ProviderFactoryExtensionPoint.class);
- this.endpointResolverFactories = extensionPoints.getExtensionPoint(EndpointResolverFactoryExtensionPoint.class);
- this.javaInterfaceFactory = compositeContext.getJavaInterfaceFactory();
- this.propertyValueFactory = factories.getFactory(PropertyValueFactory.class);
- ContextFactoryExtensionPoint contextFactories = extensionPoints.getExtensionPoint(ContextFactoryExtensionPoint.class);
- this.componentContextFactory = contextFactories.getFactory(ComponentContextFactory.class);
- this.requestContextFactory = contextFactories.getFactory(RequestContextFactory.class);
- proxyFactory = compositeContext.getProxyFactory();
- this.conversationManager = compositeContext.getConversationManager();
- }
-
- /**
- * @see org.apache.tuscany.sca.core.assembly.CompositeActivator#activate(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentReference)
- */
- public void activate(RuntimeComponent component, RuntimeComponentReference ref) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Activating component reference: " + component.getURI() + "#" + ref.getName());
- }
- resolveTargets(ref);
- for (Binding binding : ref.getBindings()) {
- addReferenceBindingProvider(component, ref, binding);
- }
-
- for (Endpoint endpoint : ref.getEndpoints()){
- // TODO - source component should be set in the builder but the
- // way the builder is written it's difficult to get at it
- endpoint.setSourceComponent(component);
-
- addEndpointResolver(component, ref, endpoint);
- }
- }
-
- public void start(RuntimeComponent component, RuntimeComponentReference ref) {
- synchronized (ref) {
- resolveTargets(ref);
- for (Binding binding : ref.getBindings()) {
- ReferenceBindingProvider provider = ref.getBindingProvider(binding);
- if (provider == null) {
- provider = addReferenceBindingProvider(component, ref, binding);
- }
- if (provider != null) {
- provider.start();
- }
- addReferenceWire(component, ref, binding);
- }
-
- // targets now have an endpoint representation. We can use this to
- // look for unresolved endpoints using dummy wires for late resolution
- for (Endpoint endpoint : ref.getEndpoints()){
- addReferenceEndpointWire(component, ref, endpoint);
- }
- }
- }
-
- public void stop(Component component, ComponentReference reference) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Stopping component reference: " + component.getURI() + "#" + reference.getName());
- }
- RuntimeComponentReference runtimeRef = ((RuntimeComponentReference)reference);
- for (Binding binding : reference.getBindings()) {
- ReferenceBindingProvider bindingProvider = runtimeRef.getBindingProvider(binding);
- if (bindingProvider != null) {
- bindingProvider.stop();
- }
- }
- }
-
- public void deactivate(RuntimeComponent component, RuntimeComponentReference ref) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Deactivating component reference: " + component.getURI() + "#" + ref.getName());
- }
- removeReferenceWires(ref);
- for (Binding binding : ref.getBindings()) {
- removeReferenceBindingProvider(component, ref, binding);
- }
-
- }
-
- /**
- * @param component
- * @param reference
- * @param binding
- */
- private EndpointResolver addEndpointResolver(RuntimeComponent component,
- RuntimeComponentReference reference,
- Endpoint endpoint){
-
- // only create endpoint resolvers for unresolved endpoints currently
- // this will also prevent a wire from being created later
- if (!endpoint.isUnresolved()){
- return null;
- }
-
- // This souldn't happen as the endpoint resolver extension point is in core-spi but
- // just in case returning null here will mean that no wire is created and calling
- // the reference will fail with NPE
- if (endpointResolverFactories == null){
- return null;
- }
-
- EndpointResolverFactory<Endpoint> resolverFactory =
- (EndpointResolverFactory<Endpoint>)endpointResolverFactories.getEndpointResolverFactory(endpoint.getClass());
-
- if (resolverFactory != null) {
- EndpointResolver endpointResolver =
- resolverFactory.createEndpointResolver(endpoint, null);
- if (endpointResolver != null) {
- ((RuntimeComponentReference)reference).setEndpointResolver(endpoint, endpointResolver);
- }
-
- return endpointResolver;
- } else {
- // TODO - for the time being allow the lack of an endpoint provider to be the
- // switch to turn off endpoint processing
- return null;
- //throw new IllegalStateException("Endpoint provider factory not found for class: " + endpoint.getClass().getName());
- }
- }
-
- public void addReferenceBindingProviderForEndpoint(Endpoint endpoint){
- addReferenceBindingProvider((RuntimeComponent)endpoint.getSourceComponent(),
- (RuntimeComponentReference)endpoint.getSourceComponentReference(),
- endpoint.getSourceBinding());
- }
-
- /**
- * @param component
- * @param reference
- * @param binding
- */
- private ReferenceBindingProvider addReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- BindingProviderFactory providerFactory =
- (BindingProviderFactory)providerFactories.getProviderFactory(binding.getClass());
- if (providerFactory != null) {
- @SuppressWarnings("unchecked")
- ReferenceBindingProvider bindingProvider =
- providerFactory.createReferenceBindingProvider((RuntimeComponent)component,
- (RuntimeComponentReference)reference,
- binding);
- if (bindingProvider != null) {
- ((RuntimeComponentReference)reference).setBindingProvider(binding, bindingProvider);
- }
- for (PolicyProviderFactory f : providerFactories.getPolicyProviderFactories()) {
- PolicyProvider policyProvider = f.createReferencePolicyProvider(component, reference, binding);
- if (policyProvider != null) {
- reference.addPolicyProvider(binding, policyProvider);
- }
- }
-
- return bindingProvider;
- } else {
- throw new IllegalStateException("Provider factory not found for class: " + binding.getClass().getName());
- }
- }
-
- /**
- * @param reference
- */
- private void resolveTargets(RuntimeComponentReference reference) {
- // The code that used to be here to resolved unresolved targets is now
- // at the bottom of BaseWireBuilder.connectComponentReferences()
- }
-
- /**
- * Create the runtime wires for a reference endpoint. Currently this method
- * only deals with the late binding case and creates a dummy wire that
- * will use the Endpoint to resolve the target at the point when the
- * wire chains are created.
- *
- * @param component
- * @param reference
- * @param binding
- */
- private void addReferenceEndpointWire(Component component, ComponentReference reference, Endpoint endpoint) {
- // only deal with unresolved endpoints as, to prevent breaking changes, targets that are resolved
- // at build time are still represented as bindings in the binding list
- if (((RuntimeComponentReference)reference).getEndpointResolver(endpoint) == null){
- // no endpoint provider has previously been created so don't create the
- // wire
- return;
- }
-
- // TODO: TUSCANY-2580: avoid NPE if the InterfaceCOntract is null
- Reference ctref = endpoint.getSourceComponentReference().getReference();
- if (ctref != null && ctref.getInterfaceContract() == null) {
- ctref.setInterfaceContract(reference.getInterfaceContract());
- }
-
- RuntimeWire wire = new EndpointWireImpl(endpoint, this);
-
- RuntimeComponentReference runtimeRef = (RuntimeComponentReference)reference;
- runtimeRef.getRuntimeWires().add(wire);
- }
-
-
- /**
- * Create the runtime wires for a reference binding
- *
- * @param component
- * @param reference
- * @param binding
- */
- private void addReferenceWire(Component component, ComponentReference reference, Binding binding) {
- if (!(reference instanceof RuntimeComponentReference)) {
- return;
- }
-
- // create wire if binding has an endpoint
- Component targetComponent = null;
- ComponentService targetComponentService = null;
- Binding targetBinding = null;
-
- if (binding instanceof OptimizableBinding) {
- OptimizableBinding endpoint = (OptimizableBinding)binding;
- targetComponent = endpoint.getTargetComponent();
- targetComponentService = endpoint.getTargetComponentService();
- targetBinding = endpoint.getTargetBinding();
- // FIXME: TUSCANY-2136, For unresolved binding, don't add wire. Is it the right solution?
- if (!reference.isCallback() && binding.getURI() == null && targetComponentService == null) {
- return;
- }
- }
-
- // create a forward wire, either static or dynamic
- addReferenceWire(component, reference, binding, targetComponent, targetComponentService, targetBinding);
-
- /*
- // if static forward wire (not from self-reference), try to create a static callback wire
- if (targetComponentService != null && !reference.getName().startsWith("$self$.")) {
- ComponentReference callbackReference = targetComponentService.getCallbackReference();
- if (callbackReference != null) {
- Binding callbackBinding = null;
- Binding callbackServiceBinding = null;
- // select a service callback binding that can be wired back to this component
- for (Binding refBinding : callbackReference.getBindings()) {
- // first look for a callback binding whose name matches the target binding name
- if (refBinding.getName().equals(targetBinding.getName())) {
- callbackBinding = refBinding;
- break;
- }
- }
- // see if there is a matching reference callback binding
- if (callbackBinding != null) {
- callbackServiceBinding = reference.getCallbackService().getBinding(callbackBinding.getClass());
- }
- // if there isn't an end-to-end match, try again based on target binding type
- if (callbackBinding == null || callbackServiceBinding == null) {
- callbackBinding = callbackReference.getBinding(targetBinding.getClass());
- if (callbackBinding != null) {
- callbackServiceBinding = reference.getCallbackService().getBinding(callbackBinding.getClass());
- }
- }
- if (callbackBinding != null && callbackServiceBinding != null) {
- // end-to-end match, so create a static callback wire as well as the static forward wire
-
- addReferenceWire(targetComponent, callbackReference, callbackBinding, component, reference
- .getCallbackService(), callbackServiceBinding);
- } else {
- // no end-to-end match, so do not create a static callback wire
- }
- }
- }
- */
- }
-
- public void addReferenceWireForEndpoint(Endpoint endpoint){
- addReferenceWire(endpoint.getSourceComponent(),
- endpoint.getSourceComponentReference(),
- endpoint.getSourceBinding(),
- endpoint.getTargetComponent(),
- endpoint.getTargetComponentService(),
- endpoint.getTargetBinding());
- }
- /**
- * Create a reference wire for a forward call or a callback
- * @param reference
- * @param service
- * @param serviceBinding
- * @param component
- * @param referenceBinding
- */
- private RuntimeWire addReferenceWire(Component refComponent,
- ComponentReference reference,
- Binding refBinding,
- Component serviceComponent,
- ComponentService service,
- Binding serviceBinding) {
- RuntimeComponentReference runtimeRef = (RuntimeComponentReference)reference;
- InterfaceContract bindingContract = getInterfaceContract(reference, refBinding);
-
- // Use the interface contract of the reference on the component type
- Reference componentTypeRef = reference.getReference();
-
- InterfaceContract sourceContract;
- if (componentTypeRef == null || componentTypeRef.getInterfaceContract() == null) {
- sourceContract = reference.getInterfaceContract();
- } else {
- sourceContract = componentTypeRef.getInterfaceContract();
- }
-
- sourceContract = sourceContract.makeUnidirectional(false);
-
- EndpointReference wireSource =
- new EndpointReferenceImpl((RuntimeComponent)refComponent, reference, refBinding, sourceContract);
- ComponentService callbackService = reference.getCallbackService();
- if (callbackService != null) {
- // select a reference callback binding to pass with invocations on this wire
- Binding callbackBinding = null;
- for (Binding binding : callbackService.getBindings()) {
- // first look for a callback binding whose name matches the reference binding name
- if (refBinding.getName().startsWith(binding.getName())) {
- callbackBinding = binding;
- break;
- }
- }
- // if no callback binding found, try again based on reference binding type
- if (callbackBinding == null) {
- callbackBinding = callbackService.getBinding(refBinding.getClass());
- }
- InterfaceContract callbackContract = callbackService.getInterfaceContract();
- EndpointReference callbackEndpoint =
- new EndpointReferenceImpl((RuntimeComponent)refComponent, callbackService, callbackBinding,
- callbackContract);
- wireSource.setCallbackEndpoint(callbackEndpoint);
- }
-
- EndpointReference wireTarget =
- new EndpointReferenceImpl((RuntimeComponent)serviceComponent, service, serviceBinding, bindingContract);
-
- // TUSCANY-2029 - We should use the URI of the serviceBinding because the target may be a Component in a
- // nested composite.
- if (serviceBinding != null) {
- wireTarget.setURI(serviceBinding.getURI());
- }
-
- RuntimeWire wire =
- new RuntimeWireImpl(wireSource, wireTarget, interfaceContractMapper, workScheduler, wireProcessor,
- messageFactory, conversationManager);
- runtimeRef.getRuntimeWires().add(wire);
-
- return wire;
- }
-
- private void addImplementationProvider(RuntimeComponent component, Implementation implementation) {
- ImplementationProviderFactory providerFactory =
- (ImplementationProviderFactory)providerFactories.getProviderFactory(implementation.getClass());
- if (providerFactory != null) {
- @SuppressWarnings("unchecked")
- ImplementationProvider implementationProvider =
- providerFactory.createImplementationProvider(component, implementation);
- if (implementationProvider != null) {
- component.setImplementationProvider(implementationProvider);
- }
- } else {
- throw new IllegalStateException("Provider factory not found for class: " + implementation.getClass()
- .getName());
- }
- for (PolicyProviderFactory f : providerFactories.getPolicyProviderFactories()) {
- PolicyProvider policyProvider = f.createImplementationPolicyProvider(component, implementation);
- if (policyProvider != null) {
- component.addPolicyProvider(policyProvider);
- }
- }
-
- }
-
- private void removeImplementationProvider(RuntimeComponent component) {
- component.setImplementationProvider(null);
- component.getPolicyProviders().clear();
- }
-
- /**
- * @param component
- * @param service
- * @param binding
- */
- private ServiceBindingProvider addServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding) {
- BindingProviderFactory providerFactory =
- (BindingProviderFactory)providerFactories.getProviderFactory(binding.getClass());
- if (providerFactory != null) {
- @SuppressWarnings("unchecked")
- ServiceBindingProvider bindingProvider =
- providerFactory.createServiceBindingProvider((RuntimeComponent)component,
- (RuntimeComponentService)service,
- binding);
- if (bindingProvider != null) {
- ((RuntimeComponentService)service).setBindingProvider(binding, bindingProvider);
- }
- for (PolicyProviderFactory f : providerFactories.getPolicyProviderFactories()) {
- PolicyProvider policyProvider = f.createServicePolicyProvider(component, service, binding);
- if (policyProvider != null) {
- service.addPolicyProvider(binding, policyProvider);
- }
- }
- return bindingProvider;
- } else {
- throw new IllegalStateException("Provider factory not found for class: " + binding.getClass().getName());
- }
- }
-
- private void removeServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding) {
- service.setBindingProvider(binding, null);
- for (Binding b : service.getBindings()) {
- List<PolicyProvider> pps = service.getPolicyProviders(b);
- if (pps != null) {
- pps.clear();
- }
- }
- }
-
- private void removeReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- reference.setBindingProvider(binding, null);
- for (Binding b : reference.getBindings()) {
- List<PolicyProvider> pps = reference.getPolicyProviders(b);
- if (pps != null) {
- pps.clear();
- }
- }
- }
-
- public void start(Composite composite) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Starting composite: " + composite.getName());
- }
- for (Component component : composite.getComponents()) {
- start(component);
- }
- }
-
- public void stop(Composite composite) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Stopping composite: " + composite.getName());
- }
- for (final Component component : composite.getComponents()) {
- stop(component);
- }
- }
-
- public void start(Component component) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Starting component: " + component.getURI());
- }
- RuntimeComponent runtimeComponent = ((RuntimeComponent)component);
- if(runtimeComponent.isStarted()) {
- return;
- }
-
- configureComponentContext(runtimeComponent);
-
- for (ComponentReference reference : component.getReferences()) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Starting component reference: " + component.getURI() + "#" + reference.getName());
- }
- RuntimeComponentReference runtimeRef = ((RuntimeComponentReference)reference);
- runtimeRef.setComponent(runtimeComponent);
-
- for (Endpoint endpoint : reference.getEndpoints()) {
- final EndpointResolver endpointResolver = runtimeRef.getEndpointResolver(endpoint);
- if (endpointResolver != null) {
- // Allow endpoint resolvers to do any startup reference manipulation
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- endpointResolver.start();
- return null;
- }
- });
- }
- }
-
- for (Binding binding : reference.getBindings()) {
- final ReferenceBindingProvider bindingProvider = runtimeRef.getBindingProvider(binding);
- if (bindingProvider != null) {
- // Allow bindings to add shutdown hooks. Requires RuntimePermission shutdownHooks in policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- bindingProvider.start();
- return null;
- }
- });
- }
- }
- }
-
- for (ComponentService service : component.getServices()) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Starting component service: " + component.getURI() + "#" + service.getName());
- }
- RuntimeComponentService runtimeService = (RuntimeComponentService)service;
- for (Binding binding : service.getBindings()) {
- final ServiceBindingProvider bindingProvider = runtimeService.getBindingProvider(binding);
- if (bindingProvider != null) {
- // bindingProvider.start();
- // Allow bindings to add shutdown hooks. Requires RuntimePermission shutdownHooks in policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- bindingProvider.start();
- return null;
- }
- });
- }
- }
- }
-
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- start((Composite)implementation);
- } else {
- ImplementationProvider implementationProvider = runtimeComponent.getImplementationProvider();
- if (implementationProvider != null) {
- implementationProvider.start();
- }
- }
-
- if (component instanceof ScopedRuntimeComponent) {
- ScopedRuntimeComponent scopedRuntimeComponent = (ScopedRuntimeComponent)component;
- if (scopedRuntimeComponent.getScopeContainer() != null) {
- scopedRuntimeComponent.getScopeContainer().start();
- }
- }
-
- runtimeComponent.setStarted(true);
- }
-
- /**
- * @param runtimeComponent
- */
- public void configureComponentContext(RuntimeComponent runtimeComponent) {
- RuntimeComponentContext componentContext = (RuntimeComponentContext) componentContextFactory.createComponentContext(runtimeComponent);
- runtimeComponent.setComponentContext(componentContext);
- }
-
- /**
- * Stop a component
- */
- public void stop(Component component) {
- if (!((RuntimeComponent)component).isStarted()) {
- return;
- }
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Stopping component: " + component.getURI());
- }
- for (ComponentService service : component.getServices()) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Stopping component service: " + component.getURI() + "#" + service.getName());
- }
- for (Binding binding : service.getBindings()) {
- final ServiceBindingProvider bindingProvider = ((RuntimeComponentService)service).getBindingProvider(binding);
- if (bindingProvider != null) {
- // Allow bindings to read properties. Requires PropertyPermission read in security policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- bindingProvider.stop();
- return null;
- }
- });
- }
- }
- }
- for (ComponentReference reference : component.getReferences()) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Starting component reference: " + component.getURI() + "#" + reference.getName());
- }
- RuntimeComponentReference runtimeRef = ((RuntimeComponentReference)reference);
-
- for (Binding binding : reference.getBindings()) {
- final ReferenceBindingProvider bindingProvider = runtimeRef.getBindingProvider(binding);
- if (bindingProvider != null) {
- // Allow bindings to read properties. Requires PropertyPermission read in security policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- bindingProvider.stop();
- return null;
- }
- });
- }
- }
-
- for (Endpoint endpoint : reference.getEndpoints()) {
- final EndpointResolver endpointResolver = runtimeRef.getEndpointResolver(endpoint);
- if (endpointResolver != null) {
- // Allow endpoint resolvers to do any shutdown reference manipulation
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- endpointResolver.stop();
- return null;
- }
- });
- }
- }
- }
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- stop((Composite)implementation);
- } else {
- final ImplementationProvider implementationProvider = ((RuntimeComponent)component).getImplementationProvider();
- if (implementationProvider != null) {
- // Allow bindings to read properties. Requires PropertyPermission read in security policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- implementationProvider.stop();
- return null;
- }
- });
- }
- }
-
- if (component instanceof ScopedRuntimeComponent) {
- ScopedRuntimeComponent runtimeComponent = (ScopedRuntimeComponent)component;
- if (runtimeComponent.getScopeContainer() != null &&
- runtimeComponent.getScopeContainer().getLifecycleState() != ScopeContainer.STOPPED) {
- runtimeComponent.getScopeContainer().stop();
- }
- }
-
- ((RuntimeComponent)component).setStarted(false);
- }
-
- /**
- * Get the effective interface contract for a reference binding
- *
- * @param reference
- * @param binding
- * @return
- */
- private InterfaceContract getInterfaceContract(ComponentReference reference, Binding binding) {
- InterfaceContract interfaceContract = reference.getInterfaceContract();
- ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
- if (provider != null) {
- InterfaceContract bindingContract = provider.getBindingInterfaceContract();
- if (bindingContract != null) {
- interfaceContract = bindingContract;
- }
- }
- return interfaceContract.makeUnidirectional(false);
- }
-
- /**
- * Remove the runtime wires for a reference binding
- * @param reference
- */
- private void removeReferenceWires(ComponentReference reference) {
- if (!(reference instanceof RuntimeComponentReference)) {
- return;
- }
- // [rfeng] Comment out the following statements to avoid the on-demand activation
- // RuntimeComponentReference runtimeRef = (RuntimeComponentReference)reference;
- // runtimeRef.getRuntimeWires().clear();
- }
-
- /**
- * Get the effective interface contract for the service binding
- *
- * @param service
- * @param binding
- * @return
- */
- private InterfaceContract getInterfaceContract(ComponentService service, Binding binding) {
- InterfaceContract interfaceContract = service.getInterfaceContract();
-
- ServiceBindingProvider provider = ((RuntimeComponentService)service).getBindingProvider(binding);
- if (provider != null) {
- InterfaceContract bindingContract = provider.getBindingInterfaceContract();
- if (bindingContract != null) {
- interfaceContract = bindingContract;
- }
- }
- return interfaceContract.makeUnidirectional(false);
- }
-
- /**
- * Remove runtime wires for a service binding
- *
- * @param component
- * @param service
- */
- private void removeServiceWires(ComponentService service) {
- if (!(service instanceof RuntimeComponentService)) {
- return;
- }
- RuntimeComponentService runtimeService = (RuntimeComponentService)service;
- runtimeService.getRuntimeWires().clear();
- }
-
- /**
- * Create a service wire for a forward call or a callback
- * @param service
- * @param serviceBinding
- * @param reference
- * @param component
- * @param referenceBinding
- */
- private RuntimeWire addServiceWire(Component serviceComponent, ComponentService service, Binding serviceBinding) {
- if (!(service instanceof RuntimeComponentService)) {
- return null;
- }
- RuntimeComponentService runtimeService = (RuntimeComponentService)service;
-
- // FIXME: [rfeng] We might need a better way to get the impl interface contract
- Service targetService = service.getService();
- if (targetService == null) {
- targetService = service;
- }
- InterfaceContract targetContract = targetService.getInterfaceContract().makeUnidirectional(false);
-
- InterfaceContract sourceContract = getInterfaceContract(service, serviceBinding);
-
- EndpointReference wireSource = new EndpointReferenceImpl(null, null, serviceBinding, sourceContract);
-
- EndpointReference wireTarget =
- new EndpointReferenceImpl((RuntimeComponent)serviceComponent, (RuntimeComponentService)service,
- serviceBinding, targetContract);
-
- RuntimeWire wire =
- new RuntimeWireImpl(wireSource, wireTarget, interfaceContractMapper, workScheduler, wireProcessor,
- messageFactory, conversationManager);
- runtimeService.getRuntimeWires().add(wire);
-
- return wire;
- }
-
- public void activate(RuntimeComponent component, RuntimeComponentService service) {
- if (service.getService() == null) {
- if (logger.isLoggable(Level.WARNING)) {
- logger.warning("Skipping component service not defined in the component type: " + component.getURI()
- + "#"
- + service.getName());
- }
- return;
- }
- if (service.getService() instanceof CompositeService) {
- return;
- }
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Activating component service: " + component.getURI() + "#" + service.getName());
- }
-
- for (Binding binding : service.getBindings()) {
- addServiceBindingProvider(component, service, binding);
- addServiceWire(component, service, binding);
- }
- }
-
- public void deactivate(RuntimeComponent component, RuntimeComponentService service) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Deactivating component service: " + component.getURI() + "#" + service.getName());
- }
- removeServiceWires(service);
- for (Binding binding : service.getBindings()) {
- removeServiceBindingProvider(component, service, binding);
- }
- }
-
- private void addScopeContainer(Component component) {
- if (!(component instanceof ScopedRuntimeComponent)) {
- return;
- }
- ScopedRuntimeComponent runtimeComponent = (ScopedRuntimeComponent)component;
- ScopeContainer scopeContainer = scopeRegistry.getScopeContainer(runtimeComponent);
- if (scopeContainer != null && scopeContainer.getScope() == Scope.CONVERSATION) {
- conversationManager.addListener((ConversationalScopeContainer)scopeContainer);
- }
- runtimeComponent.setScopeContainer(scopeContainer);
- }
-
- private void removeScopeContainer(Component component) {
- if (!(component instanceof ScopedRuntimeComponent)) {
- return;
- }
- ScopedRuntimeComponent runtimeComponent = (ScopedRuntimeComponent)component;
- ScopeContainer scopeContainer = runtimeComponent.getScopeContainer();
- if(scopeContainer != null && scopeContainer.getScope() == Scope.CONVERSATION) {
- conversationManager.removeListener((ConversationalScopeContainer) scopeContainer);
- }
- runtimeComponent.setScopeContainer(null);
- }
-
- public void activateComponent(Component component)
- throws ActivationException {
- try {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Activating component: " + component.getURI());
- }
-
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- activate((Composite) implementation);
- } else if (implementation != null) {
- addImplementationProvider((RuntimeComponent) component,
- implementation);
- addScopeContainer(component);
- }
-
- for (ComponentService service : component.getServices()) {
- activate((RuntimeComponent) component,
- (RuntimeComponentService) service);
- }
-
- for (ComponentReference reference : component.getReferences()) {
- activate((RuntimeComponent) component,
- (RuntimeComponentReference) reference);
- }
- } catch (Exception e) {
- throw new ActivationException(e);
- }
- }
-
- public void deactivateComponent(Component component)
- throws ActivationException {
- try {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Deactivating component: " + component.getURI());
- }
- for (ComponentService service : component.getServices()) {
- deactivate((RuntimeComponent) component,
- (RuntimeComponentService) service);
- }
-
- for (ComponentReference reference : component.getReferences()) {
- deactivate((RuntimeComponent) component,
- (RuntimeComponentReference) reference);
- }
-
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- deactivate((Composite) implementation);
- } else if (implementation != null) {
- removeImplementationProvider((RuntimeComponent) component);
- removeScopeContainer(component);
- }
- } catch (Exception e) {
- throw new ActivationException(e);
- }
- }
-
- public void activate(Composite composite) throws ActivationException {
- try {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Activating composite: " + composite.getName());
- }
- for (Component component : composite.getComponents()) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Activating component: " + component.getURI());
- }
-
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- activate((Composite)implementation);
- } else if (implementation != null) {
- addImplementationProvider((RuntimeComponent)component, implementation);
- addScopeContainer(component);
- }
-
- for (ComponentService service : component.getServices()) {
- activate((RuntimeComponent)component, (RuntimeComponentService)service);
- }
-
- for (ComponentReference reference : component.getReferences()) {
- activate((RuntimeComponent)component, (RuntimeComponentReference)reference);
- }
- }
- } catch (Exception e) {
- throw new ActivationException(e);
- }
- }
-
- public void deactivate(Composite composite) throws ActivationException {
- try {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Deactivating composite: " + composite.getName());
- }
- for (Component component : composite.getComponents()) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Deactivating component: " + component.getURI());
- }
- for (ComponentService service : component.getServices()) {
- deactivate((RuntimeComponent)component, (RuntimeComponentService)service);
- }
-
- for (ComponentReference reference : component.getReferences()) {
- deactivate((RuntimeComponent)component, (RuntimeComponentReference)reference);
- }
-
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- deactivate((Composite)implementation);
- } else if (implementation != null) {
- removeImplementationProvider((RuntimeComponent)component);
- removeScopeContainer(component);
- }
- }
- } catch (Exception e) {
- throw new ActivationException(e);
- }
- }
-
- /**
- * @return the referenceHelper
- */
- public CompositeContext getCompositeContext() {
- return compositeContext;
- }
-
- /**
- * @return the domainComposite
- */
- public Composite getDomainComposite() {
- return domainComposite;
- }
-
- /**
- * @param domainComposite the domainComposite to set
- */
- public void setDomainComposite(Composite domainComposite) {
- this.domainComposite = domainComposite;
- }
-
- public Component resolve(String componentURI) {
- for (Composite composite : domainComposite.getIncludes()) {
- Component component = resolve(composite, componentURI);
- if (component != null) {
- return component;
- }
- }
- return null;
- }
-
- public Component resolve(Composite composite, String componentURI) {
- for (Component component : composite.getComponents()) {
- String uri = component.getURI();
- if (uri.equals(componentURI)) {
- return component;
- }
- if (componentURI.startsWith(uri)) {
- Implementation implementation = component.getImplementation();
- if (!(implementation instanceof Composite)) {
- return null;
- }
- return resolve((Composite)implementation, componentURI);
- }
- }
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointReferenceImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointReferenceImpl.java
deleted file mode 100644
index 022cac398a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointReferenceImpl.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.assembly.impl;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * @version $Rev$ $Date$
- */
-public class EndpointReferenceImpl implements EndpointReference {
- private RuntimeComponent component;
- private Contract contract;
- private Binding binding;
- private InterfaceContract interfaceContract;
- private String uri;
- private EndpointReference callbackEndpoint;
- private ReferenceParameters parameters = new ReferenceParametersImpl();
-
- /**
- * @param component
- * @param contract
- * @param binding
- * @param interfaceContract
- */
- public EndpointReferenceImpl(RuntimeComponent component,
- Contract contract,
- Binding binding,
- InterfaceContract interfaceContract) {
- super();
- this.component = component;
- this.contract = contract;
- this.binding = binding;
- this.interfaceContract = interfaceContract;
- this.uri = (component != null ? component.getURI() : "") + '/' +
- (contract != null ? contract.getName() : "");
- }
-
- /**
- * @param uri
- */
- public EndpointReferenceImpl(String uri) {
- super();
- this.uri = uri;
- }
-
- public Binding getBinding() {
- return binding;
- }
-
- public void setBinding(Binding binding) {
- this.binding = binding;
- }
-
- public RuntimeComponent getComponent() {
- return component;
- }
-
- public void setComponent(RuntimeComponent component) {
- this.component = component;
- }
-
- public Contract getContract() {
- return contract;
- }
-
- public void setContract(Contract contract) {
- this.contract = contract;
- }
-
- public InterfaceContract getInterfaceContract() {
- return interfaceContract;
- }
-
- public void setInterfaceContract(InterfaceContract interfaceContract) {
- this.interfaceContract = interfaceContract;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public EndpointReference getCallbackEndpoint() {
- return callbackEndpoint;
- }
-
- public void setCallbackEndpoint(EndpointReference callbackEndpoint) {
- this.callbackEndpoint = callbackEndpoint;
- }
-
- @Override
- public int hashCode() {
- final int PRIME = 31;
- int result = 1;
- result = PRIME * result + ((uri == null) ? 0 : uri.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final EndpointReferenceImpl other = (EndpointReferenceImpl)obj;
- if (uri == null) {
- if (other.uri != null) {
- return false;
- }
- } else if (!uri.equals(other.uri)) {
- return false;
- }
- return true;
- }
-
- /**
- * @see java.lang.Object#clone()
- */
- @Override
- public Object clone() throws CloneNotSupportedException {
- EndpointReferenceImpl copy = (EndpointReferenceImpl)super.clone();
- /* [nash] no need to copy callback endpoint
- if (callbackEndpoint != null) {
- copy.callbackEndpoint = (EndpointReference)callbackEndpoint.clone();
- }
- */
- if (parameters != null) {
- copy.parameters = (ReferenceParameters)parameters.clone();
- }
- return copy;
- }
-
- /**
- * @return the parameters
- */
- public ReferenceParameters getReferenceParameters() {
- return parameters;
- }
-
- /**
- * @param parameters the parameters to set
- */
- public void setReferenceParameters(ReferenceParameters parameters) {
- this.parameters = parameters;
- }
-
- public void mergeEndpoint(EndpointReference epr) {
- this.component = epr.getComponent();
- this.contract = epr.getContract();
- this.binding = epr.getBinding();
- this.interfaceContract = epr.getInterfaceContract();
- this.uri = epr.getURI();
- this.callbackEndpoint = epr.getCallbackEndpoint();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointWireImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointWireImpl.java
deleted file mode 100644
index b089abba4f..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointWireImpl.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.assembly.impl;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.core.invocation.impl.InvocationChainImpl;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolver;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.ServiceUnavailableException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class EndpointWireImpl implements RuntimeWire {
-
- private Endpoint endpoint;
- private CompositeActivatorImpl compositeActivator;
-
- private EndpointResolver endpointResolver;
- private EndpointReference source;
- private RuntimeWire wire;
- private InvocationChain binidngInvocationChain;
-
- /**
- * @param endpoint
- */
- public EndpointWireImpl(Endpoint endpoint, CompositeActivator compositeActivator) {
- super();
- this.endpoint = endpoint;
- // TODO - improve the SPI to get rid of this cast
- this.compositeActivator = (CompositeActivatorImpl)compositeActivator;
-
- // store source configuration as we have most of this now. We don't though know what the
- // target is yet.
- Reference componentTypeRef = endpoint.getSourceComponentReference().getReference();
- InterfaceContract sourceContract =
- componentTypeRef == null ? endpoint.getSourceComponentReference().getInterfaceContract() : componentTypeRef.getInterfaceContract();
- sourceContract = sourceContract.makeUnidirectional(false);
-
- source = new EndpointReferenceImpl((RuntimeComponent)endpoint.getSourceComponent(),
- endpoint.getSourceComponentReference(),
- null,
- sourceContract);
-
- RuntimeComponentReference runtimeRef = ((RuntimeComponentReference)endpoint.getSourceComponentReference());
- endpointResolver = runtimeRef.getEndpointResolver(endpoint);
-
- }
-
- public synchronized List<InvocationChain> getInvocationChains() {
- // where late binding happens. Find the endpoint provider and
- // ask it to do the endpoint resolution.
- if (endpoint.isUnresolved()){
-
- // this method should locate a viable target service and complete the
- // endpoint configuration
- endpointResolver.resolve();
-
- if (endpoint.isUnresolved()){
- throw new ServiceUnavailableException("Unable to resolve service for component: " +
- endpoint.getSourceComponent().getName() +
- " reference: " +
- endpoint.getSourceComponentReference().getName() +
- " target: " +
- endpoint.getTargetName());
- }
- }
-
- if (wire == null){
- RuntimeComponentReference runtimeRef = ((RuntimeComponentReference)endpoint.getSourceComponentReference());
-
- // add the resolved binding into the reference
- runtimeRef.getBindings().add(endpoint.getSourceBinding());
-
- // add a binding provider into the reference for the resolved binding
- compositeActivator.addReferenceBindingProviderForEndpoint(endpoint);
-
- // extract the binding provider that has been created
- ReferenceBindingProvider bindingProvider = runtimeRef.getBindingProvider(endpoint.getSourceBinding());
-
- // start the binding provider
- bindingProvider.start();
-
- // create the wire
- compositeActivator.addReferenceWireForEndpoint(endpoint);
-
- // extract the wire that has been created
- wire = runtimeRef.getRuntimeWire(endpoint.getSourceBinding());
- }
-
- return wire.getInvocationChains();
- }
-
- public InvocationChain getInvocationChain(Operation operation) {
- if (wire ==null){
- return null;
- } else {
- return wire.getInvocationChain(operation);
- }
- }
-
- public Object invoke(Message msg) throws InvocationTargetException {
- // not called as the endpoint wire only appears on the reference side
- return null;
- }
-
- public Object invoke(Operation operation, Object[] args) throws InvocationTargetException {
- // not called as the endpoint wire only appears on the reference side
- return null;
- }
-
- public Object invoke(Operation operation, Message msg) throws InvocationTargetException {
- // not called as the endpoint wire only appears on the reference side
- return null;
- }
-
-
- public EndpointReference getSource() {
- return source;
- }
-
- public EndpointReference getTarget() {
- return null;
- }
-
- public void setTarget(EndpointReference target) {
- }
-
- public void rebuild() {
- }
-
- public synchronized InvocationChain getBindingInvocationChain() {
- if (binidngInvocationChain == null) {
- if (source instanceof RuntimeComponentReference) {
- binidngInvocationChain = new InvocationChainImpl(null, null, true);
- } else {
- binidngInvocationChain = new InvocationChainImpl(null, null, false);
- }
- }
- return binidngInvocationChain;
- }
-
- // TODO: TUSCANY-2580: give RuntimeComponentReferenceImpl a way to get at the endpoint
- public Endpoint getEndpoint() {
- return endpoint;
- }
-
- /**
- * @see java.lang.Object#clone()
- */
- @Override
- public Object clone() throws CloneNotSupportedException {
- EndpointWireImpl copy = (EndpointWireImpl)super.clone();
- return copy;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ReferenceParameterProcessor.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ReferenceParameterProcessor.java
deleted file mode 100644
index 213f1d8afa..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ReferenceParameterProcessor.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.assembly.impl;
-
-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.monitor.Monitor;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-
-/**
- * Artifact processor for reference parameters.
- *
- * @version $Rev$ $Date$
- */
-public class ReferenceParameterProcessor implements StAXArtifactProcessor<ReferenceParameters> {
- private static final QName REFERENCE_PARAMETERS =
- new QName("http://tuscany.apache.org/xmlns/sca/1.0", "referenceParameters", "tuscany");
-
- /**
- * Constructs a new processor.
- *
- * @param modelFactories
- */
- public ReferenceParameterProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- }
-
- /**
- * @see org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor#getArtifactType()
- */
- public QName getArtifactType() {
- return REFERENCE_PARAMETERS;
- }
-
- /**
- * @see org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor#read(javax.xml.stream.XMLStreamReader)
- */
- public ReferenceParameters read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- ReferenceParameters parameters = new ReferenceParametersImpl();
- parameters.setConversationID(reader.getAttributeValue(null, "conversationID"));
- parameters.setCallbackID(reader.getAttributeValue(null, "callbackID"));
- return parameters;
- }
-
- /**
- * @see org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor#write(java.lang.Object, javax.xml.stream.XMLStreamWriter)
- */
- public void write(ReferenceParameters model, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- writer.writeStartElement(REFERENCE_PARAMETERS.getPrefix(),
- REFERENCE_PARAMETERS.getLocalPart(),
- REFERENCE_PARAMETERS.getNamespaceURI());
- writer.writeNamespace(REFERENCE_PARAMETERS.getPrefix(), REFERENCE_PARAMETERS.getNamespaceURI());
- if (model.getConversationID() != null) {
- writer.writeAttribute("conversationID", model.getConversationID().toString());
- }
- if (model.getCallbackID() != null) {
- writer.writeAttribute("callbackID", model.getCallbackID().toString());
- }
- writer.writeEndElement();
- }
-
- /**
- * @see org.apache.tuscany.sca.contribution.processor.ArtifactProcessor#getModelType()
- */
- public Class<ReferenceParameters> getModelType() {
- return ReferenceParameters.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.contribution.processor.ArtifactProcessor#resolve(java.lang.Object, org.apache.tuscany.sca.contribution.resolver.ModelResolver)
- */
- public void resolve(ReferenceParameters model, ModelResolver resolver) throws ContributionResolveException {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ReferenceParametersImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ReferenceParametersImpl.java
deleted file mode 100644
index 0170af54fc..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ReferenceParametersImpl.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ReferenceParametersImpl implements ReferenceParameters {
- private Object callbackID;
- private Object conversationID;
- private EndpointReference callbackReference;
- private Object callbackObjectID;
-
- /**
- * @return the callbackID
- */
- public Object getCallbackID() {
- return callbackID;
- }
- /**
- * @param callbackID the callbackID to set
- */
- public void setCallbackID(Object callbackID) {
- this.callbackID = callbackID;
- }
- /**
- * @return the conversationID
- */
- public Object getConversationID() {
- return conversationID;
- }
- /**
- * @param conversationID the conversationID to set
- */
- public void setConversationID(Object conversationID) {
- this.conversationID = conversationID;
- }
-
- /**
- * @see org.apache.tuscany.sca.runtime.ReferenceParameters#getCallbackReference()
- */
- public EndpointReference getCallbackReference() {
- return callbackReference;
- }
- /**
- * @see org.apache.tuscany.sca.runtime.ReferenceParameters#setCallback(java.lang.Object)
- */
- public void setCallbackReference(EndpointReference callback) {
- this.callbackReference = callback;
- }
-
- /**
- * @see java.lang.Object#clone()
- */
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- /**
- * @return the callbackObjectID
- */
- public Object getCallbackObjectID() {
- return callbackObjectID;
- }
- /**
- * @param callbackObjectID the callbackObjectID to set
- */
- public void setCallbackObjectID(Object callbackObjectID) {
- this.callbackObjectID = callbackObjectID;
- }
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((callbackID == null) ? 0 : callbackID.hashCode());
- result = prime * result + ((callbackObjectID == null) ? 0 : callbackObjectID.hashCode());
- result = prime * result + ((callbackReference == null) ? 0 : callbackReference.hashCode());
- result = prime * result + ((conversationID == null) ? 0 : conversationID.hashCode());
- return result;
- }
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof ReferenceParametersImpl))
- return false;
- final ReferenceParametersImpl other = (ReferenceParametersImpl)obj;
- if (callbackID == null) {
- if (other.callbackID != null)
- return false;
- } else if (!callbackID.equals(other.callbackID))
- return false;
- if (callbackObjectID == null) {
- if (other.callbackObjectID != null)
- return false;
- } else if (!callbackObjectID.equals(other.callbackObjectID))
- return false;
- if (callbackReference == null) {
- if (other.callbackReference != null)
- return false;
- } else if (!callbackReference.equals(other.callbackReference))
- return false;
- if (conversationID == null) {
- if (other.conversationID != null)
- return false;
- } else if (!conversationID.equals(other.conversationID))
- return false;
- return true;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentImpl.java
deleted file mode 100644
index 6032005b9a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentImpl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.assembly.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.impl.ComponentImpl;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ResolverExtension;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopedRuntimeComponent;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class RuntimeComponentImpl extends ComponentImpl implements RuntimeComponent,
- ScopedRuntimeComponent, ResolverExtension {
- protected RuntimeComponentContext componentContext;
- protected ImplementationProvider implementationProvider;
- protected List<PolicyProvider> policyProviders = new ArrayList<PolicyProvider>();
- protected ScopeContainer scopeContainer;
- protected boolean started;
- protected ModelResolver modelResolver;
-
- /**
- */
- public RuntimeComponentImpl() {
- super();
- }
-
- public ImplementationProvider getImplementationProvider() {
- return implementationProvider;
- }
-
- public void setImplementationProvider(ImplementationProvider provider) {
- this.implementationProvider = provider;
- }
-
- public ScopeContainer getScopeContainer() {
- return scopeContainer;
- }
-
- public void setScopeContainer(ScopeContainer scopeContainer) {
- this.scopeContainer = scopeContainer;
- }
-
- public boolean isStarted() {
- return started;
- }
-
- public void setStarted(boolean started) {
- this.started = started;
- }
-
- /**
- * @return the componentContext
- */
- public RuntimeComponentContext getComponentContext() {
- return componentContext;
- }
-
- /**
- * @param componentContext the componentContext to set
- */
- public void setComponentContext(RuntimeComponentContext componentContext) {
- this.componentContext = componentContext;
- }
-
- public void addPolicyProvider(PolicyProvider policyProvider) {
- policyProviders.add(policyProvider);
- }
-
- public List<PolicyProvider> getPolicyProviders() {
- return policyProviders;
- }
-
- public ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
- @Override
- public String toString() {
- return getName();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentReferenceImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentReferenceImpl.java
deleted file mode 100644
index eda274bd29..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentReferenceImpl.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.impl.ComponentReferenceImpl;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolver;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Implementation of a Component Reference.
- *
- * @version $Rev$ $Date$
- */
-public class RuntimeComponentReferenceImpl extends ComponentReferenceImpl implements RuntimeComponentReference {
- private ArrayList<RuntimeWire> wires;
- private HashMap<Binding, ReferenceBindingProvider> bindingProviders =
- new HashMap<Binding, ReferenceBindingProvider>();
- private HashMap<Endpoint, EndpointResolver> endpointResolvers =
- new HashMap<Endpoint, EndpointResolver>();
- private HashMap<Binding, List<PolicyProvider>> policyProviders = new HashMap<Binding, List<PolicyProvider>>();
-
- private RuntimeComponent component;
-
- public RuntimeComponentReferenceImpl() {
- super();
- }
-
- public synchronized List<RuntimeWire> getRuntimeWires() {
- if (wires == null) {
- wires = new ArrayList<RuntimeWire>();
- component.getComponentContext().start(this);
- }
- return wires;
- }
-
- public RuntimeWire getRuntimeWire(Binding binding) {
- for (RuntimeWire wire : getRuntimeWires()) {
- if (wire.getSource().getBinding() == binding) {
- return wire;
- }
- }
-
- // TODO: TUSCANY-2580: before returning null see if a candidate binding matches
- for (RuntimeWire wire : getRuntimeWires()) {
- if (wire instanceof EndpointWireImpl) {
- Endpoint endpoint = ((EndpointWireImpl)wire).getEndpoint();
- for (Binding b : endpoint.getCandidateBindings()) {
- if (b == binding) {
- return wire;
- }
- }
- }
- }
- return null;
- }
-
- public ReferenceBindingProvider getBindingProvider(Binding binding) {
- return bindingProviders.get(binding);
- }
-
- public void setBindingProvider(Binding binding, ReferenceBindingProvider bindingProvider) {
- bindingProviders.put(binding, bindingProvider);
- }
-
- public EndpointResolver getEndpointResolver(Endpoint endpoint){
- return endpointResolvers.get(endpoint);
- }
-
- public void setEndpointResolver(Endpoint endpoint, EndpointResolver endpointResolver){
- endpointResolvers.put(endpoint, endpointResolver);
- }
-
- public Invoker getInvoker(Binding binding, Operation operation) {
- RuntimeWire wire = getRuntimeWire(binding);
- if (wire == null) {
- return null;
- }
- InvocationChain chain = wire.getInvocationChain(operation);
- return chain == null ? null : chain.getHeadInvoker();
- }
-
- /**
- * @return the component
- */
- public RuntimeComponent getComponent() {
- return component;
- }
-
- /**
- * @param component the component to set
- */
- public void setComponent(RuntimeComponent component) {
- this.component = component;
- }
-
- /**
- * @see org.apache.tuscany.sca.assembly.impl.ComponentReferenceImpl#clone()
- */
- @Override
- public Object clone() throws CloneNotSupportedException {
- RuntimeComponentReferenceImpl ref = (RuntimeComponentReferenceImpl)super.clone();
- ref.wires = null;
- ref.bindingProviders = new HashMap<Binding, ReferenceBindingProvider>();
- ref.policyProviders = new HashMap<Binding, List<PolicyProvider>>();
- return ref;
- }
-
- public void addPolicyProvider(Binding binding, PolicyProvider policyProvider) {
- List<PolicyProvider> providers = policyProviders.get(binding);
- if (providers == null) {
- providers = new ArrayList<PolicyProvider>();
- policyProviders.put(binding, providers);
- }
- providers.add(policyProvider);
- }
-
- public List<PolicyProvider> getPolicyProviders(Binding binding) {
- return policyProviders.get(binding);
- }
-
- @Override
- public String toString() {
- return getName();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentServiceImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentServiceImpl.java
deleted file mode 100644
index 2cbd72f218..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeComponentServiceImpl.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.impl.ComponentServiceImpl;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Implementation of a Component Service.
- *
- * @version $Rev$ $Date$
- */
-public class RuntimeComponentServiceImpl extends ComponentServiceImpl implements RuntimeComponentService {
- private ArrayList<RuntimeWire> wires = new ArrayList<RuntimeWire>();
- private ArrayList<RuntimeWire> callbackWires = new ArrayList<RuntimeWire>();
- private HashMap<Binding, ServiceBindingProvider> bindingProviders = new HashMap<Binding, ServiceBindingProvider>();
- private HashMap<Binding, List<PolicyProvider>> policyProviders = new HashMap<Binding, List<PolicyProvider>>();
-
- public RuntimeComponentServiceImpl() {
- super();
- }
-
- public List<RuntimeWire> getRuntimeWires() {
- return wires;
- }
-
- public RuntimeWire getRuntimeWire(Binding binding) {
- for (RuntimeWire wire : wires) {
- if (wire.getTarget().getBinding() == binding) {
- return wire;
- }
- }
- return null;
- }
-
- public RuntimeWire getRuntimeWire(Binding binding, InterfaceContract interfaceContract) {
- RuntimeWire wire = getRuntimeWire(binding);
- if (wire == null) {
- return null;
- }
- if (interfaceContract != null && interfaceContract != wire.getSource().getInterfaceContract()) {
- try {
- // FIXME: [rfeng] We could avoid clone() using a better comparison of the two interface contracts
- wire = (RuntimeWire)wire.clone();
- wire.getSource().setInterfaceContract(interfaceContract);
- wire.rebuild();
- } catch (CloneNotSupportedException e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- return wire;
- }
-
- public List<RuntimeWire> getCallbackWires() {
- return callbackWires;
- }
-
- public ServiceBindingProvider getBindingProvider(Binding binding) {
- return bindingProviders.get(binding);
- }
-
- public void setBindingProvider(Binding binding, ServiceBindingProvider bindingProvider) {
- bindingProviders.put(binding, bindingProvider);
- }
-
- public Invoker getInvoker(Binding binding, Operation operation) {
- return getInvoker(binding, null, operation);
- }
-
- public Invoker getInvoker(Binding binding, InterfaceContract interfaceContract, Operation operation) {
- InvocationChain chain = getInvocationChain(binding, interfaceContract, operation);
- if (chain != null) {
- return chain.getHeadInvoker();
- } else {
- return null;
- }
- }
-
- public InvocationChain getInvocationChain(Binding binding, InterfaceContract interfaceContract, Operation operation) {
- RuntimeWire wire = getRuntimeWire(binding);
- if (wire == null) {
- return null;
- }
- if (interfaceContract != null && interfaceContract != wire.getSource().getInterfaceContract()) {
- try {
- // FIXME: [rfeng] We could avoid clone() using a better comparison of the two interface contracts
- wire = (RuntimeWire)wire.clone();
- wire.getSource().setInterfaceContract(interfaceContract);
- wire.rebuild();
- } catch (CloneNotSupportedException e) {
- throw new ServiceRuntimeException(e);
- }
- }
- return wire.getInvocationChain(operation);
- }
-
- public InvocationChain getInvocationChain(Binding binding, Operation operation) {
- return getInvocationChain(binding, null, operation);
- }
-
- /**
- * @see org.apache.tuscany.sca.assembly.impl.ComponentServiceImpl#clone()
- */
- @SuppressWarnings("unchecked")
- @Override
- public Object clone() throws CloneNotSupportedException {
- RuntimeComponentServiceImpl clone = (RuntimeComponentServiceImpl)super.clone();
- clone.bindingProviders = (HashMap<Binding, ServiceBindingProvider>)bindingProviders.clone();
- clone.wires = (ArrayList<RuntimeWire>)wires.clone();
- clone.callbackWires = (ArrayList<RuntimeWire>)callbackWires.clone();
- clone.policyProviders = (HashMap<Binding, List<PolicyProvider>>)policyProviders.clone();
- return clone;
- }
-
- public void addPolicyProvider(Binding binding, PolicyProvider policyProvider) {
- List<PolicyProvider> providers = policyProviders.get(binding);
- if (providers == null) {
- providers = new ArrayList<PolicyProvider>();
- policyProviders.put(binding, providers);
- }
- providers.add(policyProvider);
- }
-
- public List<PolicyProvider> getPolicyProviders(Binding binding) {
- return policyProviders.get(binding);
- }
-
- @Override
- public String toString() {
- return getName();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeWireImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeWireImpl.java
deleted file mode 100644
index 62c2791060..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeWireImpl.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-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.Contract;
-import org.apache.tuscany.sca.core.conversation.ConversationManager;
-import org.apache.tuscany.sca.core.invocation.NonBlockingInterceptor;
-import org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker;
-import org.apache.tuscany.sca.core.invocation.impl.InvocationChainImpl;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.provider.PolicyProviderRRB;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ReferenceBindingProviderRRB;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProviderRRB;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.apache.tuscany.sca.runtime.RuntimeWireProcessor;
-import org.apache.tuscany.sca.work.WorkScheduler;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class RuntimeWireImpl implements RuntimeWire {
- private EndpointReference wireSource;
- private EndpointReference wireTarget;
-
- private transient RuntimeWireProcessor wireProcessor;
- private transient InterfaceContractMapper interfaceContractMapper;
- private transient WorkScheduler workScheduler;
- private transient MessageFactory messageFactory;
- private transient ConversationManager conversationManager;
- private transient RuntimeWireInvoker invoker;
-
- // the following is a very simple cache that avoids re-cloning a wire
- // when consecutive callbacks to the same endpoint are made
- private EndpointReference lastCallback;
- private RuntimeWire cachedWire;
- private boolean wireReserved;
- private RuntimeWireImpl clonedFrom;
-
- private List<InvocationChain> chains;
- private InvocationChain bindingInvocationChain;
-
- /**
- * @param source
- * @param target
- * @param interfaceContractMapper
- * @param workScheduler
- * @param wireProcessor
- * @param messageFactory
- * @param conversationManager
- */
- public RuntimeWireImpl(EndpointReference source,
- EndpointReference target,
- InterfaceContractMapper interfaceContractMapper,
- WorkScheduler workScheduler,
- RuntimeWireProcessor wireProcessor,
- MessageFactory messageFactory,
- ConversationManager conversationManager) {
- super();
- this.wireSource = source;
- this.wireTarget = target;
- this.interfaceContractMapper = interfaceContractMapper;
- this.workScheduler = workScheduler;
- this.wireProcessor = wireProcessor;
- this.messageFactory = messageFactory;
- this.conversationManager = conversationManager;
- this.invoker = new RuntimeWireInvoker(this.messageFactory, this.conversationManager, this);
- }
-
- public synchronized List<InvocationChain> getInvocationChains() {
- if (chains == null) {
- initInvocationChains();
- }
- return chains;
- }
-
- public synchronized InvocationChain getBindingInvocationChain() {
- if (bindingInvocationChain == null) {
- Contract source = wireSource.getContract();
- if (source instanceof RuntimeComponentReference) {
- bindingInvocationChain = new InvocationChainImpl(null, null, true);
- initReferenceBindingInvocationChains();
- } else {
- bindingInvocationChain = new InvocationChainImpl(null, null, false);
- initServiceBindingInvocationChains();
- }
- }
- return bindingInvocationChain;
- }
-
- public InvocationChain getInvocationChain(Operation operation) {
- for (InvocationChain chain : getInvocationChains()) {
- Operation op = null;
- if (wireSource.getContract() != null) {
- // Reference chain
- op = chain.getSourceOperation();
- } else {
- // Service chain
- op = chain.getTargetOperation();
- }
- if (interfaceContractMapper.isCompatible(operation, op, op.getInterface().isRemotable())) {
- return chain;
- }
- }
- return null;
- }
-
- public Object invoke(Message msg) throws InvocationTargetException {
- return getBindingInvocationChain().getHeadInvoker().invoke(msg);
- }
-
- public Object invoke(Operation operation, Object[] args) throws InvocationTargetException {
- Message msg = messageFactory.createMessage();
- msg.setBody(args);
- return invoker.invoke(operation, msg);
- }
-
- public Object invoke(Operation operation, Message msg) throws InvocationTargetException {
- return invoker.invoke(operation, msg);
- }
-
- /**
- * Initialize the invocation chains
- */
- private void initInvocationChains() {
- chains = new ArrayList<InvocationChain>();
- InterfaceContract sourceContract = wireSource.getInterfaceContract();
- InterfaceContract targetContract = wireTarget.getInterfaceContract();
-
- Contract source = wireSource.getContract();
- if (source instanceof RuntimeComponentReference) {
- // It's the reference wire
- RuntimeComponentReference reference = (RuntimeComponentReference)wireSource.getContract();
- Binding refBinding = wireSource.getBinding();
- for (Operation operation : sourceContract.getInterface().getOperations()) {
- Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(), operation);
- if (targetOperation == null) {
- throw new ServiceRuntimeException("No matching operation for " + operation.getName()
- + " is found in reference "
- + wireSource.getComponent().getURI()
- + "#"
- + reference.getName());
- }
- InvocationChain chain = new InvocationChainImpl(operation, targetOperation, true);
- if (operation.isNonBlocking()) {
- addNonBlockingInterceptor(reference, refBinding, chain);
- }
- addReferenceBindingInterceptor(reference, refBinding, chain, operation);
- chains.add(chain);
- }
-
- } else {
- // It's the service wire
- RuntimeComponentService service = (RuntimeComponentService)wireTarget.getContract();
- RuntimeComponent serviceComponent = wireTarget.getComponent();
- Binding serviceBinding = wireTarget.getBinding();
- for (Operation operation : sourceContract.getInterface().getOperations()) {
- Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(), operation);
- if (targetOperation == null) {
- throw new ServiceRuntimeException("No matching operation for " + operation.getName()
- + " is found in service "
- + serviceComponent.getURI()
- + "#"
- + service.getName());
- }
- InvocationChain chain = new InvocationChainImpl(operation, targetOperation, false);
- if (operation.isNonBlocking()) {
- addNonBlockingInterceptor(service, serviceBinding, chain);
- }
- addServiceBindingInterceptor(service, serviceBinding, chain, operation);
- addImplementationInterceptor(serviceComponent, service, chain, targetOperation);
- chains.add(chain);
- }
-
- }
- wireProcessor.process(this);
- }
-
- private void initReferenceBindingInvocationChains() {
- RuntimeComponentReference reference = (RuntimeComponentReference)wireSource.getContract();
- Binding referenceBinding = wireSource.getBinding();
-
- // add the binding interceptors to the reference binding wire
- ReferenceBindingProvider provider = reference.getBindingProvider(referenceBinding);
- if ((provider != null) &&
- (provider instanceof ReferenceBindingProviderRRB)){
- ((ReferenceBindingProviderRRB)provider).configureBindingChain(this);
- }
-
- // add the policy interceptors to the service binding wire
- // find out which policies are active
- List<PolicyProvider> pps = ((RuntimeComponentReference)reference).getPolicyProviders(referenceBinding);
- if (pps != null) {
- for (PolicyProvider p : pps) {
- if (p instanceof PolicyProviderRRB) {
- Interceptor interceptor = ((PolicyProviderRRB)p).createBindingInterceptor();
- if (interceptor != null) {
- bindingInvocationChain.addInterceptor(p.getPhase(), interceptor);
- }
- }
- }
- }
- }
-
- private void initServiceBindingInvocationChains() {
- RuntimeComponentService service = (RuntimeComponentService)wireTarget.getContract();
- Binding serviceBinding = wireTarget.getBinding();
-
- // add the binding interceptors to the service binding wire
- ServiceBindingProvider provider = service.getBindingProvider(serviceBinding);
- if ((provider != null) &&
- (provider instanceof ServiceBindingProviderRRB)){
- ((ServiceBindingProviderRRB)provider).configureBindingChain(this);
- }
-
- // add the policy interceptors to the service binding wire
- List<PolicyProvider> pps = ((RuntimeComponentService)service).getPolicyProviders(serviceBinding);
- if (pps != null) {
- for (PolicyProvider p : pps) {
- if (p instanceof PolicyProviderRRB) {
- Interceptor interceptor = ((PolicyProviderRRB)p).createBindingInterceptor();
- if (interceptor != null) {
- bindingInvocationChain.addInterceptor(p.getPhase(), interceptor);
- }
- }
- }
- }
-
-
- // TODO - add something on the end of the wire to invoke the
- // invocation chain. Need to split out the runtime
- // wire invoker into conversation, callback interceptors etc
- bindingInvocationChain.addInvoker(invoker);
-
- }
-
- public EndpointReference getSource() {
- return wireSource;
- }
-
- public EndpointReference getTarget() {
- return wireTarget;
- }
-
- public void setTarget(EndpointReference target) {
- if (this.wireTarget != target) {
- rebuild();
- }
- this.wireTarget = target;
- }
-
- public void rebuild() {
- this.chains = null;
- }
-
- /**
- * Add the interceptor for a reference binding
- *
- * @param reference
- * @param binding
- * @param chain
- * @param operation
- */
- private void addReferenceBindingInterceptor(ComponentReference reference,
- Binding binding,
- InvocationChain chain,
- Operation operation) {
- ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
- if (provider != null) {
- Invoker invoker = provider.createInvoker(operation);
- if (invoker != null) {
- chain.addInvoker(invoker);
- }
- }
- List<PolicyProvider> pps = ((RuntimeComponentReference)reference).getPolicyProviders(binding);
- if (pps != null) {
- for (PolicyProvider p : pps) {
- Interceptor interceptor = p.createInterceptor(operation);
- if (interceptor != null) {
- chain.addInterceptor(p.getPhase(), p.createInterceptor(operation));
- }
- }
- }
- }
-
- /**
- * Add the interceptor for a binding
- *
- * @param reference
- * @param binding
- * @param chain
- * @param operation
- */
- private void addServiceBindingInterceptor(ComponentService service,
- Binding binding,
- InvocationChain chain,
- Operation operation) {
- List<PolicyProvider> pps = ((RuntimeComponentService)service).getPolicyProviders(binding);
- if (pps != null) {
- for (PolicyProvider p : pps) {
- Interceptor interceptor = p.createInterceptor(operation);
- if (interceptor != null) {
- chain.addInterceptor(p.getPhase(), p.createInterceptor(operation));
- }
- }
- }
- }
-
- /**
- * Add a non-blocking interceptor if the reference binding needs it
- *
- * @param reference
- * @param binding
- * @param chain
- */
- private void addNonBlockingInterceptor(ComponentReference reference, Binding binding, InvocationChain chain) {
- ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
- if (provider != null) {
- boolean supportsOneWayInvocation = provider.supportsOneWayInvocation();
- if (!supportsOneWayInvocation) {
- chain.addInterceptor(Phase.REFERENCE, new NonBlockingInterceptor(workScheduler));
- }
- }
- }
-
- /**
- * Add a non-blocking interceptor if the service binding needs it
- *
- * @param service
- * @param binding
- * @param chain
- */
- private void addNonBlockingInterceptor(ComponentService service, Binding binding, InvocationChain chain) {
- ServiceBindingProvider provider = ((RuntimeComponentService)service).getBindingProvider(binding);
- if (provider != null) {
- if (!provider.supportsOneWayInvocation()) {
- chain.addInterceptor(Phase.SERVICE, new NonBlockingInterceptor(workScheduler));
- }
- }
- }
-
- /**
- * Add the interceptor for a component implementation
- *
- * @param component
- * @param service
- * @param chain
- * @param operation
- */
- private void addImplementationInterceptor(Component component,
- ComponentService service,
- InvocationChain chain,
- Operation operation) {
- ImplementationProvider provider = ((RuntimeComponent)component).getImplementationProvider();
- if (provider != null) {
- Invoker invoker = null;
- invoker = provider.createInvoker((RuntimeComponentService)service, operation);
- chain.addInvoker(invoker);
- }
- List<PolicyProvider> pps = ((RuntimeComponent)component).getPolicyProviders();
- if (pps != null) {
- for (PolicyProvider p : pps) {
- Interceptor interceptor = p.createInterceptor(operation);
- if (interceptor != null) {
- chain.addInterceptor(p.getPhase(), p.createInterceptor(operation));
- }
- }
- }
- }
-
- /**
- * @see java.lang.Object#clone()
- */
- @Override
- public Object clone() throws CloneNotSupportedException {
- RuntimeWireImpl copy = (RuntimeWireImpl)super.clone();
- copy.wireSource = (EndpointReference)wireSource.clone();
- copy.wireTarget = (EndpointReference)wireTarget.clone();
- copy.invoker = new RuntimeWireInvoker(copy.messageFactory, copy.conversationManager, copy);
- copy.cachedWire = null; // TUSCANY-2630
- return copy;
- }
-
- /**
- * @return the conversationManager
- */
- public ConversationManager getConversationManager() {
- return conversationManager;
- }
-
- public synchronized RuntimeWire lookupCache(EndpointReference callback) {
- if (lastCallback != null && callback.getURI().equals(lastCallback.getURI()) && !wireReserved) {
- wireReserved = true;
- return cachedWire;
- } else {
- return null;
- }
- }
-
- public synchronized void addToCache(EndpointReference callback, RuntimeWire clonedWire) {
- ((RuntimeWireImpl)clonedWire).setClonedFrom(this);
- lastCallback = callback;
- cachedWire = clonedWire;
- wireReserved = true;
- }
-
- public synchronized void releaseClonedWire(RuntimeWire wire) {
- if (cachedWire == wire) {
- wireReserved = false;
- }
- }
-
- public synchronized void releaseWire() {
- clonedFrom.releaseClonedWire(this);
- }
-
- private void setClonedFrom(RuntimeWireImpl wire) {
- clonedFrom = wire;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CallableReferenceExt.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CallableReferenceExt.java
deleted file mode 100644
index c0217e7336..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CallableReferenceExt.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.context;
-
-import java.io.Externalizable;
-import java.io.IOException;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.core.conversation.ConversationExt;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.CallableReference;
-
-/**
- * Extended version of CallableReference
- */
-public interface CallableReferenceExt<B> extends CallableReference<B>, Externalizable {
- /**
- * @return
- */
- RuntimeWire getRuntimeWire();
-
- /**
- * @return
- * @throws IOException
- */
- String toXMLString() throws IOException;
-
- /**
- * @param callbackID
- */
- void attachCallbackID(Object callbackID);
-
- void attachConversationID(Object conversationID);
-
- void attachConversation(ConversationExt conversation);
-
- void attachConversation(Object conversationID);
-
- /**
- * @return
- */
- EndpointReference getEndpointReference();
-
- /**
- * @return
- */
- XMLStreamReader getXMLReader();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/ComponentContextExt.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/ComponentContextExt.java
deleted file mode 100644
index 6db3af213d..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/ComponentContextExt.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.context;
-
-import org.apache.tuscany.sca.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.runtime.RuntimeComponentContext;
-
-/**
- * Extended ComponentContext
- */
-public interface ComponentContextExt extends RuntimeComponentContext {
- CompositeActivator getCompositeActivator();
- CompositeContext getCompositeContext();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CompositeContext.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CompositeContext.java
deleted file mode 100644
index 29c4dfd362..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CompositeContext.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.context;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.stream.XMLStreamReader;
-
-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.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.core.conversation.ConversationManager;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ThreadMessageContext;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public abstract class CompositeContext {
- /**
- * Create a self-reference for a component service
- * @param component
- * @param service
- * @throws CloneNotSupportedException
- * @throws InvalidInterfaceException
- */
- public abstract ComponentReference createSelfReference(Component component,
- ComponentService service,
- Class<?> businessInterface)
- throws CloneNotSupportedException, InvalidInterfaceException;
-
- /**
- * Bind a component reference to a component service
- * @param <B>
- * @param businessInterface
- * @param reference
- * @param service
- * @return
- * @throws CloneNotSupportedException
- * @throws InvalidInterfaceException
- */
- public abstract RuntimeComponentReference bindComponentReference(Class<?> businessInterface,
- RuntimeComponentReference reference,
- RuntimeComponent component,
- RuntimeComponentService service)
- throws CloneNotSupportedException, InvalidInterfaceException;
-
- /**
- * @param component
- * @param reference
- * @param writer
- * @throws IOException
- */
- public abstract void write(Component component, ComponentReference reference, Writer writer) throws IOException;
-
- /**
- * @param component
- * @param reference
- * @param service
- * @param writer
- * @throws IOException
- */
- public abstract void write(Component component,
- ComponentReference reference,
- ComponentService service,
- Writer writer) throws IOException;
-
- /**
- * @param component
- * @param reference
- * @return
- * @throws IOException
- */
- public abstract String toXML(Component component, ComponentReference reference) throws IOException;
-
- /**
- * @param component
- * @param service
- * @return
- * @throws IOException
- */
- public abstract String toXML(Component component, ComponentService service) throws IOException;
-
- /**
- * @param reader
- * @return
- * @throws IOException
- */
- public abstract RuntimeComponent read(Reader reader) throws IOException;
-
- /**
- * @param streamReader
- * @return
- * @throws IOException
- */
- public abstract RuntimeComponent read(XMLStreamReader streamReader) throws IOException;
-
- /**
- * @param xml
- * @return
- * @throws IOException
- */
- public abstract Component fromXML(String xml) throws IOException;
-
- /**
- * @param streamReader
- * @return
- * @throws IOException
- */
- public abstract Component fromXML(XMLStreamReader streamReader) throws IOException;
-
- /**
- * @return
- */
- public static RuntimeComponent getCurrentComponent() {
- Message message = ThreadMessageContext.getMessageContext();
- if (message != null) {
- EndpointReference to = message.getTo();
- if (to == null) {
- return null;
- }
- RuntimeComponent component = message.getTo().getComponent();
- return component;
- }
- return null;
- }
-
- /**
- * @return
- */
- public static CompositeActivator getCurrentCompositeActivator() {
- RuntimeComponent component = getCurrentComponent();
- if (component != null) {
- ComponentContextExt context = (ComponentContextExt)component.getComponentContext();
- return context.getCompositeActivator();
- }
- return null;
- }
-
- /**
- * @return
- */
- public static CompositeContext getCurrentCompositeContext() {
- CompositeActivator activator = getCurrentCompositeActivator();
- if (activator != null) {
- return activator.getCompositeContext();
- }
- return null;
- }
-
- /**
- * @param component
- */
- public static ComponentService getSingleService(Component component) {
- ComponentService targetService;
- List<ComponentService> services = component.getServices();
- List<ComponentService> regularServices = new ArrayList<ComponentService>();
- for (ComponentService service : services) {
- if (service.isCallback()) {
- continue;
- }
- String name = service.getName();
- if (!name.startsWith("$") || name.startsWith("$dynamic$")) {
- regularServices.add(service);
- }
- }
- if (regularServices.size() == 0) {
- throw new ServiceRuntimeException("No service is declared on component " + component.getURI());
- }
- if (regularServices.size() != 1) {
- throw new ServiceRuntimeException("More than one service is declared on component " + component.getURI()
- + ". Service name is required to get the service.");
- }
- targetService = regularServices.get(0);
- return targetService;
- }
-
- public abstract ExtensionPointRegistry getExtensionPointRegistry();
-
- public abstract ConversationManager getConversationManager();
-
- /**
- * Get the java interface factory
- * @return
- */
- public abstract JavaInterfaceFactory getJavaInterfaceFactory();
-
- /**
- * Get the proxy factory
- * @return
- */
- public abstract ProxyFactory getProxyFactory();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/DefaultComponentContextFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/DefaultComponentContextFactory.java
deleted file mode 100644
index 4e43518738..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/DefaultComponentContextFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.context;
-
-import org.apache.tuscany.sca.context.ComponentContextFactory;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.context.impl.ComponentContextImpl;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.oasisopen.sca.ComponentContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DefaultComponentContextFactory implements ComponentContextFactory {
- private final ExtensionPointRegistry registry;
-
- public DefaultComponentContextFactory(ExtensionPointRegistry registry) {
- this.registry = registry;
- }
-
- public ComponentContext createComponentContext(RuntimeComponent component) {
- return new ComponentContextImpl(registry, component);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/DefaultRequestContextFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/DefaultRequestContextFactory.java
deleted file mode 100644
index ace4dc48e1..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/DefaultRequestContextFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.context;
-
-import org.apache.tuscany.sca.context.RequestContextFactory;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.context.impl.RequestContextImpl;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.oasisopen.sca.RequestContext;
-
-/**
- * Default implementation of RequestContextFactory
- */
-public class DefaultRequestContextFactory implements RequestContextFactory {
-
- public DefaultRequestContextFactory(ExtensionPointRegistry registry) {
- }
-
- public RequestContext createRequestContext(RuntimeComponent component) {
- return new RequestContextImpl(component);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/ServiceReferenceExt.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/ServiceReferenceExt.java
deleted file mode 100644
index aa1e1de0f6..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/ServiceReferenceExt.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.context;
-
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * Extended ServiceReference
- */
-public interface ServiceReferenceExt<B> extends CallableReferenceExt<B>, ServiceReference<B> {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CallableReferenceImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CallableReferenceImpl.java
deleted file mode 100644
index c2264302b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CallableReferenceImpl.java
+++ /dev/null
@@ -1,605 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.context.impl;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.UUID;
-
-import javax.xml.stream.XMLStreamReader;
-
-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.CompositeService;
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.BindingBuilderExtension;
-import org.apache.tuscany.sca.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.core.assembly.impl.CompositeActivatorImpl;
-import org.apache.tuscany.sca.core.assembly.impl.EndpointReferenceImpl;
-import org.apache.tuscany.sca.core.assembly.impl.EndpointWireImpl;
-import org.apache.tuscany.sca.core.assembly.impl.ReferenceParametersImpl;
-import org.apache.tuscany.sca.core.context.CallableReferenceExt;
-import org.apache.tuscany.sca.core.context.ComponentContextExt;
-import org.apache.tuscany.sca.core.context.CompositeContext;
-import org.apache.tuscany.sca.core.conversation.ConversationExt;
-import org.apache.tuscany.sca.core.conversation.ConversationManager;
-import org.apache.tuscany.sca.core.conversation.ConversationState;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.Conversation;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Base class for implementations of service and callback references.
- *
- * @version $Rev$ $Date$
- * @param <B> the type of the business interface
- */
-public class CallableReferenceImpl<B> implements CallableReferenceExt<B> {
- static final long serialVersionUID = -521548304761848325L;
- protected transient CompositeActivator compositeActivator;
- protected transient ProxyFactory proxyFactory;
- protected transient Class<B> businessInterface;
- protected transient Object proxy;
-
- // if the wire targets a conversational service this holds the conversation state
- protected transient ConversationManager conversationManager;
- protected transient ConversationExt conversation;
- protected transient Object conversationID;
- protected Object callbackID; // The callbackID should be serializable
-
- protected transient RuntimeComponent component;
- protected transient RuntimeComponentReference reference;
- protected transient Binding binding;
-
- protected String scdl;
-
- private transient RuntimeComponentReference clonedRef;
- private transient ReferenceParameters refParams;
- private transient XMLStreamReader xmlReader;
-
- private transient RuntimeWire endpointWire;
-
- /*
- * Public constructor for Externalizable serialization/deserialization
- */
- public CallableReferenceImpl() {
- super();
- }
-
- /*
- * Public constructor for use by XMLStreamReader2CallableReference
- */
- public CallableReferenceImpl(XMLStreamReader xmlReader) throws Exception {
- this.xmlReader = xmlReader;
- resolve();
- }
-
- protected CallableReferenceImpl(Class<B> businessInterface,
- RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding,
- ProxyFactory proxyFactory,
- CompositeActivator compositeActivator) {
- this.proxyFactory = proxyFactory;
- this.businessInterface = businessInterface;
- this.component = component;
- this.reference = reference;
- this.binding = binding;
- // FIXME: The SCA Specification is not clear how we should handle multiplicity
- // for CallableReference
- if (this.binding == null) {
- this.binding = this.reference.getBinding(SCABinding.class);
- if (this.binding == null) {
-
- // TODO: TUSCANY-2580: if the refernece doesn't have a binding yet then instead of NPE use a candidate one if its avaialable
- if (reference.getBindings() != null && reference.getBindings().size() > 0) {
- this.binding = this.reference.getBindings().get(0);
- } else {
- this.binding = this.reference.getEndpoints().get(0).getCandidateBindings().get(0);
- if (this.reference.getEndpoints().get(0).getInterfaceContract() == null) {
- this.reference.getEndpoints().get(0).setInterfaceContract(reference.getInterfaceContract());
- }
- }
- }
- }
-
- // FIXME: Should we normalize the componentName/serviceName URI into an absolute SCA URI in the SCA binding?
- // sca:component1/component11/component112/service1?
- this.compositeActivator = compositeActivator;
- this.conversationManager = this.compositeActivator.getCompositeContext().getConversationManager();
- initCallbackID();
- }
-
- public CallableReferenceImpl(Class<B> businessInterface, RuntimeWire wire, ProxyFactory proxyFactory) {
- this.proxyFactory = proxyFactory;
- this.businessInterface = businessInterface;
- bind(wire);
- }
-
- public RuntimeWire getRuntimeWire() {
- try {
- resolve();
- if (endpointWire != null) {
- return endpointWire;
- } else if (reference != null) {
- return reference.getRuntimeWire(binding);
- } else {
- return null;
- }
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- protected void bind(RuntimeWire wire) {
- if (wire != null) {
-
- if (wire instanceof EndpointWireImpl) {
- endpointWire = wire;
- }
- this.component = wire.getSource().getComponent();
- this.reference = (RuntimeComponentReference)wire.getSource().getContract();
- this.binding = wire.getSource().getBinding();
- this.compositeActivator = ((ComponentContextExt)component.getComponentContext()).getCompositeActivator();
- this.conversationManager = this.compositeActivator.getCompositeContext().getConversationManager();
- initCallbackID();
- }
- }
-
- protected void initCallbackID() {
- if (reference.getInterfaceContract() != null) {
- if (reference.getInterfaceContract().getCallbackInterface() != null) {
- this.callbackID = createCallbackID();
- }
- }
- }
-
- public B getProxy() throws ObjectCreationException {
- try {
- if (proxy == null) {
- proxy = createProxy();
- }
- return businessInterface.cast(proxy);
- } catch (Exception e) {
- throw new ObjectCreationException(e);
- }
- }
-
- public void setProxy(Object proxy) {
- this.proxy = proxy;
- }
-
- protected Object createProxy() throws Exception {
- return proxyFactory.createProxy(this);
- }
-
- public B getService() {
- try {
- resolve();
- return getProxy();
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public Class<B> getBusinessInterface() {
- try {
- resolve();
- return businessInterface;
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public boolean isConversational() {
- try {
- resolve();
- return reference == null ? false : reference.getInterfaceContract().getInterface().isConversational();
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public Conversation getConversation() {
- try {
- // resolve from XML just in case this CallableReference is the result of
- // passing a CallableReference as a parameter
- resolve();
-
- if (conversation == null || conversation.getState() == ConversationState.ENDED) {
- conversation = null;
- }
- return conversation;
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public Object getCallbackID() {
- try {
- resolve();
- return callbackID;
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- final boolean hasSCDL = in.readBoolean();
- if (hasSCDL) {
- this.scdl = in.readUTF();
- } else {
- this.scdl = null;
- }
- }
-
- /**
- * @throws IOException
- */
- private synchronized void resolve() throws Exception {
- if ((scdl != null || xmlReader != null) && component == null && reference == null) {
- CompositeContext componentContextHelper = CompositeContext.getCurrentCompositeContext();
- if (componentContextHelper != null) {
- this.compositeActivator = CompositeContext.getCurrentCompositeActivator();
- this.conversationManager = componentContextHelper.getConversationManager();
- Component c;
- if (xmlReader != null) {
- c = componentContextHelper.fromXML(xmlReader);
- xmlReader = null; // OK to GC this now
- } else {
- c = componentContextHelper.fromXML(scdl);
- scdl = null; // OK to GC this now
- }
- this.component = (RuntimeComponent)c;
- compositeActivator.configureComponentContext(this.component);
- this.reference = (RuntimeComponentReference)c.getReferences().get(0);
- this.reference.setComponent(this.component);
- clonedRef = reference;
- ReferenceParameters parameters = null;
- for (Object ext : reference.getExtensions()) {
- if (ext instanceof ReferenceParameters) {
- parameters = (ReferenceParameters)ext;
- break;
- }
- }
- if (parameters != null) {
- refParams = parameters;
- this.callbackID = parameters.getCallbackID();
- attachConversation(parameters.getConversationID());
- }
-
- for (Binding binding : reference.getBindings()) {
- if (binding instanceof OptimizableBinding) {
- // Resolve the Component
- final String bindingURI = binding.getURI();
- final Component targetComponent = resolveComponentURI(bindingURI);
-
- // Find the Service
- ComponentService targetService = resolveServiceURI(bindingURI, targetComponent);
-
- // if the target service is a promoted service then find the
- // service it promotes
- if ((targetService != null) && (targetService.getService() instanceof CompositeService)) {
- CompositeService compositeService = (CompositeService)targetService.getService();
- // Find the promoted component service
- ComponentService promotedComponentService = getPromotedComponentService(compositeService);
- if (promotedComponentService != null && !promotedComponentService.isUnresolved()) {
- targetService = promotedComponentService;
- }
- }
-
- OptimizableBinding optimizableBinding = (OptimizableBinding)binding;
- optimizableBinding.setTargetComponent(targetComponent);
- optimizableBinding.setTargetComponentService(targetService);
- if (targetService != null) {
- for (Binding serviceBinding : targetService.getBindings()) {
- if (serviceBinding.getClass() == binding.getClass()) {
- optimizableBinding.setTargetBinding(serviceBinding);
- break;
- }
- }
- }
- }
- }
- // FIXME: The SCA Specification is not clear how we should handle multiplicity
- // for CallableReference
- if (binding == null) {
- binding = reference.getBinding(SCABinding.class);
- if (binding == null) {
- binding = reference.getBindings().get(0);
- }
- }
- Interface i = reference.getInterfaceContract().getInterface();
- if (i instanceof JavaInterface) {
- JavaInterface javaInterface = (JavaInterface)i;
- if (javaInterface.isUnresolved()) {
- // Allow privileged access to get ClassLoader. Requires RuntimePermission in
- // security policy.
- ClassLoader classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- return Thread.currentThread().getContextClassLoader();
- }
- });
- javaInterface.setJavaClass(classLoader.loadClass(javaInterface.getName()));
- compositeActivator.getCompositeContext().getJavaInterfaceFactory()
- .createJavaInterface(javaInterface, javaInterface.getJavaClass());
- //FIXME: If the interface needs XSDs to be loaded (e.g., for static SDO),
- // this needs to be done here. We usually search for XSDs in the current
- // contribution at resolve time. Is it possible to locate the current
- // contribution at runtime?
- }
- this.businessInterface = (Class<B>)javaInterface.getJavaClass();
- }
- if (binding instanceof BindingBuilderExtension) {
- ((BindingBuilderExtension)binding).getBuilder().build(component, reference, binding, null);
- }
- this.proxyFactory = compositeActivator.getCompositeContext().getProxyFactory();
- }
- } else {
- this.compositeActivator = CompositeContext.getCurrentCompositeActivator();
- if (this.compositeActivator != null) {
- this.proxyFactory = this.compositeActivator.getCompositeContext().getProxyFactory();
- }
- }
- }
-
- /**
- * Follow a service promotion chain down to the inner most (non composite)
- * component service.
- *
- * @param topCompositeService
- * @return
- */
- private ComponentService getPromotedComponentService(CompositeService compositeService) {
- ComponentService componentService = compositeService.getPromotedService();
- if (componentService != null) {
- Service service = componentService.getService();
- if (componentService.getName() != null && service instanceof CompositeService) {
-
- // Continue to follow the service promotion chain
- return getPromotedComponentService((CompositeService)service);
-
- } else {
-
- // Found a non-composite service
- return componentService;
- }
- } else {
-
- // No promoted service
- return null;
- }
- }
-
- /**
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- try {
- final String xml = toXMLString();
- if (xml == null) {
- out.writeBoolean(false);
- } else {
- out.writeBoolean(true);
- out.writeUTF(xml);
- }
- } catch (Exception e) {
- // e.printStackTrace();
- throw new IOException(e.toString());
- }
- }
-
- public String toXMLString() throws IOException {
- if (reference != null) {
- if (clonedRef == null) {
- try {
- clonedRef = (RuntimeComponentReference)reference.clone();
- } catch (CloneNotSupportedException e) {
- // will not happen
- }
- }
- if (refParams == null) {
- refParams = new ReferenceParametersImpl();
-
- // remove any existing reference parameters from the clone
- Object toRemove = null;
- for (Object extension : clonedRef.getExtensions()) {
- if (extension instanceof ReferenceParameters) {
- toRemove = extension;
- }
- }
-
- if (toRemove != null) {
- clonedRef.getExtensions().remove(toRemove);
- }
-
- // add the new reference parameter object
- clonedRef.getExtensions().add(refParams);
- }
- refParams.setCallbackID(callbackID);
- if (conversation != null) {
- refParams.setConversationID(conversation.getConversationID());
- }
- return ((CompositeActivatorImpl)compositeActivator).getCompositeContext().toXML(component, clonedRef);
- } else {
- return scdl;
- }
- }
-
- /**
- * Create a callback id
- *
- * @return the callback id
- */
- private String createCallbackID() {
- return UUID.randomUUID().toString();
- }
-
- public void attachCallbackID(Object callbackID) {
- this.callbackID = callbackID;
- }
-
- public void attachConversationID(Object conversationID) {
- this.conversationID = conversationID;
- }
-
- public void attachConversation(ConversationExt conversation) {
- this.conversation = conversation;
- }
-
- public void attachConversation(Object conversationID) {
- if (conversationID != null) {
- ConversationExt conversation = conversationManager.getConversation(conversationID);
- if (conversation == null) {
- conversation = conversationManager.startConversation(conversationID);
- }
- this.conversation = conversation;
- } else {
- this.conversation = null;
- }
- }
-
- protected ReferenceParameters getReferenceParameters() {
- ReferenceParameters parameters = new ReferenceParametersImpl();
- parameters.setCallbackID(callbackID);
- if (getConversation() != null) {
- parameters.setConversationID(conversation.getConversationID());
- }
- return parameters;
- }
-
- public EndpointReference getEndpointReference() {
- try {
- resolve();
-
- // Use the interface contract of the reference on the component type
- Reference componentTypeRef = reference.getReference();
- InterfaceContract sourceContract =
- componentTypeRef == null ? reference.getInterfaceContract() : componentTypeRef.getInterfaceContract();
- sourceContract = sourceContract.makeUnidirectional(false);
- EndpointReference epr = new EndpointReferenceImpl(component, reference, binding, sourceContract);
- ReferenceParameters parameters = getReferenceParameters();
- epr.setReferenceParameters(parameters);
- return epr;
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public XMLStreamReader getXMLReader() {
- return xmlReader;
- }
-
- /**
- * Resolves the specified URI to a Component using the compositeActivator.
- * There are two cases that we need to handle:
- * <ul>
- * <li>URI containing just Composite name(s) (i.e. no Service name specified)
- * <li>URI containing Composite name(s) and a Service Name
- * </ul>
- *
- * @param componentURI The URI of the Component to resolve
- * @return The Component for the specified URI or null if not founds
- */
- protected Component resolveComponentURI(String componentURI) {
- // If the URI has come from a binding, it may well start with a '/'. We will need
- // to remove this so we can match it to the composite names.
- if (componentURI.startsWith("/")) {
- componentURI = componentURI.substring(1);
- }
-
- // First assume that we are dealing with a Component URI without a Service Name
- Component component = compositeActivator.resolve(componentURI);
- if (component != null) {
- return component;
- }
-
- // Perhaps we have a ComponentURI that has a ServiceName on the end of it
- final int index = componentURI.lastIndexOf('/');
- if (index > -1) {
- componentURI = componentURI.substring(0, index);
- return compositeActivator.resolve(componentURI);
- }
-
- // We could not resolve the Component URI
- return null;
- }
-
- /**
- * Examines the Services on the specified Component and returns the Service that matches the
- * specified Binding URI.
- *
- * @param bindingURI The Binding URI to resolve on the Component
- * @param targetComponent The Component containing the Services
- * @return The Service with the specified serviceName or null if no such Service found.
- */
- protected ComponentService resolveServiceURI(String bindingURI, Component targetComponent) {
-
- ComponentService targetService = null;
-
- if (targetComponent != null) {
- if (bindingURI.startsWith("/")) {
- bindingURI = bindingURI.substring(1);
- }
-
- final String componentURI = targetComponent.getURI();
- final String serviceName;
- if (componentURI.equals(bindingURI)) {
- // No service specified
- serviceName = "";
- } else {
- // Get the Service name from the Binding URI
- serviceName = bindingURI.substring(componentURI.length() + 1);
- }
-
- if ("".equals(serviceName)) {
- targetService = CompositeContext.getSingleService(targetComponent);
- } else {
- for (ComponentService service : targetComponent.getServices()) {
- if (service.getName().equals(serviceName)) {
- targetService = service;
- break;
- }
- }
- }
- }
-
- return targetService;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
deleted file mode 100644
index d935f6b93a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.context.impl;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.context.ContextFactoryExtensionPoint;
-import org.apache.tuscany.sca.context.PropertyValueFactory;
-import org.apache.tuscany.sca.context.RequestContextFactory;
-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.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.core.context.ComponentContextExt;
-import org.apache.tuscany.sca.core.context.CompositeContext;
-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.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Implementation of ComponentContext that delegates to a ComponentContextProvider.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentContextImpl implements ComponentContextExt {
- private final RuntimeComponent component;
-
- private final CompositeActivator compositeActivator;
- private final RequestContextFactory requestContextFactory;
- private final ProxyFactory proxyFactory;
- private final AssemblyFactory assemblyFactory;
- private final JavaInterfaceFactory javaInterfaceFactory;
- private final PropertyValueFactory propertyFactory;
-
- public ComponentContextImpl(ExtensionPointRegistry registry, RuntimeComponent component) {
- this.component = component;
- FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
- this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
- this.javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
- UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
- this.compositeActivator = utilities.getUtility(CompositeActivator.class);
- this.requestContextFactory =
- registry.getExtensionPoint(ContextFactoryExtensionPoint.class).getFactory(RequestContextFactory.class);
- this.proxyFactory = new ExtensibleProxyFactory(registry.getExtensionPoint(ProxyFactoryExtensionPoint.class));
- this.propertyFactory = factories.getFactory(PropertyValueFactory.class);
- }
-
- public String getURI() {
- return component.getURI();
- }
-
- public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
- return (R)proxyFactory.cast(target);
- }
-
- public <B> B getService(Class<B> businessInterface, String referenceName) {
- ServiceReference<B> serviceRef = getServiceReference(businessInterface, referenceName);
- return serviceRef.getService();
- }
-
- public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName) {
- try {
- for (ComponentReference ref : component.getReferences()) {
- if (referenceName.equals(ref.getName())) {
- /* ******************** Contribution for issue TUSCANY-2281 ******************** */
- Multiplicity multiplicity = ref.getMultiplicity();
- if (multiplicity == Multiplicity.ZERO_N || multiplicity == Multiplicity.ONE_N) {
- throw new IllegalArgumentException("Reference " + referenceName
- + " has multiplicity "
- + multiplicity);
- }
- /* ******************** Contribution for issue TUSCANY-2281 ******************** */
-
- return getServiceReference(businessInterface, (RuntimeComponentReference)ref, null);
- }
- }
- throw new ServiceRuntimeException("Reference not found: " + referenceName);
- } catch (ServiceRuntimeException e) {
- throw e;
- } catch (Exception e) {
- throw new ServiceRuntimeException(e.getMessage(), e);
- }
- }
-
- /**
- * Gets the value for the specified property with the specified type.
- *
- * @param type The type of the property value we are getting
- * @param propertyName The name of the property we are getting
- * @param B The class of the property value we are getting
- *
- * @throws ServiceRuntimeException If a Property for the specified propertyName
- * is not found
- *
- * @see #setPropertyValueFactory(PropertyValueFactory)
- */
- public <B> B getProperty(Class<B> type, String propertyName) {
- for (ComponentProperty p : component.getProperties()) {
- if (propertyName.equals(p.getName())) {
- return propertyFactory.createPropertyValue(p, type);
- }
- }
- throw new ServiceRuntimeException("Property not found: " + propertyName);
- }
-
- public <B> ServiceReference<B> createSelfReference(Class<B> businessInterface) {
- ComponentService service = CompositeContext.getSingleService(component);
- try {
- return createSelfReference(businessInterface, service);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e.getMessage(), e);
- }
- }
-
- public <B> ServiceReference<B> createSelfReference(Class<B> businessInterface, String serviceName) {
- try {
- for (ComponentService service : component.getServices()) {
- if (serviceName.equals(service.getName())) {
- return createSelfReference(businessInterface, service);
- }
- }
- throw new ServiceRuntimeException("Service not found: " + serviceName);
- } catch (ServiceRuntimeException e) {
- throw e;
- } catch (Exception e) {
- throw new ServiceRuntimeException(e.getMessage(), e);
- }
- }
-
- /**
- * @param <B>
- * @param businessInterface
- * @param service
- * @return
- */
- public <B> ServiceReference<B> createSelfReference(Class<B> businessInterface, ComponentService service) {
- try {
- RuntimeComponentReference ref =
- (RuntimeComponentReference)createSelfReference(component, service, businessInterface);
- ref.setComponent(component);
- return getServiceReference(businessInterface, ref, null);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public RequestContext getRequestContext() {
- if (requestContextFactory != null) {
- return requestContextFactory.createRequestContext(component);
- } else {
- return new RequestContextImpl(component);
- }
- }
-
- /**
- * @param businessInterface
- * @param reference
- * @return
- * @throws CloneNotSupportedException
- * @throws InvalidInterfaceException
- */
- public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface,
- RuntimeComponentReference reference,
- Binding binding) {
- try {
- RuntimeComponentReference ref = (RuntimeComponentReference)reference;
- InterfaceContract interfaceContract = reference.getInterfaceContract();
- Reference componentTypeReference = reference.getReference();
- if (componentTypeReference != null && componentTypeReference.getInterfaceContract() != null) {
- interfaceContract = componentTypeReference.getInterfaceContract();
- }
- InterfaceContract refInterfaceContract = getInterfaceContract(interfaceContract, businessInterface);
- if (refInterfaceContract != interfaceContract) {
- ref = (RuntimeComponentReference)reference.clone();
- if (interfaceContract != null) {
- ref.setInterfaceContract(interfaceContract);
- } else {
- ref.setInterfaceContract(refInterfaceContract);
- }
- }
- ref.setComponent(component);
- return new ServiceReferenceImpl<B>(businessInterface, component, ref, binding, proxyFactory,
- compositeActivator);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * Bind a component reference to a component service
- * @param <B>
- * @param businessInterface
- * @param reference
- * @param service
- * @return
- * @throws CloneNotSupportedException
- * @throws InvalidInterfaceException
- */
- public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface,
- RuntimeComponentReference reference,
- RuntimeComponent component,
- RuntimeComponentService service) {
- try {
- RuntimeComponentReference ref = (RuntimeComponentReference)reference.clone();
- InterfaceContract interfaceContract = reference.getInterfaceContract();
- Reference componentTypeReference = reference.getReference();
- if (componentTypeReference != null && componentTypeReference.getInterfaceContract() != null) {
- interfaceContract = componentTypeReference.getInterfaceContract();
- }
- InterfaceContract refInterfaceContract = getInterfaceContract(interfaceContract, businessInterface);
- if (refInterfaceContract != interfaceContract) {
- ref = (RuntimeComponentReference)reference.clone();
- ref.setInterfaceContract(interfaceContract);
- }
- ref.getTargets().add(service);
- ref.getBindings().clear();
- for (Binding binding : service.getBindings()) {
- if (binding instanceof OptimizableBinding) {
- OptimizableBinding optimizableBinding = (OptimizableBinding)((OptimizableBinding)binding).clone();
- optimizableBinding.setTargetBinding(binding);
- optimizableBinding.setTargetComponent(component);
- optimizableBinding.setTargetComponentService(service);
- ref.getBindings().add(optimizableBinding);
- } else {
- ref.getBindings().add(binding);
- }
- }
- return new ServiceReferenceImpl<B>(businessInterface, component, ref, proxyFactory, compositeActivator);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public <B> CallableReference<B> getCallableReference(Class<B> businessInterface,
- RuntimeComponent component,
- RuntimeComponentService service) {
- try {
- if (businessInterface == null) {
- InterfaceContract contract = service.getInterfaceContract();
- businessInterface = (Class<B>)((JavaInterface)contract.getInterface()).getJavaClass();
- }
- RuntimeComponentReference ref =
- (RuntimeComponentReference)createSelfReference(component, service, businessInterface);
- ref.setComponent(component);
- return new CallableReferenceImpl<B>(businessInterface, component, ref, null, proxyFactory,
- compositeActivator);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * Create a self-reference for a component service
- * @param component
- * @param service
- * @throws CloneNotSupportedException
- * @throws InvalidInterfaceException
- */
- private ComponentReference createSelfReference(Component component,
- ComponentService service,
- Class<?> businessInterface) throws CloneNotSupportedException,
- InvalidInterfaceException {
- ComponentReference componentReference = assemblyFactory.createComponentReference();
- componentReference.setName("$self$." + service.getName());
- for (Binding binding : service.getBindings()) {
- if (binding instanceof OptimizableBinding) {
- OptimizableBinding optimizableBinding = (OptimizableBinding)((OptimizableBinding)binding).clone();
- optimizableBinding.setTargetBinding(binding);
- optimizableBinding.setTargetComponent(component);
- optimizableBinding.setTargetComponentService(service);
- componentReference.getBindings().add(optimizableBinding);
- } else {
- componentReference.getBindings().add(binding);
- }
- }
-
- componentReference.setCallback(service.getCallback());
- componentReference.getTargets().add(service);
- componentReference.getPolicySets().addAll(service.getPolicySets());
- componentReference.getRequiredIntents().addAll(service.getRequiredIntents());
-
- InterfaceContract interfaceContract = service.getInterfaceContract();
- Service componentTypeService = service.getService();
- if (componentTypeService != null && componentTypeService.getInterfaceContract() != null) {
- interfaceContract = componentTypeService.getInterfaceContract();
- }
- interfaceContract = getInterfaceContract(interfaceContract, businessInterface);
- componentReference.setInterfaceContract(interfaceContract);
- componentReference.setMultiplicity(Multiplicity.ONE_ONE);
- // component.getReferences().add(componentReference);
- return componentReference;
- }
-
- /**
- * @param interfaceContract
- * @param businessInterface
- * @return
- * @throws CloneNotSupportedException
- * @throws InvalidInterfaceException
- */
- private InterfaceContract getInterfaceContract(InterfaceContract interfaceContract, Class<?> businessInterface)
- throws CloneNotSupportedException, InvalidInterfaceException {
- boolean compatible = false;
- if (interfaceContract != null && interfaceContract.getInterface() != null) {
- Interface interfaze = interfaceContract.getInterface();
- if (interfaze instanceof JavaInterface) {
- Class<?> cls = ((JavaInterface)interfaze).getJavaClass();
- if (businessInterface.isAssignableFrom(cls)) {
- compatible = true;
- }
- }
- }
-
- if (!compatible) {
- // The interface is not assignable from the interface contract
- interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(businessInterface);
- interfaceContract.setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- interfaceContract.setCallbackInterface(javaInterfaceFactory.createJavaInterface(callInterface
- .getCallbackClass()));
- }
- }
-
- return interfaceContract;
- }
-
- /**
- * @return the compositeActivator
- */
- public CompositeActivator getCompositeActivator() {
- return compositeActivator;
- }
-
- /**
- * @see org.apache.tuscany.sca.runtime.RuntimeComponentContext#start(org.apache.tuscany.sca.runtime.RuntimeComponentReference)
- */
- public void start(RuntimeComponentReference reference) {
- compositeActivator.start(component, reference);
- }
-
- /**
- * @see org.apache.tuscany.sca.runtime.RuntimeComponentContext#read(java.io.Reader)
- */
- public RuntimeComponent read(Reader reader) throws IOException {
- RuntimeComponent component = compositeActivator.getCompositeContext().read(reader);
- compositeActivator.configureComponentContext(component);
- return component;
- }
-
- /**
- * @see org.apache.tuscany.sca.runtime.RuntimeComponentContext#write(org.apache.tuscany.sca.runtime.RuntimeComponentReference, java.io.Writer)
- */
- public void write(RuntimeComponentReference reference, Writer writer) throws IOException {
- compositeActivator.getCompositeContext().write(component, reference, writer);
- }
-
- /* ******************** Contribution for issue TUSCANY-2281 ******************** */
-
- /**
- * @see ComponentContext#getServices(Class<B>, String)
- */
- public <B> Collection<B> getServices(Class<B> businessInterface, String referenceName) {
- ArrayList<B> services = new ArrayList<B>();
- Collection<ServiceReference<B>> serviceRefs = getServiceReferences(businessInterface, referenceName);
- for (ServiceReference<B> serviceRef : serviceRefs) {
- services.add(serviceRef.getService());
- }
- return services;
- }
-
- /**
- * @see ComponentContext#getServiceReferences(Class<B>, String)
- */
- public <B> Collection<ServiceReference<B>> getServiceReferences(Class<B> businessInterface, String referenceName) {
- try {
- for (ComponentReference ref : component.getReferences()) {
- if (referenceName.equals(ref.getName())) {
- ArrayList<ServiceReference<B>> serviceRefs = new ArrayList<ServiceReference<B>>();
- for (Binding binding : ref.getBindings()) {
- serviceRefs
- .add(getServiceReference(businessInterface, (RuntimeComponentReference)ref, binding));
- }
- return serviceRefs;
- }
- }
- throw new ServiceRuntimeException("Reference not found: " + referenceName);
- } catch (ServiceRuntimeException e) {
- throw e;
- } catch (Exception e) {
- throw new ServiceRuntimeException(e.getMessage(), e);
- }
- }
- /* ******************** Contribution for issue TUSCANY-2281 ******************** */
-
- public CompositeContext getCompositeContext() {
- return compositeActivator.getCompositeContext();
- }
-
- public ExtensionPointRegistry getExtensionPointRegistry() {
- return getCompositeContext().getExtensionPointRegistry();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CompositeContextImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CompositeContextImpl.java
deleted file mode 100644
index 06a667f951..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/CompositeContextImpl.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.context.impl;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-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.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-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.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.core.context.CompositeContext;
-import org.apache.tuscany.sca.core.conversation.ConversationManager;
-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.core.invocation.ThreadMessageContext;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CompositeContextImpl extends CompositeContext {
- private final ExtensionPointRegistry extensionPointRegistry;
- private final UtilityExtensionPoint utilityExtensionPoint;
- private final AssemblyFactory assemblyFactory;
- private final JavaInterfaceFactory javaInterfaceFactory;
- private final StAXArtifactProcessorExtensionPoint staxProcessors;
- private final XMLInputFactory xmlInputFactory;
- private final XMLOutputFactory xmlOutputFactory;
- private final ProxyFactory proxyFactory;
-
- public CompositeContextImpl(ExtensionPointRegistry registry) {
- this.extensionPointRegistry = registry;
- this.utilityExtensionPoint = extensionPointRegistry.getExtensionPoint(UtilityExtensionPoint.class);
- FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
- this.xmlInputFactory = factories.getFactory(XMLInputFactory.class);
- this.xmlOutputFactory = factories.getFactory(XMLOutputFactory.class);
- this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
- this.javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
- this.staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- ProxyFactoryExtensionPoint proxyFactories = extensionPointRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class);
- this.proxyFactory = new ExtensibleProxyFactory(proxyFactories);
- }
-
- /**
- * Create a self-reference for a component service
- * @param component
- * @param service
- * @throws CloneNotSupportedException
- * @throws InvalidInterfaceException
- */
- public ComponentReference createSelfReference(Component component,
- ComponentService service,
- Class<?> businessInterface) throws CloneNotSupportedException,
- InvalidInterfaceException {
- ComponentReference componentReference = assemblyFactory.createComponentReference();
- componentReference.setName("$self$." + service.getName());
- for (Binding binding : service.getBindings()) {
- if (binding instanceof OptimizableBinding) {
- OptimizableBinding optimizableBinding = (OptimizableBinding)((OptimizableBinding)binding).clone();
- optimizableBinding.setTargetBinding(binding);
- optimizableBinding.setTargetComponent(component);
- optimizableBinding.setTargetComponentService(service);
- componentReference.getBindings().add(optimizableBinding);
- } else {
- componentReference.getBindings().add(binding);
- }
- }
-
- componentReference.setCallback(service.getCallback());
- componentReference.getTargets().add(service);
- componentReference.getPolicySets().addAll(service.getPolicySets());
- componentReference.getRequiredIntents().addAll(service.getRequiredIntents());
-
- InterfaceContract interfaceContract = service.getInterfaceContract();
- Service componentTypeService = service.getService();
- if (componentTypeService != null && componentTypeService.getInterfaceContract() != null) {
- interfaceContract = componentTypeService.getInterfaceContract();
- }
- interfaceContract = getInterfaceContract(interfaceContract, businessInterface);
- componentReference.setInterfaceContract(interfaceContract);
- componentReference.setMultiplicity(Multiplicity.ONE_ONE);
- // component.getReferences().add(componentReference);
- return componentReference;
- }
-
- /**
- * @param interfaceContract
- * @param businessInterface
- * @return
- * @throws CloneNotSupportedException
- * @throws InvalidInterfaceException
- */
- private InterfaceContract getInterfaceContract(InterfaceContract interfaceContract, Class<?> businessInterface)
- throws CloneNotSupportedException, InvalidInterfaceException {
- Interface interfaze = interfaceContract.getInterface();
- boolean compatible = false;
- if (interfaze instanceof JavaInterface) {
- Class<?> cls = ((JavaInterface)interfaze).getJavaClass();
- if (businessInterface.isAssignableFrom(cls)) {
- compatible = true;
- }
- }
- if (!compatible) {
- // The interface is not assignable from the interface contract
- interfaceContract = (InterfaceContract)interfaceContract.clone();
- interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(businessInterface));
- }
-
- return interfaceContract;
- }
-
- /**
- * Bind a component reference to a component service
- * @param <B>
- * @param businessInterface
- * @param reference
- * @param service
- * @return
- * @throws CloneNotSupportedException
- * @throws InvalidInterfaceException
- */
- public RuntimeComponentReference bindComponentReference(Class<?> businessInterface,
- RuntimeComponentReference reference,
- RuntimeComponent component,
- RuntimeComponentService service)
- throws CloneNotSupportedException, InvalidInterfaceException {
- RuntimeComponentReference ref = (RuntimeComponentReference)reference.clone();
- InterfaceContract interfaceContract = reference.getInterfaceContract();
- Reference componentTypeReference = reference.getReference();
- if (componentTypeReference != null && componentTypeReference.getInterfaceContract() != null) {
- interfaceContract = componentTypeReference.getInterfaceContract();
- }
- InterfaceContract refInterfaceContract = getInterfaceContract(interfaceContract, businessInterface);
- if (refInterfaceContract != interfaceContract) {
- ref = (RuntimeComponentReference)reference.clone();
- ref.setInterfaceContract(interfaceContract);
- }
- ref.setComponent(component);
- ref.getTargets().add(service);
- ref.getBindings().clear();
- for (Binding binding : service.getBindings()) {
- if (binding instanceof OptimizableBinding) {
- OptimizableBinding optimizableBinding = (OptimizableBinding)((OptimizableBinding)binding).clone();
- optimizableBinding.setTargetBinding(binding);
- optimizableBinding.setTargetComponent(component);
- optimizableBinding.setTargetComponentService(service);
- ref.getBindings().add(optimizableBinding);
- } else {
- ref.getBindings().add(binding);
- }
- }
- return ref;
- }
-
- public void write(Component component, ComponentReference reference, Writer writer) throws IOException {
- write(component, reference, null, writer);
- }
-
- public void write(Component component, ComponentReference reference, ComponentService service, Writer writer) throws IOException {
- try {
- StAXArtifactProcessor<Composite> processor = staxProcessors.getProcessor(Composite.class);
- Composite composite = assemblyFactory.createComposite();
- composite.setName(new QName("http://tuscany.apache.org/xmlns/sca/1.0", "default"));
- Component comp = assemblyFactory.createComponent();
- comp.setName("default");
- comp.setURI(component.getURI());
- composite.getComponents().add(comp);
- if (reference != null) {
- comp.getReferences().add(reference);
- }
- if (service != null) {
- comp.getServices().add(service);
- }
-
- XMLStreamWriter streamWriter = xmlOutputFactory.createXMLStreamWriter(writer);
- processor.write(composite, streamWriter);
- } catch (Exception e) {
- throw new IOException(e.getMessage());
- }
- }
-
- public String toXML(Component component, ComponentReference reference) throws IOException {
- StringWriter writer = new StringWriter();
- write(component, reference, writer);
- return writer.toString();
- }
-
- public String toXML(Component component, ComponentService service) throws IOException {
- StringWriter writer = new StringWriter();
- write(component, null, service, writer);
- return writer.toString();
- }
-
- public RuntimeComponent read(Reader reader) throws IOException {
- try {
- XMLStreamReader streamReader = xmlInputFactory.createXMLStreamReader(reader);
- return read(streamReader);
- } catch (Exception e) {
- throw new IOException(e.getMessage());
- }
- }
-
- public RuntimeComponent read(XMLStreamReader streamReader) throws IOException {
- try {
- StAXArtifactProcessor<Composite> processor = staxProcessors.getProcessor(Composite.class);
- Composite composite = processor.read(streamReader);
- RuntimeComponent component = (RuntimeComponent)composite.getComponents().get(0);
- return component;
- } catch (Exception e) {
- throw new IOException(e.getMessage());
- }
- }
-
- public Component fromXML(String xml) throws IOException {
- return read(new StringReader(xml));
- }
-
- public Component fromXML(XMLStreamReader streamReader) throws IOException {
- return read(streamReader);
- }
-
- public static RuntimeComponent getCurrentComponent() {
- Message message = ThreadMessageContext.getMessageContext();
- if (message != null) {
- EndpointReference to = message.getTo();
- if (to == null) {
- return null;
- }
- RuntimeComponent component = message.getTo().getComponent();
- return component;
- }
- return null;
- }
-
- public static CompositeActivator getCurrentCompositeActivator() {
- RuntimeComponent component = getCurrentComponent();
- if (component != null) {
- ComponentContextImpl context = (ComponentContextImpl)component.getComponentContext();
- return context.getCompositeActivator();
- }
- return null;
- }
-
- public static CompositeContext getCurrentCompositeContext() {
- CompositeActivator activator = getCurrentCompositeActivator();
- if (activator != null) {
- return activator.getCompositeContext();
- }
- return null;
- }
-
- /**
- * @param component
- */
- public static ComponentService getSingleService(Component component) {
- ComponentService targetService;
- List<ComponentService> services = component.getServices();
- List<ComponentService> regularServices = new ArrayList<ComponentService>();
- for (ComponentService service : services) {
- if (service.isCallback()) {
- continue;
- }
- String name = service.getName();
- if (!name.startsWith("$") || name.startsWith("$dynamic$")) {
- regularServices.add(service);
- }
- }
- if (regularServices.size() == 0) {
- throw new ServiceRuntimeException("No service is declared on component " + component.getURI());
- }
- if (regularServices.size() != 1) {
- throw new ServiceRuntimeException("More than one service is declared on component " + component.getURI()
- + ". Service name is required to get the service.");
- }
- targetService = regularServices.get(0);
- return targetService;
- }
-
- public ExtensionPointRegistry getExtensionPointRegistry() {
- return extensionPointRegistry;
- }
-
- public ConversationManager getConversationManager() {
- return utilityExtensionPoint.getUtility(ConversationManager.class);
- }
-
- /**
- * Get the java interface factory
- * @return
- */
- public JavaInterfaceFactory getJavaInterfaceFactory() {
- return javaInterfaceFactory;
- }
-
- /**
- * Get the proxy factory
- * @return
- */
- public ProxyFactory getProxyFactory() {
- return proxyFactory;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java
deleted file mode 100644
index 015c80c6fa..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.context.impl;
-
-import java.util.List;
-
-import javax.security.auth.Subject;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.context.CallableReferenceExt;
-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.core.invocation.ThreadMessageContext;
-import org.apache.tuscany.sca.core.invocation.impl.CallbackReferenceImpl;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.RequestContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class RequestContextImpl implements RequestContext {
-
- private ProxyFactoryExtensionPoint proxyFactoryExtensionPoint;
-
- public RequestContextImpl(RuntimeComponent component) {
- ExtensionPointRegistry registry = component.getComponentContext().getExtensionPointRegistry();
- proxyFactoryExtensionPoint = registry.getExtensionPoint(ProxyFactoryExtensionPoint.class);
- }
-
- public Subject getSecuritySubject() {
- Subject subject = null;
-
- for (Object header : ThreadMessageContext.getMessageContext().getHeaders()){
- if (header instanceof Subject){
- subject = (Subject)header;
- break;
- }
- }
- return subject;
- }
-
- public String getServiceName() {
- return ThreadMessageContext.getMessageContext().getTo().getContract().getName();
- }
-
- public <B> CallableReference<B> getServiceReference() {
- Message msgContext = ThreadMessageContext.getMessageContext();
- // FIXME: [rfeng] Is this the service reference matching the caller side?
- EndpointReference to = msgContext.getTo();
- RuntimeComponentService service = (RuntimeComponentService) to.getContract();
- RuntimeComponent component = (RuntimeComponent) to.getComponent();
-
- CallableReference<B> callableReference = component.getComponentContext().getCallableReference(null, component, service);
- ReferenceParameters parameters = msgContext.getFrom().getReferenceParameters();
- ((CallableReferenceExt<B>) callableReference).attachCallbackID(parameters.getCallbackID());
- ((CallableReferenceExt<B>) callableReference).attachConversation(parameters.getConversationID());
- return callableReference;
- }
-
- public <CB> CB getCallback() {
- CallableReference<CB> cb = getCallbackReference();
- if (cb == null) {
- return null;
- }
- return cb.getService();
- }
-
- @SuppressWarnings("unchecked")
- public <CB> CallableReference<CB> getCallbackReference() {
- Message msgContext = ThreadMessageContext.getMessageContext();
- EndpointReference to = msgContext.getTo();
- RuntimeComponentService service = (RuntimeComponentService) to.getContract();
- RuntimeComponentReference callbackReference = (RuntimeComponentReference)service.getCallbackReference();
- if (callbackReference == null) {
- return null;
- }
- JavaInterface javaInterface = (JavaInterface) callbackReference.getInterfaceContract().getInterface();
- Class<CB> javaClass = (Class<CB>)javaInterface.getJavaClass();
- List<RuntimeWire> wires = callbackReference.getRuntimeWires();
- ProxyFactory proxyFactory = new ExtensibleProxyFactory(proxyFactoryExtensionPoint);
- CallbackReferenceImpl ref = CallbackReferenceImpl.newInstance(javaClass, proxyFactory, wires);
- if (ref != null) {
- //ref.resolveTarget();
- ReferenceParameters parameters = msgContext.getFrom().getReferenceParameters();
- ref.attachCallbackID(parameters.getCallbackID());
- if (ref.getConversation() != null) {
- ref.attachConversationID(parameters.getConversationID());
- }
- }
- return ref;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java
deleted file mode 100644
index 8aec07ceda..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.context.impl;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.core.context.CallableReferenceExt;
-import org.apache.tuscany.sca.core.context.ServiceReferenceExt;
-import org.apache.tuscany.sca.core.conversation.ConversationState;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * Default implementation of a ServiceReference.
- *
- * @version $Rev$ $Date$
- * @param <B> the type of the business interface
- */
-public class ServiceReferenceImpl<B> extends CallableReferenceImpl<B> implements ServiceReferenceExt<B> {
- private static final long serialVersionUID = 6763709434194361540L;
-
- protected transient Object callback;
-
- /*
- * Public constructor for Externalizable serialization/deserialization
- */
- public ServiceReferenceImpl() {
- super();
- }
-
- /*
- * Public constructor for use by XMLStreamReader2CallableReference
- */
- public ServiceReferenceImpl(XMLStreamReader xmlReader) throws Exception {
- super(xmlReader);
- }
-
- /**
- * @param businessInterface
- * @param wire
- * @param proxyFactory
- */
- public ServiceReferenceImpl(Class<B> businessInterface, RuntimeWire wire, ProxyFactory proxyFactory) {
- super(businessInterface, wire, proxyFactory);
- }
-
- public ServiceReferenceImpl(Class<B> businessInterface,
- RuntimeComponent component,
- RuntimeComponentReference reference,
- ProxyFactory proxyFactory,
- CompositeActivator compositeActivator) {
- super(businessInterface, component, reference, null, proxyFactory, compositeActivator);
- }
-
- public ServiceReferenceImpl(Class<B> businessInterface,
- RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding,
- ProxyFactory proxyFactory,
- CompositeActivator compositeActivator) {
- super(businessInterface, component, reference, binding, proxyFactory, compositeActivator);
- }
-
- public Object getConversationID() {
- return conversationID;
- }
-
- public void setConversationID(Object conversationID) throws IllegalStateException {
- if (conversation == null || conversation.getState() != ConversationState.ENDED) {
- this.conversationID = conversationID;
- this.conversation = null;
- } else {
- throw new IllegalStateException("Trying to set the conversationId on a service reference but the state of the conversation "
- + conversation.getConversationID()
- + " is "
- + conversation.getState());
- }
- }
-
- public void setCallbackID(Object callbackID) {
- this.callbackID = callbackID;
- }
-
- public Object getCallback() {
- return callback;
- }
-
- public void setCallback(Object callback) {
- if (callback != null && !(callback instanceof CallableReference)) {
- //FIXME: need to check if callback object supports the callback interface
- // returned by reference.getInterfaceContract().getCallbackInterface()
- }
- this.callback = callback;
- }
-
- @Override
- protected ReferenceParameters getReferenceParameters() {
- ReferenceParameters parameters = super.getReferenceParameters();
- if (callback != null) {
- if (callback instanceof ServiceReference) {
- EndpointReference callbackRef = ((CallableReferenceExt)callback).getEndpointReference();
- parameters.setCallbackReference(callbackRef);
- } else {
- EndpointReference callbackRef = getRuntimeWire().getSource().getCallbackEndpoint();
- parameters.setCallbackReference(callbackRef);
- parameters.setCallbackObjectID(callback);
- }
- }
- return parameters;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationExt.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationExt.java
deleted file mode 100644
index 9182b080fe..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationExt.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.conversation;
-
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.oasisopen.sca.Conversation;
-
-/**
- * An extended interface over org.oasisopen.Conversation
- *
- * @version $Rev$ $Date$
- */
-public interface ConversationExt extends Conversation {
- /**
- * Get the state of a conversation
- * @return The state
- */
- ConversationState getState();
-
- /**
- * @param state the state to set
- */
- void setState(ConversationState state);
-
- /**
- * @param conversationID the conversationID to set
- */
- void setConversationID(Object conversationID);
-
-
- /**
- * will check whether this conversation has expired and update state if it has
- * @return true if it has expired
- */
- boolean isExpired();
-
- /**
- * updates the last time this conversation was referenced
- */
- void updateLastReferencedTime();
-
- void initializeConversationAttributes(RuntimeComponent targetComponent);
-
-
- /**
- * @return true if the conversational attributes have been initialized
- */
- boolean conversationalAttributesInitialized();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationListener.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationListener.java
deleted file mode 100644
index 425fa3af9c..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationListener.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.conversation;
-
-/**
- * Listener for the events of a conversation
- *
- * @version $Rev$ $Date$
- */
-public interface ConversationListener {
- /**
- * The conversation is started
- */
- void conversationStarted(ConversationExt conversation);
- /**
- * The conversation is ended
- */
- void conversationEnded(ConversationExt conversation);
- /**
- * The conversation is expired
- */
- void conversationExpired(ConversationExt conversation);
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationManager.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationManager.java
deleted file mode 100644
index ed858bd499..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationManager.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.conversation;
-
-/**
- * The manager of conversations
- *
- * @version $Rev$ $Date$
- */
-public interface ConversationManager {
- /**
- * @param conversationID
- * @return
- */
- ConversationExt startConversation(Object conversationID);
-
- /**
- * @param conversationID
- */
- void endConversation(Object conversationID);
-
- /**
- * @param conversationID
- * @return
- */
- ConversationExt getConversation(Object conversationID);
-
- /**
- * @param conversationID
- */
- void expireConversation(Object conversationID);
-
- /**
- * Add a listener to this conversation
- * @param listener
- */
- void addListener(ConversationListener listener);
-
- /**
- * Remove a listener from this conversation
- * @param listener
- */
- void removeListener(ConversationListener listener);
-
- /**
- * @return the default max age for a conversation
- */
- long getMaxAge();
-
- /**
- * @return the default max idle time for a conversation
- */
- long getMaxIdleTime();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationState.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationState.java
deleted file mode 100644
index 692d6861ba..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/ConversationState.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.conversation;
-
-/**
- * The states of a conversation
- *
- * @version $Rev$ $Date$
- */
-public enum ConversationState {
- STARTED, ENDED, EXPIRED
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/impl/ConversationManagerImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/impl/ConversationManagerImpl.java
deleted file mode 100644
index e23659b990..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/impl/ConversationManagerImpl.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.conversation.impl;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.tuscany.sca.core.conversation.ConversationExt;
-import org.apache.tuscany.sca.core.conversation.ConversationListener;
-import org.apache.tuscany.sca.core.conversation.ConversationManager;
-import org.apache.tuscany.sca.core.conversation.ConversationState;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConversationManagerImpl implements ConversationManager {
-
- private List<ConversationListener> listeners = Collections.synchronizedList(new ArrayList<ConversationListener>());
- private Map<Object, ConversationExt> conversations = new ConcurrentHashMap<Object, ConversationExt>();
-
- /**
- * the default max age. this is set to 1 hour
- */
- private static final long DEFAULT_MAX_AGE = 60 * 60 * 1000;;
-
- /**
- * the default max idle time. this is set to 1 hour
- */
- private static final long DEFAULT_MAX_IDLE_TIME = 60 * 60 * 1000;
-
- /**
- * the globally used max age
- */
- private final long maxAge;
-
- /**
- * the globally used max idle time
- */
- private final long maxIdleTime;
-
- /**
- * the reaper thread
- */
- private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
-
- /**
- * constructor
- */
- public ConversationManagerImpl() {
- long mit = DEFAULT_MAX_IDLE_TIME;
- long ma = DEFAULT_MAX_AGE;
-
- // Allow privileged access to read system property. Requires PropertyPermission in security
- // policy.
- String aProperty = AccessController.doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty(ConversationManager.class.getName() + ".MaxIdleTime");
- }
- });
- if (aProperty != null) {
- try {
- mit = Long.parseLong(aProperty) * 1000;
- } catch (NumberFormatException nfe) {
- // Ignore
- }
- }
-
- // Allow privileged access to read system property. Requires PropertyPermission in security
- // policy.
- aProperty = AccessController.doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty(ConversationManager.class.getName() + ".MaxAge");
- }
- });
- if (aProperty != null) {
- try {
- ma = Long.parseLong(aProperty) * 1000;
- } catch (NumberFormatException nfe) {
- // Ignore
- }
- }
-
- maxAge = ma;
- maxIdleTime = mit;
- }
-
- /**
- * @see org.apache.tuscany.sca.core.conversation.ConversationManager#addListener(org.apache.tuscany.sca.core.conversation.ConversationListener)
- */
- public void addListener(ConversationListener listener) {
- listeners.add(listener);
- }
-
- /**
- * @see org.apache.tuscany.sca.core.conversation.ConversationManager#endConversation(org.apache.tuscany.sca.core.conversation.ConversationExt)
- */
- public void endConversation(Object conversationID) {
- ConversationExt conv = getConversation(conversationID);
- if (conv != null) {
- conv.setState(ConversationState.ENDED);
- for (ConversationListener listener : listeners) {
- listener.conversationEnded(conv);
- }
- conv.setConversationID(null);
- conversations.remove(conversationID);
- } else {
- throw new IllegalStateException("Conversation " + conversationID + " doesn't exist.");
- }
- }
-
- public void expireConversation(Object conversationID) {
- ConversationExt conv = getConversation(conversationID);
- if (conv != null) {
- for (ConversationListener listener : listeners) {
- listener.conversationExpired(conv);
- }
- conversations.remove(conversationID);
- } else {
- throw new IllegalStateException("Conversation " + conversationID + " doesn't exist.");
- }
-
- }
-
- /**
- * @see org.apache.tuscany.sca.core.conversation.ConversationManager#getConversation(java.lang.Object)
- */
- public ConversationExt getConversation(Object conversationID) {
- // ConcurrentHashMap cannot take null key
- return conversationID == null ? null : conversations.get(conversationID);
- }
-
- /**
- * @see org.apache.tuscany.sca.core.conversation.ConversationManager#removeListener(org.apache.tuscany.sca.core.conversation.ConversationListener)
- */
- public void removeListener(ConversationListener listener) {
- listeners.remove(listener);
- }
-
- /**
- * starts the reaper thread
- */
- public void scheduleConversation(ExtendedConversationImpl aConversation, long time) {
- this.scheduler.schedule(aConversation, time, TimeUnit.MILLISECONDS);
- }
-
- /**
- * stops the reaper thread
- */
- public synchronized void stopReaper() {
-
- // Prevent the scheduler from submitting any additional reapers,
- // initiate an orderly shutdown if a reaper task is in progress.
- this.scheduler.shutdown();
- }
-
- /**
- * @see org.apache.tuscany.sca.core.conversation.ConversationManager#startConversation(java.lang.Object)
- */
- public ConversationExt startConversation(Object conversationID) {
-
- if (conversationID == null) {
- conversationID = UUID.randomUUID().toString();
- }
- ConversationExt conversation = getConversation(conversationID);
- if (conversation != null && conversation.getState() != ConversationState.ENDED) {
- throw new IllegalStateException(conversation + " already exists.");
- }
-
- conversation = new ExtendedConversationImpl(this, conversationID, ConversationState.STARTED);
- conversations.put(conversationID, conversation);
- for (ConversationListener listener : listeners) {
- listener.conversationStarted(conversation);
- }
- return conversation;
- }
-
- /**
- * return the default max idle time
- * @param impProvider the implementation Provider to extract any ConversationAttribute details
- */
- public long getMaxIdleTime() {
- return maxIdleTime;
- }
-
- /**
- * returns the default max age
- * @param impProvider the implementation Provider to extract any ConversationAttribute details
- */
- public long getMaxAge() {
- return maxAge;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/impl/ExtendedConversationImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/impl/ExtendedConversationImpl.java
deleted file mode 100644
index 26939cfbc1..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/conversation/impl/ExtendedConversationImpl.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.conversation.impl;
-
-import org.apache.tuscany.sca.core.conversation.ConversationState;
-import org.apache.tuscany.sca.core.conversation.ConversationExt;
-import org.apache.tuscany.sca.core.scope.ScopedImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class ExtendedConversationImpl implements ConversationExt, Runnable {
-
- private final ConversationManagerImpl manager;
- private volatile Object conversationID;
- private ConversationState state;
-
- /**
- * syncs access to the state
- */
- private final Object stateSync = new Object();
-
- /**
- * the maximum time a conversation can exist
- */
- private long expirationTime = 0;
-
- /**
- * the maximum time this conversation can be idle
- */
- private long maxIdleTime = 0;
-
- /**
- * the maximum age of this conversation
- */
- private long maxAge = 0;
-
- /**
- * the time that this object was created
- */
- private long creationTime;
-
- /**
- * the time that this object was last referenced
- */
- private long lastReferencedTime;
-
- /**
- * boolean to ensure expiry only occurs once
- */
- private boolean expired = false;
-
- /**
- * boolean to indicate if the conversation attributes have
- * been set. In the case where a remote binding is used
- * within a composite the JDKInvocationHandler can create the
- * conversation but the conversationAttributes are not available
- * until the conversation is retrieved by the RuntimeWireInvoker
- */
- private boolean conversationAttributesInitialized = false;
-
- /**
- * Constructor
- * @param manager the conversation manager
- * @param conversationID the conversation id associated with this conversation
- * @param state the initial state of this conversation
- * @param aMaxAge the maximum age of the conversation
- * @param aMaxIdleTime the maximum idle time
- */
- public ExtendedConversationImpl(ConversationManagerImpl manager,
- Object conversationID, ConversationState state) {
- super();
-
- this.creationTime = System.currentTimeMillis();
- this.lastReferencedTime = creationTime;
- this.manager = manager;
- this.conversationID = conversationID;
- this.state = state;
- }
-
- /**
- * will check whether this conversation has expired and update state if it has
- * @return true if it has expired
- */
- public boolean isExpired() {
- long currentTime;
- synchronized (stateSync) {
-
- // if the attributes haven't been initialized then
- // this conversation object can't expire
- if (conversationAttributesInitialized == false) {
- return false;
- }
-
- // check state first
- if (state == ConversationState.EXPIRED) {
- return true;
- }
-
- // check whether the time is finished
- currentTime = System.currentTimeMillis();
- if (((this.lastReferencedTime + this.maxIdleTime) <= currentTime)
- || (this.expirationTime <= currentTime)) {
- setState(ConversationState.EXPIRED);
- return true;
- }
- }
- scheduleNextExpiryTime(currentTime);
- return false;
- }
-
- /**
- * schedule next expiry time
- */
- public void scheduleNextExpiryTime(long currentTime) {
- if ((lastReferencedTime + maxIdleTime) < expirationTime){
- manager.scheduleConversation(this, (lastReferencedTime + maxIdleTime) - currentTime);
- } else {
- manager.scheduleConversation(this, expirationTime - currentTime);
- }
- }
- /**
- * updates the last time this conversation was referenced
- */
- public void updateLastReferencedTime() {
- this.lastReferencedTime = System.currentTimeMillis();
- if (conversationAttributesInitialized == true){
- scheduleNextExpiryTime(lastReferencedTime);
- }
- }
-
- public ConversationState getState() {
- synchronized (stateSync){
- return state;
- }
- }
-
- public void end() {
- manager.endConversation(conversationID);
- }
-
- public Object getConversationID() {
- return conversationID;
- }
-
- /**
- * @param state the state to set
- */
- public void setState(ConversationState state) {
- synchronized (stateSync){
- this.state = state;
- }
- }
-
- /**
- * @param conversationID the conversationID to set
- */
- public void setConversationID(Object conversationID) {
- synchronized (stateSync){
- if (state != ConversationState.ENDED) {
- throw new IllegalStateException("The state of conversation " + conversationID + " " + state);
- }
- }
- this.conversationID = conversationID;
- }
-
- /**
- * @param maxAge the maximum age of this conversation
- */
- public void initializeConversationAttributes(RuntimeComponent targetComponent){
- if (targetComponent != null){
- this.maxAge = getMaxIdleTime(targetComponent.getImplementationProvider());
- this.maxIdleTime = getMaxAge(targetComponent.getImplementationProvider());
- this.expirationTime = creationTime + maxAge;
- this.conversationAttributesInitialized = true;
- }
- }
-
- /**
- * @return true if the conversational attributes have been initialized
- */
- public boolean conversationalAttributesInitialized(){
- return this.conversationAttributesInitialized;
- }
-
- /**
- * return the max idle time
- * @param impProvider the implementation Provider to extract any ConversationAttribute details
- */
- private long getMaxIdleTime(ImplementationProvider impProvider) {
- // Check to see if the maxIdleTime has been specified using @ConversationAttributes.
- // Implementation annotated attributes are honoured first.
- if ((impProvider != null) &&
- (impProvider instanceof ScopedImplementationProvider)) {
- ScopedImplementationProvider aScopedImpl =
- (ScopedImplementationProvider) impProvider;
-
- long maxIdleTime = aScopedImpl.getMaxIdleTime();
- if (maxIdleTime > 0) {
- return maxIdleTime;
- }
- }
- return manager.getMaxIdleTime();
- }
-
- /**
- * returns the max age
- * @param impProvider the implementation Provider to extract any ConversationAttribute details
- */
- private long getMaxAge(ImplementationProvider impProvider){
-
- // Check to see if the maxAge has been specified using @ConversationAttributes.
- // Implementation annotated attributes are honoured first.
- if ((impProvider != null) &&
- (impProvider instanceof ScopedImplementationProvider)) {
- ScopedImplementationProvider aScopedImpl =
- (ScopedImplementationProvider) impProvider;
-
- long maxAge = aScopedImpl.getMaxAge();
- if (maxAge > 0) {
- return maxAge;
- }
- }
- return manager.getMaxAge();
- }
-
- /**
- * called when expiring
- */
- public void run() {
- synchronized (stateSync){
- if (!expired){
- if (isExpired()) {
- expired = true;
- try {
- manager.expireConversation(getConversationID());
- } catch (IllegalStateException ise) {
- // ignore this.. this can occur if another thread has subsequently ended
- // the conversation
- }
- }
- }
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/InstanceWrapper.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/InstanceWrapper.java
deleted file mode 100644
index 2371897dce..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/InstanceWrapper.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.factory;
-
-import org.apache.tuscany.sca.core.scope.TargetDestructionException;
-import org.apache.tuscany.sca.core.scope.TargetInitializationException;
-
-
-/**
- * Provides lifecycle management for an implementation instance associated with
- * a component for use by the component's associated {@link org.apache.tuscany.sca.core.scope.ScopeContainer}
- *
- * @version $Rev$ $Date$
- */
-public interface InstanceWrapper<T> {
-
- /**
- * @return
- */
- T getInstance();
-
- /**
- * @throws TargetInitializationException
- */
- void start() throws TargetInitializationException;
-
- /**
- * @throws TargetDestructionException
- */
- void stop() throws TargetDestructionException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/ObjectCreationException.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/ObjectCreationException.java
deleted file mode 100644
index d35b27fd24..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/ObjectCreationException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.factory;
-
-
-/**
- * Denotes an error creating a new object instance
- *
- * @version $Rev$ $Date$
- */
-public class ObjectCreationException extends RuntimeException {
- private static final long serialVersionUID = -6423113430265944499L;
-
- public ObjectCreationException() {
- super();
- }
-
- public ObjectCreationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ObjectCreationException(String message) {
- super(message);
- }
-
- public ObjectCreationException(Throwable cause) {
- super(cause);
- }
-
-}
-
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/ObjectFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/ObjectFactory.java
deleted file mode 100644
index 3f64d2405b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/factory/ObjectFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.factory;
-
-/**
- * Implementations create new instances of a particular type
- *
- * @version $Rev$ $Date$
- */
-public interface ObjectFactory<T> {
-
- /**
- * Return a instance of the type that this factory creates.
- *
- * @return a instance from this factory
- */
- T getInstance() throws ObjectCreationException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CachedProxy.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CachedProxy.java
deleted file mode 100644
index 8c8f001eb9..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CachedProxy.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.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/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallableReferenceObjectFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallableReferenceObjectFactory.java
deleted file mode 100644
index 8a54b7568f..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallableReferenceObjectFactory.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.oasisopen.sca.CallableReference;
-
-/**
- * Uses a wire to return a CallableReference
- *
- * @version $Rev$ $Date$
- */
-public class CallableReferenceObjectFactory implements ObjectFactory<CallableReference<?>> {
- private Class<?> businessInterface;
- private RuntimeComponent component;
- private RuntimeComponentReference reference;
- private Binding binding;
-
- /**
- * Constructor.
- *
- * To support the @Reference protected CallableReference<MyService> ref;
- *
- * @param businessInterface the interface to inject
- * @param component the component defining the reference to be injected
- * @param reference the reference to be injected
- * @param binding the binding for the reference
- */
- public CallableReferenceObjectFactory(Class<?> businessInterface,
- RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- this.businessInterface = businessInterface;
- this.component = component;
- this.reference = reference;
- this.binding = binding;
- }
-
- public CallableReference<?> getInstance() throws ObjectCreationException {
- return component.getComponentContext().getServiceReference(businessInterface, reference, binding);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackInterfaceInterceptor.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackInterfaceInterceptor.java
deleted file mode 100644
index 1ee922144f..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackInterfaceInterceptor.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.oasisopen.sca.NoRegisteredCallbackException;
-
-/**
- * An interceptor applied to the forward direction of a wire that ensures the callback target implements the required
- * service contract. This is required as callback targets may be set dynamically by service implementations.
- *
- * @version $Rev$ $Date$
- */
-public class CallbackInterfaceInterceptor implements Interceptor {
- private Invoker next;
-
- public CallbackInterfaceInterceptor() {
- }
-
- public Message invoke(Message msg) {
- ReferenceParameters parameters = msg.getFrom().getReferenceParameters();
- if (parameters.getCallbackObjectID() != null || parameters.getCallbackReference() != msg.getFrom()
- .getCallbackEndpoint()) {
- return next.invoke(msg);
- } else {
- throw new NoRegisteredCallbackException("Callback target does not implement the callback interface");
- }
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-
- public Invoker getNext() {
- return next;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackReferenceObjectFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackReferenceObjectFactory.java
deleted file mode 100644
index b949500ab9..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackReferenceObjectFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.core.invocation.impl.CallbackReferenceImpl;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.CallableReference;
-
-/**
- * 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<CallableReference<?>> {
- 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 CallableReference<?> getInstance() throws ObjectCreationException {
- return CallbackReferenceImpl.newInstance(businessInterface, proxyFactory, wires);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackWireObjectFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackWireObjectFactory.java
deleted file mode 100644
index 2b37c30451..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackWireObjectFactory.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Returns proxy instance for a wire callback
- *
- * @version $Rev$ $Date$
- */
-public class CallbackWireObjectFactory<B> implements ObjectFactory<B> {
- private Class<B> businessInterface;
- private ProxyFactory proxyFactory;
- private List<RuntimeWire> wires;
-
- public CallbackWireObjectFactory(Class<B> interfaze, ProxyFactory proxyFactory, List<RuntimeWire> wires) {
- this.businessInterface = interfaze;
- this.proxyFactory = proxyFactory;
- this.wires = wires;
- }
-
- public B getInstance() throws ObjectCreationException {
- return proxyFactory.createCallbackProxy(businessInterface, wires);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CglibProxyFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CglibProxyFactory.java
deleted file mode 100644
index 4c3bee0dc9..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CglibProxyFactory.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.invocation;
-
-import java.lang.reflect.Method;
-import java.util.List;
-
-import net.sf.cglib.proxy.Callback;
-import net.sf.cglib.proxy.Enhancer;
-import net.sf.cglib.proxy.Factory;
-import net.sf.cglib.proxy.MethodInterceptor;
-import net.sf.cglib.proxy.MethodProxy;
-
-import org.apache.tuscany.sca.core.context.impl.CallableReferenceImpl;
-import org.apache.tuscany.sca.core.context.impl.ServiceReferenceImpl;
-import org.apache.tuscany.sca.core.invocation.impl.CallbackReferenceImpl;
-import org.apache.tuscany.sca.core.invocation.impl.JDKCallbackInvocationHandler;
-import org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * The implementation of a wire service that uses cglib dynamic proxies
- *
- * @version $Rev$ $Date$
- */
-public class CglibProxyFactory implements ProxyFactory {
- private MessageFactory messageFactory;
-
- public CglibProxyFactory(MessageFactory messageFactory, InterfaceContractMapper mapper) {
- this.messageFactory = messageFactory;
-
- }
-
- public <T> T createProxy(Class<T> interfaze, RuntimeWire wire) throws ProxyCreationException {
- ServiceReference<T> serviceReference = new ServiceReferenceImpl(interfaze, wire, this);
- return createProxy(serviceReference);
- }
-
- /**
- * create the proxy with cglib. use the same JDKInvocationHandler as
- * JDKProxyService.
- */
- public <T> T createProxy(CallableReference<T> callableReference) throws ProxyCreationException {
- Enhancer enhancer = new Enhancer();
- Class<T> interfaze = callableReference.getBusinessInterface();
- enhancer.setSuperclass(interfaze);
- enhancer.setCallback(new CglibMethodInterceptor<T>(callableReference));
- Object proxy = enhancer.create();
- ((CallableReferenceImpl)callableReference).setProxy(proxy);
- return interfaze.cast(proxy);
- }
-
- /**
- * create the callback proxy with cglib. use the same
- * JDKCallbackInvocationHandler as JDKProxyService.
- */
- public <T> T createCallbackProxy(Class<T> interfaze, final List<RuntimeWire> wires) throws ProxyCreationException {
- CallbackReferenceImpl<T> callbackReference = CallbackReferenceImpl.newInstance(interfaze, this, wires);
- return callbackReference != null ? createCallbackProxy(callbackReference) : null;
- }
-
- /**
- * create the callback proxy with cglib. use the same
- * JDKCallbackInvocationHandler as JDKProxyService.
- */
- public <T> T createCallbackProxy(CallbackReferenceImpl<T> callbackReference) throws ProxyCreationException {
- Enhancer enhancer = new Enhancer();
- Class<T> interfaze = callbackReference.getBusinessInterface();
- enhancer.setSuperclass(interfaze);
- enhancer.setCallback(new CglibMethodInterceptor<T>(callbackReference));
- Object proxy = enhancer.create();
- callbackReference.setProxy(proxy);
- return interfaze.cast(proxy);
- }
-
- @SuppressWarnings("unchecked")
- public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
- if (isProxyClass(target.getClass())) {
- Factory factory = (Factory)target;
- Callback[] callbacks = factory.getCallbacks();
- if (callbacks.length != 1 || !(callbacks[0] instanceof CglibMethodInterceptor)) {
- throw new IllegalArgumentException("The object is not a known proxy.");
- }
- CglibMethodInterceptor interceptor = (CglibMethodInterceptor)callbacks[0];
- return (R)interceptor.invocationHandler.getCallableReference();
- } else {
- throw new IllegalArgumentException("The object is not a known proxy.");
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.core.invocation.ProxyFactory#isProxyClass(java.lang.Class)
- */
- public boolean isProxyClass(Class<?> clazz) {
- return Factory.class.isAssignableFrom(clazz);
- }
-
- private class CglibMethodInterceptor<T> implements MethodInterceptor {
- private JDKInvocationHandler invocationHandler;
-
- public CglibMethodInterceptor(CallableReference<T> callableReference) {
- invocationHandler = new JDKInvocationHandler(messageFactory, callableReference);
- }
-
- public CglibMethodInterceptor(CallbackReferenceImpl<T> callbackReference) {
- invocationHandler = new JDKCallbackInvocationHandler(messageFactory, callbackReference);
- }
-
- /*
- public CglibMethodInterceptor(Class<T> interfaze, RuntimeWire wire) {
- ServiceReference<T> serviceRef = new ServiceReferenceImpl<T>(interfaze, wire, CglibProxyFactory.this);
- invocationHandler = new JDKInvocationHandler(messageFactory, serviceRef);
- }
-
- public CglibMethodInterceptor(Class<T> interfaze, List<RuntimeWire> wires) {
- CallbackReferenceImpl ref = new CallbackReferenceImpl(interfaze, CglibProxyFactory.this, wires);
- invocationHandler = new JDKCallbackInvocationHandler(messageFactory, ref);
- }
- */
-
- /**
- * @see net.sf.cglib.proxy.MethodInterceptor#intercept(java.lang.Object, java.lang.reflect.Method, java.lang.Object[], net.sf.cglib.proxy.MethodProxy)
- */
- public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
- Object result = invocationHandler.invoke(proxy, method, args);
- return result;
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/DefaultProxyFactoryExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/DefaultProxyFactoryExtensionPoint.java
deleted file mode 100644
index bb212d5869..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/DefaultProxyFactoryExtensionPoint.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.invocation;
-
-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.core.invocation.impl.JDKProxyFactory;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-
-/**
- * Default implementation of a ProxyFactoryExtensionPoint.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultProxyFactoryExtensionPoint implements ProxyFactoryExtensionPoint {
- private InterfaceContractMapper interfaceContractMapper;
- private MessageFactory messageFactory;
-
- private ProxyFactory interfaceFactory;
- private ProxyFactory classFactory;
-
- public DefaultProxyFactoryExtensionPoint(ExtensionPointRegistry extensionPoints) {
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- this.interfaceContractMapper = utilities.getUtility(InterfaceContractMapper.class);
-
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- this.messageFactory = modelFactories.getFactory(MessageFactory.class);
-
- interfaceFactory = new JDKProxyFactory(messageFactory, interfaceContractMapper);
- }
-
- public DefaultProxyFactoryExtensionPoint(MessageFactory messageFactory, InterfaceContractMapper mapper) {
- this.interfaceContractMapper = mapper;
- this.messageFactory = messageFactory;
- interfaceFactory = new JDKProxyFactory(messageFactory, mapper);
- }
-
- public ProxyFactory getClassProxyFactory() {
- return classFactory;
- }
-
- public ProxyFactory getInterfaceProxyFactory() {
- return interfaceFactory;
- }
-
- public void setClassProxyFactory(ProxyFactory factory) {
- this.classFactory = factory;
-
- }
-
- public void setInterfaceProxyFactory(ProxyFactory factory) {
- this.interfaceFactory = factory;
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleProxyFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleProxyFactory.java
deleted file mode 100644
index 0be6e31b43..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleProxyFactory.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.core.invocation.impl.CallbackReferenceImpl;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.CallableReference;
-
-/**
- * An extensible proxy factory.
- *
- * @version $Rev$ $Date$
- */
-public class ExtensibleProxyFactory implements ProxyFactory {
-
- private ProxyFactoryExtensionPoint proxyFactories;
-
- public ExtensibleProxyFactory(ProxyFactoryExtensionPoint proxyFactories) {
- this.proxyFactories = proxyFactories;
- }
-
- /**
- * @see org.apache.tuscany.sca.core.invocation.ProxyFactory#cast(java.lang.Object)
- */
- @SuppressWarnings("unchecked")
- public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
- ProxyFactory interfaceFactory = proxyFactories.getInterfaceProxyFactory();
- ProxyFactory classFactory = proxyFactories.getClassProxyFactory();
- if (interfaceFactory.isProxyClass(target.getClass())) {
- return (R)interfaceFactory.cast(target);
- } else if (classFactory != null && classFactory.isProxyClass(target.getClass())) {
- return (R)classFactory.cast(target);
- } else {
- throw new IllegalArgumentException("The target is not a callable proxy");
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.core.invocation.ProxyFactory#createCallbackProxy(java.lang.Class,
- * java.util.List)
- */
- public <T> T createCallbackProxy(Class<T> interfaze, List<RuntimeWire> wires) throws ProxyCreationException {
- ProxyFactory interfaceFactory = proxyFactories.getInterfaceProxyFactory();
- ProxyFactory classFactory = proxyFactories.getClassProxyFactory();
- if (interfaze.isInterface()) {
- return interfaceFactory.createCallbackProxy(interfaze, wires);
- } else {
- return classFactory.createCallbackProxy(interfaze, wires);
- }
- }
-
- public <T> T createProxy(CallableReference<T> callableReference) throws ProxyCreationException {
- ProxyFactory interfaceFactory = proxyFactories.getInterfaceProxyFactory();
- ProxyFactory classFactory = proxyFactories.getClassProxyFactory();
- if (callableReference.getBusinessInterface().isInterface()) {
- return interfaceFactory.createProxy(callableReference);
- } else {
- return classFactory.createProxy(callableReference);
- }
- }
-
- public <T> T createCallbackProxy(CallbackReferenceImpl<T> callbackReference) throws ProxyCreationException {
- ProxyFactory interfaceFactory = proxyFactories.getInterfaceProxyFactory();
- ProxyFactory classFactory = proxyFactories.getClassProxyFactory();
- if (callbackReference.getBusinessInterface().isInterface()) {
- return interfaceFactory.createCallbackProxy(callbackReference);
- } else {
- return classFactory.createCallbackProxy(callbackReference);
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.core.invocation.ProxyFactory#createProxy(java.lang.Class,
- * org.apache.tuscany.sca.runtime.RuntimeWire)
- */
- public <T> T createProxy(Class<T> interfaze, RuntimeWire wire) throws ProxyCreationException {
- ProxyFactory interfaceFactory = proxyFactories.getInterfaceProxyFactory();
- ProxyFactory classFactory = proxyFactories.getClassProxyFactory();
- if (interfaze.isInterface()) {
- return interfaceFactory.createProxy(interfaze, wire);
- } else {
- return classFactory.createProxy(interfaze, wire);
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.core.invocation.ProxyFactory#isProxyClass(java.lang.Class)
- */
- public boolean isProxyClass(Class<?> clazz) {
- ProxyFactory interfaceFactory = proxyFactories.getInterfaceProxyFactory();
- ProxyFactory classFactory = proxyFactories.getClassProxyFactory();
- return interfaceFactory.isProxyClass(clazz) || (classFactory != null && classFactory.isProxyClass(clazz));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleWireProcessor.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleWireProcessor.java
deleted file mode 100644
index 934f2f7aa0..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleWireProcessor.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.apache.tuscany.sca.runtime.RuntimeWireProcessor;
-import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint;
-
-/**
- * The default implementation of an extensible <code>WireProcessor</code>
- *
- * @version $Rev$ $Date$
- */
-public class ExtensibleWireProcessor implements RuntimeWireProcessor {
-
- private RuntimeWireProcessorExtensionPoint processors;
-
- public ExtensibleWireProcessor(RuntimeWireProcessorExtensionPoint processors) {
- this.processors = processors;
- }
-
- public void process(RuntimeWire wire) {
- for (RuntimeWireProcessor processor : processors.getWireProcessors()) {
- processor.process(wire);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java
deleted file mode 100644
index 494cb93d97..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.apache.tuscany.sca.work.WorkScheduler;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Adds non-blocking behavior to an invocation chain
- *
- * @version $Rev$ $Date$
- */
-public class NonBlockingInterceptor implements Interceptor {
-
- private static final Message RESPONSE = new ImmutableMessage();
-
- /**
- * The JDK logger that will be used to log messages.
- */
- private static final Logger LOGGER = Logger.getLogger(NonBlockingInterceptor.class.getName());
-
- private WorkScheduler workScheduler;
- private Invoker next;
-
- public NonBlockingInterceptor(WorkScheduler workScheduler) {
- this.workScheduler = workScheduler;
- }
-
- public NonBlockingInterceptor(WorkScheduler workScheduler, Interceptor next) {
- this.workScheduler = workScheduler;
- this.next = next;
- }
-
- /**
- * Sets desired workScheduler to NonBlockingInterceptor. This is a useful function for the extension framework
- * to set desired workmanager on the InvocationChain, other than default workmanager which is set per Tuscany runtime.
- * Using this function, extension framework can set desired workmanager on InvocationChain during post wire processing.
- * @param workScheduler workScheduler which contains workmanager
- */
- public void setWorkScheduler(WorkScheduler workScheduler){
- this.workScheduler = workScheduler;
- }
-
- public Message invoke(final Message msg) {
- // Schedule the invocation of the next interceptor in a new Work instance
- try {
- workScheduler.scheduleWork(new Runnable() {
- public void run() {
- Message context = ThreadMessageContext.setMessageContext(msg);
- try {
- Message response = null;
-
- Throwable ex = null;
- try {
- response = next.invoke(msg);
- } catch (Throwable t) {
- ex = t;
- }
-
- // Tuscany-2225 - Did the @OneWay method complete successfully?
- // (i.e. no exceptions)
- if (response != null && response.isFault()) {
- // The @OneWay method threw an Exception. Lets log it and
- // then pass it on to the WorkScheduler so it can notify any
- // listeners
- ex = (Throwable)response.getBody();
- }
- if (ex != null) {
- LOGGER.log(Level.SEVERE, "Exception from @OneWay invocation", ex);
- throw new ServiceRuntimeException("Exception from @OneWay invocation", ex);
- }
- } finally {
- ThreadMessageContext.setMessageContext(context);
- }
- }
- });
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- return RESPONSE;
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-
- /**
- * A dummy message passed back on an invocation
- */
- private static class ImmutableMessage implements Message {
-
- public Object getBody() {
- return null;
- }
-
- public void setBody(Object body) {
- if (body != null) {
- throw new UnsupportedOperationException();
- }
- }
-
- public void setCallbackWires(LinkedList<RuntimeWire> wires) {
-
- }
-
- public Object getMessageID() {
- return null;
- }
-
- public void setMessageID(Object messageId) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isFault() {
- return false;
- }
-
- public void setFaultBody(Object fault) {
- throw new UnsupportedOperationException();
- }
-
- public EndpointReference getFrom() {
- return null;
- }
-
- public EndpointReference getTo() {
- return null;
- }
-
- public void setFrom(EndpointReference from) {
- throw new UnsupportedOperationException();
- }
-
- public void setTo(EndpointReference to) {
- throw new UnsupportedOperationException();
- }
-
- public Operation getOperation() {
- return null;
- }
-
- public void setOperation(Operation op) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Message#getReplyTo()
- */
- public EndpointReference getReplyTo() {
- return null;
- }
-
- public Map<String, Object> getQoSContext() {
- return null;
- }
-
- public List<Object> getHeaders() {
- return null;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyCreationException.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyCreationException.java
deleted file mode 100644
index 0b36b178f3..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyCreationException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-
-
-/**
- * Denotes an error creating a proxy
- *
- * @version $Rev$ $Date$
- */
-public class ProxyCreationException extends ObjectCreationException {
- private static final long serialVersionUID = 8002454344828513781L;
-
- public ProxyCreationException() {
- super();
- }
-
- public ProxyCreationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ProxyCreationException(String message) {
- super(message);
- }
-
- public ProxyCreationException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactory.java
deleted file mode 100644
index a5fabdf0f6..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.core.invocation.impl.CallbackReferenceImpl;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.CallableReference;
-
-/**
- * Creates proxies that implement Java interfaces and invocation handlers for fronting wires
- *
- * @version $Rev$ $Date$
- */
-
-public interface ProxyFactory {
-
- /**
- * Creates a Java proxy for the given wire
- *
- * @param interfaze the interface the proxy implements
- * @param wire the wire to proxy
- * @return the proxy
- * @throws ProxyCreationException
- */
- <T> T createProxy(Class<T> interfaze, RuntimeWire wire) throws ProxyCreationException;
-
- /**
- * Creates a Java proxy for the given CallableReference
- *
- * @param callableReference The CallableReference
- * @return the proxy
- * @throws ProxyCreationException
- */
- <T> T createProxy(CallableReference<T> callableReference) throws ProxyCreationException;
-
- /**
- * Creates a Java proxy for the service contract callback
- *
- * @param interfaze the interface the proxy should implement
- * @return the proxy
- * @throws ProxyCreationException
- */
- <T> T createCallbackProxy(Class<T> interfaze, List<RuntimeWire> wires) throws ProxyCreationException;
-
- /**
- * Creates a Java proxy for the given callback reference
- *
- * @param callableReference The CallableReference
- * @return the proxy
- * @throws ProxyCreationException
- */
- <T> T createCallbackProxy(CallbackReferenceImpl<T> callbackReference) throws ProxyCreationException;
-
- /**
- * Cast a proxy to a CallableReference.
- *
- * @param target a proxy generated by this implementation
- * @return a CallableReference (or subclass) equivalent to this proxy
- * @throws IllegalArgumentException if the object supplied is not a proxy
- */
- <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException;
-
- /**
- * Test if a given class is a generated proxy class by this factory
- * @param clazz A java class or interface
- * @return true if the class is a generated proxy class by this factory
- */
- boolean isProxyClass(Class<?> clazz);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactoryExtensionPoint.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactoryExtensionPoint.java
deleted file mode 100644
index 875a252798..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactoryExtensionPoint.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.invocation;
-
-
-/**
- * The extension point to plug in proxy factories
- * @version $Rev$ $Date$
- */
-public interface ProxyFactoryExtensionPoint {
-
- /**
- * Get the proxy factory for java interfaces
- * @return
- */
- ProxyFactory getInterfaceProxyFactory();
-
- /**
- * Get the proxy factory for java classes
- * @return
- */
- ProxyFactory getClassProxyFactory();
-
- /**
- * Set the proxy factory for java interfaces
- * @param factory
- */
- void setInterfaceProxyFactory(ProxyFactory factory);
-
- /**
- * Set the proxy factory for java classes
- * @param factory
- */
- void setClassProxyFactory(ProxyFactory factory);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeWireInvoker.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeWireInvoker.java
deleted file mode 100644
index 0b73373e80..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeWireInvoker.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.InvocationTargetException;
-
-import org.apache.tuscany.sca.core.conversation.ConversationManager;
-import org.apache.tuscany.sca.core.conversation.ConversationState;
-import org.apache.tuscany.sca.core.conversation.ConversationExt;
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopedRuntimeComponent;
-import org.apache.tuscany.sca.core.scope.TargetDestructionException;
-import org.apache.tuscany.sca.core.scope.TargetResolutionException;
-import org.apache.tuscany.sca.interfacedef.ConversationSequence;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.ConversationEndedException;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class RuntimeWireInvoker implements Invoker{
- protected ConversationManager conversationManager;
- protected boolean conversational;
- protected ConversationExt conversation;
- protected MessageFactory messageFactory;
- protected Object conversationID;
- protected Object callbackID;
- protected Object callbackObject;
- protected RuntimeWire wire;
-
- public RuntimeWireInvoker(MessageFactory messageFactory, ConversationManager conversationManager, RuntimeWire wire) {
- this.messageFactory = messageFactory;
- this.wire = wire;
- this.conversationManager = conversationManager;
- init(wire);
- }
-
- protected void init(RuntimeWire wire) {
- if (wire != null) {
- ReferenceParameters parameters = wire.getSource().getReferenceParameters();
- this.callbackID = parameters.getCallbackID();
- this.callbackObject = parameters.getCallbackReference();
- this.conversationID = parameters.getConversationID();
- InterfaceContract contract = wire.getSource().getInterfaceContract();
- this.conversational = contract.getInterface().isConversational();
- }
- }
-
- /*
- * TODO - Introduced to allow the RuntimeWireInvoker to sit on the end of the
- * service binding chain. Runtime wire invoke needs splitting up into
- * separate conversation, callback interceptors etc.
- */
- public Message invoke(Message msg) {
-
- try {
- Object response = invoke(msg.getOperation(),msg);
- // Hack to put the response back in a message.
- // shouldn't take it out of the response message in the first place
- msg.setBody(response);
- } catch (InvocationTargetException e) {
- throw new ServiceRuntimeException(e);
- }
-
- return msg;
- }
-
- public Object invoke(Operation operation, Message msg) throws InvocationTargetException {
- return invoke(wire, operation, msg);
- }
-
- public Object invoke(RuntimeWire wire, Operation operation, Message msg) throws InvocationTargetException {
- RuntimeWire runtimeWire = wire == null ? this.wire : wire;
- InvocationChain chain = runtimeWire.getInvocationChain(operation);
- return invoke(chain, msg, runtimeWire);
- }
-
- protected Object invoke(InvocationChain chain, Message msg, RuntimeWire wire) throws InvocationTargetException {
- EndpointReference from = msg.getFrom();
- EndpointReference epFrom = wire.getSource();
- if (from != null) {
- from.mergeEndpoint(epFrom);
- } else {
- msg.setFrom(epFrom);
- }
- msg.setTo(wire.getTarget());
-
- Invoker headInvoker = chain.getHeadInvoker();
- Operation operation = chain.getTargetOperation();
- msg.setOperation(operation);
-
- Message msgContext = ThreadMessageContext.getMessageContext();
- Object currentConversationID = msgContext.getFrom().getReferenceParameters().getConversationID();
-
- ThreadMessageContext.setMessageContext(msg);
- try {
- conversationPreinvoke(msg);
- // handleCallback(msg, currentConversationID);
- // dispatch the wire down the chain and get the response
- Message resp = headInvoker.invoke(msg);
- Object body = resp.getBody();
- if (resp.isFault()) {
- throw new InvocationTargetException((Throwable)body);
- }
- return body;
- } catch (InvocationTargetException e) {
- throw e;
- } catch (Throwable e) {
- throw new ServiceRuntimeException(e);
- } finally {
- try {
- conversationPostInvoke(msg);
- } catch (TargetDestructionException e) {
- throw new ServiceRuntimeException(e);
- } finally {
- ThreadMessageContext.setMessageContext(msgContext);
- }
- }
- }
-
- /**
- * @param msgContext
- */
- protected EndpointReference getCallbackEndpoint(Message msgContext) {
- EndpointReference from = msgContext.getFrom();
- return from == null ? null : from.getReferenceParameters().getCallbackReference();
- }
-
- /**
- * Pre-invoke for the conversation handling
- * @param msg
- * @throws TargetResolutionException
- */
- private void conversationPreinvoke(Message msg) {
- if (conversational) {
- ReferenceParameters parameters = msg.getFrom().getReferenceParameters();
- // in some cases the ConversationID that should be used comes in with the
- // message, e.g. when ws binding is in use.
- Object convID = parameters.getConversationID();
- if (convID != null) {
- conversationID = convID;
- }
- conversation = conversationManager.getConversation(conversationID);
-
- if (conversation == null || conversation.getState() == ConversationState.ENDED) {
- conversation = conversationManager.startConversation(conversationID);
- conversation.initializeConversationAttributes(wire.getTarget().getComponent());
- } else if (conversation.conversationalAttributesInitialized() == false) {
- conversation.initializeConversationAttributes(wire.getTarget().getComponent());
- } else if (conversation.isExpired()){
- throw new ConversationEndedException("Conversation has expired.");
- }
-
- conversation.updateLastReferencedTime();
-
- parameters.setConversationID(conversation.getConversationID());
- }
- }
-
- /**
- * Post-invoke for the conversation handling
- * @param wire
- * @param operation
- * @throws TargetDestructionException
- */
- @SuppressWarnings("unchecked")
- private void conversationPostInvoke(Message msg) throws TargetDestructionException {
- if (conversational) {
- Operation operation = msg.getOperation();
- ConversationSequence sequence = operation.getConversationSequence();
- if (sequence == ConversationSequence.CONVERSATION_END) {
- // in some cases the ConversationID that should be used comes in with the
- // message, e.g. when ws binding is in use.
- Object convID = msg.getFrom().getReferenceParameters().getConversationID();
- if (convID != null) {
- conversationID = convID;
- }
- conversation = conversationManager.getConversation(conversationID);
-
- // remove conversation id from scope container
- ScopeContainer scopeContainer = getConversationalScopeContainer(msg);
-
- if (scopeContainer != null) {
- scopeContainer.remove(conversation.getConversationID());
- }
-
- conversation.end();
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private ScopeContainer getConversationalScopeContainer(Message msg) {
- ScopeContainer scopeContainer = null;
-
- RuntimeComponent component = msg.getTo().getComponent();
-
- if (component instanceof ScopedRuntimeComponent) {
- ScopedRuntimeComponent scopedRuntimeComponent = (ScopedRuntimeComponent)component;
- ScopeContainer container = scopedRuntimeComponent.getScopeContainer();
-
- if ((container != null) && (container.getScope() == Scope.CONVERSATION)) {
- scopeContainer = container;
- }
- }
-
- return scopeContainer;
- }
-
-
- /**
- * Minimal wrapper for a callback object contained in a ServiceReference
- */
- private static class CallbackObjectWrapper<T> implements InstanceWrapper<T> {
-
- private T instance;
-
- private CallbackObjectWrapper(T instance) {
- this.instance = instance;
- }
-
- public T getInstance() {
- return instance;
- }
-
- public void start() {
- // do nothing
- }
-
- public void stop() {
- // do nothing
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java
deleted file mode 100644
index 5ae4a24b36..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import org.apache.tuscany.sca.core.assembly.impl.EndpointReferenceImpl;
-import org.apache.tuscany.sca.core.invocation.impl.MessageImpl;
-import org.apache.tuscany.sca.invocation.Message;
-
-/**
- * Class for tunnelling a WorkContext through the invocation of a user class.
- *
- * @version $Rev$ $Date$
- */
-public final class ThreadMessageContext {
-
- private static final ThreadLocal<Message> CONTEXT = new ThreadLocal<Message>() {
- @Override
- protected synchronized Message initialValue() {
- Message msg = new MessageImpl();
- msg.setFrom(new EndpointReferenceImpl("/"));
- return msg;
- }
- };
-
- private ThreadMessageContext() {
- }
-
- /**
- * Set the WorkContext for the current thread.
- * The current work context is returned and must be restored after the invocation is complete.
- * Typical usage would be:
- * <pre>
- * WorkContext old = PojoWorkContextTunnel.setThreadWorkContext(newContext);
- * try {
- * ... invoke user code ...
- * } finally {
- * PojoWorkContextTunnel.setThreadWorkContext(old);
- * }
- * </pre>
- * @param context
- * @return the current work context for the thread; this must be restored after the invocation is made
- */
- public static Message setMessageContext(Message context) {
- Message old = CONTEXT.get();
- CONTEXT.set(context);
- return old;
- }
-
- /**
- * Returns the WorkContext for the current thread.
- *
- * @return the WorkContext for the current thread
- */
- public static Message getMessageContext() {
- return CONTEXT.get();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/WireObjectFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/WireObjectFactory.java
deleted file mode 100644
index 2fc3d6c7eb..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/WireObjectFactory.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import org.apache.tuscany.sca.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.core.invocation.impl.NoMethodForOperationException;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Uses a wire to return an object instance
- *
- * @version $Rev$ $Date$
- */
-public class WireObjectFactory<T> implements ObjectFactory<T> {
- private Class<T> interfaze;
- private RuntimeWire wire;
- private ProxyFactory proxyService;
-
- /**
- * Constructor.
- *
- * @param interfaze the interface to inject on the client
- * @param wire the backing wire
- * @param proxyService the wire service to create the proxy
- * @throws NoMethodForOperationException
- */
- public WireObjectFactory(Class<T> interfaze, RuntimeWire wire, ProxyFactory proxyService) {
- this.interfaze = interfaze;
- this.wire = wire;
- this.proxyService = proxyService;
- }
-
- public T getInstance() throws ObjectCreationException {
- return new ServiceReferenceImpl<T>(interfaze, wire, proxyService).getProxy();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/CallbackReferenceImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/CallbackReferenceImpl.java
deleted file mode 100644
index 79daf537ea..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/CallbackReferenceImpl.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.List;
-
-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.Contract;
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
-import org.apache.tuscany.sca.core.assembly.impl.EndpointReferenceImpl;
-import org.apache.tuscany.sca.core.assembly.impl.RuntimeComponentReferenceImpl;
-import org.apache.tuscany.sca.core.assembly.impl.RuntimeWireImpl;
-import org.apache.tuscany.sca.core.context.CompositeContext;
-import org.apache.tuscany.sca.core.context.impl.CallableReferenceImpl;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ThreadMessageContext;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Returns proxy instance for a wire callback
- *
- * @version $Rev: 576055 $ $Date: 2007-09-16 08:11:45 +0100 (Sun, 16 Sep 2007) $
- */
-public class CallbackReferenceImpl<B> extends CallableReferenceImpl<B> {
- private RuntimeWire wire;
- private List<RuntimeWire> wires;
- private EndpointReference resolvedEndpoint;
- private Object convID;
-
- public static CallbackReferenceImpl newInstance(Class interfaze,
- ProxyFactory proxyFactory,
- List<RuntimeWire> wires) {
- if (getCallbackEndpoint(ThreadMessageContext.getMessageContext()) != null) {
- return new CallbackReferenceImpl(interfaze, proxyFactory, wires);
- } else {
- return null;
- }
- }
-
- /**
- * Public constructor for Externalizable serialization/deserialization.
- */
- public CallbackReferenceImpl() {
- super();
- }
-
- private CallbackReferenceImpl(Class<B> interfaze, ProxyFactory proxyFactory, List<RuntimeWire> wires) {
- super(interfaze, null, proxyFactory);
- this.wires = wires;
- init();
- }
-
- public void init() {
- Message msgContext = ThreadMessageContext.getMessageContext();
- wire = selectCallbackWire(msgContext);
- if (wire == null) {
- //FIXME: need better exception
- throw new RuntimeException("No callback binding found for " + msgContext.getTo().getURI());
- }
- resolvedEndpoint = getCallbackEndpoint(msgContext);
- convID = msgContext.getFrom().getReferenceParameters().getConversationID();
- callbackID = msgContext.getFrom().getReferenceParameters().getCallbackID();
- }
-
- @Override
- protected Object createProxy() throws Exception {
- return proxyFactory.createCallbackProxy(this);
- }
-
- protected RuntimeWire getCallbackWire() {
- if (resolvedEndpoint == null) {
- return null;
- } else {
- return cloneAndBind(wire);
- }
- }
-
- protected Object getConvID() {
- return convID;
- }
-
- protected EndpointReference getResolvedEndpoint() {
- return resolvedEndpoint;
- }
-
- private RuntimeWire selectCallbackWire(Message msgContext) {
- // look for callback binding with same name as service binding
- EndpointReference to = msgContext.getTo();
- if (to == null) {
- //FIXME: need better exception
- throw new RuntimeException("Destination for forward call is not available");
- }
- for (RuntimeWire wire : wires) {
- if (wire.getSource().getBinding().getName().equals(to.getBinding().getName())) {
- return wire;
- }
- }
-
- // if no match, look for callback binding with same type as service binding
- for (RuntimeWire wire : wires) {
- if (wire.getSource().getBinding().getClass() == to.getBinding().getClass()) {
- return wire;
- }
- }
-
- // no suitable callback wire was found
- return null;
- }
-
- /**
- * @param msgContext
- */
- private static EndpointReference getCallbackEndpoint(Message msgContext) {
- EndpointReference from = msgContext.getFrom();
- if (from == null) {
- return null;
- }
- return from.getReferenceParameters().getCallbackReference();
- }
-
- private RuntimeWire cloneAndBind(RuntimeWire wire) {
- RuntimeWire boundWire = null;
- if (resolvedEndpoint != null) {
- boundWire = ((RuntimeWireImpl)wire).lookupCache(resolvedEndpoint);
- if (boundWire != null) {
- return boundWire;
- }
- try {
- Contract contract = resolvedEndpoint.getContract();
- RuntimeComponentReference ref = null;
- if (contract == null) {
- boundWire = (RuntimeWire)wire.clone();
-
- } else if (contract instanceof RuntimeComponentReference) {
- ref = (RuntimeComponentReference)contract;
- boundWire = ref.getRuntimeWire(resolvedEndpoint.getBinding());
-
- } else { // contract instanceof RuntimeComponentService
- ref = bind((RuntimeComponentReference)wire.getSource().getContract(),
- resolvedEndpoint.getComponent(),
- (RuntimeComponentService)contract);
- boundWire = ref.getRuntimeWires().get(0);
- }
- configureWire(boundWire);
- ((RuntimeWireImpl)wire).addToCache(resolvedEndpoint, boundWire);
- } catch (CloneNotSupportedException e) {
- // will not happen
- }
- }
- return boundWire;
- }
-
- private static RuntimeComponentReference bind(RuntimeComponentReference reference,
- RuntimeComponent component,
- RuntimeComponentService service) throws CloneNotSupportedException {
- RuntimeComponentReference ref = (RuntimeComponentReference)reference.clone();
- ref.getTargets().add(service);
- ref.getBindings().clear();
- for (Binding binding : service.getBindings()) {
- if (binding instanceof OptimizableBinding) {
- OptimizableBinding optimizableBinding = (OptimizableBinding)((OptimizableBinding)binding).clone();
- optimizableBinding.setTargetBinding(binding);
- optimizableBinding.setTargetComponent(component);
- optimizableBinding.setTargetComponentService(service);
- ref.getBindings().add(optimizableBinding);
- } else {
- ref.getBindings().add(binding);
- }
- }
- return ref;
- }
-
- private void configureWire(RuntimeWire wire) {
- // need to set the endpoint on the binding also so that when the chains are created next
- // the sca binding can decide whether to provide local or remote invokers.
- // TODO - there is a problem here though in that I'm setting a target on a
- // binding that may possibly be trying to point at two things in the multi threaded
- // case. Need to confirm the general model here and how the clone and bind part
- // is intended to work
- Binding binding = wire.getSource().getBinding();
- binding.setURI(resolvedEndpoint.getURI());
-
- // also need to set the target contract as it varies for the sca binding depending on
- // whether it is local or remote
- RuntimeComponentReference ref = (RuntimeComponentReference)wire.getSource().getContract();
- wire.getTarget().setInterfaceContract(ref.getBindingProvider(binding).getBindingInterfaceContract());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- super.readExternal(in);
- this.callbackID = in.readObject();
- this.convID = in.readObject();
-
- this.compositeActivator = CompositeContext.getCurrentCompositeActivator();
-
- // Get the target Component and Service from the URI
- final String uri = in.readUTF();
- final Component targetComponent = super.resolveComponentURI(uri);
- final ComponentService targetService = super.resolveServiceURI(uri, targetComponent);
- final InterfaceContract targetServiceIfaceContract = targetService.getInterfaceContract();
-
- // Re-create the resolved Endpoint
- this.resolvedEndpoint = new EndpointReferenceImpl(
- (RuntimeComponent) targetComponent, targetService, null,
- targetServiceIfaceContract);
-
- // Copy the Java Interface from the Service
- final JavaInterface ji = (JavaInterface) targetServiceIfaceContract.getInterface();
- this.businessInterface = (Class<B>) ji.getJavaClass();
-
- // We need to re-create the callback wire. We need to do this on a clone of the Service
- // wire since we need to change some details on it.
- // FIXME: Is this the best way to do this?
- final RuntimeWire cbWire = ((RuntimeComponentService) targetService).getRuntimeWires().get(0);
- try {
- this.wire = (RuntimeWireImpl) cbWire.clone();
- } catch (CloneNotSupportedException e) {
- throw new IOException(e.toString());
- }
-
- // Setup the reference on the cloned wire
- final RuntimeComponentReference ref = new RuntimeComponentReferenceImpl();
- ref.setComponent((RuntimeComponent) targetComponent);
- ref.setInterfaceContract(targetServiceIfaceContract);
- ((EndpointReferenceImpl) this.wire.getSource()).setContract(ref);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void writeExternal(ObjectOutput out) throws IOException {
- super.writeExternal(out);
- out.writeObject(this.callbackID);
- out.writeObject(this.convID);
- out.writeUTF(this.resolvedEndpoint.getURI());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImpl.java
deleted file mode 100644
index 3c7fefb674..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImpl.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Phase;
-
-/**
- * Default implementation of an invocation chain
- *
- * @version $Rev$ $Date$
- */
-public class InvocationChainImpl implements InvocationChain {
- private Operation sourceOperation;
- private Operation targetOperation;
- private List<Node> nodes = new ArrayList<Node>();
-
- // FIXME: Not a good practice to use static reference
- private static final PhaseManager phaseManager = new PhaseManager();
- private boolean forReference;
- private boolean allowsPassByReference;
-
- public InvocationChainImpl(Operation sourceOperation, Operation targetOperation, boolean forReference) {
- // TODO - binding invocation chain doesn't provide operations
- //assert sourceOperation != null;
- //assert targetOperation != null;
- this.targetOperation = targetOperation;
- this.sourceOperation = sourceOperation;
- this.forReference = forReference;
- }
-
- public Operation getTargetOperation() {
- return targetOperation;
- }
-
- public void setTargetOperation(Operation operation) {
- this.targetOperation = operation;
- }
-
- public void addInterceptor(Interceptor interceptor) {
- String phase = forReference ? Phase.REFERENCE : Phase.SERVICE;
- addInterceptor(phase, interceptor);
- }
-
- public void addInvoker(Invoker invoker) {
- String phase = forReference ? Phase.REFERENCE_BINDING : Phase.IMPLEMENTATION;
- addInvoker(phase, invoker);
- }
-
- public Invoker getHeadInvoker() {
- return nodes.isEmpty() ? null : nodes.get(0).getInvoker();
- }
-
- public Invoker getTailInvoker() {
- return nodes.isEmpty() ? null : nodes.get(nodes.size() - 1).getInvoker();
- }
-
- /**
- * @return the sourceOperation
- */
- public Operation getSourceOperation() {
- return sourceOperation;
- }
-
- /**
- * @param sourceOperation the sourceOperation to set
- */
- public void setSourceOperation(Operation sourceOperation) {
- this.sourceOperation = sourceOperation;
- }
-
- public void addInterceptor(int index, Interceptor interceptor) {
- addInterceptor(interceptor);
- }
-
- public void addInterceptor(String phase, Interceptor interceptor) {
- addInvoker(phase, interceptor);
- }
-
- private void addInvoker(String phase, Invoker invoker) {
- int index = phaseManager.getAllPhases().indexOf(phase);
- if (index == -1) {
- throw new IllegalArgumentException("Invalid phase name: " + phase);
- }
- Node node = new Node(index, invoker);
- ListIterator<Node> li = nodes.listIterator();
- Node before = null, after = null;
- boolean found = false;
- while (li.hasNext()) {
- before = after;
- after = li.next();
- if (after.getPhaseIndex() > index) {
- // Move back
- li.previous();
- li.add(node);
- found = true;
- break;
- }
- }
- if (!found) {
- // Add to the end
- nodes.add(node);
- before = after;
- after = null;
- }
-
- // Relink the interceptors
- if (before != null) {
- if (before.getInvoker() instanceof Interceptor) {
- ((Interceptor)before.getInvoker()).setNext(invoker);
- }
- }
- if (after != null) {
- if (invoker instanceof Interceptor) {
- ((Interceptor)invoker).setNext(after.getInvoker());
- }
- }
-
- }
-
- public boolean allowsPassByReference() {
- if (allowsPassByReference) {
- // No need to check the invokers
- return true;
- }
- // Check if any of the invokers allows pass-by-reference
- boolean allowsPBR = false;
- for (Node i : nodes) {
- if (i.getInvoker() instanceof DataExchangeSemantics) {
- if (((DataExchangeSemantics)i.getInvoker()).allowsPassByReference()) {
- allowsPBR = true;
- break;
- }
- }
- }
- return allowsPBR;
- }
-
- public void setAllowsPassByReference(boolean allowsPBR) {
- this.allowsPassByReference = allowsPBR;
- }
-
- private static class Node {
- private int phaseIndex;
- private Invoker invoker;
-
- public Node(int phaseIndex, Invoker invoker) {
- super();
- this.phaseIndex = phaseIndex;
- this.invoker = invoker;
- }
-
- public int getPhaseIndex() {
- return phaseIndex;
- }
-
- public Invoker getInvoker() {
- return invoker;
- }
-
- @Override
- public String toString() {
- return "(" + phaseIndex + ")" + invoker;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKCallbackInvocationHandler.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKCallbackInvocationHandler.java
deleted file mode 100644
index 2d88ed36d9..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKCallbackInvocationHandler.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation.impl;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.core.assembly.impl.RuntimeWireImpl;
-import org.apache.tuscany.sca.core.context.impl.CallableReferenceImpl;
-import org.apache.tuscany.sca.core.conversation.ConversationState;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.NoRegisteredCallbackException;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Responsible for dispatching to a callback through a wire. <p/> TODO cache
- * target invoker
- *
- * @version $Rev$ $Date$
- */
-public class JDKCallbackInvocationHandler extends JDKInvocationHandler {
- private static final long serialVersionUID = -3350283555825935609L;
-
- public JDKCallbackInvocationHandler(MessageFactory messageFactory, CallbackReferenceImpl ref) {
- super(messageFactory, ref);
- this.fixedWire = false;
- }
-
- @Override
- @SuppressWarnings( {"unchecked"})
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- if (Object.class == method.getDeclaringClass()) {
- return invokeObjectMethod(method, args);
- }
-
- // obtain a dedicated wire to be used for this callback invocation
- RuntimeWire wire = ((CallbackReferenceImpl)callableReference).getCallbackWire();
- if (wire == null) {
- //FIXME: need better exception
- throw new ServiceRuntimeException("No callback wire found");
- }
-
- // set the conversational state based on the interface that
- // is specified for the reference that this wire belongs to
- initConversational(wire);
-
- // set the conversation id into the conversation object. This is
- // a special case for callbacks as, unless otherwise set manually,
- // the callback should use the same conversation id as was received
- // on the incoming call to this component
- if (conversational) {
-
- if (conversation == null || conversation.getState() == ConversationState.ENDED) {
- conversation = null;
- }
- Object convID = conversation == null ? null : conversation.getConversationID();
-
- // create a conversation id if one doesn't exist
- // already, i.e. the conversation is just starting
- if (convID == null) {
- convID = ((CallbackReferenceImpl)callableReference).getConvID();
- if (convID != null) {
- conversation = ((RuntimeWireImpl)wire).getConversationManager().getConversation(convID);
- if (callableReference != null) {
- ((CallableReferenceImpl)callableReference).attachConversation(conversation);
- }
- }
- }
- }
-
- setEndpoint(((CallbackReferenceImpl)callableReference).getResolvedEndpoint());
-
- InvocationChain chain = getInvocationChain(method, wire);
- if (chain == null) {
- throw new IllegalArgumentException("No matching operation is found: " + method);
- }
-
- try {
- return invoke(chain, args, wire, wire.getSource());
- } catch (InvocationTargetException e) {
- Throwable t = e.getCause();
- if (t instanceof NoRegisteredCallbackException) {
- throw t;
- }
- throw e;
- } finally {
- // allow the cloned wire to be reused by subsequent callbacks
- ((RuntimeWireImpl)wire).releaseWire();
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java
deleted file mode 100644
index ff58a116b7..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import java.io.Serializable;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.tuscany.sca.core.assembly.impl.RuntimeWireImpl;
-import org.apache.tuscany.sca.core.context.CallableReferenceExt;
-import org.apache.tuscany.sca.core.context.impl.CallableReferenceImpl;
-import org.apache.tuscany.sca.core.conversation.ConversationExt;
-import org.apache.tuscany.sca.core.conversation.ConversationManager;
-import org.apache.tuscany.sca.core.conversation.ConversationState;
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.invocation.ThreadMessageContext;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopedRuntimeComponent;
-import org.apache.tuscany.sca.core.scope.TargetDestructionException;
-import org.apache.tuscany.sca.core.scope.TargetResolutionException;
-import org.apache.tuscany.sca.interfacedef.ConversationSequence;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ConversationEndedException;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JDKInvocationHandler implements InvocationHandler, Serializable {
- private static final long serialVersionUID = -3366410500152201371L;
-
- protected boolean conversational;
- protected ConversationExt conversation;
- protected MessageFactory messageFactory;
- protected EndpointReference source;
- protected EndpointReference target;
- protected RuntimeWire wire;
- protected CallableReference<?> callableReference;
- protected Class<?> businessInterface;
-
- protected boolean fixedWire = true;
-
- protected transient Map<Method, InvocationChain> chains = new HashMap<Method, InvocationChain>();
-
- public JDKInvocationHandler(MessageFactory messageFactory, Class<?> businessInterface, RuntimeWire wire) {
- this.messageFactory = messageFactory;
- this.wire = wire;
- this.businessInterface = businessInterface;
- init(this.wire);
- }
-
- public JDKInvocationHandler(MessageFactory messageFactory, CallableReference<?> callableReference) {
- this.messageFactory = messageFactory;
- this.callableReference = callableReference;
- if (callableReference != null) {
- this.businessInterface = callableReference.getBusinessInterface();
- this.conversation = (ConversationExt)callableReference.getConversation();
- this.wire = ((CallableReferenceExt<?>)callableReference).getRuntimeWire();
- if (wire != null) {
- init(wire);
- }
- }
- }
-
- protected void init(RuntimeWire wire) {
- if (wire != null) {
- try {
- // Clone the endpoint reference so that reference parameters can be changed
- source = (EndpointReference)wire.getSource().clone();
- } catch (CloneNotSupportedException e) {
- throw new ServiceRuntimeException(e);
- }
- initConversational(wire);
- }
- }
-
- protected void initConversational(RuntimeWire wire) {
- InterfaceContract contract = wire.getSource().getInterfaceContract();
- this.conversational = contract.getInterface().isConversational();
- }
-
- protected Object getCallbackID() {
- if (callableReference != null) {
- return callableReference.getCallbackID();
- } else {
- return null;
- }
- }
-
- protected Object getConversationID() {
- if (callableReference != null && callableReference instanceof ServiceReference) {
- return ((ServiceReference)callableReference).getConversationID();
- } else {
- return null;
- }
- }
-
- protected Object getCallbackObject() {
- if (callableReference != null && callableReference instanceof ServiceReference) {
- return ((ServiceReference)callableReference).getCallback();
- } else {
- return null;
- }
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- if (Object.class == method.getDeclaringClass()) {
- return invokeObjectMethod(method, args);
- }
- if (wire == null) {
- throw new ServiceRuntimeException("No runtime wire is available");
- }
- InvocationChain chain = getInvocationChain(method, wire);
- if (chain == null) {
- throw new IllegalArgumentException("No matching operation is found: " + method);
- }
-
- // send the invocation down the wire
- Object result = invoke(chain, args, wire, source);
-
- return result;
- }
-
- /**
- * Handle the methods on the Object.class
- * @param method
- * @param args
- */
- protected Object invokeObjectMethod(Method method, Object[] args) throws Throwable {
- String name = method.getName();
- if ("toString".equals(name)) {
- return "[Proxy - " + toString() + "]";
- } else if ("equals".equals(name)) {
- Object obj = args[0];
- if (obj == null) {
- return false;
- }
- if (!Proxy.isProxyClass(obj.getClass())) {
- return false;
- }
- return equals(Proxy.getInvocationHandler(obj));
- } else if ("hashCode".equals(name)) {
- return hashCode();
- } else {
- return method.invoke(this);
- }
- }
-
- /**
- * Determines if the given operation matches the given method
- *
- * @return true if the operation matches, false if does not
- */
- // FIXME: Should it be in the InterfaceContractMapper?
- @SuppressWarnings("unchecked")
- private static boolean match(Operation operation, Method method) {
- if (operation instanceof JavaOperation) {
- JavaOperation javaOp = (JavaOperation)operation;
- Method m = javaOp.getJavaMethod();
- if (!method.getName().equals(m.getName())) {
- return false;
- }
- if (method.equals(m)) {
- return true;
- }
- } else {
- if (!method.getName().equals(operation.getName())) {
- return false;
- }
- }
-
- // For remotable interface, operation is not overloaded.
- if (operation.getInterface().isRemotable()) {
- return true;
- }
-
- Class<?>[] params = method.getParameterTypes();
-
- DataType<List<DataType>> inputType = null;
- if (operation.isWrapperStyle()) {
- inputType = operation.getWrapper().getUnwrappedInputType();
- } else {
- inputType = operation.getInputType();
- }
- List<DataType> types = inputType.getLogical();
- boolean matched = true;
- if (types.size() == params.length && method.getName().equals(operation.getName())) {
- for (int i = 0; i < params.length; i++) {
- Class<?> clazz = params[i];
- Class<?> type = types.get(i).getPhysical();
- // Object.class.isAssignableFrom(int.class) returns false
- if (type != Object.class && (!type.isAssignableFrom(clazz))) {
- matched = false;
- }
- }
- } else {
- matched = false;
- }
- return matched;
-
- }
-
- protected synchronized InvocationChain getInvocationChain(Method method, RuntimeWire wire) {
- if (fixedWire && chains.containsKey(method)) {
- return chains.get(method);
- }
- InvocationChain found = null;
- for (InvocationChain chain : wire.getInvocationChains()) {
- Operation operation = chain.getSourceOperation();
- if (operation.isDynamic()) {
- operation.setName(method.getName());
- found = chain;
- break;
- } else if (match(operation, method)) {
- found = chain;
- break;
- }
- }
- if (fixedWire) {
- chains.put(method, found);
- }
- return found;
- }
-
- protected void setEndpoint(EndpointReference endpoint) {
- this.target = endpoint;
- }
-
- protected Object invoke(InvocationChain chain, Object[] args, RuntimeWire wire, EndpointReference source)
- throws Throwable {
- Message msg = messageFactory.createMessage();
- msg.setFrom(source);
- if (target != null) {
- msg.setTo(target);
- } else {
- msg.setTo(wire.getTarget());
- }
- Invoker headInvoker = chain.getHeadInvoker();
- Operation operation = chain.getTargetOperation();
- msg.setOperation(operation);
- msg.setBody(args);
-
- Message msgContext = ThreadMessageContext.getMessageContext();
- Object currentConversationID = msgContext.getFrom().getReferenceParameters().getConversationID();
-
- conversationPreinvoke(msg, wire);
- handleCallback(msg, wire, currentConversationID);
- ThreadMessageContext.setMessageContext(msg);
- boolean abnormalEndConversation = false;
- try {
- // dispatch the wire down the chain and get the response
- Message resp = headInvoker.invoke(msg);
- Object body = resp.getBody();
- if (resp.isFault()) {
- // mark the conversation as ended if the exception is not a business exception
- if (currentConversationID != null ){
- try {
- boolean businessException = false;
-
- for (DataType dataType : operation.getFaultTypes()){
- if (dataType.getPhysical() == ((Throwable)body).getClass()){
- businessException = true;
- break;
- }
- }
-
- if (businessException == false){
- abnormalEndConversation = true;
- }
- } catch (Exception ex){
- // TODO - sure what the best course of action is here. We have
- // a system exception in the middle of a business exception
- }
- }
- throw (Throwable)body;
- }
- return body;
- } finally {
- conversationPostInvoke(msg, wire, abnormalEndConversation);
- ThreadMessageContext.setMessageContext(msgContext);
- }
- }
-
- /**
- * @param msg
- * @param wire
- * @param interfaze
- * @throws TargetResolutionException
- */
- private void handleCallback(Message msg, RuntimeWire wire, Object currentConversationID)
- throws TargetResolutionException {
- ReferenceParameters parameters = msg.getFrom().getReferenceParameters();
- parameters.setCallbackID(getCallbackID());
- if (msg.getFrom() == null || msg.getFrom().getCallbackEndpoint() == null) {
- return;
- }
-
- parameters.setCallbackReference(msg.getFrom().getCallbackEndpoint());
-
- // If we are passing out a callback target
- // register the calling component instance against this
- // new conversation id so that stateful callbacks will be
- // able to find it
- Object callbackObject = getCallbackObject();
- if (conversational && callbackObject == null) {
- // the component instance is already registered
- // so add another registration
- ScopeContainer<Object> scopeContainer = getConversationalScopeContainer(wire);
-
- if (scopeContainer != null && currentConversationID != null) {
- scopeContainer.addWrapperReference(currentConversationID, conversation.getConversationID());
- }
- }
-
- Interface interfaze = msg.getFrom().getCallbackEndpoint().getInterfaceContract().getInterface();
- if (callbackObject != null) {
- if (callbackObject instanceof ServiceReference) {
- EndpointReference callbackRef = ((CallableReferenceExt<?>)callbackObject).getEndpointReference();
- parameters.setCallbackReference(callbackRef);
- } else {
- if (interfaze != null) {
- if (!interfaze.isConversational()) {
- throw new IllegalArgumentException(
- "Callback object for stateless callback is not a ServiceReference");
- } else {
- if (!(callbackObject instanceof Serializable)) {
- throw new IllegalArgumentException(
- "Callback object for stateful callback is not Serializable");
- }
- ScopeContainer scopeContainer = getConversationalScopeContainer(wire);
- if (scopeContainer != null) {
- InstanceWrapper wrapper = new CallbackObjectWrapper(callbackObject);
- scopeContainer.registerWrapper(wrapper, conversation.getConversationID());
- }
- parameters.setCallbackObjectID(callbackObject);
- }
- }
- }
- }
- }
-
- /**
- * Pre-invoke for the conversation handling
- * @param msg
- * @throws TargetResolutionException
- */
- private void conversationPreinvoke(Message msg, RuntimeWire wire) {
- if (!conversational) {
- // Not conversational or the conversation has been started
- return;
- }
-
- ConversationManager conversationManager = ((RuntimeWireImpl)wire).getConversationManager();
-
- if (conversation == null || conversation.getState() == ConversationState.ENDED) {
-
- conversation = conversationManager.startConversation(getConversationID());
-
- // if this is a local wire then set up the conversation timeouts here based on the
- // parameters from the component
- if (wire.getTarget().getComponent() != null){
- conversation.initializeConversationAttributes(wire.getTarget().getComponent());
- }
-
- // connect the conversation to the CallableReference so it can be retrieve in the future
- if (callableReference != null) {
- ((CallableReferenceImpl)callableReference).attachConversation(conversation);
- }
- } else if (conversation.isExpired()) {
- throw new ConversationEndedException("Conversation " + conversation.getConversationID() + " has expired.");
- }
-
- // if this is a local wire then schedule conversation timeouts based on the timeout
- // parameters from the service implementation. If this isn't a local wire then
- // the RuntimeWireInvoker will take care of this
- if (wire.getTarget().getComponent() != null){
- conversation.updateLastReferencedTime();
- }
-
- msg.getFrom().getReferenceParameters().setConversationID(conversation.getConversationID());
-
- }
-
- /**
- * Post-invoke for the conversation handling
- * @param wire
- * @param operation
- * @throws TargetDestructionException
- */
- @SuppressWarnings("unchecked")
- private void conversationPostInvoke(Message msg, RuntimeWire wire, boolean abnormalEndConversation)
- throws TargetDestructionException {
- Operation operation = msg.getOperation();
- ConversationSequence sequence = operation.getConversationSequence();
- // We check that conversation has not already ended as there is only one
- // conversation manager in the runtime and so, in the case of remote bindings,
- // the conversation will already have been stopped when we get back to the client
- if ((sequence == ConversationSequence.CONVERSATION_END || abnormalEndConversation) &&
- (conversation.getState() != ConversationState.ENDED)) {
-
- // remove conversation id from scope container
- ScopeContainer scopeContainer = getConversationalScopeContainer(wire);
-
- if (scopeContainer != null) {
- scopeContainer.remove(conversation.getConversationID());
- }
-
- conversation.end();
- }
- }
-
- private ScopeContainer<Object> getConversationalScopeContainer(RuntimeWire wire) {
- ScopeContainer<Object> scopeContainer = null;
-
- RuntimeComponent runtimeComponent = wire.getSource().getComponent();
-
- if (runtimeComponent instanceof ScopedRuntimeComponent) {
- ScopedRuntimeComponent scopedRuntimeComponent = (ScopedRuntimeComponent)runtimeComponent;
- ScopeContainer<Object> tmpScopeContainer = scopedRuntimeComponent.getScopeContainer();
-
- if ((tmpScopeContainer != null) && (tmpScopeContainer.getScope() == Scope.CONVERSATION)) {
- scopeContainer = tmpScopeContainer;
- }
- }
-
- return scopeContainer;
- }
-
- /**
- * Creates a new conversation id
- *
- * @return the conversation id
- */
- private Object createConversationID() {
- if (getConversationID() != null) {
- return getConversationID();
- } else {
- return UUID.randomUUID().toString();
- }
- }
-
- /**
- * @return the callableReference
- */
- public CallableReference<?> getCallableReference() {
- return callableReference;
- }
-
- /**
- * @param callableReference the callableReference to set
- */
- public void setCallableReference(CallableReference<?> callableReference) {
- this.callableReference = callableReference;
- }
-
- /**
- * Minimal wrapper for a callback object contained in a ServiceReference
- */
- private static class CallbackObjectWrapper<T> implements InstanceWrapper<T> {
-
- private T instance;
-
- private CallbackObjectWrapper(T instance) {
- this.instance = instance;
- }
-
- public T getInstance() {
- return instance;
- }
-
- public void start() {
- // do nothing
- }
-
- public void stop() {
- // do nothing
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKProxyFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKProxyFactory.java
deleted file mode 100644
index b0c2edd2b6..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKProxyFactory.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation.impl;
-
-import java.lang.reflect.InvocationHandler;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.List;
-
-import org.apache.tuscany.sca.core.context.impl.CallableReferenceImpl;
-import org.apache.tuscany.sca.core.context.impl.ServiceReferenceImpl;
-import org.apache.tuscany.sca.core.invocation.ProxyCreationException;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.invocation.CachedProxy;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * the default implementation of a wire service that uses JDK dynamic proxies
- *
- * @version $Rev$ $Date$
- */
-public class JDKProxyFactory implements ProxyFactory {
- protected InterfaceContractMapper contractMapper;
- private MessageFactory messageFactory;
-
- public JDKProxyFactory(MessageFactory messageFactory, InterfaceContractMapper mapper) {
- this.contractMapper = mapper;
- this.messageFactory = messageFactory;
- }
-
- /**
- * The original createProxy method assumes that the proxy doesn't want to
- * share conversation state so sets the conversation object to null
- */
- public <T> T createProxy(Class<T> interfaze, RuntimeWire wire) throws ProxyCreationException {
- ServiceReference<T> serviceReference = new ServiceReferenceImpl(interfaze, wire, this);
- return createProxy(serviceReference);
- }
-
- public <T> T createProxy(CallableReference<T> callableReference) throws ProxyCreationException {
- assert callableReference != null;
- final Class<T> interfaze = callableReference.getBusinessInterface();
- InvocationHandler handler = new JDKInvocationHandler(messageFactory, callableReference);
- // Allow privileged access to class loader. Requires RuntimePermission in security policy.
- ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- return interfaze.getClassLoader();
- }
- });
- Object proxy = CachedProxy.newProxyInstance(cl, new Class[] {interfaze}, handler);
- ((CallableReferenceImpl)callableReference).setProxy(proxy);
- return interfaze.cast(proxy);
- }
-
- public <T> T createCallbackProxy(Class<T> interfaze, List<RuntimeWire> wires) throws ProxyCreationException {
- CallbackReferenceImpl<T> callbackReference = CallbackReferenceImpl.newInstance(interfaze, this, wires);
- return callbackReference != null ? createCallbackProxy(callbackReference) : null;
- }
-
- public <T> T createCallbackProxy(CallbackReferenceImpl<T> callbackReference) throws ProxyCreationException {
- assert callbackReference != null;
- Class<T> interfaze = callbackReference.getBusinessInterface();
- InvocationHandler handler = new JDKCallbackInvocationHandler(messageFactory, callbackReference);
- ClassLoader cl = interfaze.getClassLoader();
- Object proxy = CachedProxy.newProxyInstance(cl, new Class[] {interfaze}, handler);
- callbackReference.setProxy(proxy);
- return interfaze.cast(proxy);
- }
-
- public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
- InvocationHandler handler = CachedProxy.getInvocationHandler(target);
- if (handler instanceof JDKInvocationHandler) {
- return (R)((JDKInvocationHandler)handler).getCallableReference();
- } else {
- throw new IllegalArgumentException("The object is not a known proxy.");
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.core.invocation.ProxyFactory#isProxyClass(java.lang.Class)
- */
- public boolean isProxyClass(Class<?> clazz) {
- return CachedProxy.isProxyClass(clazz);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/MessageFactoryImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/MessageFactoryImpl.java
deleted file mode 100644
index 6ce2ffca21..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/MessageFactoryImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.invocation.impl;
-
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-
-/**
- * Implementation of MessageFactory.
- *
- * @version $Rev$ $Date$
- */
-public class MessageFactoryImpl implements MessageFactory {
-
- public Message createMessage() {
- return new MessageImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/MessageImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/MessageImpl.java
deleted file mode 100644
index e81e5a2f31..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/MessageImpl.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.core.assembly.impl.EndpointReferenceImpl;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-
-/**
- * The default implementation of a message flowed through a wire during an invocation
- *
- * @version $Rev $Date$
- */
-public class MessageImpl implements Message {
- private List<Object> headers = new ArrayList<Object>();
- private Object body;
- private Object messageID;
- private boolean isFault;
- private Operation operation;
-
- private EndpointReference from;
- private EndpointReference to;
-
- public MessageImpl() {
- this.from = new EndpointReferenceImpl("/");
- this.to = new EndpointReferenceImpl("/");
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getBody() {
- return (T)body;
- }
-
- public <T> void setBody(T body) {
- this.isFault = false;
- this.body = body;
- }
-
- public Object getMessageID() {
- return messageID;
- }
-
- public void setMessageID(Object messageId) {
- this.messageID = messageId;
- }
-
- public boolean isFault() {
- return isFault;
- }
-
- public void setFaultBody(Object fault) {
- this.isFault = true;
- this.body = fault;
- }
-
- public EndpointReference getFrom() {
- return from;
- }
-
- public void setFrom(EndpointReference from) {
- this.from = from;
- }
-
- public EndpointReference getTo() {
- return to;
- }
-
- public void setTo(EndpointReference to) {
- this.to = to;
- }
-
- public Operation getOperation() {
- return operation;
- }
-
- public void setOperation(Operation op) {
- this.operation = op;
- }
-
- public List<Object> getHeaders() {
- return headers;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/NoMethodForOperationException.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/NoMethodForOperationException.java
deleted file mode 100644
index 45f4bf52bf..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/NoMethodForOperationException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation.impl;
-
-import org.apache.tuscany.sca.core.invocation.ProxyCreationException;
-
-
-/**
- * Thrown when an {@link org.apache.tuscany.sca.core.factory.model.Operation} cannot be mapped to a method on an interface
- * @version $Rev$ $Date$
- */
-public class NoMethodForOperationException extends ProxyCreationException {
- private static final long serialVersionUID = 5116536602309483679L;
-
- public NoMethodForOperationException() {
- }
-
- public NoMethodForOperationException(String message) {
- super(message);
- }
-
- public NoMethodForOperationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public NoMethodForOperationException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManager.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManager.java
deleted file mode 100644
index 602958ab5e..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManager.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import static org.apache.tuscany.sca.invocation.Phase.IMPLEMENTATION;
-import static org.apache.tuscany.sca.invocation.Phase.IMPLEMENTATION_POLICY;
-import static org.apache.tuscany.sca.invocation.Phase.REFERENCE;
-import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_BINDING;
-import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_BINDING_POLICY;
-import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_BINDING_TRANSPORT;
-import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_BINDING_WIREFORMAT;
-import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_INTERFACE;
-import static org.apache.tuscany.sca.invocation.Phase.REFERENCE_POLICY;
-import static org.apache.tuscany.sca.invocation.Phase.SERVICE;
-import static org.apache.tuscany.sca.invocation.Phase.SERVICE_BINDING;
-import static org.apache.tuscany.sca.invocation.Phase.SERVICE_BINDING_OPERATION_SELECTOR;
-import static org.apache.tuscany.sca.invocation.Phase.SERVICE_BINDING_POLICY;
-import static org.apache.tuscany.sca.invocation.Phase.SERVICE_BINDING_TRANSPORT;
-import static org.apache.tuscany.sca.invocation.Phase.SERVICE_BINDING_WIREFORMAT;
-import static org.apache.tuscany.sca.invocation.Phase.SERVICE_INTERFACE;
-import static org.apache.tuscany.sca.invocation.Phase.SERVICE_POLICY;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PhaseManager {
- private static final Logger log = Logger.getLogger(PhaseManager.class.getName());
-
- public static final String STAGE_REFERENCE = "reference";
- public static final String STAGE_REFERENCE_BINDING = "reference.binding";
- public static final String STAGE_SERVICE_BINDING = "service.binding";
- public static final String STAGE_SERVICE = "service";
- public static final String STAGE_IMPLEMENTATION = "implementation";
-
- private static final String[] SYSTEM_REFERENCE_PHASES =
- {REFERENCE, REFERENCE_INTERFACE, REFERENCE_POLICY, REFERENCE_BINDING};
-
- private static final String[] SYSTEM_REFERENCE_BINDING_PHASES =
- {REFERENCE_BINDING_WIREFORMAT, REFERENCE_BINDING_POLICY, REFERENCE_BINDING_TRANSPORT};
-
- private static final String[] SYSTEM_SERVICE_BINDING_PHASES =
- {SERVICE_BINDING_TRANSPORT, SERVICE_BINDING_OPERATION_SELECTOR, SERVICE_BINDING_WIREFORMAT, SERVICE_BINDING_POLICY};
-
- private static final String[] SYSTEM_SERVICE_PHASES =
- {SERVICE_BINDING, SERVICE_POLICY, SERVICE_INTERFACE, SERVICE};
-
- private static final String[] SYSTEM_IMPLEMENTATION_PHASES = {IMPLEMENTATION_POLICY, IMPLEMENTATION};
-
- private String pattern = Phase.class.getName();
- private Map<String, Stage> stages;
- private List<String> phases;
-
- public class Stage {
- private String name;
- private PhaseSorter<String> sorter = new PhaseSorter<String>();
- private Set<String> firstSet = new HashSet<String>();
- private Set<String> lastSet = new HashSet<String>();
- private List<String> phases = new ArrayList<String>();
-
- public Stage(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public PhaseSorter<String> getSorter() {
- return sorter;
- }
-
- public Set<String> getFirstSet() {
- return firstSet;
- }
-
- public Set<String> getLastSet() {
- return lastSet;
- }
-
- public List<String> getPhases() {
- return phases;
- }
-
- @Override
- public String toString() {
- return name + phases;
- }
- }
-
- // For unit test purpose
- PhaseManager(String pattern) {
- super();
- this.pattern = pattern;
- }
-
- public PhaseManager() {
- }
-
- private List<String> getPhases(String stage) {
- Stage s = getStages().get(stage);
- return s == null ? null : s.getPhases();
- }
-
- public List<String> getReferencePhases() {
- return getPhases(STAGE_REFERENCE);
- }
-
- public List<String> getServicePhases() {
- return getPhases(STAGE_SERVICE);
- }
-
- public List<String> getReferenceBindingPhases() {
- return getPhases(STAGE_REFERENCE_BINDING);
- }
-
- public List<String> getServiceBindingPhases() {
- return getPhases(STAGE_SERVICE_BINDING);
- }
-
- public List<String> getImplementationPhases() {
- return getPhases(STAGE_IMPLEMENTATION);
- }
-
- public synchronized List<String> getAllPhases() {
- if (phases == null) {
- phases = new ArrayList<String>();
- phases.addAll(getReferencePhases());
- phases.addAll(getReferenceBindingPhases());
- phases.addAll(getServiceBindingPhases());
- phases.addAll(getServicePhases());
- phases.addAll(getImplementationPhases());
- }
- return phases;
- }
-
- public synchronized Map<String, Stage> getStages() {
- if (stages != null) {
- return stages;
- }
- init();
-
- Set<ServiceDeclaration> services;
- try {
- services = ServiceDiscovery.getInstance().getServiceDeclarations(pattern);
- } catch (IOException e) {
- throw new ServiceRuntimeException(e);
- }
-
- for (ServiceDeclaration d : services) {
- if (log.isLoggable(Level.FINE)) {
- log.fine(d.getLocation() + ": " + d.getAttributes());
- }
- String name = d.getAttributes().get("name");
- if (name == null) {
- throw new ServiceRuntimeException("Required attribute 'name' is missing.");
- }
- String stageName = d.getAttributes().get("stage");
- if (stageName == null) {
- throw new ServiceRuntimeException("Required attribute 'stage' is missing.");
- }
- Stage stage = stages.get(stageName);
- if (stage == null) {
- throw new ServiceRuntimeException("Invalid stage: " + stageName);
- }
- PhaseSorter<String> graph = stage.getSorter();
- Set<String> firstSet = stage.getFirstSet(), lastSet = stage.getLastSet();
-
- String before = d.getAttributes().get("before");
- String after = d.getAttributes().get("after");
- if (before != null) {
- StringTokenizer tokenizer = new StringTokenizer(before);
- while (tokenizer.hasMoreTokens()) {
- String p = tokenizer.nextToken();
- if (!"*".equals(p)) {
- graph.addEdge(name, p);
- } else {
- firstSet.add(name);
- }
- }
- }
- if (after != null) {
- StringTokenizer tokenizer = new StringTokenizer(after);
- while (tokenizer.hasMoreTokens()) {
- String p = tokenizer.nextToken();
- if (!"*".equals(p)) {
- graph.addEdge(p, name);
- } else {
- lastSet.add(name);
- }
- }
- }
- graph.addVertext(name);
- if(firstSet.size()>1) {
- log.warning("More than one phases are declared to be first: "+firstSet);
- }
- for (String s : firstSet) {
- for (String v : new HashSet<String>(graph.getVertices().keySet())) {
- if (!firstSet.contains(v)) {
- graph.addEdge(s, v);
- }
- }
- }
- if(lastSet.size()>1) {
- log.warning("More than one phases are declared to be the last: "+lastSet);
- }
- for (String s : lastSet) {
- for (String v : new HashSet<String>(graph.getVertices().keySet())) {
- if (!lastSet.contains(v)) {
- graph.addEdge(v, s);
- }
- }
- }
-
- }
-
- for (Stage s : stages.values()) {
- List<String> phases = s.getSorter().topologicalSort(false);
- s.getPhases().clear();
- s.getPhases().addAll(phases);
- }
- if (log.isLoggable(Level.FINE)) {
- log.fine("Stages: " + stages);
- }
- return stages;
- }
-
- private void init() {
- stages = new HashMap<String, Stage>();
-
- Stage referenceStage = new Stage(STAGE_REFERENCE);
- for (int i = 1; i < SYSTEM_REFERENCE_PHASES.length; i++) {
- referenceStage.getSorter().addEdge(SYSTEM_REFERENCE_PHASES[i - 1], SYSTEM_REFERENCE_PHASES[i]);
- }
- referenceStage.getLastSet().add(REFERENCE_BINDING);
- stages.put(referenceStage.getName(), referenceStage);
-
- Stage referenceBindingStage = new Stage(STAGE_REFERENCE_BINDING);
- for (int i = 1; i < SYSTEM_REFERENCE_BINDING_PHASES.length; i++) {
- referenceBindingStage.getSorter().addEdge(SYSTEM_REFERENCE_BINDING_PHASES[i - 1], SYSTEM_REFERENCE_BINDING_PHASES[i]);
- }
- stages.put(referenceBindingStage.getName(), referenceBindingStage);
-
- Stage serviceBindingStage = new Stage(STAGE_SERVICE_BINDING);
- for (int i = 1; i < SYSTEM_SERVICE_BINDING_PHASES.length; i++) {
- serviceBindingStage.getSorter().addEdge(SYSTEM_SERVICE_BINDING_PHASES[i - 1], SYSTEM_SERVICE_BINDING_PHASES[i]);
- }
- stages.put(serviceBindingStage.getName(), serviceBindingStage);
-
-
- Stage serviceStage = new Stage(STAGE_SERVICE);
- for (int i = 1; i < SYSTEM_SERVICE_PHASES.length; i++) {
- serviceStage.getSorter().addEdge(SYSTEM_SERVICE_PHASES[i - 1], SYSTEM_SERVICE_PHASES[i]);
- }
- stages.put(serviceStage.getName(), serviceStage);
-
- Stage implementationStage = new Stage(STAGE_IMPLEMENTATION);
- for (int i = 1; i < SYSTEM_IMPLEMENTATION_PHASES.length; i++) {
- implementationStage.getSorter().addEdge(SYSTEM_IMPLEMENTATION_PHASES[i - 1],
- SYSTEM_IMPLEMENTATION_PHASES[i]);
- }
- implementationStage.getLastSet().add(IMPLEMENTATION);
- stages.put(implementationStage.getName(), implementationStage);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseSorter.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseSorter.java
deleted file mode 100644
index 175f3463ad..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/PhaseSorter.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Directed, weighted graph
- *
- * @param <V> The type of vertex object
- * @param <E> The type of edge object
- *
- * @version $Rev$ $Date$
- */
-public class PhaseSorter<V> implements Cloneable {
- private final Map<V, Vertex> vertices = new HashMap<V, Vertex>();
-
- /**
- * Vertex of a graph
- */
- public final class Vertex {
- private V value;
-
- // TODO: Do we want to support multiple edges for a vertex pair? If so,
- // we should use a List instead of Map
- private Map<Vertex, Edge> outEdges = new HashMap<Vertex, Edge>();
- private Map<Vertex, Edge> inEdges = new HashMap<Vertex, Edge>();
-
- private Vertex(V value) {
- this.value = value;
- }
-
- @Override
- public String toString() {
- return "(" + value + ")";
- }
-
- public V getValue() {
- return value;
- }
-
- public Map<Vertex, Edge> getOutEdges() {
- return outEdges;
- }
-
- public Map<Vertex, Edge> getInEdges() {
- return inEdges;
- }
-
- }
-
- /**
- * An Edge connects two vertices in one direction
- */
- public final class Edge {
- private Vertex sourceVertex;
-
- private Vertex targetVertex;
-
- public Edge(Vertex source, Vertex target) {
- this.sourceVertex = source;
- this.targetVertex = target;
- }
-
- @Override
- public String toString() {
- return sourceVertex + "->" + targetVertex;
- }
-
- public Vertex getTargetVertex() {
- return targetVertex;
- }
-
- public void setTargetVertex(Vertex vertex) {
- this.targetVertex = vertex;
- }
-
- public Vertex getSourceVertex() {
- return sourceVertex;
- }
-
- public void setSourceVertex(Vertex sourceVertex) {
- this.sourceVertex = sourceVertex;
- }
- }
-
- public void addEdge(V source, V target) {
- Vertex s = getVertex(source);
- if (s == null) {
- s = new Vertex(source);
- vertices.put(source, s);
- }
- Vertex t = getVertex(target);
- if (t == null) {
- t = new Vertex(target);
- vertices.put(target, t);
- }
- Edge edge = new Edge(s, t);
- s.outEdges.put(t, edge);
- t.inEdges.put(s, edge);
- }
-
- public void addVertext(V source) {
- Vertex s = getVertex(source);
- if (s == null) {
- s = new Vertex(source);
- vertices.put(source, s);
- }
- }
-
- public Vertex getVertex(V source) {
- Vertex s = vertices.get(source);
- return s;
- }
-
- public boolean removeEdge(V source, V target) {
- Vertex s = getVertex(source);
- if (s == null) {
- return false;
- }
-
- Vertex t = getVertex(target);
- if (t == null) {
- return false;
- }
-
- return s.outEdges.remove(t) != null && t.inEdges.remove(s) != null;
-
- }
-
- public void removeEdge(Edge edge) {
- edge.sourceVertex.outEdges.remove(edge.targetVertex);
- edge.targetVertex.inEdges.remove(edge.sourceVertex);
- }
-
- public void removeVertex(Vertex vertex) {
- vertices.remove(vertex.getValue());
- for (Edge e : new ArrayList<Edge>(vertex.outEdges.values())) {
- removeEdge(e);
- }
- for (Edge e : new ArrayList<Edge>(vertex.inEdges.values())) {
- removeEdge(e);
- }
- }
-
- public Edge getEdge(Vertex source, Vertex target) {
- return source.outEdges.get(target);
- }
-
- public Edge getEdge(V source, V target) {
- Vertex sv = getVertex(source);
- if (sv == null) {
- return null;
- }
- Vertex tv = getVertex(target);
- if (tv == null) {
- return null;
- }
- return getEdge(getVertex(source), getVertex(target));
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- for (Vertex v : vertices.values()) {
- sb.append(v.outEdges.values()).append("\n");
- }
- return sb.toString();
- }
-
- public Map<V, Vertex> getVertices() {
- return vertices;
- }
-
- public void addGraph(PhaseSorter<V> otherGraph) {
- for (Vertex v : otherGraph.vertices.values()) {
- for (Edge e : v.outEdges.values()) {
- addEdge(e.sourceVertex.value, e.targetVertex.value);
- }
- }
- }
-
- private Vertex getFirst() {
- for (Vertex v : vertices.values()) {
- if (v.inEdges.isEmpty()) {
- return v;
- }
- }
- if (!vertices.isEmpty()) {
- throw new IllegalArgumentException("Circular ordering has been detected: " + toString());
- } else {
- return null;
- }
- }
-
- public List<V> topologicalSort(boolean readOnly) {
- PhaseSorter<V> graph = (!readOnly) ? this : (PhaseSorter<V>)clone();
- List<V> list = new ArrayList<V>();
- while (true) {
- Vertex v = graph.getFirst();
- if (v == null) {
- break;
- }
- list.add(v.getValue());
- graph.removeVertex(v);
- }
-
- return list;
- }
-
- @Override
- public Object clone() {
- PhaseSorter<V> copy = new PhaseSorter<V>();
- copy.addGraph(this);
- return copy;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java
deleted file mode 100644
index 4674456925..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * Implements functionality common to scope contexts.
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractScopeContainer<KEY> implements ScopeContainer<KEY> {
- protected Map<KEY, InstanceWrapper<?>> wrappers = new ConcurrentHashMap<KEY, InstanceWrapper<?>>();
- protected final Scope scope;
-
- protected RuntimeComponent component;
- protected volatile int lifecycleState = UNINITIALIZED;
-
-
- public AbstractScopeContainer(Scope scope, RuntimeComponent component) {
- this.scope = scope;
- this.component = component;
- }
-
- protected void checkInit() {
- if (getLifecycleState() != RUNNING) {
- throw new IllegalStateException("Scope container not running [" + getLifecycleState() + "]");
- }
- }
-
- /**
- * Creates a new physical instance of a component, wrapped in an
- * InstanceWrapper.
- *
- * @param component the component whose instance should be created
- * @return a wrapped instance that has been injected but not yet started
- * @throws TargetResolutionException if there was a problem creating the
- * instance
- */
- protected InstanceWrapper createInstanceWrapper() throws TargetResolutionException {
- ImplementationProvider implementationProvider = component.getImplementationProvider();
- if (implementationProvider instanceof ScopedImplementationProvider) {
- return ((ScopedImplementationProvider)implementationProvider).createInstanceWrapper();
- }
- return null;
- }
-
- public InstanceWrapper getAssociatedWrapper(KEY contextId) throws TargetResolutionException {
- return getWrapper(contextId); // TODO: what is this method supposed to do diff than getWrapper?
- }
-
- public Scope getScope() {
- return scope;
- }
-
- public InstanceWrapper getWrapper(KEY contextId) throws TargetResolutionException {
- return wrappers.get(contextId);
- }
-
- public void addWrapperReference(KEY existingContextId, KEY newContextId)
- throws TargetResolutionException {
- // do nothing here. the conversational scope container implements this
- }
-
- public void registerWrapper(InstanceWrapper wrapper, KEY contextId) throws TargetResolutionException {
- // do nothing here. the conversational scope container implements this
- }
-
- protected boolean isEagerInit() {
- ImplementationProvider implementationProvider = ((RuntimeComponent)component).getImplementationProvider();
- if (implementationProvider instanceof ScopedImplementationProvider) {
- return ((ScopedImplementationProvider)implementationProvider).isEagerInit();
- }
- return false;
- }
-
- public void returnWrapper(InstanceWrapper wrapper, KEY contextId) throws TargetDestructionException {
- }
-
- /**
- * Default implementation of remove which does nothing
- *
- * @param contextId the identifier of the context to remove.
- */
- public void remove(KEY contextId)
- throws TargetDestructionException {
- }
-
- public synchronized void start() {
- int lifecycleState = getLifecycleState();
- if (lifecycleState != UNINITIALIZED && lifecycleState != STOPPED) {
- throw new IllegalStateException("Scope must be in UNINITIALIZED or STOPPED state [" + lifecycleState + "]");
- }
- setLifecycleState(RUNNING);
- }
-
- public void startContext(KEY contextId) {
- if(isEagerInit()) {
- try {
- getWrapper(contextId);
- } catch (TargetResolutionException e) {
- //
- }
- }
- }
-
- public synchronized void stop() {
- int lifecycleState = getLifecycleState();
- if (lifecycleState != RUNNING) {
- throw new IllegalStateException("Scope in wrong state [" + lifecycleState + "]");
- }
- setLifecycleState(STOPPED);
- }
-
- public void stopContext(KEY contextId) {
- wrappers.remove(contextId);
- }
-
- @Override
- public String toString() {
- String s;
- switch (lifecycleState) {
- case ScopeContainer.CONFIG_ERROR:
- s = "CONFIG_ERROR";
- break;
- case ScopeContainer.ERROR:
- s = "ERROR";
- break;
- case ScopeContainer.INITIALIZING:
- s = "INITIALIZING";
- break;
- case ScopeContainer.INITIALIZED:
- s = "INITIALIZED";
- break;
- case ScopeContainer.RUNNING:
- s = "RUNNING";
- break;
- case ScopeContainer.STOPPING:
- s = "STOPPING";
- break;
- case ScopeContainer.STOPPED:
- s = "STOPPED";
- break;
- case ScopeContainer.UNINITIALIZED:
- s = "UNINITIALIZED";
- break;
- default:
- s = "UNKNOWN";
- break;
- }
- return "In state [" + s + ']';
- }
-
- public RuntimeComponent getComponent() {
- return component;
- }
-
- public void setComponent(RuntimeComponent component) {
- this.component = component;
- }
-
- public int getLifecycleState() {
- return lifecycleState;
- }
-
- /**
- * Set the current state of the Lifecycle.
- *
- * @param lifecycleState the new state
- */
- protected void setLifecycleState(int lifecycleState) {
- this.lifecycleState = lifecycleState;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/DefaultScopeRegistry.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/DefaultScopeRegistry.java
deleted file mode 100644
index b6857be97a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/DefaultScopeRegistry.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.scope;
-
-import org.apache.tuscany.sca.core.scope.impl.CompositeScopeContainerFactory;
-import org.apache.tuscany.sca.core.scope.impl.ConversationalScopeContainerFactory;
-import org.apache.tuscany.sca.core.scope.impl.RequestScopeContainerFactory;
-import org.apache.tuscany.sca.core.scope.impl.ScopeRegistryImpl;
-import org.apache.tuscany.sca.core.scope.impl.StatelessScopeContainerFactory;
-
-/**
- * A default scope registry implementation.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultScopeRegistry extends ScopeRegistryImpl implements ScopeRegistry {
-
- public DefaultScopeRegistry() {
- ScopeContainerFactory[] factories =
- new ScopeContainerFactory[] {new CompositeScopeContainerFactory(), new StatelessScopeContainerFactory(),
- new RequestScopeContainerFactory(),
- new ConversationalScopeContainerFactory(),
- // new HttpSessionScopeContainer(monitor)
- };
- for (ScopeContainerFactory f : factories) {
- register(f);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/Scope.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/Scope.java
deleted file mode 100644
index 0a20d793f7..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/Scope.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope;
-
-/**
- * The default implementation scopes supported by assemblies.
- *
- * @version $Rev$ $Date$
- */
-public class Scope {
- public static final Scope STATELESS = new Scope("STATELESS");
- public static final Scope REQUEST = new Scope("REQUEST");
- public static final Scope SESSION = new Scope("SESSION");
- public static final Scope CONVERSATION = new Scope("CONVERSATION");
- public static final Scope COMPOSITE = new Scope("COMPOSITE");
- public static final Scope SYSTEM = new Scope("SYSTEM");
- public static final Scope UNDEFINED = new Scope("UNDEFINED");
-
- private String scope;
-
- public Scope(String scope) {
- this.scope = scope.toUpperCase().intern();
- }
-
- public String getScope() {
- return scope;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- final Scope scope1 = (Scope) o;
- return !(scope != null ? scope != scope1.scope.intern() : scope1.scope != null);
- }
-
- @Override
- public int hashCode() {
- return scope != null ? scope.hashCode() : 0;
- }
-
- @Override
- public String toString() {
- return scope;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainer.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainer.java
deleted file mode 100644
index 2398ecea3e..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainer.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-
-/**
- * Manages the lifecycle and visibility of instances associated with a an {@link RuntimeComponent}.
- *
- * @version $Rev$ $Date$
- * @param <KEY> the type of IDs that this container uses to identify its contexts.
- * For example, for COMPOSITE scope this could be the URI of the composite component,
- * or for HTTP Session scope it might be the HTTP session ID.
- */
-public interface ScopeContainer<KEY> {
-
- /**
- * Returns the Scope that this container supports.
- *
- * @return the Scope that this container supports
- */
- Scope getScope();
-
- /**
- * Start a new context with the supplied ID.
- *
- * @param contextId an ID that uniquely identifies the context.
- */
- void startContext(KEY contextId);
-
- /**
- * Stop the context with the supplied ID.
- *
- * @param contextId an ID that uniquely identifies the context.
- */
- void stopContext(KEY contextId);
-
- /**
- * Returns an instance wrapper associated with the current scope context, creating one if necessary
- * @param contextId the id for the scope context
- *
- * @return the wrapper for the target instance
- * @throws TargetResolutionException if there was a problem instantiating the target instance
- */
- InstanceWrapper getWrapper(KEY contextId) throws TargetResolutionException;
-
- /**
- * Allows a component to be registered against more than one context id. This is required in the
- * case of stateful callbacks where we want to identify the originating client component instance
- * as the callback target but we don't want to reuse the clients original conversation id
- *
- * @param existingContextId an id that identifies an existing component instance
- * @param newContextId a new id against which this component will also be registered
- * @throws TargetResolutionException
- */
- void addWrapperReference(KEY existingContextId, KEY newContextId)
- throws TargetResolutionException;
-
- /**
- * Register an existing instance against a context id. This is needed
- * for a stateful callback where the service reference for the forward call
- * contains a callback object that is not a service reference.
- *
- * @param wrapper the instance wrapper for the instance to be registered
- * @param contextId the id for the scope context
- * @throws TargetResolutionException
- */
- void registerWrapper(InstanceWrapper wrapper, KEY contextId)
- throws TargetResolutionException;
-
- /**
- * Returns an implementation instance associated with the current scope context.
- * If no instance is found, a {@link TargetNotFoundException} is thrown.
- * @param contextId the id for the scope context
- *
- * @return the wrapper for the target instance
- * @throws TargetResolutionException if there was a problem instantiating the target instance
- */
- InstanceWrapper getAssociatedWrapper(KEY contextId)
- throws TargetResolutionException;
-
- /**
- * Return a wrapper after use (for example, after invoking the instance).
- * @param wrapper the wrapper for the target instance being returned
- * @param contextId the id for the scope context
- *
- * @throws TargetDestructionException if there was a problem returning the target instance
- */
- void returnWrapper(InstanceWrapper wrapper, KEY contextId)
- throws TargetDestructionException;
-
- /**
- * Removes an identified component implementation instance associated with the current
- * context from persistent storage
- *
- * @param contextId the identifier of the context to remove.
- */
- void remove(KEY contextId)
- throws TargetDestructionException;
-
- /* A configuration error state */
- int CONFIG_ERROR = -1;
- /* Has not been initialized */
- int UNINITIALIZED = 0;
- /* In the process of being configured and initialized */
- int INITIALIZING = 1;
- /* Instantiated and configured */
- int INITIALIZED = 2;
- /* Configured and initialized */
- int RUNNING = 4;
- /* In the process of being shutdown */
- int STOPPING = 5;
- /* Has been shutdown and removed from the composite */
- int STOPPED = 6;
- /* In an error state */
- int ERROR = 7;
-
- /**
- * Returns the lifecycle state
- *
- * @see #UNINITIALIZED
- * @see #INITIALIZING
- * @see #INITIALIZED
- * @see #RUNNING
- * @see #STOPPING
- * @see #STOPPED
- */
- int getLifecycleState();
-
- /**
- * Starts the Lifecycle.
- */
- void start();
-
- /**
- * Stops the Lifecycle.
- */
- void stop();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainerFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainerFactory.java
deleted file mode 100644
index b19c14b3e0..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainerFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.scope;
-
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * Factory to create ScopeContainer for components
- *
- * @version $Rev$ $Date$
- */
-public interface ScopeContainerFactory {
- ScopeContainer createScopeContainer(RuntimeComponent component);
- Scope getScope();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeRegistry.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeRegistry.java
deleted file mode 100644
index 842ed4c547..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeRegistry.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope;
-
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-
-/**
- * Manages {@link ScopeContainer}s in the runtime
- *
- * @version $Rev$ $Date$
- */
-public interface ScopeRegistry {
-
- /**
- * Returns the scope container for the given scope or null if one not found
- *
- * @param scope the scope
- * @return the scope container for the given scope or null if one not found
- */
- ScopeContainer getScopeContainer(RuntimeComponent component);
-
- /**
- * @param factory
- */
- void register(ScopeContainerFactory factory);
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopedImplementationProvider.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopedImplementationProvider.java
deleted file mode 100644
index 30d5c77181..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopedImplementationProvider.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.scope;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-
-/**
- * A component implementation can implement this interface to provide scope
- * management for the components
- *
- * @version $Rev$ $Date$
- */
-public interface ScopedImplementationProvider extends ImplementationProvider {
- /**
- * Get the scope for the component implementation
- *
- * @return The scope for the component implementation, if null is returned,
- * STATELESS will be used
- */
- Scope getScope();
-
- /**
- * Indicate if the component needs to be eagerly initialized
- *
- * @return true if the component is marked to be eagerly initialized, false
- * otherwise
- */
- boolean isEagerInit();
-
- /**
- * @return the maxAge
- */
- long getMaxAge();
-
- /**
- * @return the maxIdleTime
- */
- long getMaxIdleTime();
-
- /**
- * Create a wrapper for the component instance for the scope management
- *
- * @return A wrapper for the component instance
- */
- InstanceWrapper createInstanceWrapper();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopedRuntimeComponent.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopedRuntimeComponent.java
deleted file mode 100644
index c27b112f8a..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopedRuntimeComponent.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.scope;
-
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * Scoped runtime component
- *
- * @version $Rev$ $Date$
- */
-public interface ScopedRuntimeComponent extends RuntimeComponent {
- /**
- * Set the associated scope container
- * @param scopeContainer
- */
- void setScopeContainer(ScopeContainer scopeContainer);
- /**
- * Get the assoicated scope container
- * @return
- */
- ScopeContainer getScopeContainer();
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetDestructionException.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetDestructionException.java
deleted file mode 100644
index 0f83dad97d..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetDestructionException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope;
-
-/**
- * Denotes an error destroying a target
- *
- * @version $Rev$ $Date$
- */
-public class TargetDestructionException extends TargetResolutionException {
- private static final long serialVersionUID = -6126684147851674709L;
-
- public TargetDestructionException() {
- super();
- }
-
- public TargetDestructionException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public TargetDestructionException(String message) {
- super(message);
- }
-
- public TargetDestructionException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetInitializationException.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetInitializationException.java
deleted file mode 100644
index 15959c0608..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetInitializationException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope;
-
-/**
- * Denotes an error initializing a target
- *
- * @version $Rev$ $Date$
- */
-public class TargetInitializationException extends TargetResolutionException {
- private static final long serialVersionUID = -6228778208649752698L;
-
- public TargetInitializationException() {
- super();
- }
-
- public TargetInitializationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public TargetInitializationException(String message) {
- super(message);
- }
-
- public TargetInitializationException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetNotFoundException.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetNotFoundException.java
deleted file mode 100644
index bb46a2499b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetNotFoundException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope;
-
-/**
- * Thrown when a target of an operation cannot be found
- *
- * @version $Rev$ $Date$
- */
-public class TargetNotFoundException extends TargetResolutionException {
- private static final long serialVersionUID = 5541830480658471186L;
-
- public TargetNotFoundException() {
- super();
- }
-
- public TargetNotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public TargetNotFoundException(String message) {
- super(message);
- }
-
- public TargetNotFoundException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetResolutionException.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetResolutionException.java
deleted file mode 100644
index ea8d0e876c..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/TargetResolutionException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope;
-
-/**
- * Denotes an error retrieving a target instance
- *
- * @version $Rev$ $Date$
- */
-public class TargetResolutionException extends Exception {
- private static final long serialVersionUID = 2912513650522019405L;
-
- public TargetResolutionException() {
- super();
- }
-
- public TargetResolutionException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public TargetResolutionException(String message) {
- super(message);
- }
-
- public TargetResolutionException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainer.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainer.java
deleted file mode 100644
index 6763c8117d..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainer.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope.impl;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.scope.AbstractScopeContainer;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.TargetDestructionException;
-import org.apache.tuscany.sca.core.scope.TargetNotFoundException;
-import org.apache.tuscany.sca.core.scope.TargetResolutionException;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * A scope context which manages atomic component instances keyed by composite
- *
- * @version $Rev$ $Date$
- */
-public class CompositeScopeContainer<KEY> extends AbstractScopeContainer<KEY> {
- private InstanceWrapper<?> wrapper;
-
- public CompositeScopeContainer(RuntimeComponent component) {
- super(Scope.COMPOSITE, component);
- }
-
- @Override
- public synchronized void stop() {
- super.stop();
- if (wrapper != null) {
- try {
- wrapper.stop();
- } catch (TargetDestructionException e) {
- throw new IllegalStateException(e);
- }
- }
- wrapper = null;
- }
-
- @Override
- public synchronized InstanceWrapper getWrapper(KEY contextId) throws TargetResolutionException {
- if (wrapper == null) {
- wrapper = createInstanceWrapper();
- wrapper.start();
- }
- return wrapper;
- }
-
- @Override
- public InstanceWrapper getAssociatedWrapper(KEY contextId) throws TargetResolutionException {
- if (wrapper == null) {
- throw new TargetNotFoundException(component.getURI());
- }
- return wrapper;
- }
-
- @Override
- public synchronized void start() {
- super.start();
- if (isEagerInit()) {
- try {
- getWrapper(null);
- } catch (TargetResolutionException e) {
- throw new IllegalStateException(e);
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainerFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainerFactory.java
deleted file mode 100644
index f61e70a598..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainerFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.scope.impl;
-
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopeContainerFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CompositeScopeContainerFactory implements ScopeContainerFactory {
-
- public ScopeContainer createScopeContainer(RuntimeComponent component) {
- return new CompositeScopeContainer(component);
- }
-
- public Scope getScope() {
- return Scope.COMPOSITE;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ConversationalScopeContainer.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ConversationalScopeContainer.java
deleted file mode 100644
index 853866d8e8..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ConversationalScopeContainer.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.scope.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.tuscany.sca.core.conversation.ConversationListener;
-import org.apache.tuscany.sca.core.conversation.ConversationManager;
-import org.apache.tuscany.sca.core.conversation.ConversationExt;
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.invocation.ThreadMessageContext;
-import org.apache.tuscany.sca.core.scope.AbstractScopeContainer;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.TargetDestructionException;
-import org.apache.tuscany.sca.core.scope.TargetResolutionException;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * A scope context which manages atomic component instances keyed on ConversationID
- *
- * @version $Rev$ $Date$
- */
-public class ConversationalScopeContainer extends AbstractScopeContainer<Object> implements ConversationListener {
- private ConversationManager conversationManager;
- private Map<Object, InstanceLifeCycleWrapper> instanceLifecycleCollection =
- new ConcurrentHashMap<Object, InstanceLifeCycleWrapper>();
-
- public ConversationalScopeContainer(RuntimeComponent component) {
- super(Scope.CONVERSATION, component);
-
- // Note: aStore is here to preserve the original factory interface. It is not currently used in this
- // implementation since we do not support instance persistence.
-
- // Check System properties to see if timeout values have been specified. All timeout values
- // will be specified in seconds.
- //
-
- }
-
-
- protected InstanceWrapper getInstanceWrapper(boolean create, Object contextId) throws TargetResolutionException {
-
- // we might get a null context if the target service has
- // conversational scope but only its callback interface
- // is conversational. In this case we need to invent a
- // conversation Id here to store the service against
- // and populate the thread context
- if (contextId == null) {
- contextId = UUID.randomUUID().toString();
- Message msgContext = ThreadMessageContext.getMessageContext();
-
- if (msgContext != null) {
- msgContext.getFrom().getReferenceParameters().setConversationID(contextId);
- }
- }
-
- InstanceLifeCycleWrapper anInstanceWrapper = this.instanceLifecycleCollection.get(contextId);
-
- if (anInstanceWrapper == null && !create)
- return null;
-
- if (anInstanceWrapper == null) {
- anInstanceWrapper = new InstanceLifeCycleWrapper(contextId);
- this.instanceLifecycleCollection.put(contextId, anInstanceWrapper);
- }
-
- return anInstanceWrapper.getInstanceWrapper(contextId);
-
- }
-
- @Override
- public InstanceWrapper getWrapper(Object contextId) throws TargetResolutionException {
- return getInstanceWrapper(true, contextId);
- }
-
- /**
- * This method allows a new context id to be registered alongside an existing one. This happens in
- * one case, when a conversation includes a stateful callback. The client component instance
- * must be registered against all outgoing conversation ids so that the component instance
- * can be found when the callback arrives
- *
- * @param existingContextId the context id against which the component is already registered
- * @param context this should be a conversation object so that the conversation can b stored
- * and reset when the component instance is removed
- */
- @Override
- public void addWrapperReference(Object existingContextId, Object contextId) throws TargetResolutionException {
-
-
- // get the instance wrapper via the existing id
- InstanceLifeCycleWrapper existingInstanceWrapper = this.instanceLifecycleCollection.get(existingContextId);
- InstanceLifeCycleWrapper newInstanceWrapper = this.instanceLifecycleCollection.get(contextId);
-
- // only add the extra reference once
- if (newInstanceWrapper == null) {
- // add the id to the list of ids that the wrapper holds. Used for reference
- // counting and conversation resetting on destruction.
- existingInstanceWrapper.addCallbackConversation(contextId);
-
- // add the reference to the collection
- this.instanceLifecycleCollection.put(contextId, existingInstanceWrapper);
- }
- }
-
- @Override
- public void registerWrapper(InstanceWrapper wrapper, Object contextId) throws TargetResolutionException {
- // if a wrapper for a different instance is already registered for this contextId, remove it
- InstanceLifeCycleWrapper anInstanceWrapper = this.instanceLifecycleCollection.get(contextId);
- if (anInstanceWrapper != null) {
- if (anInstanceWrapper.getInstanceWrapper(contextId).getInstance() != wrapper.getInstance()) {
- remove(contextId);
- } else {
- return;
- }
- }
-
- anInstanceWrapper = new InstanceLifeCycleWrapper(wrapper, contextId);
- this.instanceLifecycleCollection.put(contextId, anInstanceWrapper);
- }
-
- // The remove is invoked when a conversation is explicitly ended. This can occur by using the @EndsConversation or API.
- // In this case the instance is immediately removed. A new conversation will be started on the next operation
- // associated with this conversationId's service reference.
- //
- @Override
- public void remove(Object contextId) throws TargetDestructionException {
- if (contextId != null) {
- if (this.instanceLifecycleCollection.containsKey(contextId)) {
- InstanceLifeCycleWrapper anInstanceLifeCycleWrapper = this.instanceLifecycleCollection.get(contextId);
- this.instanceLifecycleCollection.remove(contextId);
- anInstanceLifeCycleWrapper.removeInstanceWrapper(contextId);
- }
- }
- }
-
- /*
- * This is an inner class that keeps track of the lifecycle of a conversation scoped
- * implementation instance.
- *
- */
-
- private class InstanceLifeCycleWrapper {
- private Object clientConversationId;
- private List<Object> callbackConversations = new ArrayList<Object>();
-
- private InstanceLifeCycleWrapper(Object contextId) throws TargetResolutionException {
- this.clientConversationId = contextId;
- this.createInstance(contextId);
- }
-
- private InstanceLifeCycleWrapper(InstanceWrapper wrapper, Object contextId) throws TargetResolutionException {
- this.clientConversationId = contextId;
- wrappers.put(contextId, wrapper);
- }
-
-
- // Associates a callback conversation with this instance. Each time the scope container
- // is asked to remove an object given a ontextId an associated conversation object will
- // have its conversationId reset to null. When the list of ids is empty the component instance
- // will be removed from the scope container
- private void addCallbackConversation(Object conversationID) {
- InstanceWrapper ctx = getInstanceWrapper(clientConversationId);
- callbackConversations.add(conversationID);
- wrappers.put(conversationID, ctx);
- }
-
- //
- // Return the backing implementation instance
- //
- private InstanceWrapper getInstanceWrapper(Object contextId) {
- InstanceWrapper ctx = wrappers.get(contextId);
- return ctx;
- }
-
- private void removeInstanceWrapper(Object contextId) throws TargetDestructionException {
- InstanceWrapper ctx = getInstanceWrapper(contextId);
- wrappers.remove(contextId);
-
- // find out if we are dealing with the original client conversation id
- // and reset accordingly
- if ( ( clientConversationId != null ) && ( clientConversationId.equals(contextId)) ) {
- clientConversationId = null;
- } else {
- // reset the conversationId in the conversation object if present
- // so that and ending callback causes the conversation in the originating
- // service reference in the client to be reset
- callbackConversations.remove(contextId);
- }
-
- // stop the component if this removes the last reference
- if (clientConversationId == null && callbackConversations.isEmpty()) {
- ctx.stop();
- }
- }
-
- private void createInstance(Object contextId) throws TargetResolutionException {
- InstanceWrapper instanceWrapper = createInstanceWrapper();
- instanceWrapper.start();
- wrappers.put(contextId, instanceWrapper);
- }
-
- }
-
- /**
- * @see org.apache.tuscany.sca.core.conversation.ConversationListener#conversationEnded(org.apache.tuscany.sca.core.conversation.ConversationExt)
- */
- public void conversationEnded(ConversationExt conversation) {
- try {
- remove(conversation.getConversationID());
- } catch (Exception ex) {
-
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.core.conversation.ConversationListener#conversationExpired(org.apache.tuscany.sca.core.conversation.ConversationExt)
- */
- public void conversationExpired(ConversationExt conversation) {
-
- Object conversationId = conversation.getConversationID();
- InstanceLifeCycleWrapper ilcw = instanceLifecycleCollection.get(conversationId);
- if (ilcw != null) {
- // cycle through all the references to this instance and
- // remove them from the underlying wrappers collection and
- // from the lifecycle wrappers collection
-
- for (Object conversationID : ilcw.callbackConversations) {
- try{
- ilcw.removeInstanceWrapper(conversationID);
- remove(conversationID);
- } catch(TargetDestructionException tde) {
- System.out.println("Could not remove conversation id " + conversationID);
- }
- }
-
-
- if (ilcw.clientConversationId != null) {
- try{
- ilcw.removeInstanceWrapper(ilcw.clientConversationId);
- remove(ilcw.clientConversationId);
- } catch(TargetDestructionException tde) {
- System.out.println("Could not remove conversation id " + ilcw.clientConversationId);
- }
- }
-
- }
-
- }
-
- /**
- * @see org.apache.tuscany.sca.core.conversation.ConversationListener#conversationStarted(org.apache.tuscany.sca.core.conversation.ConversationExt)
- */
- public void conversationStarted(ConversationExt conversation) {
- startContext(conversation.getConversationID());
- }
-
- /**
- * @return the conversationManager
- */
- public ConversationManager getConversationManager() {
- return conversationManager;
- }
-
- /**
- * @param conversationManager the conversationManager to set
- */
- public void setConversationManager(ConversationManager conversationManager) {
- this.conversationManager = conversationManager;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ConversationalScopeContainerFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ConversationalScopeContainerFactory.java
deleted file mode 100644
index f8ffc027a1..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ConversationalScopeContainerFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.scope.impl;
-
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopeContainerFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConversationalScopeContainerFactory implements ScopeContainerFactory {
-
- public ConversationalScopeContainerFactory() {
- super();
- }
-
- public ScopeContainer createScopeContainer(RuntimeComponent component) {
- return new ConversationalScopeContainer(component);
- }
-
- public Scope getScope() {
- return Scope.CONVERSATION;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/HttpSessionScopeContainer.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/HttpSessionScopeContainer.java
deleted file mode 100644
index bfe197255d..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/HttpSessionScopeContainer.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope.impl;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.scope.AbstractScopeContainer;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.TargetResolutionException;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * A scope context which manages atomic component instances keyed on HTTP
- * session
- *
- * @version $Rev$ $Date$
- */
-public class HttpSessionScopeContainer extends AbstractScopeContainer<Object> {
-
- public HttpSessionScopeContainer(RuntimeComponent component) {
- super(Scope.SESSION, component);
- }
-
- @Override
- public synchronized void start() {
- if (lifecycleState != UNINITIALIZED && lifecycleState != STOPPED) {
- throw new IllegalStateException("Scope must be in UNINITIALIZED or STOPPED state [" + lifecycleState + "]");
- }
- lifecycleState = RUNNING;
- }
-
- @Override
- public synchronized void stop() {
- lifecycleState = STOPPED;
- }
-
- protected InstanceWrapper getInstanceWrapper(boolean create) throws TargetResolutionException {
-// Object key = workContext.getIdentifier(Scope.SESSION);
- // FIXME: Need to fix this
- Object key ="http-session-id";
- assert key != null : "HTTP session key not bound in work context";
- InstanceWrapper ctx = wrappers.get(key);
- if (ctx == null && !create) {
- return null;
- }
- if (ctx == null) {
- ctx = super.createInstanceWrapper();
- ctx.start();
- wrappers.put(key, ctx);
- }
- return ctx;
- }
-
- @Override
- public InstanceWrapper getWrapper(Object contextId) throws TargetResolutionException {
- return getInstanceWrapper(true);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/HttpSessionScopeContainerFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/HttpSessionScopeContainerFactory.java
deleted file mode 100644
index d6aaa4cc84..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/HttpSessionScopeContainerFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.scope.impl;
-
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopeContainerFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * @version $Rev$ $Date$
- */
-public class HttpSessionScopeContainerFactory implements ScopeContainerFactory {
-
- public HttpSessionScopeContainerFactory() {
- super();
- }
-
- public ScopeContainer createScopeContainer(RuntimeComponent component) {
- return new HttpSessionScopeContainer(component);
- }
-
- public Scope getScope() {
- return Scope.SESSION;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/RequestScopeContainer.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/RequestScopeContainer.java
deleted file mode 100644
index 7519af2341..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/RequestScopeContainer.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope.impl;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.scope.AbstractScopeContainer;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.TargetResolutionException;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * A scope context which manages atomic component instances keyed on the current
- * request context
- *
- * @version $Rev$ $Date$
- */
-public class RequestScopeContainer extends AbstractScopeContainer<Thread> {
- private final Map<Thread, InstanceWrapper> contexts;
-
- public RequestScopeContainer(RuntimeComponent component) {
- super(Scope.REQUEST, component);
- contexts = new ConcurrentHashMap<Thread, InstanceWrapper>();
- }
-
- @Override
- public synchronized void start() {
- if (lifecycleState != UNINITIALIZED && lifecycleState != STOPPED) {
- throw new IllegalStateException("Scope must be in UNINITIALIZED or STOPPED state [" + lifecycleState + "]");
- }
- lifecycleState = RUNNING;
- }
-
- @Override
- public synchronized void stop() {
- contexts.clear();
- // synchronized (destroyQueues) {
- // destroyQueues.clear();
- // }
- lifecycleState = STOPPED;
- }
-
- protected InstanceWrapper getInstanceWrapper(boolean create) throws TargetResolutionException {
- InstanceWrapper ctx = wrappers.get(Thread.currentThread());
- if (ctx == null && !create) {
- return null;
- }
- if (ctx == null) {
- ctx = super.createInstanceWrapper();
- ctx.start();
- wrappers.put(Thread.currentThread(), ctx);
- }
- return ctx;
- }
-
- @Override
- public InstanceWrapper getWrapper(Thread contextId) throws TargetResolutionException {
- return getInstanceWrapper(true);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/RequestScopeContainerFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/RequestScopeContainerFactory.java
deleted file mode 100644
index 9d1cf88d96..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/RequestScopeContainerFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.scope.impl;
-
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopeContainerFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * @version $Rev$ $Date$
- */
-public class RequestScopeContainerFactory implements ScopeContainerFactory {
-
- public ScopeContainer createScopeContainer(RuntimeComponent component) {
- return new RequestScopeContainer(component);
- }
-
- public Scope getScope() {
- return Scope.REQUEST;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ScopeRegistryImpl.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ScopeRegistryImpl.java
deleted file mode 100644
index f11295c9fa..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/ScopeRegistryImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope.impl;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopeContainerFactory;
-import org.apache.tuscany.sca.core.scope.ScopeRegistry;
-import org.apache.tuscany.sca.core.scope.ScopedImplementationProvider;
-import org.apache.tuscany.sca.core.scope.ScopedRuntimeComponent;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * The default implementation of a scope registry
- *
- * @version $Rev$ $Date$
- */
-public class ScopeRegistryImpl implements ScopeRegistry {
- private final Map<Scope, ScopeContainerFactory> scopeCache = new ConcurrentHashMap<Scope, ScopeContainerFactory>();
-
- public void register(ScopeContainerFactory factory) {
- scopeCache.put(factory.getScope(), factory);
- }
-
- public ScopeContainer getScopeContainer(RuntimeComponent runtimeComponent) {
- if (!(runtimeComponent instanceof ScopedRuntimeComponent)) {
- return null;
- }
- ScopedRuntimeComponent component = (ScopedRuntimeComponent)runtimeComponent;
- if (component.getScopeContainer() != null) {
- return component.getScopeContainer();
- }
- ImplementationProvider implementationProvider = component.getImplementationProvider();
- if (implementationProvider instanceof ScopedImplementationProvider) {
- ScopedImplementationProvider provider = (ScopedImplementationProvider)implementationProvider;
- Scope scope = provider.getScope();
- if (scope == null) {
- scope = Scope.STATELESS;
- }
- ScopeContainerFactory factory = scopeCache.get(scope);
- ScopeContainer container = factory.createScopeContainer(component);
- component.setScopeContainer(container);
- return container;
- }
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainer.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainer.java
deleted file mode 100644
index 0639b8885b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.scope.impl;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.scope.AbstractScopeContainer;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.TargetDestructionException;
-import org.apache.tuscany.sca.core.scope.TargetResolutionException;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * A scope context which manages stateless atomic component instances in a non-pooled fashion.
- *
- * @version $Rev$ $Date$
- */
-public class StatelessScopeContainer<KEY> extends AbstractScopeContainer<KEY> {
-
- public StatelessScopeContainer(RuntimeComponent component) {
- super(Scope.STATELESS, component);
- }
-
- @Override
- public InstanceWrapper getWrapper(KEY contextId)
- throws TargetResolutionException {
- InstanceWrapper ctx = createInstanceWrapper();
- ctx.start();
- return ctx;
- }
-
- @Override
- public InstanceWrapper getAssociatedWrapper(KEY contextId)
- throws TargetResolutionException {
- return getWrapper(contextId);
- }
-
- @Override
- public void returnWrapper(InstanceWrapper wrapper, KEY contextId)
- throws TargetDestructionException {
- wrapper.stop();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainerFactory.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainerFactory.java
deleted file mode 100644
index 5bf20a6a5f..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainerFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.scope.impl;
-
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopeContainerFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * @version $Rev$ $Date$
- */
-public class StatelessScopeContainerFactory implements ScopeContainerFactory {
-
- public ScopeContainer createScopeContainer(RuntimeComponent component) {
- return new StatelessScopeContainer(component);
- }
-
- public Scope getScope() {
- return Scope.STATELESS;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/DefaultWorkScheduler.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/DefaultWorkScheduler.java
deleted file mode 100644
index 3df2f7188b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/DefaultWorkScheduler.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import org.apache.tuscany.sca.work.NotificationListener;
-import org.apache.tuscany.sca.work.WorkScheduler;
-import org.apache.tuscany.sca.work.WorkSchedulerException;
-
-/**
- * A work scheduler implementation based on a JSR 237 work manager.
- * <p/>
- * <p/>
- * This needs a JSR 237 work manager implementation available for scheduling work. Instances can be configured with a
- * work manager implementation that is injected in. It is the responsibility of the runtime environment to make a work
- * manager implementation available. For example, if the managed environment supports work manager the runtime can use
- * the appropriate lookup mechanism to inject the work manager implementation. </p>
- *
- * @version $Rev$ $Date$
- */
-public class DefaultWorkScheduler implements WorkScheduler {
-
- /**
- * Underlying JSR-237 work manager
- */
- private ThreadPoolWorkManager jsr237WorkManager;
-
- /**
- * Initializes the JSR 237 work manager.
- *
- * @param jsr237WorkManager JSR 237 work manager.
- */
- public DefaultWorkScheduler() {
- }
-
- private synchronized ThreadPoolWorkManager getWorkManager() {
- if (jsr237WorkManager != null) {
- return jsr237WorkManager;
- }
-// try {
-// InitialContext ctx = new InitialContext();
-// jsr237WorkManager = (ThreadPoolWorkManager)ctx.lookup("java:comp/env/wm/TuscanyWorkManager");
-// } catch (Throwable e) {
-// // ignore
-// }
- if (jsr237WorkManager == null) {
- jsr237WorkManager = new ThreadPoolWorkManager(10);
- }
- return jsr237WorkManager;
- }
-
- /**
- * Schedules a unit of work for future execution. The notification listener is used to register interest in
- * callbacks regarding the status of the work.
- *
- * @param work The unit of work that needs to be asynchronously executed.
- */
- public <T extends Runnable> void scheduleWork(T work) {
- scheduleWork(work, null);
- }
-
- /**
- * Schedules a unit of work for future execution. The notification listener is used to register interest in
- * callbacks regarding the status of the work.
- *
- * @param work The unit of work that needs to be asynchronously executed.
- * @param listener Notification listener for callbacks.
- */
- public <T extends Runnable> void scheduleWork(T work, NotificationListener<T> listener) {
-
- if (work == null) {
- throw new IllegalArgumentException("Work cannot be null");
- }
-
- Work<T> jsr237Work = new Work<T>(work);
- try {
- if (listener == null) {
- getWorkManager().schedule(jsr237Work);
- } else {
- Jsr237WorkListener<T> jsr237WorkListener = new Jsr237WorkListener<T>(listener, work);
- getWorkManager().schedule(jsr237Work, jsr237WorkListener);
- }
- } catch (IllegalArgumentException ex) {
- if (listener != null) {
- listener.workRejected(work);
- } else {
- throw new WorkSchedulerException(ex);
- }
- } catch (Exception ex) {
- throw new WorkSchedulerException(ex);
- }
-
- }
-
- public void destroy() {
- if (jsr237WorkManager instanceof ThreadPoolWorkManager) {
- // Allow privileged access to modify threads. Requires RuntimePermission in security
- // policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- ((ThreadPoolWorkManager)jsr237WorkManager).destroy();
- return null;
- }
- });
- }
- }
-
- /*
- * WorkListener for keeping track of work status callbacks.
- *
- */
- private class Jsr237WorkListener<T extends Runnable> implements WorkListener {
-
- // Notification listener
- private NotificationListener<T> listener;
-
- // Work
- private T work;
-
- /*
- * Initializes the notification listener.
- */
- public Jsr237WorkListener(NotificationListener<T> listener, T work) {
- this.listener = listener;
- this.work = work;
- }
-
- /*
- * Callback when the work is accepted.
- */
- public void workAccepted(WorkEvent workEvent) {
- T work = getWork();
- listener.workAccepted(work);
- }
-
- /*
- * Callback when the work is rejected.
- */
- public void workRejected(WorkEvent workEvent) {
- T work = getWork();
- listener.workRejected(work);
- }
-
- /*
- * Callback when the work is started.
- */
- public void workStarted(WorkEvent workEvent) {
- T work = getWork();
- listener.workStarted(work);
- }
-
- /*
- * Callback when the work is completed.
- */
- public void workCompleted(WorkEvent workEvent) {
- T work = getWork();
- Exception exception = workEvent.getException();
- if (exception != null) {
- listener.workFailed(work, exception);
- } else {
- listener.workCompleted(work);
- }
- }
-
- /*
- * Gets the underlying work from the work event.
- */
- private T getWork() {
- return work;
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManager.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManager.java
deleted file mode 100644
index 12fa4a485d..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManager.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.work.impl;
-
-import java.rmi.server.UID;
-import java.util.Collection;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ThreadFactory;
-
-import org.apache.tuscany.sca.work.WorkSchedulerException;
-import org.oasisopen.sca.annotation.Destroy;
-
-/**
- * A thread-pool based implementation for the JSR-237 work manager.
- * <p/>
- * <p/>
- * This implementation supports only local work.
- * <p/>
- * TODO Elaborate the implementation. </p>
- *
- * @version $Rev$ $Date$
- */
-public class ThreadPoolWorkManager {
-
- // Map of work items currently handled by the work manager
- private Map<WorkItem, WorkListener> workItems = new ConcurrentHashMap<WorkItem, WorkListener>();
-
- // Thread-pool
- private ExecutorService executor;
-
- /**
- * Initializes the thread-pool.
- *
- * @param threadPoolSize Thread-pool size.
- * @throws IllegalArgumentException if threadPoolSize < 1
- */
- public ThreadPoolWorkManager(int threadPoolSize) {
- if (threadPoolSize < 1) {
- throw new IllegalArgumentException("Invalid threadPoolSize of "
- + threadPoolSize + ". It must be >= 1");
- }
-
- // Creates a new Executor, use a custom ThreadFactory that
- // creates daemon threads.
- executor = Executors.newFixedThreadPool(threadPoolSize, new ThreadFactory() {
- public Thread newThread(Runnable r) {
- Thread thread = new Thread(r);
- thread.setDaemon(true);
- return thread;
- }
- });
- }
-
- /**
- * Schedules a unit of work asynchronously.
- *
- * @param work Work that needs to be scheduled.
- * @return Work Work item representing the asynchronous work
- */
- public WorkItem schedule(Work<?> work) throws IllegalArgumentException {
- return schedule(work, null);
- }
-
- /**
- * Schedules a unit of work asynchronously.
- *
- * @param work Work that needs to be scheduled.
- * @param workListener Work listener for callbacks.
- * @return Work Work item representing the asynchronous work
- */
- public WorkItem schedule(Work<?> work, WorkListener workListener) throws IllegalArgumentException {
-
- WorkItem workItem = new WorkItem(new UID().toString(), work);
- if (workListener != null) {
- workItems.put(workItem, workListener);
- }
- workAccepted(workItem, work);
- if (scheduleWork(work, workItem)) {
- return workItem;
- } else {
- workItem.setStatus(WorkEvent.WORK_REJECTED);
- if (workListener != null) {
- workListener.workRejected(new WorkEvent(workItem));
- }
- throw new IllegalArgumentException("Unable to schedule work");
- }
- }
-
- /**
- * Wait for all the specified units of work to finish.
- *
- * @param works Units of the work that need to finish.
- * @param timeout Timeout for waiting for the units of work to finish.
- */
- public boolean waitForAll(Collection<Work<?>> works, long timeout) {
- throw new UnsupportedOperationException("waitForAll not supported");
- }
-
- /**
- * Wait for any of the specified units of work to finish.
- *
- * @param works Units of the work that need to finish.
- * @param timeout Timeout for waiting for the units of work to finish.
- */
- public Collection<Work<?>> waitForAny(Collection<Work<?>> works, long timeout) {
- throw new UnsupportedOperationException("waitForAny not supported");
- }
-
- /**
- * Method provided for subclasses to indicate a work acceptance.
- *
- * @param workItem Work item representing the work that was accepted.
- * @param work Work that was accepted.
- */
- private void workAccepted(final WorkItem workItem, final Work<?> work) {
- WorkListener listener = workItems.get(workItem);
- if (listener != null) {
- workItem.setStatus(WorkEvent.WORK_ACCEPTED);
- WorkEvent event = new WorkEvent(workItem);
- listener.workAccepted(event);
- }
- }
-
- /*
- * Method to indicate a work start.
- */
- private void workStarted(final WorkItem workItem, final Work<?> work) {
- WorkListener listener = workItems.get(workItem);
- if (listener != null) {
- workItem.setStatus(WorkEvent.WORK_STARTED);
- WorkEvent event = new WorkEvent(workItem);
- listener.workStarted(event);
- }
- }
-
- /*
- * Method to indicate a work completion.
- */
- private void workCompleted(final WorkItem workItem, final Work<?> work) {
- workCompleted(workItem, work, null);
- }
-
- /*
- * Method to indicate a work completion.
- */
- private void workCompleted(final WorkItem workItem, final Work<?> work, final WorkSchedulerException exception) {
- WorkListener listener = workItems.get(workItem);
- if (listener != null) {
- workItem.setStatus(WorkEvent.WORK_COMPLETED);
- workItem.setResult(work);
- workItem.setException(exception);
- WorkEvent event = new WorkEvent(workItem);
- listener.workCompleted(event);
- workItems.remove(workItem);
- }
- }
-
- /*
- * Schedules the work using the ThreadPool.
- */
- private boolean scheduleWork(final Work<?> work, final WorkItem workItem) {
- try {
- executor.execute(new DecoratingWork(workItem, work));
- return true;
- } catch (RejectedExecutionException ex) {
- return false;
- }
- }
-
- /*
- * Class that decorates the original worker so that it can get callbacks when work is done.
- */
- private final class DecoratingWork implements Runnable {
-
- // Work item for this work.
- private WorkItem workItem;
-
- // The original work.
- private Work decoratedWork;
-
- /*
- * Initializes the work item and underlying work.
- */
- private DecoratingWork(final WorkItem workItem, final Work decoratedWork) {
- this.workItem = workItem;
- this.decoratedWork = decoratedWork;
- }
-
- /*
- * Overrides the run method.
- */
- public void run() {
- workStarted(workItem, decoratedWork);
- try {
- decoratedWork.run();
- workCompleted(workItem, decoratedWork);
- } catch (Throwable th) {
- workCompleted(workItem, decoratedWork, new WorkSchedulerException(th.getMessage(), th));
- }
- }
-
- }
-
- @Destroy
- public void destroy() {
- executor.shutdown();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/Work.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/Work.java
deleted file mode 100644
index ca06d0e854..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/Work.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.work.impl;
-
-/**
- * JCA work wrapper.
- *
- * @version $Rev$ $Date$
- */
-public class Work<T extends Runnable> {
-
- // Work that is being executed.
- private T work;
-
- /*
- * Initializes the work instance.
- */
- public Work(T work) {
- this.work = work;
- }
-
- /*
- * Returns the completed work.
- */
- public T getWork() {
- return work;
- }
-
- /*
- * Release the work.
- */
- public void release() {
- }
-
- /*
- * Work attributes are not daemon.
- */
- public boolean isDaemon() {
- return false;
- }
-
- /*
- * Runs the work.
- */
- public void run() {
- work.run();
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkEvent.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkEvent.java
deleted file mode 100644
index 4580011806..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkEvent.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.work.impl;
-
-import org.apache.tuscany.sca.work.WorkSchedulerException;
-
-
-
-/**
- * Default immutable implementation of the <code>WorkEvent</code> class.
- *
- * @version $Rev$ $Date$
- */
-class WorkEvent {
-
- public static final int WORK_ACCEPTED = 1;
- public static final int WORK_REJECTED = 2;
- public static final int WORK_STARTED = 3;
- public static final int WORK_COMPLETED = 4;
-
- // Work item for this event
- private WorkItem workItem;
-
- // Exception if something has gone wrong
- private WorkSchedulerException exception;
-
- /**
- * Instantiates the event.
- *
- * @param workItem Work item for this event.
- */
- public WorkEvent(final WorkItem workItem) {
- this.workItem = workItem;
- this.exception = workItem.getException();
- }
-
- /**
- * Returns the work type based on whether the work was accepted, started,
- * rejected or completed.
- *
- * @return Work type.
- */
- public int getType() {
- return workItem.getStatus();
- }
-
- /**
- * Returns the work item associated with this work type.
- *
- * @return Work item.
- */
- public WorkItem getWorkItem() {
- return workItem;
- }
-
- /**
- * Returns the exception if the work completed with an exception.
- *
- * @return Work exception.
- */
- public WorkSchedulerException getException() {
- return exception;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkItem.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkItem.java
deleted file mode 100644
index 0fc104d0fc..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkItem.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.work.impl;
-
-import org.apache.tuscany.sca.work.WorkSchedulerException;
-
-/**
- * An identity based immutable implementation of the <code>WorkItem</code>
- * interface.
- *
- * @version $Rev$ $Date$
- */
-class WorkItem {
-
- // Id scoped for the VM
- private String id;
-
- // Status
- private int status = -1;
-
- // Result
- private Work<?> result;
-
- // Original work
- private Work<?> originalWork;
-
- // Exception
- private WorkSchedulerException exception;
-
- /**
- * Instantiates an id for this item.
- *
- * @param id of this work event.
- */
- protected WorkItem(final String id, final Work<?> orginalWork) {
- this.id = id;
- this.originalWork = orginalWork;
- }
-
- /**
- * Returns the id.
- *
- * @return Id of this item.
- */
- public String getId() {
- return id;
- }
-
- /**
- * Returns the original work.
- *
- * @return Original work.
- */
- public Work<?> getOriginalWork() {
- return originalWork;
- }
-
- /**
- * Returns the work result if the work completed.
- *
- * @return Work.
- * @throws WorkException If the work completed with an exception.
- */
- public Work<?> getResult() {
- return result;
- }
-
- /**
- * Sets the result.
- *
- * @param result Result.
- */
- protected void setResult(final Work<?> result) {
- this.result = result;
- }
-
- /**
- * Returns the exception if work completed with an exception.
- *
- * @return Work exception.
- */
- protected WorkSchedulerException getException() {
- return exception;
- }
-
- /**
- * Sets the exception.
- *
- * @param exception Exception.
- */
- protected void setException(final WorkSchedulerException exception) {
- this.exception = exception;
- }
-
- /**
- * Returns the work type based on whether the work was accepted, started,
- * rejected or completed.
- *
- * @return Work status.
- */
- public int getStatus() {
- return status;
- }
-
- /**
- * Sets the status.
- *
- * @param status Status.
- */
- protected void setStatus(final int status) {
- this.status = status;
- }
-
- /**
- * @see Object#hashCode()
- */
- @Override
- public int hashCode() {
- return id.hashCode();
- }
-
- /**
- * Indicates whether some other object is "equal to" this one.
- *
- * @param obj Object to be compared.
- * @return true if this object is the same as the obj argument; false
- * otherwise..
- */
- @Override
- public boolean equals(final Object obj) {
- return (obj != null) && (obj.getClass() == WorkItem.class) && ((WorkItem) obj).id.equals(id);
- }
-
- /**
- * Compares this object with the specified object for order. Returns a
- * negative integer, zero, or a positive integer as this object is less
- * than, equal to, or greater than the specified object.
- *
- * @param o Object to be compared.
- * @return A negative integer, zero, or a positive integer as this object
- * is less than, equal to, or greater than the specified object.
- * @throws ClassCastException needs better documentation.
- */
- public int compareTo(final Object o) {
- if (o.getClass() != WorkItem.class) {
- throw new ClassCastException(o.getClass().getName());
- } else {
- return ((WorkItem) o).getId().compareTo(getId());
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkListener.java b/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkListener.java
deleted file mode 100644
index facb2dfe56..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkListener.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.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/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ComponentContextFactory b/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ComponentContextFactory
deleted file mode 100644
index e118d5967b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.ComponentContextFactory
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT 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.tuscany.sca.core.context.DefaultComponentContextFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.RequestContextFactory b/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.RequestContextFactory
deleted file mode 100644
index 171588cc7b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.context.RequestContextFactory
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT 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.tuscany.sca.core.context.DefaultRequestContextFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 5fc42915cb..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.core.assembly.impl.ReferenceParameterProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#referenceParameters,model=org.apache.tuscany.sca.runtime.ReferenceParameters
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.assembly.CompositeActivator b/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.assembly.CompositeActivator
deleted file mode 100644
index d5e13292d2..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.assembly.CompositeActivator
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.core.assembly.impl.CompositeActivatorImpl
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.conversation.ConversationManager b/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.conversation.ConversationManager
deleted file mode 100644
index 67cec934b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.conversation.ConversationManager
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.core.conversation.impl.ConversationManagerImpl
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint b/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint
deleted file mode 100644
index af281d8f4d..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.core.invocation.DefaultProxyFactoryExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.scope.ScopeRegistry b/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.scope.ScopeRegistry
deleted file mode 100644
index a4a0154987..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.scope.ScopeRegistry
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.core.scope.DefaultScopeRegistry
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.invocation.MessageFactory b/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.invocation.MessageFactory
deleted file mode 100644
index 00a33e1656..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.invocation.MessageFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.core.invocation.impl.MessageFactoryImpl
diff --git a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.work.WorkScheduler b/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.work.WorkScheduler
deleted file mode 100644
index 9923ba5927..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.work.WorkScheduler
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.core.work.impl.DefaultWorkScheduler
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/CallbackInterfaceInterceptorTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/CallbackInterfaceInterceptorTestCase.java.fixme
deleted file mode 100644
index b11eaa9621..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/CallbackInterfaceInterceptorTestCase.java.fixme
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.wire;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.core.assembly.impl.EndpointReferenceImpl;
-import org.apache.tuscany.sca.core.invocation.CallbackInterfaceInterceptor;
-import org.apache.tuscany.sca.core.invocation.impl.MessageFactoryImpl;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Message;
-import org.easymock.EasyMock;
-import org.oasisopen.sca.NoRegisteredCallbackException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CallbackInterfaceInterceptorTestCase extends TestCase {
-
- public void testHasCallbackObject() {
- CallbackInterfaceInterceptor interceptor = new CallbackInterfaceInterceptor();
- Interceptor next = EasyMock.createMock(Interceptor.class);
- EasyMock.expect(next.invoke(EasyMock.isA(Message.class))).andReturn(null);
- EasyMock.replay(next);
- interceptor.setNext(next);
- Message msg = new MessageFactoryImpl().createMessage();
- msg.setFrom(new EndpointReferenceImpl("uri"));
- msg.getFrom().getReferenceParameters().setCallbackObjectID("ABC");
- interceptor.invoke(msg);
- EasyMock.verify(next);
- }
-
- public void testNoCallbackObject() {
- CallbackInterfaceInterceptor interceptor = new CallbackInterfaceInterceptor();
- Message msg = new MessageFactoryImpl().createMessage();
- msg.setFrom(new EndpointReferenceImpl("uri"));
- msg.getFrom().getReferenceParameters().setCallbackObjectID(null);
- try {
- interceptor.invoke(msg);
- fail();
- } catch (NoRegisteredCallbackException e) {
- // expected
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImplTestCase.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImplTestCase.java
deleted file mode 100644
index 866b0994e7..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/InvocationChainImplTestCase.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.tuscany.sca.core.invocation.impl.InvocationChainImpl;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class InvocationChainImplTestCase {
-
- @Test
- public void testInsertAtEnd() throws Exception {
- Operation op = newOperation("foo");
- InvocationChain chain = new InvocationChainImpl(op, op, true);
- Interceptor inter2 = new MockInterceptor();
- Interceptor inter1 = new MockInterceptor();
- chain.addInterceptor(inter1);
- chain.addInterceptor(inter2);
- Interceptor head = (Interceptor)chain.getHeadInvoker();
- assertEquals(inter1, head);
- assertEquals(inter2, head.getNext());
- assertEquals(inter2, chain.getTailInvoker());
-
- }
-
- @Test
- public void testAddByPhase() throws Exception {
- Operation op = newOperation("foo");
- InvocationChain chain = new InvocationChainImpl(op, op, false);
- Interceptor inter1 = new MockInterceptor();
- Interceptor inter2 = new MockInterceptor();
- Interceptor inter3 = new MockInterceptor();
- Interceptor inter4 = new MockInterceptor();
- chain.addInterceptor(inter3); // SERVICE
- chain.addInterceptor(Phase.IMPLEMENTATION_POLICY, inter4);
- chain.addInterceptor(Phase.SERVICE_POLICY, inter2);
- chain.addInterceptor(Phase.SERVICE_BINDING, inter1);
- Interceptor head = (Interceptor)chain.getHeadInvoker();
- assertEquals(inter1, head);
- assertEquals(inter2, inter1.getNext());
- assertEquals(inter3, inter2.getNext());
- assertEquals(inter4, inter3.getNext());
- assertEquals(inter4, chain.getTailInvoker());
- }
-
- private class MockInterceptor implements Interceptor {
-
- private Invoker next;
-
- public Message invoke(Message msg) {
- return null;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-
- public Invoker getNext() {
- return next;
- }
-
- }
-
- private static Operation newOperation(String name) {
- Operation operation = new OperationImpl();
- operation.setName(name);
- return operation;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/NonBlockingInterceptorTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/NonBlockingInterceptorTestCase.java.fixme
deleted file mode 100644
index b8150d4edc..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/NonBlockingInterceptorTestCase.java.fixme
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.wire;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.getCurrentArguments;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.core.invocation.NonBlockingInterceptor;
-import org.apache.tuscany.sca.core.invocation.ThreadMessageContext;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.work.WorkScheduler;
-import org.easymock.EasyMock;
-import org.easymock.IAnswer;
-
-/**
- * @version $Rev$ $Date$
- */
-public class NonBlockingInterceptorTestCase extends TestCase {
-
- public void testInvoke() throws Exception {
- WorkScheduler scheduler = createMock(WorkScheduler.class);
- scheduler.scheduleWork(isA(Runnable.class));
- expectLastCall().andStubAnswer(new IAnswer<Object>() {
- public Object answer() throws Throwable {
- Runnable runnable = (Runnable) getCurrentArguments()[0];
- runnable.run();
- return null;
- }
- });
- replay(scheduler);
- Message context = createMock(Message.class);
- //String convID = "convID";
- //TODO port to the new way of dealing with conversation IDs later
- //EasyMock.expect(context.getConversationID()).andReturn(convID);
- EasyMock.replay(context);
- ThreadMessageContext.setMessageContext(context);
- Message msg = createMock(Message.class);
- //TODO port to the new way of dealing with conversation IDs later
- //msg.setConversationID(convID);
- Interceptor next = EasyMock.createMock(Interceptor.class);
- EasyMock.expect(next.invoke(EasyMock.eq(msg))).andReturn(msg);
- EasyMock.expect(msg.isFault()).andReturn(false);
- EasyMock.replay(next);
- EasyMock.replay(msg);
- Interceptor interceptor = new NonBlockingInterceptor(scheduler, next);
- interceptor.invoke(msg);
- verify(context);
- verify(next);
- verify(msg);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManagerTestCase.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManagerTestCase.java
deleted file mode 100644
index 8fcead004d..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/PhaseManagerTestCase.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.invocation.impl;
-
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PhaseManagerTestCase {
-
- @Test
- public void testDiscovery() {
- PhaseManager pm = new PhaseManager("org.apache.tuscany.sca.invocation.PhaseTest");
- List<String> phases = pm.getAllPhases();
- System.out.println(phases.size());
- System.out.println(phases);
- // Assert.assertEquals(15, phases.size());
- Assert.assertEquals("reference.first", phases.get(0));
-
- int rt = phases.indexOf("reference.transaction");
- Assert.assertTrue(rt > phases.indexOf("reference.interface"));
-
- int st = phases.indexOf("service.transaction");
- Assert.assertTrue(st > phases.indexOf("service.binding"));
-
- int it = phases.indexOf("implementation.transaction");
- Assert.assertTrue(it < phases.indexOf("implementation.policy"));
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/PhaseSorterTestCase.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/PhaseSorterTestCase.java
deleted file mode 100644
index c268e133e4..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/impl/PhaseSorterTestCase.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class PhaseSorterTestCase {
- private PhaseSorter<String> graph;
-
- @Before
- public void setUp() throws Exception {
- graph = new PhaseSorter<String>();
- }
-
- @Test
- public void testSort() {
- graph.addEdge("a", "b");
- graph.addEdge("a", "c");
- graph.addEdge("c", "d");
- graph.addEdge("b", "c");
- List<String> order = graph.topologicalSort(true);
- assertEquals(Arrays.asList("a", "b", "c", "d"), order);
- assertTrue(!graph.getVertices().isEmpty());
-
- graph.addEdge("d", "a");
- try {
- order = graph.topologicalSort(true);
- assertTrue("Should have failed", false);
- } catch (IllegalArgumentException e) {
- assertTrue(true);
- }
-
- graph.removeEdge("d", "a");
- order = graph.topologicalSort(false);
- assertEquals(Arrays.asList("a", "b", "c", "d"), order);
- assertTrue(graph.getVertices().isEmpty());
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/FailingWork.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/FailingWork.java
deleted file mode 100644
index fe29a9501f..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/FailingWork.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.work.impl;
-
-import org.apache.tuscany.sca.core.work.impl.Work;
-
-
-/**
- * Simple Work item that will throw an exception
- *
- * @version $Rev$ $Date$
- */
-public class FailingWork extends Work {
-
- public FailingWork() {
- super(null);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isDaemon() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public void release() {
- }
-
- /**
- * Throws an IllegalArgumentException
- */
- public void run() {
- System.out.println("Starting " + this + " and throwing an Exception");
- throw new IllegalArgumentException("Sample exception from " + this);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyFailingRunnable.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyFailingRunnable.java
deleted file mode 100644
index 2d791e5012..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyFailingRunnable.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.work.impl;
-
-/**
- * Simple Runnable that throws an IllegalArgumentException
- *
- * @version $Rev$ $Date$
- */
-public class JSR237MyFailingRunnable extends JSR237MyRunnable {
-
- /**
- * Constructor
- */
- public JSR237MyFailingRunnable() {
- super(-1);
- }
-
- /**
- * Sleeps for a period of time defined by sleepTime
- */
- @Override
- public void run() {
- System.out.println("Starting " + this + " and throwing an Exception");
- throw new IllegalArgumentException("Sample exception from " + this);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyRunnable.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyRunnable.java
deleted file mode 100644
index c0183b6f9b..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyRunnable.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.work.impl;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Simple Runnable that is used for testing Jsr237WorkScheduler
- *
- * @version $Rev$ $Date$
- */
-public class JSR237MyRunnable implements Runnable {
-
- /**
- * Count of workAccepted() method calls
- */
- private AtomicInteger runCompletedCount = new AtomicInteger();
-
- /**
- * The amount of time to sleep in the Run loop
- */
- private final long sleepTime;
-
- /**
- * Constructor
- *
- * @param sleepTime The amount of time to sleep (in milliseconds) in the run() method
- */
- public JSR237MyRunnable(long sleepTime) {
- this.sleepTime = sleepTime;
- }
-
- /**
- * Sleeps for a period of time defined by sleepTime
- */
- public void run() {
- System.out.println("Starting " + this);
- try {
- Thread.sleep(sleepTime);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- System.out.println("Done " + this);
- runCompletedCount.incrementAndGet();
- }
-
- /**
- * Returns the number of completed calls to run()
- *
- * @return The number of completed calls to run()
- */
- public int getRunCompletedCount() {
- return runCompletedCount.get();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyRunnerListener.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyRunnerListener.java
deleted file mode 100644
index 307f24aca7..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/JSR237MyRunnerListener.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.tuscany.sca.work.NotificationListener;
-
-/**
- * Simple NotificationListener that is used for testing Jsr237WorkScheduler
- *
- * @version $Rev$ $Date$
- */
-public class JSR237MyRunnerListener implements NotificationListener<JSR237MyRunnable> {
-
- /**
- * Count of workAccepted() method calls
- */
- private AtomicInteger workAcceptedCallCount = new AtomicInteger();
-
- /**
- * Count of workStarted() method calls
- */
- private AtomicInteger workStartedCallCount = new AtomicInteger();
-
- /**
- * Count of workCompleted() method calls
- */
- private AtomicInteger workCompletedCallCount = new AtomicInteger();
-
- /**
- * Count of workFailed() method calls
- */
- private AtomicInteger workFailedCallCount = new AtomicInteger();
-
- /**
- * Count of workRejected() method calls
- */
- private AtomicInteger workRejectedCallCount = new AtomicInteger();
-
- /**
- * List of all exceptions thrown by Work items
- */
- private List<Throwable> workExceptions = Collections.synchronizedList(new ArrayList<Throwable>());
-
- /**
- * {@inheritDoc}
- */
- public void workAccepted(JSR237MyRunnable work) {
- workAcceptedCallCount.incrementAndGet();
- }
-
- /**
- * {@inheritDoc}
- */
- public void workCompleted(JSR237MyRunnable work) {
- workCompletedCallCount.incrementAndGet();
- }
-
- /**
- * {@inheritDoc}
- */
- public void workFailed(JSR237MyRunnable work, Throwable error) {
- workExceptions.add(error);
- workFailedCallCount.incrementAndGet();
- }
-
- /**
- * {@inheritDoc}
- */
- public void workRejected(JSR237MyRunnable work) {
- workRejectedCallCount.incrementAndGet();
- }
-
- /**
- * {@inheritDoc}
- */
- public void workStarted(JSR237MyRunnable work) {
- workStartedCallCount.incrementAndGet();
- }
-
- /**
- * Returns the number of calls to workAccepted()
- *
- * @return The number of calls to workAccepted()
- */
- public int getWorkAcceptedCallCount() {
- return workAcceptedCallCount.get();
- }
-
- /**
- * Returns the number of calls to workStarted()
- *
- * @return The number of calls to workStarted()
- */
- public int getWorkStartedCallCount() {
- return workStartedCallCount.get();
- }
-
- /**
- * Returns the number of calls to workCompleted()
- *
- * @return The number of calls to workCompleted()
- */
- public int getWorkCompletedCallCount() {
- return workCompletedCallCount.get();
- }
-
- /**
- * Returns the number of calls to workFailed()
- *
- * @return The number of calls to workFailed()
- */
- public int getWorkFailedCallCount() {
- return workFailedCallCount.get();
- }
-
- /**
- * Returns the number of calls to workRejected()
- *
- * @return The number of calls to workRejected()
- */
- public int getWorkRejectedCallCount() {
- return workRejectedCallCount.get();
- }
-
- /**
- * Returns a List of all exceptions that are thrown by the Work items
- *
- * @return A List of all exceptions that are thrown by the Work items
- */
- public List<Throwable> getWorkExceptions() {
- return Collections.unmodifiableList(workExceptions);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/Jsr237WorkSchedulerTestCase.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/Jsr237WorkSchedulerTestCase.java
deleted file mode 100644
index 851528b20c..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/Jsr237WorkSchedulerTestCase.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import org.apache.tuscany.sca.core.work.impl.DefaultWorkScheduler;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test case for Jsr237WorkScheduler
- *
- * @version $Rev$ $Date$
- */
-public class Jsr237WorkSchedulerTestCase {
-
- /**
- * Wait up to 20 seconds for the Work units to complete
- */
- private static final long WAIT_TIMEOUT = 20000;
-
- /**
- * This is the shared instance of the ThreadPoolWorkManager used by the tests
- */
- private static DefaultWorkScheduler workSchedular = null;
-
- /**
- * Setup the Jsr237WorkScheduler
- */
- @BeforeClass
- public static void setup() {
- workSchedular = new DefaultWorkScheduler();
- }
-
- /**
- * Make sure that the Jsr237WorkScheduler is stopped after running the tests
- */
- @AfterClass
- public static void destroy() {
- if (workSchedular != null) {
- workSchedular.destroy();
- }
- }
-
- /**
- * Tests running a single fast job on the Jsr237WorkScheduler
- */
- @Test
- public void testSingleFastJob() {
- // Create the work and register it
- JSR237MyRunnable fast = new JSR237MyRunnable(10);
- JSR237MyRunnerListener listener = new JSR237MyRunnerListener();
- workSchedular.scheduleWork(fast, listener);
-
- // Wait for the 1 job to complete
- waitForWorkToComplete(listener, 1);
-
- // Test that the job completed successfully.
- Assert.assertEquals(1, listener.getWorkAcceptedCallCount());
- Assert.assertEquals(0, listener.getWorkRejectedCallCount());
- Assert.assertEquals(1, listener.getWorkStartedCallCount());
- Assert.assertEquals(1, listener.getWorkCompletedCallCount());
- Assert.assertEquals(0, listener.getWorkExceptions().size());
- }
-
- /**
- * Tests running a single job that fails on the Jsr237WorkScheduler
- */
- @Test
- public void testSingleFailingJob() {
- // Create the work and register it
- JSR237MyFailingRunnable fail = new JSR237MyFailingRunnable();
- JSR237MyRunnerListener listener = new JSR237MyRunnerListener();
- workSchedular.scheduleWork(fail, listener);
-
- // Wait for the 1 job to complete
- waitForWorkToComplete(listener, 1);
-
- // Test that the job completed successfully.
- Assert.assertEquals(1, listener.getWorkAcceptedCallCount());
- Assert.assertEquals(0, listener.getWorkRejectedCallCount());
- Assert.assertEquals(1, listener.getWorkStartedCallCount());
- Assert.assertEquals(0, listener.getWorkCompletedCallCount());
- Assert.assertEquals(1, listener.getWorkFailedCallCount());
- Assert.assertEquals(1, listener.getWorkExceptions().size());
- }
-
- /**
- * Tests running a mixture of fast and slow jobs on the Jsr237WorkScheduler
- */
- @Test
- public void testMultipleJobs() {
- // Create the work and register it
- JSR237MyRunnable fast1 = new JSR237MyRunnable(5);
- JSR237MyRunnable fast2 = new JSR237MyRunnable(10);
- JSR237MyRunnable fast3 = new JSR237MyRunnable(20);
- JSR237MyRunnable slow1= new JSR237MyRunnable(200);
- JSR237MyRunnable slow2 = new JSR237MyRunnable(200);
- JSR237MyRunnerListener listener = new JSR237MyRunnerListener();
- workSchedular.scheduleWork(fast1, listener);
- workSchedular.scheduleWork(fast2, listener);
- workSchedular.scheduleWork(fast3, listener);
- workSchedular.scheduleWork(slow1, listener);
- workSchedular.scheduleWork(slow2, listener);
-
- // Wait for the 5 jobs to complete
- waitForWorkToComplete(listener, 5);
-
- // Test that the job completed successfully.
- Assert.assertEquals(5, listener.getWorkAcceptedCallCount());
- Assert.assertEquals(0, listener.getWorkRejectedCallCount());
- Assert.assertEquals(5, listener.getWorkStartedCallCount());
- Assert.assertEquals(5, listener.getWorkCompletedCallCount());
- Assert.assertEquals(0, listener.getWorkExceptions().size());
- }
-
- /**
- * Tests running a mixture of fast and slow jobs some of which fail on the
- * Jsr237WorkScheduler
- */
- @Test
- public void testMultipleJobsSomeFail() {
- // Create the work and register it
- JSR237MyRunnable fast1 = new JSR237MyRunnable(5);
- JSR237MyRunnable fast2 = new JSR237MyRunnable(10);
- JSR237MyRunnable fast3 = new JSR237MyRunnable(20);
- JSR237MyRunnable slow1= new JSR237MyRunnable(200);
- JSR237MyRunnable slow2 = new JSR237MyRunnable(200);
- JSR237MyFailingRunnable fail1 = new JSR237MyFailingRunnable();
- JSR237MyFailingRunnable fail2 = new JSR237MyFailingRunnable();
- JSR237MyRunnerListener listener = new JSR237MyRunnerListener();
- workSchedular.scheduleWork(fast1, listener);
- workSchedular.scheduleWork(fast2, listener);
- workSchedular.scheduleWork(fail1, listener);
- workSchedular.scheduleWork(fast3, listener);
- workSchedular.scheduleWork(slow1, listener);
- workSchedular.scheduleWork(fail2, listener);
- workSchedular.scheduleWork(slow2, listener);
-
- // Wait for the 7 jobs to complete
- waitForWorkToComplete(listener, 7);
-
- // Test that the job completed successfully.
- Assert.assertEquals(7, listener.getWorkAcceptedCallCount());
- Assert.assertEquals(0, listener.getWorkRejectedCallCount());
- Assert.assertEquals(7, listener.getWorkStartedCallCount());
- Assert.assertEquals(5, listener.getWorkCompletedCallCount());
- Assert.assertEquals(2, listener.getWorkFailedCallCount());
- Assert.assertEquals(2, listener.getWorkExceptions().size());
- }
-
- /**
- * Tests running a single job that has no listener
- */
- @Test
- public void testSingleFastJobWithNoListener() {
- // Create the work and register it
- JSR237MyRunnable fast = new JSR237MyRunnable(10);
- workSchedular.scheduleWork(fast);
-
- // Wait for the job to complete
- long startTime = System.currentTimeMillis();
- while (true) {
- int completedCount = fast.getRunCompletedCount();
- if (completedCount == 1) {
- break;
- }
-
- if (System.currentTimeMillis() - startTime > WAIT_TIMEOUT) {
- Assert.fail("Only " + completedCount + " work items completed before timeout");
- return;
- }
-
- // Lets wait for the job to complete
- try {
- Thread.sleep(25);
- } catch (InterruptedException ex) {
- Assert.fail("Unexpected exception: " + ex);
- }
- }
- }
-
- /**
- * Tests scheduling a null as the work item
- */
- @Test
- public void testNullWork() {
- try {
- workSchedular.scheduleWork(null);
- Assert.fail("Should have thrown IllegalArgumentException ");
- } catch (IllegalArgumentException ex) {
- // As expected
- Assert.assertTrue(ex.toString().indexOf("null") != -1);
- }
- }
-
- /**
- * Waits for the specified number of jobs to complete or the timeout to fire.
- *
- * @param listener The listener to use to track Work unit completion
- * @param completedWorkItemsToWaitFor The number of Work items to complete
- */
- private void waitForWorkToComplete(JSR237MyRunnerListener listener, int completedWorkItemsToWaitFor) {
- long startTime = System.currentTimeMillis();
- while (true) {
- int completedCount = listener.getWorkCompletedCallCount() + listener.getWorkFailedCallCount();
- if (completedCount == completedWorkItemsToWaitFor) {
- return;
- }
-
- if (System.currentTimeMillis() - startTime > WAIT_TIMEOUT) {
- Assert.fail("Only " + completedCount + " work items completed before timeout");
- return;
- }
-
- // Lets wait for more jobs to complete
- try {
- Thread.sleep(25);
- } catch (InterruptedException ex) {
- Assert.fail("Unexpected exception: " + ex);
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/TestWorkListener.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/TestWorkListener.java
deleted file mode 100644
index 24a91331a4..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/TestWorkListener.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.tuscany.sca.core.work.impl.WorkEvent;
-import org.apache.tuscany.sca.core.work.impl.WorkListener;
-import org.apache.tuscany.sca.work.WorkSchedulerException;
-import org.junit.Assert;
-
-/**
- * A simple WorkListener that tracks invocations to it.
- *
- * @version $Rev$ $Date$
- */
-public class TestWorkListener implements WorkListener {
-
- /**
- * Count of workAccepted() method calls
- */
- private AtomicInteger workAcceptedCallCount = new AtomicInteger();
-
- /**
- * Count of workStarted() method calls
- */
- private AtomicInteger workStartedCallCount = new AtomicInteger();
-
- /**
- * Count of workCompleted() method calls
- */
- private AtomicInteger workCompletedCallCount = new AtomicInteger();
-
- /**
- * Count of workRejected() method calls
- */
- private AtomicInteger workRejectedCallCount = new AtomicInteger();
-
- /**
- * List of all exceptions thrown by Work items
- */
- private List<WorkSchedulerException> workExceptions = Collections.synchronizedList(new ArrayList<WorkSchedulerException>());
-
- /**
- * {@inheritDoc}
- */
- public void workAccepted(WorkEvent work) {
- workAcceptedCallCount.incrementAndGet();
-
- // Validate the WorkEvent
- Assert.assertNotNull(work.getWorkItem());
- Assert.assertEquals(WorkEvent.WORK_ACCEPTED, work.getType());
- }
-
- /**
- * {@inheritDoc}
- */
- public void workStarted(WorkEvent work) {
- workStartedCallCount.incrementAndGet();
-
- // Validate the WorkEvent
- Assert.assertNotNull(work.getWorkItem());
- Assert.assertEquals(WorkEvent.WORK_STARTED, work.getType());
- }
-
- /**
- * {@inheritDoc}
- */
- public void workCompleted(WorkEvent work) {
- if (work.getException() != null) {
- workExceptions.add(work.getException());
- }
-
- // Validate the WorkEvent
- Assert.assertNotNull(work.getWorkItem());
- Assert.assertEquals(WorkEvent.WORK_COMPLETED, work.getType());
-
- workCompletedCallCount.incrementAndGet();
- }
-
- /**
- * {@inheritDoc}
- */
- public void workRejected(WorkEvent work) {
- workRejectedCallCount.incrementAndGet();
-
- // Validate the WorkEvent
- Assert.assertNotNull(work.getWorkItem());
- Assert.assertEquals(WorkEvent.WORK_REJECTED, work.getType());
- }
-
- /**
- * Returns the number of calls to workAccepted()
- *
- * @return The number of calls to workAccepted()
- */
- public int getWorkAcceptedCallCount() {
- return workAcceptedCallCount.get();
- }
-
- /**
- * Returns the number of calls to workStarted()
- *
- * @return The number of calls to workStarted()
- */
- public int getWorkStartedCallCount() {
- return workStartedCallCount.get();
- }
-
- /**
- * Returns the number of calls to workCompleted()
- *
- * @return The number of calls to workCompleted()
- */
- public int getWorkCompletedCallCount() {
- return workCompletedCallCount.get();
- }
-
- /**
- * Returns the number of calls to workRejected()
- *
- * @return The number of calls to workRejected()
- */
- public int getWorkRejectedCallCount() {
- return workRejectedCallCount.get();
- }
-
- /**
- * Returns a List of all exceptions that are thrown by the Work items
- *
- * @return A List of all exceptions that are thrown by the Work items
- */
- public List<WorkSchedulerException> getWorkExceptions() {
- return Collections.unmodifiableList(workExceptions);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManagerTestCase.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManagerTestCase.java
deleted file mode 100644
index 89fd74ef38..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManagerTestCase.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.work.impl;
-
-import org.apache.tuscany.sca.core.work.impl.ThreadPoolWorkManager;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This test case will test the ThreadPoolWorkManager
- *
- * @version $Rev$ $Date$
- */
-public class ThreadPoolWorkManagerTestCase {
-
- /**
- * Wait up to 20 seconds for the Work units to complete
- */
- private static final long WAIT_TIMEOUT = 20000;
-
- /**
- * This is the shared instance of the ThreadPoolWorkManager used by the tests
- */
- private static ThreadPoolWorkManager workManager = null;
-
- /**
- * Setup the ThreadPoolWorkManager
- */
- @BeforeClass
- public static void setup() {
- workManager = new ThreadPoolWorkManager(10);
- }
-
- /**
- * Make sure that the ThreadPoolWorkManager is stopped after running the tests
- */
- @AfterClass
- public static void destroy() {
- if (workManager != null) {
- workManager.destroy();
- }
- }
-
- /**
- * Tests running a single fast job on the ThreadPoolWorkManager
- */
- @Test
- public void testSingleFastJob() {
- // Create the work and register it
- TimeDelayWork fast = new TimeDelayWork(10);
- TestWorkListener listener = new TestWorkListener();
- workManager.schedule(fast, listener);
-
- // Wait for the 1 job to complete
- waitForWorkToComplete(listener, 1);
-
- // Test that the job completed successfully.
- Assert.assertEquals(1, listener.getWorkAcceptedCallCount());
- Assert.assertEquals(0, listener.getWorkRejectedCallCount());
- Assert.assertEquals(1, listener.getWorkStartedCallCount());
- Assert.assertEquals(1, listener.getWorkCompletedCallCount());
- Assert.assertEquals(0, listener.getWorkExceptions().size());
- }
-
- /**
- * Tests running a single job that fails on the ThreadPoolWorkManager
- */
- @Test
- public void testSingleFailingJob() {
- // Create the work and register it
- FailingWork fail = new FailingWork();
- TestWorkListener listener = new TestWorkListener();
- workManager.schedule(fail, listener);
-
- // Wait for the 1 job to complete
- waitForWorkToComplete(listener, 1);
-
- // Test that the job completed successfully.
- Assert.assertEquals(1, listener.getWorkAcceptedCallCount());
- Assert.assertEquals(0, listener.getWorkRejectedCallCount());
- Assert.assertEquals(1, listener.getWorkStartedCallCount());
- Assert.assertEquals(1, listener.getWorkCompletedCallCount());
- Assert.assertEquals(1, listener.getWorkExceptions().size());
- }
-
- /**
- * Tests running a mixture of fast and slow jobs on the ThreadPoolWorkManager
- */
- @Test
- public void testMultipleJobs() {
- // Create the work and register it
- TimeDelayWork fast1 = new TimeDelayWork(5);
- TimeDelayWork fast2 = new TimeDelayWork(10);
- TimeDelayWork fast3 = new TimeDelayWork(20);
- TimeDelayWork slow1= new TimeDelayWork(200);
- TimeDelayWork slow2 = new TimeDelayWork(200);
- TestWorkListener listener = new TestWorkListener();
- workManager.schedule(fast1, listener);
- workManager.schedule(fast2, listener);
- workManager.schedule(fast3, listener);
- workManager.schedule(slow1, listener);
- workManager.schedule(slow2, listener);
-
- // Wait for the 5 jobs to complete
- waitForWorkToComplete(listener, 5);
-
- // Test that the job completed successfully.
- Assert.assertEquals(5, listener.getWorkAcceptedCallCount());
- Assert.assertEquals(0, listener.getWorkRejectedCallCount());
- Assert.assertEquals(5, listener.getWorkStartedCallCount());
- Assert.assertEquals(5, listener.getWorkCompletedCallCount());
- Assert.assertEquals(0, listener.getWorkExceptions().size());
- }
-
- /**
- * Tests running a mixture of fast and slow jobs some of which fail on the
- * ThreadPoolWorkManager
- */
- @Test
- public void testMultipleJobsSomeFail() {
- // Create the work and register it
- TimeDelayWork fast1 = new TimeDelayWork(5);
- TimeDelayWork fast2 = new TimeDelayWork(10);
- TimeDelayWork fast3 = new TimeDelayWork(20);
- TimeDelayWork slow1= new TimeDelayWork(200);
- TimeDelayWork slow2 = new TimeDelayWork(200);
- FailingWork fail1 = new FailingWork();
- FailingWork fail2 = new FailingWork();
- TestWorkListener listener = new TestWorkListener();
- workManager.schedule(fast1, listener);
- workManager.schedule(fast2, listener);
- workManager.schedule(fail1, listener);
- workManager.schedule(fast3, listener);
- workManager.schedule(slow1, listener);
- workManager.schedule(fail2, listener);
- workManager.schedule(slow2, listener);
-
- // Wait for the 7 jobs to complete
- waitForWorkToComplete(listener, 7);
-
- // Test that the job completed successfully.
- Assert.assertEquals(7, listener.getWorkAcceptedCallCount());
- Assert.assertEquals(0, listener.getWorkRejectedCallCount());
- Assert.assertEquals(7, listener.getWorkStartedCallCount());
- Assert.assertEquals(7, listener.getWorkCompletedCallCount());
- Assert.assertEquals(2, listener.getWorkExceptions().size());
- }
-
- /**
- * Tests creating a ThreadPoolWorkManager with invalid pool sizes of -10 to 0
- * inclusive
- */
- @Test
- public void testThreadPoolWorkManagerLessThan1Size() {
- for (int i = 0; i >= -10; i--) {
- try {
- new ThreadPoolWorkManager(i);
- Assert.fail("Should have thrown IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- Assert.assertTrue(ex.toString().indexOf(Integer.toString(i)) != -1);
- }
- }
- }
-
- /**
- * Tests running a single job that has no listener
- */
- @Test
- public void testSingleFastJobWithNoListener() {
- // Create the work and register it
- TimeDelayWork fast = new TimeDelayWork(10);
- workManager.schedule(fast);
-
- // Wait for the job to complete
- long startTime = System.currentTimeMillis();
- while (true) {
- int completedCount = fast.getRunCompletedCount();
- if (completedCount == 1) {
- break;
- }
-
- if (System.currentTimeMillis() - startTime > WAIT_TIMEOUT) {
- Assert.fail("Only " + completedCount + " work items completed before timeout");
- return;
- }
-
- // Lets wait for the job to complete
- try {
- Thread.sleep(25);
- } catch (InterruptedException ex) {
- Assert.fail("Unexpected exception: " + ex);
- }
- }
-
- // Make sure we have got one completed run
- Assert.assertEquals(1, fast.getRunCompletedCount());
- }
-
- /**
- * Waits for the specified number of jobs to complete or the timeout to fire.
- *
- * @param listener The listener to use to track Work unit completion
- * @param completedWorkItemsToWaitFor The number of Work items to complete
- */
- private void waitForWorkToComplete(TestWorkListener listener, int completedWorkItemsToWaitFor) {
- long startTime = System.currentTimeMillis();
- while (true) {
- int completedCount = listener.getWorkCompletedCallCount();
- if (completedCount == completedWorkItemsToWaitFor) {
- return;
- }
-
- if (System.currentTimeMillis() - startTime > WAIT_TIMEOUT) {
- Assert.fail("Only " + completedCount + " work items completed before timeout");
- return;
- }
-
- // Lets wait for more jobs to complete
- try {
- Thread.sleep(25);
- } catch (InterruptedException ex) {
- Assert.fail("Unexpected exception: " + ex);
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/TimeDelayWork.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/TimeDelayWork.java
deleted file mode 100644
index bada856af3..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/core/work/impl/TimeDelayWork.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.work.impl;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.tuscany.sca.core.work.impl.Work;
-
-/**
- * Simple Work item that will sleep in the run() method for the specified
- * period of time
- *
- * @version $Rev$ $Date$
- */
-public class TimeDelayWork extends Work {
-
- /**
- * Count of completed run() method calls
- */
- private AtomicInteger runCompletedCount = new AtomicInteger();
-
- /**
- * The amount of time to sleep in the Run loop
- */
- private final long sleepTime;
-
- /**
- * Constructor
- *
- * @param sleepTime The amount of time to sleep (in milliseconds) in the run() method
- */
- public TimeDelayWork(long sleepTime) {
- super(null);
- this.sleepTime = sleepTime;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isDaemon() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public void release() {
- }
-
- /**
- * Sleeps for a period of time defined by sleepTime
- */
- public void run() {
- System.out.println("Starting " + this);
- try {
- Thread.sleep(sleepTime);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- System.out.println("Done " + this);
- runCompletedCount.incrementAndGet();
- }
-
- /**
- * Returns the number of completed calls to run()
- *
- * @return The number of completed calls to run()
- */
- public int getRunCompletedCount() {
- return runCompletedCount.get();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java b/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java
deleted file mode 100644
index ca7bf9b3d7..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.scope;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.junit.Test;
-/**
- * @version $Rev$ $Date$
- */
-public class ScopeTestCase {
-
- @Test
- public void testEquals() throws Exception {
- Scope scope = new Scope("COMPOSITE");
- assertTrue(scope.equals(Scope.COMPOSITE));
- }
-
- @Test
- public void testEqualsNew() throws Exception {
- Scope foo = new Scope("foo");
- Scope foo2 = new Scope("FOO");
- assertTrue(foo.equals(foo2));
- }
-
- @Test
- public void testNotEquals() throws Exception {
- Scope foo = new Scope("BAR");
- Scope foo2 = new Scope("FOO");
- assertFalse(foo.equals(foo2));
- }
-
- @Test
- public void testNotEqualsDifferent() throws Exception {
- Scope foo = new Scope("FOO");
- assertFalse(foo.equals(new Bar("FOO")));
- }
-
- public class Bar {
- String scope;
-
- public Bar(String scope) {
- this.scope = scope;
- }
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/core/src/test/resources/META-INF/services/org.apache.tuscany.sca.invocation.PhaseTest b/tags/java/sca/2.0-M1/modules/core/src/test/resources/META-INF/services/org.apache.tuscany.sca.invocation.PhaseTest
deleted file mode 100644
index ad23df3761..0000000000
--- a/tags/java/sca/2.0-M1/modules/core/src/test/resources/META-INF/services/org.apache.tuscany.sca.invocation.PhaseTest
+++ /dev/null
@@ -1,24 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-name=implementation.last, stage=implementation, after=*
-name=reference.first, stage=reference, before=*
-name=reference.transaction, stage=reference, after=reference.interface
-name=reference.binding.header, stage=reference.binding, after=reference.binding.transport
-name=service.binding.header, stage=service.binding, after=service.binding.transport
-name=service.transaction, stage=service, after=service.binding, before=component.service
-name=implementation.transaction, stage=implementation, before=implementation.policy
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/LICENSE b/tags/java/sca/2.0-M1/modules/databinding-axiom/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/databinding-axiom/META-INF/MANIFEST.MF
deleted file mode 100644
index 79cb7bf092..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,33 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.databinding.axiom;uses:="org.ap
- ache.tuscany.sca.databinding,org.apache.tuscany.sca.interfacedef.util
- ,org.apache.tuscany.sca.databinding.impl,org.apache.axiom.om.impl.bui
- lder,org.apache.tuscany.sca.interfacedef,org.apache.axiom.om,javax.xm
- l.namespace,javax.xml.stream,org.apache.tuscany.sca.interfacedef.impl
- ,org.apache.tuscany.sca.databinding.javabeans";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Data Binding for Axiom
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397285015
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Data Binding for Axiom
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.axiom.om,
- org.apache.axiom.om.impl.builder,
- org.apache.axiom.om.impl.llom.factory;resolution:=optional,
- org.apache.axiom.soap.impl.llom.soap11;resolution:=optional,
- org.apache.tuscany.sca.databinding;version="2.0.0",
- org.apache.tuscany.sca.databinding.axiom;version="2.0.0",
- org.apache.tuscany.sca.databinding.impl;version="2.0.0",
- org.apache.tuscany.sca.databinding.javabeans;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="1.4"
-Bundle-SymbolicName: org.apache.tuscany.sca.databinding.axiom
-Fragment-Host: org.apache.ws.commons.axiom.axiom-api
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/NOTICE b/tags/java/sca/2.0-M1/modules/databinding-axiom/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/pom.xml b/tags/java/sca/2.0-M1/modules/databinding-axiom/pom.xml
deleted file mode 100644
index bd6e747d13..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/pom.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding-axiom</artifactId>
- <name>Apache Tuscany SCA Data Binding for Axiom</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!--
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0-2</version>
- </dependency>
- -->
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- <version>1.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.7</version>
- <exclusions>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.7</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- <scope>runtime</scope>
- </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/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java
deleted file mode 100644
index 142229f4f6..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.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/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java
deleted file mode 100644
index cd820ab4b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.axiom;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.impl.builder.StAXBuilder;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * Helper for AXIOM
- *
- * @version $Rev$ $Date$
- */
-public class AxiomHelper {
- private static final String DEFAULT_PREFIX = "_ns_";
-
- private AxiomHelper() {
- }
-
- /**
- * See http://issues.apache.org/jira/browse/WSCOMMONS-240
- * @param om
- */
- public static void completeAndClose(OMElement om) {
- // Get the builder associated with the om element
- OMXMLParserWrapper builder = om.getBuilder();
- if (builder != null) {
- if (builder instanceof StAXBuilder) {
- ((StAXBuilder)builder).releaseParserOnClose(true);
- }
- OMElement document = builder.getDocumentElement();
- if (document != null) {
- document.build();
- }
- }
- if (builder instanceof StAXBuilder) {
- ((StAXBuilder)builder).close();
- }
- }
-
- /**
- * This method will close the builder immediately. Any subsequent Axiom objects won't
- * be built or accessible.
- */
- public static void closeImmediately(OMElement om) {
- // Get the builder associated with the om element
- OMXMLParserWrapper builder = om.getBuilder();
- if (builder != null) {
- if (builder instanceof StAXBuilder) {
- ((StAXBuilder)builder).releaseParserOnClose(true);
- ((StAXBuilder)builder).close();
- }
- // builder.close();
- }
- }
-
- /**
- * @param context
- * @param element
- */
- public static void adjustElementName(TransformationContext context, OMElement element) {
- if (context != null) {
- DataType dataType = context.getTargetDataType();
- Object logical = dataType == null ? null : dataType.getLogical();
- if (!(logical instanceof XMLType)) {
- return;
- }
- XMLType xmlType = (XMLType)logical;
- if (xmlType.isElement() && !xmlType.getElementName().equals(element.getQName())) {
- // FIXME:: Throw exception or switch to the new Element?
- OMFactory factory = OMAbstractFactory.getOMFactory();
- QName name = xmlType.getElementName();
- OMNamespace namespace = factory.createOMNamespace(name.getNamespaceURI(), name.getPrefix());
- element.setNamespace(namespace);
- element.setLocalName(name.getLocalPart());
- }
- }
- }
-
- public static OMElement createOMElement(OMFactory factory, QName element) {
- String localName = element.getLocalPart();
- OMNamespace ns = createOMNamespace(factory, element);
-
- return factory.createOMElement(localName, ns);
-
- }
-
- public static OMElement createOMElement(OMFactory factory, QName element, OMDataSource dataSource) {
- String localName = element.getLocalPart();
- OMNamespace ns = createOMNamespace(factory, element);
-
- return factory.createOMElement(dataSource, localName, ns);
-
- }
-
- /**
- * @param factory
- * @param name
- * @return
- */
- public static OMNamespace createOMNamespace(OMFactory factory, QName name) {
- String namespaceURI = name.getNamespaceURI();
- String prefix = name.getPrefix();
-
- OMNamespace ns = null;
-
- // Qualified Element: we need an OMNamespace
- if (prefix.length() == 0) {
- // The prefix does not appear to be specified, let's create one
- prefix = DEFAULT_PREFIX;
- }
- ns = factory.createOMNamespace(namespaceURI, prefix);
-
- return ns;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java
deleted file mode 100644
index 429a6dbe5d..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java
deleted file mode 100644
index e23d89327c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java
deleted file mode 100644
index 3dc73c89cb..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.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/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java
deleted file mode 100644
index ef7359fbcd..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.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/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java
deleted file mode 100644
index ea40e61746..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.axiom;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.databinding.impl.SimpleType2JavaTransformer;
-
-/**
- * Transformer to convert data from a simple java Object to OMElement.
- *
- * @version $Rev$ $Date$
- */
-public class OMElement2Object extends SimpleType2JavaTransformer<OMElement> {
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.SimpleType2JavaTransformer#close(java.lang.Object)
- */
- @Override
- protected void close(OMElement source) {
- if (source != null) {
- AxiomHelper.completeAndClose(source);
- }
- }
-
- @Override
- protected String getText(OMElement source) {
- return source.getText();
- }
-
- @Override
- public Class getSourceType() {
- return OMElement.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java
deleted file mode 100644
index b2c004324c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.axiom;
-
-import java.io.StringWriter;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-/**
- * Transformer to convert data from an OMElement to XML String
- *
- * @version $Rev$ $Date$
- */
-public class OMElement2String extends BaseTransformer<OMElement, String> implements PullTransformer<OMElement, String> {
- // private XmlOptions options;
-
- public String transform(OMElement source, TransformationContext context) {
- try {
- StringWriter writer = new StringWriter();
- source.serialize(writer);
- return writer.toString();
- } catch (XMLStreamException e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<OMElement> getSourceType() {
- return OMElement.class;
- }
-
- @Override
- protected Class<String> getTargetType() {
- return String.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java
deleted file mode 100644
index 01e7003b20..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.axiom;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class OMElement2XMLStreamReader extends BaseTransformer<OMElement, XMLStreamReader> implements
- PullTransformer<OMElement, XMLStreamReader> {
- // private XmlOptions options;
-
- public static final QName QNAME_NIL = new QName("http://www.w3.org/2001/XMLSchema-instance", "nil");
-
- public XMLStreamReader transform(OMElement source, TransformationContext context) {
- if (source == null) {
- return null;
- } else {
- if ("true".equals(source.getAttributeValue(QNAME_NIL))) {
- return null;
- } else {
- return source.getXMLStreamReader();
- }
- }
- }
-
- @Override
- protected Class<OMElement> getSourceType() {
- return OMElement.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java
deleted file mode 100644
index 9084f09dc0..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.axiom;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.XMLConstants;
-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.WrapperHandler;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * OMElement wrapper handler implementation
- *
- * @version $Rev$ $Date$
- */
-public class OMElementWrapperHandler implements WrapperHandler<OMElement> {
-
- private OMFactory factory;
-
- public OMElementWrapperHandler() {
- super();
- this.factory = OMAbstractFactory.getOMFactory();
- }
-
- public OMElement create(Operation operation, boolean input) {
- WrapperInfo wrapperInfo = operation.getWrapper();
- ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
- // Class<?> wrapperClass = input ? wrapperInfo.getInputWrapperClass() : wrapperInfo.getOutputWrapperClass();
- OMElement wrapper = AxiomHelper.createOMElement(factory, element.getQName());
- return wrapper;
- }
-
- public void setChildren(OMElement wrapper, Object[] childObjects, Operation operation, boolean input) {
- List<ElementInfo> childElements =
- input ? operation.getWrapper().getInputChildElements() : operation.getWrapper().getOutputChildElements();
- for (int i = 0; i < childElements.size(); i++) {
- setChild(wrapper, i, childElements.get(i), childObjects[i]);
- }
-
- }
-
- public void setChild(OMElement wrapper, int i, ElementInfo childElement, Object value) {
- if (childElement.isMany()) {
- Object[] elements = (Object[])value;
- if (value != null) {
- for (Object e : elements) {
- addChild(wrapper, childElement, (OMElement)e);
- }
- }
- } else {
- OMElement element = (OMElement)value;
- addChild(wrapper, childElement, element);
- }
- }
-
- private void addChild(OMElement wrapper, ElementInfo childElement, OMElement element) {
- if (element == null) {
- OMElement e = wrapper.getOMFactory().createOMElement(childElement.getQName(), wrapper);
- attachXSINil(e);
- return;
- }
- QName elementName = childElement.getQName();
- // Make it a bit tolerating of element QName
- if (!elementName.equals(element.getQName())) {
- OMNamespace namespace = factory.createOMNamespace(elementName.getNamespaceURI(), elementName.getPrefix());
- element.setNamespace(namespace);
- element.setLocalName(childElement.getQName().getLocalPart());
- }
- wrapper.addChild(element);
- }
-
- public List getChildren(OMElement wrapper, Operation operation, boolean input) {
- List<ElementInfo> childElements = input? operation.getWrapper().getInputChildElements():
- operation.getWrapper().getOutputChildElements();
-
- List<Object> elements = new ArrayList<Object>();
- int i = 0;
- for (ElementInfo e : childElements) {
- elements.add(getChild(wrapper, e, i));
- i++;
- }
- return elements;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
- */
- public DataType getWrapperType(Operation operation, boolean input) {
- WrapperInfo wrapper = operation.getWrapper();
- ElementInfo element = input ? wrapper.getInputWrapperElement() : wrapper.getOutputWrapperElement();
- DataType<XMLType> wrapperType =
- new DataTypeImpl<XMLType>(AxiomDataBinding.NAME, OMElement.class, new XMLType(element));
- return wrapperType;
- }
-
- public boolean isInstance(Object wrapperObj, Operation operation, boolean input) {
- WrapperInfo wrapperInfo = operation.getWrapper();
- ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
- // List<ElementInfo> childElements =
- // input ? wrapperInfo.getInputChildElements() : wrapperInfo.getOutputChildElements();
- OMElement wrapper = (OMElement)wrapperObj;
- if (!element.getQName().equals(wrapper.getQName())) {
- return false;
- }
- return true;
- /*
- Set<QName> names = new HashSet<QName>();
- for (ElementInfo e : childElements) {
- names.add(e.getQName());
- }
- for (Iterator i = wrapper.getChildElements(); i.hasNext();) {
- OMElement child = (OMElement)i.next();
- if (!names.contains(child.getQName())) {
- return false;
- }
- }
- return true;
- */
- }
-
- private static final QName XSI_TYPE_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi");
-
- private List<List<OMElement>> getElements(OMElement wrapper) {
- List<List<OMElement>> elements = new ArrayList<List<OMElement>>();
- List<OMElement> current = new ArrayList<OMElement>();
- elements.add(current);
- boolean first = true;
- QName last = null;
-
- for (Iterator i = wrapper.getChildElements(); i.hasNext();) {
- OMElement element = (OMElement)i.next();
- if (first || element.getQName().equals(last)) {
- current.add(element);
- last = element.getQName();
- } else {
- current = new ArrayList<OMElement>();
- elements.add(current);
- current.add(element);
- last = element.getQName();
- }
- first = false;
- }
- return elements;
- }
-
- public Object getChild(OMElement wrapper, ElementInfo childElement, int index) {
- Iterator children = wrapper.getChildrenWithName(childElement.getQName());
- if (!children.hasNext()) {
- // No name match, try by index
- List<List<OMElement>> list = getElements(wrapper);
- List<OMElement> elements = list.get(index);
- if (!childElement.isMany()) {
- return elements.isEmpty() ? null : attachXSIType(childElement, elements.get(0));
- } else {
- Object[] array = elements.toArray();
- for (Object item : array) {
- attachXSIType(childElement, (OMElement)item);
- }
- return array;
- }
- }
- if (!childElement.isMany()) {
- if (children.hasNext()) {
- OMElement child = (OMElement)children.next();
- attachXSIType(childElement, child);
- return child;
- } else {
- return null;
- }
- } else {
- List<OMElement> elements = new ArrayList<OMElement>();
- for (; children.hasNext();) {
- OMElement child = (OMElement)children.next();
- attachXSIType(childElement, child);
- elements.add(child);
- }
- return elements.toArray();
- }
- }
-
- /**
- * Create xis:type if required
- * @param childElement
- * @param element
- * @return
- */
- private OMElement attachXSIType(ElementInfo childElement, OMElement element) {
- TypeInfo type = childElement.getType();
- if (type != null && type.getQName() != null) {
- OMAttribute attr = element.getAttribute(XSI_TYPE_QNAME);
- if (attr == null) {
- String typeNS = type.getQName().getNamespaceURI();
- if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(typeNS)) {
- return element;
- }
- OMNamespace ns = element.getOMFactory().createOMNamespace(typeNS, "_typens_");
- element.declareNamespace(ns);
- OMNamespace xsiNS =
- element.getOMFactory().createOMNamespace(XSI_TYPE_QNAME.getNamespaceURI(),
- XSI_TYPE_QNAME.getPrefix());
- element.declareNamespace(xsiNS);
- attr =
- element.getOMFactory().createOMAttribute("type",
- xsiNS,
- "_typens_:" + type.getQName().getLocalPart());
- element.addAttribute(attr);
- }
- }
- return element;
- }
-
- private void attachXSINil(OMElement element) {
- OMNamespace xsiNS =
- element.getOMFactory().createOMNamespace(XSI_TYPE_QNAME.getNamespaceURI(), XSI_TYPE_QNAME.getPrefix());
- element.declareNamespace(xsiNS);
- OMAttribute attr = element.getOMFactory().createOMAttribute("nil", xsiNS, "true");
- element.addAttribute(attr);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java
deleted file mode 100644
index 88d6b462c1..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.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.impl.Java2SimpleTypeTransformer;
-
-/**
- * Transformer to convert data from an simple OMElement to Java Object
- *
- * @version $Rev$ $Date$
- */
-public class Object2OMElement extends Java2SimpleTypeTransformer<OMElement> {
-
- private OMFactory factory;
-
- public Object2OMElement() {
- super();
- factory = OMAbstractFactory.getOMFactory();
- }
-
- @Override
- protected OMElement createElement(QName element, String text, TransformationContext context) {
- OMElement omElement = AxiomHelper.createOMElement(factory, element);
- if (text == null) {
- OMNamespace xsi = factory.createOMNamespace("http://www.w3.org/2001/XMLSchema-instance", "xsi");
- OMAttribute nil = factory.createOMAttribute("nil", xsi, "true");
- omElement.addAttribute(nil);
- } else {
- factory.createOMText(omElement, text);
- }
- return omElement;
- }
-
- @Override
- public Class getTargetType() {
- return OMElement.class;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java
deleted file mode 100644
index 9eccd52d74..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.axiom;
-
-import java.io.ByteArrayInputStream;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class String2OMElement extends BaseTransformer<String, OMElement> implements
- PullTransformer<String, OMElement> {
-
- @SuppressWarnings("unchecked")
- public OMElement transform(String source, TransformationContext context) {
- try {
- StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(source.getBytes()));
- OMElement element = builder.getDocumentElement();
- AxiomHelper.adjustElementName(context, element);
- return element;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<OMElement> getTargetType() {
- return OMElement.class;
- }
-
- @Override
- protected Class<String> getSourceType() {
- return String.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java
deleted file mode 100644
index 761185c297..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.axiom;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class XMLStreamReader2OMElement extends BaseTransformer<XMLStreamReader, OMElement> implements
- PullTransformer<XMLStreamReader, OMElement> {
-
- public XMLStreamReader2OMElement() {
- super();
- }
-
- public OMElement transform(XMLStreamReader source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- StAXOMBuilder builder = new StAXOMBuilder(source);
- OMElement element = builder.getDocumentElement();
- AxiomHelper.adjustElementName(context, element);
- return element;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<OMElement> getTargetType() {
- return OMElement.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
deleted file mode 100644
index 183270f9b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# implementation classes for the databindings
-org.apache.tuscany.sca.databinding.axiom.AxiomDataBinding;name=org.apache.axiom.om.OMElement
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index 9c2357d4f4..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
+++ /dev/null
@@ -1,30 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation classes for the transformers
-# org.apache.tuscany.sca.databinding.axiom.CallableReference2OMElement;source=org.oasisopen.sca.CallableReference,target=org.apache.axiom.om.OMElement,weight=10
-# org.apache.tuscany.sca.databinding.axiom.OMElement2CallableReference;source=org.apache.axiom.om.OMElement,target=org.oasisopen.sca.CallableReference,weight=10
-org.apache.tuscany.sca.databinding.axiom.Externalizable2OMElement;source=java.io.Externalizable,target=org.apache.axiom.om.OMElement,weight=10
-org.apache.tuscany.sca.databinding.axiom.OMElement2Externalizable;source=org.apache.axiom.om.OMElement,target=java.io.Externalizable,weight=10
-org.apache.tuscany.sca.databinding.axiom.Exception2OMElement;source=java:exception,target=org.apache.axiom.om.OMElement,weight=10
-org.apache.tuscany.sca.databinding.axiom.OMElement2Exception;source=org.apache.axiom.om.OMElement,target=java:exception,weight=10
-# org.apache.tuscany.sca.databinding.axiom.Object2OMElement;source=java:simpleType,target=org.apache.axiom.om.OMElement,weight=80000
-# org.apache.tuscany.sca.databinding.axiom.OMElement2Object;source=org.apache.axiom.om.OMElement,target=java:simpleType,weight=80000
-org.apache.tuscany.sca.databinding.axiom.OMElement2String;source=org.apache.axiom.om.OMElement,target=java.lang.String,weight=80
-org.apache.tuscany.sca.databinding.axiom.OMElement2XMLStreamReader;source=org.apache.axiom.om.OMElement,target=javax.xml.stream.XMLStreamReader,weight=60
-org.apache.tuscany.sca.databinding.axiom.String2OMElement;source=java.lang.String,target=org.apache.axiom.om.OMElement,weight=80
-org.apache.tuscany.sca.databinding.axiom.XMLStreamReader2OMElement;source=javax.xml.stream.XMLStreamReader,target=org.apache.axiom.om.OMElement,weight=60
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java
deleted file mode 100644
index 7453cb787a..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.axiom;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class OMElementTestCase extends TestCase {
- private static final String IPO_XML =
- "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
- + " xmlns:ipo=\"http://www.example.com/IPO\""
- + " xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\""
- + " orderDate=\"1999-12-01\">"
- + " <shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\">"
- + " <name>Helen Zoe</name>"
- + " <street>47 Eden Street</street>"
- + " <city>Cambridge</city>"
- + " <postcode>CB1 1JR</postcode>"
- + " </shipTo>"
- + " <billTo xsi:type=\"ipo:USAddress\">"
- + " <name>Robert Smith</name>"
- + " <street>8 Oak Avenue</street>"
- + " <city>Old Town</city>"
- + " <state>PA</state>"
- + " <zip>95819</zip>"
- + " </billTo>"
- + " <items>"
- + " <item partNum=\"833-AA\">"
- + " <productName>Lapis necklace</productName>"
- + " <quantity>1</quantity>"
- + " <USPrice>99.95</USPrice>"
- + " <ipo:comment>Want this for the holidays</ipo:comment>"
- + " <shipDate>1999-12-05</shipDate>"
- + " </item>"
- + " </items>"
- + "</ipo:purchaseOrder>";
-
- public final void testStringTransform() {
- String2OMElement t1 = new String2OMElement();
- OMElement element = t1.transform(IPO_XML, null);
- OMElement2String t2 = new OMElement2String();
- String xml = t2.transform(element, null);
- Assert.assertNotNull(xml);
- Assert.assertNotNull(xml.indexOf("<ipo:comment>") != -1);
- }
-
- public final void testStringTransform2() {
- String str =
- "<p0:firstName xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
- + "xmlns:p0=\"http://helloworld\">Robert</p0:firstName>";
- String2OMElement t1 = new String2OMElement();
- OMElement element = t1.transform(str, null);
- OMElement2String t2 = new OMElement2String();
- String xml = t2.transform(element, null);
- Assert.assertNotNull(xml);
- Assert.assertNotNull(xml.indexOf("<ipo:comment>") != -1);
- }
-
- public final void testStAXTransform() {
- String2OMElement t1 = new String2OMElement();
- OMElement element = t1.transform(IPO_XML, null);
-
- OMElement2XMLStreamReader t2 = new OMElement2XMLStreamReader();
- XMLStreamReader reader = t2.transform(element, null);
-
- XMLStreamReader2OMElement t3 = new XMLStreamReader2OMElement();
- OMElement element2 = t3.transform(reader, null);
-
- Assert.assertEquals(element2.getQName(), element.getQName());
- Assert.assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), element2.getQName());
- }
-
- public final void testCopy() {
- String2OMElement t1 = new String2OMElement();
- OMElement element = t1.transform(IPO_XML, null);
- OMElement copy = (OMElement)new AxiomDataBinding().copy(element, null, null);
- assertNotSame(element, copy);
- assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), copy.getQName());
- }
-
- private static final QName XSI_NIL = new QName("http://www.w3.org/2001/XMLSchema-instance", "nil", "xsi");
-
- public final void testNil() {
- Object2OMElement t1 = new Object2OMElement();
- TransformationContext context = new TransformationContextImpl();
- DataType<XMLType> dataType =
- new DataTypeImpl<XMLType>(int.class, new XMLType(new QName("http://ns1", "nilElement"),
- SimpleTypeMapperImpl.XSD_INT));
- context.setTargetDataType(dataType);
- OMElement element = t1.transform(null, context);
- OMAttribute attribute = element.getAttribute(XSI_NIL);
- Assert.assertNotNull(attribute);
- Assert.assertEquals("true", attribute.getAttributeValue());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/ipo.xml b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/ipo.xml
deleted file mode 100644
index df901d183d..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/ipo.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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.
--->
-<ipo:purchaseOrder
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ipo="http://www.example.com/IPO"
- xsi:schemaLocation="http://www.example.com/IPO ipo.xsd"
- orderDate="1999-12-01">
-
- <shipTo exportCode="1" xsi:type="ipo:UKAddress">
- <name>Helen Zoe</name>
- <street>47 Eden Street</street>
- <city>Cambridge</city>
- <postcode>CB1 1JR</postcode>
- </shipTo>
-
- <billTo xsi:type="ipo:USAddress">
- <name>Robert Smith</name>
- <street>8 Oak Avenue</street>
- <city>Old Town</city>
- <state>PA</state>
- <zip>95819</zip>
- </billTo>
-
- <items>
- <item partNum="833-AA">
- <productName>Lapis necklace</productName>
- <quantity>1</quantity>
- <USPrice>99.95</USPrice>
- <ipo:comment>Want this for the holidays</ipo:comment>
- <shipDate>1999-12-05</shipDate>
- </item>
- </items>
-</ipo:purchaseOrder>
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/ipo.xsd b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/ipo.xsd
deleted file mode 100755
index af1e73172d..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/ipo.xsd
+++ /dev/null
@@ -1,137 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/order.wsdl b/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/order.wsdl
deleted file mode 100644
index a5ead60382..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-axiom/src/test/resources/order.wsdl
+++ /dev/null
@@ -1,76 +0,0 @@
-<?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/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/LICENSE b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/META-INF/MANIFEST.MF
deleted file mode 100644
index c3e0cff10d..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,38 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.databinding.jaxb.axiom;version
- ="1.4",org.apache.tuscany.sca.databinding.jaxb.axiom.ext;version="1.4
- "
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Data Binding for JAXB-AXIOM
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397336953
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Data Binding for JAXB-AXIOM
-Import-Package: javax.xml.bind,
- javax.xml.bind.annotation;resolution:=optional,
- javax.xml.bind.attachment,
- javax.xml.datatype;resolution:=optional,
- javax.xml.namespace,
- javax.xml.stream,
- javax.xml.transform,
- javax.xml.transform.stream,
- org.apache.axiom.om,
- org.apache.axiom.om.ds,
- org.apache.axiom.om.impl,
- org.apache.axiom.om.impl.builder,
- org.apache.axiom.om.util,
- org.apache.tuscany.sca.databinding;version="2.0.0",
- org.apache.tuscany.sca.databinding.impl;version="2.0.0",
- org.apache.tuscany.sca.databinding.jaxb;version="2.0.0",
- org.apache.tuscany.sca.databinding.jaxb.axiom;resolution:=optional,
- org.apache.tuscany.sca.databinding.xml;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.w3c.dom;resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.databinding.jaxb.axiom
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/NOTICE b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/pom.xml b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/pom.xml
deleted file mode 100644
index ec7a9fbeba..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/pom.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding-jaxb-axiom</artifactId>
- <name>Apache Tuscany SCA Data Binding for JAXB-AXIOM</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.7</version>
- <exclusions>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.7</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <repositories>
- <repository>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>java.net</id>
- <name>java.net Maven 1.x Repository</name>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>java.net2</id>
- <name>java.net Maven 2.x Repository</name>
- <url>http://download.java.net/maven/2</url>
- </pluginRepository>
- </pluginRepositories>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- <type>jar</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Djava.endorsed.dirs=target/endorsed</argLine>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>add-test-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/jaxb-source</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.jvnet.jaxb2.maven2</groupId>
- <artifactId>maven-jaxb2-plugin</artifactId>
- <version>0.5</version>
- <executions>
- <execution>
- <id>generate-jaxb</id>
- <phase>generate-test-sources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <generatePackage>com.example.ipo.jaxb</generatePackage>
- <generateDirectory>${project.build.directory}/jaxb-source</generateDirectory>
- <schemaDirectory>${basedir}/src/test/resources</schemaDirectory>
- <schemaIncludes>
- <include>ipo.xsd</include>
- </schemaIncludes>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java
deleted file mode 100644
index 93277e77bf..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb.axiom;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.impl.builder.StAXBuilder;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * Helper for AXIOM
- *
- * @version $Rev$ $Date$
- */
-public class AxiomHelper {
- private static final String DEFAULT_PREFIX = "_ns_";
-
- private AxiomHelper() {
- }
-
- /**
- * See http://issues.apache.org/jira/browse/WSCOMMONS-240
- * @param om
- */
- public static void completeAndClose(OMElement om) {
- // Get the builder associated with the om element
- OMXMLParserWrapper builder = om.getBuilder();
- if (builder != null) {
- if (builder instanceof StAXBuilder) {
- ((StAXBuilder)builder).releaseParserOnClose(true);
- }
- OMElement document = builder.getDocumentElement();
- if (document != null) {
- document.build();
- }
- }
- if (builder instanceof StAXBuilder) {
- ((StAXBuilder)builder).close();
- }
- }
-
- /**
- * This method will close the builder immediately. Any subsequent Axiom objects won't
- * be built or accessible.
- */
- public static void closeImmediately(OMElement om) {
- // Get the builder associated with the om element
- OMXMLParserWrapper builder = om.getBuilder();
- if (builder != null) {
- if (builder instanceof StAXBuilder) {
- ((StAXBuilder)builder).releaseParserOnClose(true);
- ((StAXBuilder)builder).close();
- }
- // builder.close();
- }
- }
-
- /**
- * @param context
- * @param element
- */
- public static void adjustElementName(TransformationContext context, OMElement element) {
- if (context != null) {
- DataType<?> dataType = context.getTargetDataType();
- Object logical = dataType == null ? null : dataType.getLogical();
- if (!(logical instanceof XMLType)) {
- return;
- }
- XMLType xmlType = (XMLType)logical;
- if (xmlType.isElement() && !xmlType.getElementName().equals(element.getQName())) {
- // FIXME:: Throw exception or switch to the new Element?
- OMFactory factory = OMAbstractFactory.getOMFactory();
- QName name = xmlType.getElementName();
- OMNamespace namespace = factory.createOMNamespace(name.getNamespaceURI(), name.getPrefix());
- element.setNamespace(namespace);
- element.setLocalName(name.getLocalPart());
- }
- }
- }
-
- public static OMElement createOMElement(OMFactory factory, QName element) {
- String localName = element.getLocalPart();
- OMNamespace ns = createOMNamespace(factory, element);
-
- return factory.createOMElement(localName, ns);
-
- }
-
- public static OMElement createOMElement(OMFactory factory, QName element, OMDataSource dataSource) {
- String localName = element.getLocalPart();
- OMNamespace ns = createOMNamespace(factory, element);
-
- return factory.createOMElement(dataSource, localName, ns);
-
- }
-
- /**
- * @param factory
- * @param name
- * @return
- */
- public static OMNamespace createOMNamespace(OMFactory factory, QName name) {
- String namespaceURI = name.getNamespaceURI();
- String prefix = name.getPrefix();
-
- OMNamespace ns = null;
- // Qualified Element: we need an OMNamespace
- if (prefix.length() == 0) {
- // The prefix does not appear to be specified, let's create one
- prefix = DEFAULT_PREFIX;
- }
- ns = factory.createOMNamespace(namespaceURI, prefix);
- return ns;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java
deleted file mode 100644
index 9b11e2ff11..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb.axiom;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.tuscany.sca.databinding.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.jaxb.JAXBContextHelper;
-import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding;
-
-/**
- * JAXB Object --> AXIOM OMElement transformer
- *
- * @version $Rev$ $Date$
- */
-public class JAXB2OMElement extends BaseTransformer<Object, OMElement> implements PullTransformer<Object, OMElement> {
- private OMFactory factory = OMAbstractFactory.getOMFactory();
-
- @Override
- public String getSourceDataBinding() {
- return JAXBDataBinding.NAME;
- }
-
- public OMElement transform(Object source, TransformationContext context) throws TransformationException {
- JAXBContext jaxbContext;
- try {
- jaxbContext = JAXBContextHelper.createJAXBContext(context, true);
- } catch (JAXBException e) {
- throw new TransformationException(e);
- }
- Object element = JAXBContextHelper.createJAXBElement(jaxbContext, context.getTargetDataType(), source);
- QName name = jaxbContext.createJAXBIntrospector().getElementName(element);
- JAXBDataSource dataSource = new JAXBDataSource(element, jaxbContext);
- OMElement omElement = AxiomHelper.createOMElement(factory, name, dataSource);
- return omElement;
- }
-
- @Override
- public Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- public Class<OMElement> getTargetType() {
- return OMElement.class;
- }
-
- @Override
- public int getWeight() {
- return 3000;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXBDataSource.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXBDataSource.java
deleted file mode 100644
index b6fa362ed9..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXBDataSource.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb.axiom;
-
-import java.io.OutputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axiom.om.util.StAXUtils;
-import org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JAXBDataSource implements OMDataSource {
- private JAXBContext context;
- private Object element;
- private Marshaller marshaller;
-
- public JAXBDataSource(Object element, JAXBContext context) {
- this.element = element;
- this.context = context;
- }
-
- private Marshaller getMarshaller() throws JAXBException {
- if (marshaller == null) {
- // For thread safety, not sure we can cache the marshaller
- marshaller = JAXBContextHelper.getMarshaller(context);
- }
- return marshaller;
- }
-
- private void releaseMarshaller(Marshaller marshaller) {
- JAXBContextHelper.releaseJAXBMarshaller(context, marshaller);
- }
-
- public XMLStreamReader getReader() throws XMLStreamException {
- // FIXME: [rfeng] This is a quick and dirty implementation
- // We could use the fastinfoset to optimize the roundtrip
- StringWriter writer = new StringWriter();
- serialize(writer, new OMOutputFormat());
- StringReader reader = new StringReader(writer.toString());
- return StAXUtils.createXMLStreamReader(reader);
- }
-
- public void serialize(final XMLStreamWriter xmlWriter) throws XMLStreamException {
- try {
- // marshaller.setProperty(Marshaller.JAXB_ENCODING, format.getCharSetEncoding());
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws Exception {
- try {
- Marshaller marshaller = getMarshaller();
- marshaller.marshal(element, xmlWriter);
- } finally {
- releaseMarshaller(marshaller);
- }
- return null;
- }
- });
- } catch (PrivilegedActionException e) {
- throw new XMLStreamException(e.getException());
- }
- }
-
- public void serialize(final OutputStream output, OMOutputFormat format) throws XMLStreamException {
- try {
- // marshaller.setProperty(Marshaller.JAXB_ENCODING, format.getCharSetEncoding());
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws Exception {
- try {
- Marshaller marshaller = getMarshaller();
- marshaller.marshal(element, output);
- } finally {
- releaseMarshaller(marshaller);
- }
- return null;
- }
- });
- } catch (PrivilegedActionException e) {
- throw new XMLStreamException(e.getException());
- }
- }
-
- public void serialize(final Writer writer, OMOutputFormat format) throws XMLStreamException {
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws Exception {
- try {
- Marshaller marshaller = getMarshaller();
- marshaller.marshal(element, writer);
- } finally {
- releaseMarshaller(marshaller);
- }
- return null;
- }
- });
- } catch (PrivilegedActionException e) {
- throw new XMLStreamException(e.getException());
- }
- }
-
- public Object getObject() {
- return element;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java
deleted file mode 100644
index 8e9b32cfc0..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb.axiom;
-
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.util.StreamReaderDelegate;
-
-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.jaxb.JAXBContextHelper;
-
-/**
- * @version $Rev$ $Date$
- */
-public class OMElement2JAXB extends BaseTransformer<OMElement, Object> implements PullTransformer<OMElement, Object> {
-
- @Override
- public String getSourceDataBinding() {
- return org.apache.axiom.om.OMElement.class.getName();
- }
-
- public Object transform(final OMElement source, final TransformationContext context) throws TransformationException {
- try {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws JAXBException, XMLStreamException {
- Unmarshaller unmarshaller = null;
- XMLStreamReader reader = null;
- Object result = null;
- // Marshalling directly to the output stream is faster than marshalling through the
- // XMLStreamWriter.
- // Take advantage of this optimization if there is an output stream.
- JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context, false);
- try {
- unmarshaller = JAXBContextHelper.getUnmarshaller(jaxbContext);
- reader = source.getXMLStreamReaderWithoutCaching();
- // https://issues.apache.org/jira/browse/WSCOMMONS-395
- reader = new StreamReaderDelegate(reader) {
- // Fix the issue in WSCOMMONS-395
- public String getAttributeType(int index) {
- String type = super.getAttributeType(index);
- return type == null ? "CDATA" : type;
- }
- };
- result = unmarshaller.unmarshal(reader, JAXBContextHelper.getJavaType(context.getTargetDataType()));
- } finally {
- if (reader != null) {
- reader.close();
- }
- JAXBContextHelper.releaseJAXBUnmarshaller(jaxbContext, unmarshaller);
- }
- return JAXBContextHelper.createReturnValue(jaxbContext, context.getTargetDataType(), result);
- }
- });
- } catch (PrivilegedActionException e) {
- throw new TransformationException(e.getException());
- }
- }
-
- @Override
- public Class<OMElement> getSourceType() {
- return OMElement.class;
- }
-
- @Override
- public Class<Object> getTargetType() {
- return Object.class;
- }
-
- @Override
- public int getWeight() {
- return 3000;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java
deleted file mode 100644
index f30a6c1cb8..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb.axiom.ext;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMContainer;
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.builder.CustomBuilder;
-
-/**
- * JAXBCustomBuilder creates an OMSourcedElement backed by a JAXBDataSource
- * for the specified namespace and localPart.
- */
-public class JAXBCustomBuilder implements CustomBuilder {
-
- private JAXBDSContext jdsContext;
-
- /**
- * Create a JAXBCustomBuilder
- * @param context JAXBDSContext
- */
- public JAXBCustomBuilder(JAXBDSContext context) {
- super();
- this.jdsContext = context;
- }
-
- public OMElement create(String namespace,
- String localPart,
- OMContainer parent,
- XMLStreamReader reader,
- OMFactory factory) throws OMException {
-
- // There are some situations where we want to use normal
- // unmarshalling, so return null
- if (!shouldUnmarshal(namespace, localPart)) {
- // JAXBCustomBuilderMonitor.updateTotalFailedCreates();
- return null;
- }
- try {
- // Create an OMSourcedElement backed by an unmarshalled JAXB object
- OMNamespace ns = factory.createOMNamespace(namespace, reader.getPrefix());
-
- Object jaxb = jdsContext.unmarshal(reader);
-
- OMDataSource ds = new JAXBDataSourceExt(jaxb, jdsContext);
- OMElement omse = factory.createOMElement(ds, localPart, ns);
-
- parent.addChild(omse);
- // JAXBCustomBuilderMonitor.updateTotalCreates();
- return omse;
- } catch (JAXBException e) {
- // JAXBCustomBuilderMonitor.updateTotalFailedCreates();
- throw new OMException(e);
- }
- }
-
- /**
- * The namespace identifier for the SOAP 1.1 envelope.
- */
- public static final String URI_NS_SOAP_1_1_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
- /**
- * The namespace identifier for the SOAP 1.2 envelope.
- */
- public static final String URI_NS_SOAP_1_2_ENVELOPE = "http://www.w3.org/2003/05/soap-envelope";
-
- /**
- * @param namespace
- * @param localPart
- * @return true if this ns and local part is acceptable for unmarshalling
- */
- private boolean shouldUnmarshal(String namespace, String localPart) {
-
- // Don't unmarshall SOAPFaults or anything else in the SOAP
- // namespace.
- // Don't unmarshall elements that are unqualified
- if (localPart == null || namespace == null
- || namespace.length() == 0
- || URI_NS_SOAP_1_1_ENVELOPE.equals(namespace)
- || URI_NS_SOAP_1_2_ENVELOPE.equals(namespace)) {
- return false;
- }
-
- // Don't unmarshal if this looks like encrypted data
- if (localPart.equals("EncryptedData")) {
- return false;
- }
-
- return true;
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java
deleted file mode 100644
index 28997cd244..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb.axiom.ext;
-
-import java.io.OutputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.attachment.AttachmentMarshaller;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
-import org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper;
-
-/*
- * To marshal or unmarshal a JAXB object, the JAXBContext is necessary.
- * In addition, access to the MessageContext and other context objects may be necessary
- * to get classloader information, store attachments etc.
- *
- * The JAXBDSContext bundles all of this information together.
- */
-public class JAXBDSContext {
-
- private static final Logger log = Logger.getLogger(JAXBDSContext.class.getName());
- private static final boolean DEBUG_ENABLED = log.isLoggable(Level.FINER);
-
- private JAXBContext jaxbContext = null; // JAXBContext
-
- /**
- * "Dispatch" Constructor Use this full constructor when the JAXBContent is provided by the
- * customer.
- *
- * @param jaxbContext
- */
- public JAXBDSContext(JAXBContext jaxbContext) {
- this.jaxbContext = jaxbContext;
- }
-
- public JAXBContext getJAXBContext() {
- return jaxbContext;
- }
-
- /**
- * Unmarshal the xml into a JAXB object
- * @param reader
- * @return
- * @throws JAXBException
- */
- public Object unmarshal(XMLStreamReader reader) throws JAXBException {
-
- Unmarshaller u = JAXBContextHelper.getUnmarshaller(getJAXBContext());
-
- Object jaxb = null;
-
- // Unmarshal into the business object.
- jaxb = unmarshalElement(u, reader); // preferred and always used for
- // style=document
-
- // Successfully unmarshalled the object
- // JAXBUtils.releaseJAXBUnmarshaller(getJAXBContext(cl), u);
-
- // Don't close the reader. The reader is owned by the caller, and it
- // may contain other xml instance data (other than this JAXB object)
- // reader.close();
- return jaxb;
- }
-
- /**
- * Marshal the jaxb object
- * @param obj
- * @param writer
- * @param am AttachmentMarshaller, optional Attachment
- */
- public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException {
-
- // Very easy, use the Context to get the Marshaller.
- // Use the marshaller to write the object.
- Marshaller m = JAXBContextHelper.getMarshaller(getJAXBContext());
- AttachmentMarshaller am = m.getAttachmentMarshaller();
- boolean xop = am != null ? am.isXOPPackage() : false;
- // Marshal the object
- marshalElement(obj, m, writer, !xop);
- }
-
- /**
- * Preferred way to marshal objects.
- *
- * @param b Object that can be rendered as an element and the element name is known by the
- * Marshaller
- * @param m Marshaller
- * @param writer XMLStreamWriter
- */
- private static void marshalElement(final Object b,
- final Marshaller m,
- final XMLStreamWriter writer,
- final boolean optimize) {
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- // Marshalling directly to the output stream is faster than marshalling through the
- // XMLStreamWriter.
- // Take advantage of this optimization if there is an output stream.
- try {
- OutputStream os = (optimize) ? getOutputStream(writer) : null;
- if (os != null) {
- writer.flush();
- m.marshal(b, os);
- } else {
- m.marshal(b, writer);
- }
- } catch (OMException e) {
- throw e;
- } catch (Throwable t) {
- throw new OMException(t);
- }
- return null;
- }
- });
- }
-
- /**
- * If the writer is backed by an OutputStream, then return the OutputStream
- * @param writer
- * @return OutputStream or null
- */
- private static OutputStream getOutputStream(XMLStreamWriter writer) throws XMLStreamException {
- if (writer.getClass() == MTOMXMLStreamWriter.class) {
- return ((MTOMXMLStreamWriter)writer).getOutputStream();
- }
- if (writer.getClass() == XMLStreamWriterWithOS.class) {
- return ((XMLStreamWriterWithOS)writer).getOutputStream();
- }
- return null;
- }
-
- /**
- * Preferred way to unmarshal objects
- *
- * @param u Unmarshaller
- * @param reader XMLStreamReader
- * @return Object that represents an element
- */
- private static Object unmarshalElement(final Unmarshaller u, final XMLStreamReader reader) {
- try {
- return AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- try {
- return u.unmarshal(reader);
- } catch (OMException e) {
- throw e;
- } catch (Throwable t) {
- throw new OMException(t);
- }
- }
- });
-
- } catch (OMException e) {
- throw e;
- } catch (Throwable t) {
- throw new OMException(t);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java
deleted file mode 100644
index 5a5afc13cb..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb.axiom.ext;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.axiom.om.OMDataSourceExt;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axiom.om.ds.OMDataSourceExtBase;
-import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
-import org.apache.axiom.om.util.StAXUtils;
-
-/**
- * OMDataSource backed by a jaxb object
- */
-public class JAXBDataSourceExt extends OMDataSourceExtBase {
-
- private static final Logger log = Logger.getLogger(JAXBDataSourceExt.class.getName());
-
- private Object jaxb;
- private JAXBDSContext context;
-
- public JAXBDataSourceExt(Object jaxb, JAXBDSContext context) {
- super();
- this.jaxb = jaxb;
- this.context = context;
- }
-
- public void close() {
- }
-
- public OMDataSourceExt copy() {
- return new JAXBDataSourceExt(jaxb, context);
- }
-
- public Object getObject() {
- return jaxb;
- }
-
- public JAXBDSContext getContext() {
- return context;
- }
-
- public XMLStreamReader getReader() throws XMLStreamException {
-
- try {
- String encoding = "utf-8";
- InputStream is = new ByteArrayInputStream(getXMLBytes(encoding));
- return StAXUtils.createXMLStreamReader(is, encoding);
- } catch (UnsupportedEncodingException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException {
- MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(output, format);
- serialize(writer);
- writer.flush();
- try {
- writer.close();
- } catch (XMLStreamException e) {
- // An exception can occur if nothing is written to the
- // writer. This is possible if the underlying data source
- // writers to the output stream directly.
- if (log.isLoggable(Level.FINER)) {
- log.finer("Catching and swallowing exception " + e);
- }
- }
- }
-
- public void serialize(Writer writerTarget, OMOutputFormat format) throws XMLStreamException {
- MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(StAXUtils.createXMLStreamWriter(writerTarget));
- writer.setOutputFormat(format);
- serialize(writer);
- writer.flush();
- writer.close();
- }
-
- public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
- try {
- context.marshal(jaxb, xmlWriter);
- } catch (JAXBException je) {
- throw new XMLStreamException(je);
- }
- }
-
- public byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException {
- try {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- // Exposes getOutputStream, which allows faster writes.
- XMLStreamWriterWithOS writer = new XMLStreamWriterWithOS(baos, encoding);
-
- // Write the business object to the writer
- serialize(writer);
-
- // Flush the writer
- writer.flush();
- writer.close();
- return baos.toByteArray();
- } catch (XMLStreamException e) {
- throw new OMException(e);
- }
- }
-
- public boolean isDestructiveRead() {
- return false;
- }
-
- public boolean isDestructiveWrite() {
- return false;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java
deleted file mode 100644
index 0a12654524..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb.axiom.ext;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.axiom.om.OMDataSourceExt;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.ds.OMDataSourceExtBase;
-import org.apache.axiom.om.util.StAXUtils;
-
-/**
- * OMDataSource backed by a source
- */
-public class SourceDataSource extends OMDataSourceExtBase {
- private Source data;
-
- public SourceDataSource(Source data) {
- super();
- this.data = data;
- }
-
- public void close() {
- }
-
- public OMDataSourceExt copy() {
- return new SourceDataSource(data);
- }
-
- public Object getObject() {
- return data;
- }
-
- public XMLStreamReader getReader() throws XMLStreamException {
-
- try {
- String encoding = "UTF-8";
- InputStream is = new ByteArrayInputStream(getXMLBytes(encoding));
- return StAXUtils.createXMLStreamReader(is, encoding);
- } catch (UnsupportedEncodingException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException {
- byte[] bytes = null;
- try {
- bytes = (byte[])null;
-
- if (data instanceof StreamSource) {
- InputStream is = ((StreamSource)data).getInputStream();
- if (is != null) {
- bytes = getBytesFromStream(is);
- }
- } else {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- Result result = new StreamResult(out);
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.transform(data, result);
- bytes = out.toByteArray();
- }
- } catch (OMException e) {
- throw e;
- } catch (UnsupportedEncodingException e) {
- throw e;
- } catch (Throwable e) {
- throw new OMException(e);
- }
-
- return bytes;
- }
-
- public boolean isDestructiveRead() {
- return false;
- }
-
- public boolean isDestructiveWrite() {
- return false;
- }
-
- private static byte[] getBytesFromStream(InputStream is) throws IOException {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- byte[] buf = new byte[4096];
- while (true) {
- int size = is.read(buf);
- if (size < 0) {
- break;
- }
- bos.write(buf, 0, size);
- }
- return bos.toByteArray();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStreamWriterWithOS.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStreamWriterWithOS.java
deleted file mode 100644
index 44e34c3647..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStreamWriterWithOS.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb.axiom.ext;
-
-import java.io.OutputStream;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.axiom.om.util.StAXUtils;
-
-/**
- * XMLStreamReader that exposes direct access to the OutputStream.
- * Writing to the output stream is faster in some cases.
- */
-public class XMLStreamWriterWithOS implements XMLStreamWriter {
- private XMLStreamWriter writer;
- private String charSetEncoding;
- private OutputStream os;
-
- public XMLStreamWriterWithOS(OutputStream os, String charSetEncoding) throws XMLStreamException {
- super();
- writer = null; // Writer is created when needed
- this.os = os;
- this.charSetEncoding = charSetEncoding;
- }
-
- /**
- * The writer is created lazily.
- * If only the output stream is used, then the writer is never created.
- */
- private void createWriter() throws XMLStreamException {
- if (writer == null) {
- writer = StAXUtils.createXMLStreamWriter(os, charSetEncoding);
- }
- }
-
- public void close() throws XMLStreamException {
- if (writer != null) {
- writer.close();
- }
- }
-
- public void flush() throws XMLStreamException {
- if (writer != null) {
- writer.flush();
- }
- }
-
- public NamespaceContext getNamespaceContext() {
- try {
- createWriter();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- return writer.getNamespaceContext();
- }
-
- public String getPrefix(String arg0) throws XMLStreamException {
- createWriter();
- return writer.getPrefix(arg0);
- }
-
- public Object getProperty(String arg0) throws IllegalArgumentException {
- try {
- createWriter();
- } catch (XMLStreamException e) {
- throw new IllegalArgumentException(e);
- }
- return writer.getProperty(arg0);
- }
-
- public void setDefaultNamespace(String arg0) throws XMLStreamException {
- createWriter();
- writer.setDefaultNamespace(arg0);
- }
-
- public void setNamespaceContext(NamespaceContext arg0) throws XMLStreamException {
- createWriter();
- writer.setNamespaceContext(arg0);
- }
-
- public void setPrefix(String arg0, String arg1) throws XMLStreamException {
- createWriter();
- writer.setPrefix(arg0, arg1);
- }
-
- public void writeAttribute(String arg0, String arg1, String arg2, String arg3) throws XMLStreamException {
- createWriter();
- writer.writeAttribute(arg0, arg1, arg2, arg3);
- }
-
- public void writeAttribute(String arg0, String arg1, String arg2) throws XMLStreamException {
- createWriter();
- writer.writeAttribute(arg0, arg1, arg2);
- }
-
- public void writeAttribute(String arg0, String arg1) throws XMLStreamException {
- createWriter();
- writer.writeAttribute(arg0, arg1);
- }
-
- public void writeCData(String arg0) throws XMLStreamException {
- createWriter();
- writer.writeCData(arg0);
- }
-
- public void writeCharacters(char[] arg0, int arg1, int arg2) throws XMLStreamException {
- createWriter();
- writer.writeCharacters(arg0, arg1, arg2);
- }
-
- public void writeCharacters(String arg0) throws XMLStreamException {
- createWriter();
- writer.writeCharacters(arg0);
- }
-
- public void writeComment(String arg0) throws XMLStreamException {
- createWriter();
- writer.writeComment(arg0);
- }
-
- public void writeDefaultNamespace(String arg0) throws XMLStreamException {
- createWriter();
- writer.writeDefaultNamespace(arg0);
- }
-
- public void writeDTD(String arg0) throws XMLStreamException {
- createWriter();
- writer.writeDTD(arg0);
- }
-
- public void writeEmptyElement(String arg0, String arg1, String arg2) throws XMLStreamException {
- createWriter();
- writer.writeEmptyElement(arg0, arg1, arg2);
- }
-
- public void writeEmptyElement(String arg0, String arg1) throws XMLStreamException {
- createWriter();
- writer.writeEmptyElement(arg0, arg1);
- }
-
- public void writeEmptyElement(String arg0) throws XMLStreamException {
- createWriter();
- writer.writeEmptyElement(arg0);
- }
-
- public void writeEndDocument() throws XMLStreamException {
- createWriter();
- writer.writeEndDocument();
- }
-
- public void writeEndElement() throws XMLStreamException {
- createWriter();
- writer.writeEndElement();
- }
-
- public void writeEntityRef(String arg0) throws XMLStreamException {
- createWriter();
- writer.writeEntityRef(arg0);
- }
-
- public void writeNamespace(String arg0, String arg1) throws XMLStreamException {
- createWriter();
- writer.writeNamespace(arg0, arg1);
- }
-
- public void writeProcessingInstruction(String arg0, String arg1) throws XMLStreamException {
- createWriter();
- writer.writeProcessingInstruction(arg0, arg1);
- }
-
- public void writeProcessingInstruction(String arg0) throws XMLStreamException {
- createWriter();
- writer.writeProcessingInstruction(arg0);
- }
-
- public void writeStartDocument() throws XMLStreamException {
- createWriter();
- writer.writeStartDocument();
- }
-
- public void writeStartDocument(String arg0, String arg1) throws XMLStreamException {
- createWriter();
- writer.writeStartDocument(arg0, arg1);
- }
-
- public void writeStartDocument(String arg0) throws XMLStreamException {
- createWriter();
- writer.writeStartDocument(arg0);
- }
-
- public void writeStartElement(String arg0, String arg1, String arg2) throws XMLStreamException {
- createWriter();
- writer.writeStartElement(arg0, arg1, arg2);
- }
-
- public void writeStartElement(String arg0, String arg1) throws XMLStreamException {
- createWriter();
- writer.writeStartElement(arg0, arg1);
- }
-
- public void writeStartElement(String arg0) throws XMLStreamException {
- createWriter();
- writer.writeStartElement(arg0);
- }
-
- /**
- * If this XMLStreamWriter is connected to an OutputStream
- * then the OutputStream is returned. This allows a node
- * (perhaps an OMSourcedElement) to write its content
- * directly to the OutputStream.
- * @return OutputStream or null
- */
- public OutputStream getOutputStream() throws XMLStreamException {
-
- if (os != null) {
- // Flush the state of the writer..Many times the
- // write defers the writing of tag characters (>)
- // until the next write. Flush out this character
- if (writer != null) {
- this.writeCharacters("");
- this.flush();
- }
- }
- return os;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java
deleted file mode 100644
index e8e3193e24..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb.axiom.ext;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMDataSourceExt;
-import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axiom.om.ds.OMDataSourceExtBase;
-import org.apache.axiom.om.util.StAXUtils;
-
-/**
- * OMDataSource backed by a string containing xml data
- */
-public class XMLStringDataSource extends OMDataSourceExtBase {
- private String data;
-
- public XMLStringDataSource(String data) {
- super();
- this.data = data;
- }
-
- public void close() {
- }
-
- public OMDataSourceExt copy() {
- return new XMLStringDataSource(data);
- }
-
- public Object getObject() {
- return data;
- }
-
- public XMLStreamReader getReader() throws XMLStreamException {
- StringReader reader = new StringReader(data);
- return StAXUtils.createXMLStreamReader(reader);
- }
-
- public void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException {
- try {
- writer.write(data);
- } catch (UnsupportedEncodingException e) {
- throw new XMLStreamException(e);
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException {
- return data.getBytes(encoding);
- }
-
- public boolean isDestructiveRead() {
- return false;
- }
-
- public boolean isDestructiveWrite() {
- return false;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index b48e629927..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation classes for the transformers
-org.apache.tuscany.sca.databinding.jaxb.axiom.JAXB2OMElement;source=javax.xml.bind.JAXBElement,target=org.apache.axiom.om.OMElement,weight=3000
-org.apache.tuscany.sca.databinding.jaxb.axiom.JAXB2OMElement;source=java:simpleType,target=org.apache.axiom.om.OMElement,weight=3000
-org.apache.tuscany.sca.databinding.jaxb.axiom.JAXB2OMElement;source=java:complexType,target=org.apache.axiom.om.OMElement,weight=3000
-
-org.apache.tuscany.sca.databinding.jaxb.axiom.OMElement2JAXB;source=org.apache.axiom.om.OMElement,target=javax.xml.bind.JAXBElement,weight=3000,public=false
-org.apache.tuscany.sca.databinding.jaxb.axiom.OMElement2JAXB;source=org.apache.axiom.om.OMElement,target=java:complexType,weight=90000,public=false
-org.apache.tuscany.sca.databinding.jaxb.axiom.OMElement2JAXB;source=org.apache.axiom.om.OMElement,target=java:simpleType,weight=90000,public=false
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/JAXB2OMTestCase.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/JAXB2OMTestCase.java
deleted file mode 100644
index 543a76594f..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/JAXB2OMTestCase.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.databinding.jaxb.axiom;
-
-import java.io.StringWriter;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.databinding.jaxb.JAXB2Node;
-import org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper;
-import org.apache.tuscany.sca.databinding.jaxb.axiom.JAXB2OMElement;
-import org.apache.tuscany.sca.databinding.xml.Node2XMLStreamReader;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.junit.Test;
-import org.w3c.dom.Node;
-
-import com.example.ipo.jaxb.ObjectFactory;
-import com.example.ipo.jaxb.PurchaseOrderType;
-import com.example.ipo.jaxb.USAddress;
-import com.example.ipo.jaxb.USState;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JAXB2OMTestCase {
- @Test
- public void testTransformElement() throws Exception {
- JAXBElement<PurchaseOrderType> po = createPO();
- DataType<?> sourceDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, XMLType.UNKNOWN);
- DataType<?> targetDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, new XMLType(po.getName(), null));
- TransformationContext tContext = new TransformationContextImpl();
- tContext.setSourceDataType(sourceDataType);
- tContext.setTargetDataType(targetDataType);
-
- // Force the JAXBContext to be cached
- JAXBContextHelper.createJAXBContext(tContext, true);
-
- long start = System.currentTimeMillis();
- JAXB2OMElement t1 = new JAXB2OMElement();
- OMElement om = t1.transform(po, tContext);
- long duration1 = System.currentTimeMillis() - start;
- StringWriter sw = new StringWriter();
- // serializeAndConsume() will trigger the JAXBDataSource.serialize(Writer, OMOutputFormat)
- om.serializeAndConsume(sw);
- System.out.println(sw.toString());
-
- start = System.currentTimeMillis();
- Node node = new JAXB2Node().transform(po, tContext);
- XMLStreamReader reader = new Node2XMLStreamReader().transform(node, null);
- om = new StAXOMBuilder(reader).getDocumentElement();
- sw = new StringWriter();
- om.serializeAndConsume(sw);
- long duration2 = System.currentTimeMillis() - start;
- System.out.println(sw.toString());
- System.out.println(duration1 + " vs. " + duration2);
- }
-
- @Test
- public void testTransformType() throws Exception {
- JAXBElement<PurchaseOrderType> po = createPO();
- DataType<?> sourceDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, XMLType.UNKNOWN);
- DataType<?> targetDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, new XMLType(po.getName(), null));
- TransformationContext tContext = new TransformationContextImpl();
- tContext.setSourceDataType(sourceDataType);
- tContext.setTargetDataType(targetDataType);
- OMElement om = new JAXB2OMElement().transform(po.getValue(), tContext);
- StringWriter sw = new StringWriter();
- om.serializeAndConsume(sw);
- System.out.println(sw.toString());
- }
-
- private JAXBElement<PurchaseOrderType> createPO() {
- ObjectFactory factory = new ObjectFactory();
- PurchaseOrderType type = factory.createPurchaseOrderType();
- JAXBElement<PurchaseOrderType> po = factory.createPurchaseOrder(type);
- type.setItems(factory.createItems());
- type.setComment("123");
- USAddress address = factory.createUSAddress();
- address.setCity("San Jose");
- address.setStreet("ABC St.");
- address.setState(USState.CA);
- type.setShipTo(address);
- return po;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/OMElement2JAXBTestCase.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/OMElement2JAXBTestCase.java
deleted file mode 100644
index 3c00307941..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/java/org/apache/tuscany/databinding/jaxb/axiom/OMElement2JAXBTestCase.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.databinding.jaxb.axiom;
-
-import java.io.ByteArrayInputStream;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.databinding.jaxb.axiom.OMElement2JAXB;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.junit.Test;
-
-import com.example.ipo.jaxb.PurchaseOrderType;
-
-/**
- * @version $Rev$ $Date$
- */
-public class OMElement2JAXBTestCase {
- private static final String XML =
- "<ns0:root xmlns:ns0=\"http://ns0\" xmlns:ns2=\"http://www.example.com/IPO\">" + "<ns1:next xmlns:ns1=\"http://ns1\">"
- + "<ns2:purchaseOrder>"
- + "<shipTo xsi:type=\"ns2:USAddress\" "
- + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"
- + "<street>ABC St.</street><city>San Jose</city><state>CA</state></shipTo>"
- + "<ns2:comment>123</ns2:comment><items/>"
- + "</ns2:purchaseOrder>"
- + "</ns1:next>"
- + "</ns0:root>";
-
- @Test
- public void testTransform() throws Exception {
- DataType<?> sourceDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, XMLType.UNKNOWN);
- QName qname = new QName("http://www.example.com/IPO", "purchaseOrder");
- DataType<?> targetDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, new XMLType(qname, null));
- TransformationContext tContext = new TransformationContextImpl();
- tContext.setSourceDataType(sourceDataType);
- tContext.setTargetDataType(targetDataType);
-
- StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(XML.getBytes("UTF-8")));
- OMElement root = builder.getDocumentElement();
- OMElement next = (OMElement)root.getChildElements().next();
- OMElement po = (OMElement)next.getChildElements().next();
- Object jaxb = new OMElement2JAXB().transform(po, tContext);
- Assert.assertTrue(jaxb instanceof PurchaseOrderType);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/resources/ipo.xsd b/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/resources/ipo.xsd
deleted file mode 100644
index 241ec15d36..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb-axiom/src/test/resources/ipo.xsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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/tags/java/sca/2.0-M1/modules/databinding-jaxb/LICENSE b/tags/java/sca/2.0-M1/modules/databinding-jaxb/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/databinding-jaxb/META-INF/MANIFEST.MF
deleted file mode 100644
index 7093404615..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,51 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.databinding.jaxb;uses:="org.apa
- che.tuscany.sca.databinding,org.apache.tuscany.sca.interfacedef.util,
- javax.xml.transform.dom,org.xml.sax,javax.xml.namespace,javax.imageio
- ,javax.xml.stream,org.apache.tuscany.sca.contribution.resolver,org.ap
- ache.tuscany.sca.databinding.util,org.oasisopen.sca,org.apache.tuscany.sca
- .databinding.xml,org.apache.tuscany.sca.databinding.impl,org.apache.w
- s.commons.schema.resolver,org.apache.tuscany.sca.interfacedef,org.w3c
- .dom,javax.xml.datatype,javax.activation,javax.xml.bind.attachment,ja
- vax.xml.transform,javax.xml.bind.annotation,javax.xml.transform.strea
- m,org.apache.tuscany.sca.interfacedef.impl,org.apache.tuscany.sca.xsd
- ,javax.xml.bind";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Data Binding for JAXB
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397221390
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Data Binding for JAXB
-Import-Package: javax.activation,
- javax.imageio,
- javax.xml.bind,
- javax.xml.bind.annotation,
- javax.xml.bind.annotation.adapters,
- javax.xml.bind.attachment,
- javax.xml.datatype,
- javax.xml.namespace,
- javax.xml.stream,
- javax.xml.transform,
- javax.xml.transform.dom,
- javax.xml.transform.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.databinding;version="2.0.0",
- org.apache.tuscany.sca.databinding.impl;version="2.0.0",
- org.apache.tuscany.sca.databinding.jaxb;version="2.0.0",
- org.apache.tuscany.sca.databinding.util;version="2.0.0",
- org.apache.tuscany.sca.databinding.xml;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.xsd;version="2.0.0",
- org.oasisopen.sca;version="2.0.0",
- org.w3c.dom,
- org.xml.sax
-Bundle-SymbolicName: org.apache.tuscany.sca.databinding.jaxb
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/NOTICE b/tags/java/sca/2.0-M1/modules/databinding-jaxb/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/pom.xml b/tags/java/sca/2.0-M1/modules/databinding-jaxb/pom.xml
deleted file mode 100644
index f97100f73e..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/pom.xml
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <name>Apache Tuscany SCA DataBinding for JAXB</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
- -->
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- <exclusions>
- <exclusion>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- <version>1.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.1.9</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <repositories>
- <repository>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>java.net</id>
- <name>java.net Maven 1.x Repository</name>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>java.net2</id>
- <name>java.net Maven 2.x Repository</name>
- <url>http://download.java.net/maven/2</url>
- </pluginRepository>
- </pluginRepositories>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- <type>jar</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Djava.endorsed.dirs=target/endorsed</argLine>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>add-test-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/jaxb-source</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.jvnet.jaxb2.maven2</groupId>
- <artifactId>maven-jaxb2-plugin</artifactId>
- <version>0.6.3</version>
- <executions>
- <execution>
- <id>generate-jaxb</id>
- <phase>generate-test-sources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <generatePackage>com.example.ipo.jaxb</generatePackage>
- <generateDirectory>${project.build.directory}/jaxb-source</generateDirectory>
- <schemaDirectory>${basedir}/src/test/resources</schemaDirectory>
- <schemaIncludes>
- <include>ipo.xsd</include>
- </schemaIncludes>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/AnyTypeXmlAdapter.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/AnyTypeXmlAdapter.java
deleted file mode 100644
index 57922e1c89..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/AnyTypeXmlAdapter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-/**
- * This special XmlAdapter can be used by JAXB classes to annotate the references to java interfaces
- */
-public class AnyTypeXmlAdapter extends XmlAdapter<Object, Object> {
-
- @Override
- public Object marshal(Object v) throws Exception {
- return v;
- }
-
- @Override
- public Object unmarshal(Object v) throws Exception {
- return v;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DOMElementXmlAdapter.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DOMElementXmlAdapter.java
deleted file mode 100644
index 91cb39b0f2..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DOMElementXmlAdapter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.xml.DOMDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.w3c.dom.Element;
-
-/**
- * A generic XmlAdapter for JAXB to marshal/unmarshal between the java objects and DOM elements
- */
-public class DOMElementXmlAdapter extends XmlAdapter<Element, Object> {
- private Mediator mediator;
- private DataType dataType;
- private DataType domType;
-
- public DOMElementXmlAdapter(Mediator mediator, DataType dataType) {
- this.mediator = mediator;
- this.dataType = dataType;
- this.domType = new DataTypeImpl(DOMDataBinding.NAME, Element.class, dataType.getLogical());
- }
-
- @Override
- public Element marshal(Object value) throws Exception {
- return (Element) mediator.mediate(value, dataType, domType, null);
- }
-
- @Override
- public Object unmarshal(Element element) throws Exception {
- return mediator.mediate(element, domType, dataType, null);
- }
-
- public void setMediator(Mediator mediator) {
- this.mediator = mediator;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DataConverter.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DataConverter.java
deleted file mode 100644
index 35adffe23b..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DataConverter.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.awt.Image;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.activation.DataHandler;
-import javax.imageio.ImageIO;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Provides utilities to convert an object into a different kind of Object. For example, convert a
- * String[] into a List<String>
- */
-public class DataConverter {
-
- /**
- * This method should return true if the convert method will succeed.
- * <p/>
- * Note that any changes to isConvertable() must also be accompanied by similar changes to
- * convert()
- *
- * @param obj source object or class
- * @param dest destination class
- * @return boolean true if convert(..) can convert obj to the destination class
- */
- public static boolean isConvertable(Object obj, Class dest) {
- Class src = null;
-
- if (obj != null) {
- if (obj instanceof Class) {
- src = (Class)obj;
- } else {
- src = obj.getClass();
- }
- }
-
- if (dest == null) {
- return false;
- }
-
- if (src == null) {
- return true;
- }
-
- // If we're directly assignable, we're good.
- if (dest.isAssignableFrom(src)) {
- return true;
- }
-
- // If it's a wrapping conversion, we're good.
- if (getWrapperClass(src) == dest) {
- return true;
- }
- if (getWrapperClass(dest) == src) {
- return true;
- }
-
- // If it's List -> Array or vice versa, we're good.
- if ((Collection.class.isAssignableFrom(src) || src.isArray()) && (Collection.class.isAssignableFrom(dest) || dest
- .isArray())) {
-
- // TODO this should consider the component types instead of returning true.
- return true;
- }
-
- // Allow mapping of HashMaps to Hashtables
- if (src == HashMap.class && dest == Hashtable.class)
- return true;
-
- // Allow mapping of Calendar to Date
- if (Calendar.class.isAssignableFrom(src) && dest == Date.class) {
- return true;
- }
-
- if (src.isPrimitive()) {
- return isConvertable(getWrapperClass(src), dest);
- }
-
- if (InputStream.class.isAssignableFrom(src) && dest == byte[].class) {
- return true;
- }
-
- if (Source.class.isAssignableFrom(src) && dest == byte[].class) {
- return true;
- }
-
- if (DataHandler.class.isAssignableFrom(src) && isConvertable(byte[].class, dest)) {
- return true;
- }
-
- if (DataHandler.class.isAssignableFrom(src) && dest == Image.class) {
- return true;
- }
-
- if (DataHandler.class.isAssignableFrom(src) && dest == Source.class) {
- return true;
- }
-
- if (byte[].class.isAssignableFrom(src) && dest == String.class) {
- return true;
- }
-
- // If it's a MIME type mapping and we want a DataHandler,
- // then we're good.
- // REVIEW Do we want to support this
- /*
- if (dest.getName().equals("javax.activation.DataHandler")) {
- String name = src.getName();
- if (src == String.class
- || src == java.awt.Image.class
- || name.equals("javax.mail.internet.MimeMultipart")
- || name.equals("javax.xml.transform.Source"))
- return true;
- }
- */
-
- return false;
- }
-
- /**
- * Utility function to convert an Object to some desired Class.
- * <p/>
- * Normally this is used for T[] to List<T> processing. Other conversions are also done (i.e.
- * HashMap <->Hashtable, etc.)
- * <p/>
- * Use the isConvertable() method to determine if conversion is possible. Note that any changes
- * to convert() must also be accompanied by similar changes to isConvertable()
- *
- * @param arg the array to convert
- * @param destClass the actual class we want
- * @return object of destClass if conversion possible, otherwise returns arg
- */
- public static Object convert(Object arg, Class<?> destClass) {
- if (destClass == null) {
- return arg;
- }
-
- if (arg != null && destClass.isAssignableFrom(arg.getClass())) {
- return arg;
- }
-
- // Convert between Calendar and Date
- if (arg instanceof Calendar && destClass == Date.class) {
- return ((Calendar)arg).getTime();
- }
-
- // Convert between HashMap and Hashtable
- if (arg instanceof HashMap && destClass == Hashtable.class) {
- return new Hashtable((HashMap)arg);
- }
-
- if (arg instanceof InputStream && destClass == byte[].class) {
-
- try {
- InputStream is = (InputStream)arg;
- return getBytesFromStream(is);
- } catch (IOException e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- if (arg instanceof Source && destClass == byte[].class) {
- try {
- if (arg instanceof StreamSource) {
- InputStream is = ((StreamSource)arg).getInputStream();
- if (is != null) {
- return getBytesFromStream(is);
- }
- }
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- Result result = new StreamResult(out);
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.transform((Source)arg, result);
- byte[] bytes = out.toByteArray();
- return bytes;
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- if (arg instanceof DataHandler) {
- try {
- InputStream is = ((DataHandler)arg).getInputStream();
- if (destClass == Image.class) {
- return ImageIO.read(is);
- } else if (destClass == Source.class) {
- return new StreamSource(is);
- }
- byte[] bytes = getBytesFromStream(is);
- return convert(bytes, destClass);
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- if (arg instanceof byte[] && destClass == String.class) {
- return new String((byte[])arg);
- }
-
- // If the destination is an array and the source
- // is a suitable component, return an array with
- // the single item.
- /* REVIEW do we need to support atomic to array conversion ?
- if (arg != null &&
- destClass.isArray() &&
- !destClass.getComponentType().equals(Object.class) &&
- destClass.getComponentType().isAssignableFrom(arg.getClass())) {
- Object array =
- Array.newInstance(destClass.getComponentType(), 1);
- Array.set(array, 0, arg);
- return array;
- }
- */
-
- // Return if no conversion is available
- if (!(arg instanceof Collection || (arg != null && arg.getClass().isArray()))) {
- return arg;
- }
-
- if (arg == null) {
- return null;
- }
-
- // The arg may be an array or List
- Object destValue = null;
- int length = 0;
- if (arg.getClass().isArray()) {
- length = Array.getLength(arg);
- } else {
- length = ((Collection)arg).size();
- }
-
- try {
- if (destClass.isArray()) {
- if (destClass.getComponentType().isPrimitive()) {
-
- Object array = Array.newInstance(destClass.getComponentType(), length);
- // Assign array elements
- if (arg.getClass().isArray()) {
- for (int i = 0; i < length; i++) {
- Array.set(array, i, Array.get(arg, i));
- }
- } else {
- int idx = 0;
- for (Iterator i = ((Collection)arg).iterator(); i.hasNext();) {
- Array.set(array, idx++, i.next());
- }
- }
- destValue = array;
-
- } else {
- Object[] array;
- try {
- array = (Object[])Array.newInstance(destClass.getComponentType(), length);
- } catch (Exception e) {
- return arg;
- }
-
- // Use convert to assign array elements.
- if (arg.getClass().isArray()) {
- for (int i = 0; i < length; i++) {
- array[i] = convert(Array.get(arg, i), destClass.getComponentType());
- }
- } else {
- int idx = 0;
- for (Iterator i = ((Collection)arg).iterator(); i.hasNext();) {
- array[idx++] = convert(i.next(), destClass.getComponentType());
- }
- }
- destValue = array;
- }
- } else if (Collection.class.isAssignableFrom(destClass)) {
- Collection newList = null;
- try {
- // if we are trying to create an interface, build something
- // that implements the interface
- if (destClass == Collection.class || destClass == List.class) {
- newList = new ArrayList();
- } else if (destClass == Set.class) {
- newList = new HashSet();
- } else {
- newList = (Collection)destClass.newInstance();
- }
- } catch (Exception e) {
- // No FFDC code needed
- // Couldn't build one for some reason... so forget it.
- return arg;
- }
-
- if (arg.getClass().isArray()) {
- for (int j = 0; j < length; j++) {
- newList.add(Array.get(arg, j));
- }
- } else {
- for (Iterator j = ((Collection)arg).iterator(); j.hasNext();) {
- newList.add(j.next());
- }
- }
- destValue = newList;
- } else {
- destValue = arg;
- }
- } catch (Throwable t) {
- throw new ServiceRuntimeException(t);
- }
-
- return destValue;
- }
-
- private static byte[] getBytesFromStream(InputStream is) throws IOException {
- // TODO This code assumes that available is the length of the stream.
- byte[] bytes = new byte[is.available()];
- is.read(bytes);
- return bytes;
- }
-
- public static Class getWrapperClass(Class primitive) {
- if (primitive == int.class) {
- return java.lang.Integer.class;
- } else if (primitive == short.class) {
- return java.lang.Short.class;
- } else if (primitive == boolean.class) {
- return java.lang.Boolean.class;
- } else if (primitive == byte.class) {
- return java.lang.Byte.class;
- } else if (primitive == long.class) {
- return java.lang.Long.class;
- } else if (primitive == double.class) {
- return java.lang.Double.class;
- } else if (primitive == float.class) {
- return java.lang.Float.class;
- } else if (primitive == char.class) {
- return java.lang.Character.class;
- }
-
- return null;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DefaultXMLAdapterExtensionPoint.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DefaultXMLAdapterExtensionPoint.java
deleted file mode 100644
index 062da48206..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/DefaultXMLAdapterExtensionPoint.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DefaultXMLAdapterExtensionPoint implements XMLAdapterExtensionPoint {
- private Map<Class<?>, Class<? extends XmlAdapter>> adapters =
- new ConcurrentHashMap<Class<?>, Class<? extends XmlAdapter>>();
-
- public void addAdapter(Class<?> boundType, Class<? extends XmlAdapter> adapter) {
- adapters.put(boundType, adapter);
- }
-
- public Class<? extends XmlAdapter> getAdapter(Class<?> boundType) {
- Class<? extends XmlAdapter> cls = adapters.get(boundType);
- if (cls != null) {
- return cls;
- }
- for (Map.Entry<Class<?>, Class<? extends XmlAdapter>> e : adapters.entrySet()) {
- if (e.getKey().isAssignableFrom(boundType)) {
- return e.getValue();
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public Class<? extends XmlAdapter> removeAdapter(Class<?> boundType) {
- return adapters.remove(boundType);
- }
-
- public Map<Class<?>, Class<? extends XmlAdapter>> getAdapters() {
- return adapters;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java
deleted file mode 100644
index 3e262c7d12..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JAXB2Node extends BaseTransformer<Object, Node> implements PullTransformer<Object, Node> {
-
- public Node transform(Object source, TransformationContext tContext) {
-// if (source == null) {
-// return null;
-// }
- try {
- JAXBContext context = JAXBContextHelper.createJAXBContext(tContext, true);
- Marshaller marshaller = context.createMarshaller();
- // FIXME: The default Marshaller doesn't support
- // marshaller.getNode()
- Document document = DOMHelper.newDocument();
- Object jaxbElement = JAXBContextHelper.createJAXBElement(context, tContext.getSourceDataType(), source);
- marshaller.marshal(jaxbElement, document);
- return DOMHelper.adjustElementName(tContext, document.getDocumentElement());
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- protected Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 30;
- }
-
- @Override
- public String getSourceDataBinding() {
- return JAXBDataBinding.NAME;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2SAX.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2SAX.java
deleted file mode 100644
index eee5c77285..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2SAX.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.xml.sax.ContentHandler;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JAXB2SAX extends BaseTransformer<Object, ContentHandler> implements
- PushTransformer<Object, ContentHandler> {
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- protected Class<ContentHandler> getTargetType() {
- return ContentHandler.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext)
- */
- public void transform(Object source, ContentHandler target, TransformationContext tContext) {
- try {
- JAXBContext context = JAXBContextHelper.createJAXBContext(tContext, true);
- Marshaller marshaller = context.createMarshaller();
- Object jaxbElement = JAXBContextHelper.createJAXBElement(context, tContext.getSourceDataType(), source);
- marshaller.marshal(jaxbElement, target);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 20;
- }
-
- @Override
- public String getSourceDataBinding() {
- return JAXBDataBinding.NAME;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2String.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2String.java
deleted file mode 100644
index 29951a5e16..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2String.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.io.StringWriter;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.xml.XMLStringDataBinding;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JAXB2String extends BaseTransformer<Object, String> implements PullTransformer<Object, String> {
-
- public String transform(Object source, TransformationContext tContext) {
- try {
- JAXBContext context = JAXBContextHelper.createJAXBContext(tContext, true);
- Marshaller marshaller = context.createMarshaller();
- StringWriter writer = new StringWriter();
- StreamResult result = new StreamResult(writer);
- Object jaxbElement = JAXBContextHelper.createJAXBElement(context, tContext.getSourceDataType(), source);
- marshaller.marshal(jaxbElement, result);
- return writer.toString();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- protected Class<String> getTargetType() {
- return String.class;
- }
-
- @Override
- public int getWeight() {
- return 30;
- }
-
- @Override
- public String getSourceDataBinding() {
- return JAXBDataBinding.NAME;
- }
-
- @Override
- public String getTargetDataBinding() {
- return XMLStringDataBinding.NAME;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java
deleted file mode 100644
index 4a4f21f259..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCache.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.awt.Image;
-import java.lang.ref.SoftReference;
-import java.net.URI;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.activation.DataHandler;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlSchema;
-import javax.xml.transform.Source;
-
-import org.apache.tuscany.sca.databinding.util.LRUCache;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JAXBContextCache {
- private static final int CACHE_SIZE = 128;
-
- private static HashMap<String, Class<?>> loadClassMap = new HashMap<String, Class<?>>();
-
- static {
- loadClassMap.put("byte", byte.class);
- loadClassMap.put("int", int.class);
- loadClassMap.put("short", short.class);
- loadClassMap.put("long", long.class);
- loadClassMap.put("float", float.class);
- loadClassMap.put("double", double.class);
- loadClassMap.put("boolean", boolean.class);
- loadClassMap.put("char", char.class);
- loadClassMap.put("void", void.class);
- }
-
- protected static Class<?>[] JAXB_BUILTIN_CLASSES =
- {byte[].class, boolean.class, byte.class, char.class, double.class, float.class, int.class, long.class,
- short.class, void.class, java.awt.Image.class, java.io.File.class, java.lang.Boolean.class,
- java.lang.Byte.class, java.lang.Character.class, java.lang.Class.class, java.lang.Double.class,
- java.lang.Float.class, java.lang.Integer.class, java.lang.Long.class, java.lang.Object.class,
- java.lang.Short.class, java.lang.String.class, java.lang.Void.class, java.math.BigDecimal.class,
- java.math.BigInteger.class, java.net.URI.class, java.net.URL.class, java.util.Calendar.class,
- java.util.Date.class, java.util.GregorianCalendar.class, java.util.UUID.class,
- javax.activation.DataHandler.class, javax.xml.bind.JAXBElement.class, javax.xml.datatype.Duration.class,
- javax.xml.datatype.XMLGregorianCalendar.class, javax.xml.namespace.QName.class,
- javax.xml.transform.Source.class};
-
- protected static final Set<Class<?>> BUILTIN_CLASSES_SET = new HashSet<Class<?>>(Arrays.asList(JAXB_BUILTIN_CLASSES));
-
- /*
- protected static Class<?>[] COMMON_ARRAY_CLASSES =
- new Class[] {char[].class, short[].class, int[].class, long[].class, float[].class, double[].class,
- String[].class
- };
-
- protected static final Set<Class<?>> COMMON_CLASSES_SET = new HashSet<Class<?>>(Arrays.asList(COMMON_ARRAY_CLASSES));
- */
-
- protected LRUCache<Object, JAXBContext> cache;
- protected Pool<JAXBContext, Marshaller> mpool;
- protected Pool<JAXBContext, Unmarshaller> upool;
-
- // protected JAXBContext commonContext;
- protected JAXBContext defaultContext;
-
- public JAXBContextCache() {
- this(CACHE_SIZE, CACHE_SIZE, CACHE_SIZE);
- }
-
- public JAXBContextCache(int contextSize, int marshallerSize, int unmarshallerSize) {
- cache = new LRUCache<Object, JAXBContext>(contextSize);
- mpool = new Pool<JAXBContext, Marshaller>();
- upool = new Pool<JAXBContext, Unmarshaller>();
- defaultContext = getDefaultJAXBContext();
- }
-
- public static JAXBContext getDefaultJAXBContext() {
- try {
- return JAXBContext.newInstance();
- } catch (JAXBException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- /**
- * @param name of primitive type
- * @return primitive Class or null
- */
- public static Class<?> getPrimitiveClass(String text) {
- return loadClassMap.get(text);
- }
-
- /**
- * Return the class for this name
- *
- * @return Class
- */
- private static Class<?> forName(final String className, final boolean initialize, final ClassLoader classloader)
- throws ClassNotFoundException {
- // NOTE: This method must remain private because it uses AccessController
- Class<?> cl = null;
- try {
- cl = AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
- public Class<?> run() throws ClassNotFoundException {
- // Class.forName does not support primitives
- Class<?> cls = getPrimitiveClass(className);
- if (cls == null) {
- cls = Class.forName(className, initialize, classloader);
- }
- return cls;
- }
- });
- } catch (PrivilegedActionException e) {
- throw (ClassNotFoundException)e.getException();
- }
-
- return cl;
- }
-
- /**
- * @param p Package
- * @param cl
- * @return true if each package has a ObjectFactory class or package-info
- */
- public static boolean checkPackage(String p, ClassLoader cl) {
-
- // Each package must have an ObjectFactory
- try {
- Class<?> cls = forName(p + ".ObjectFactory", false, cl);
- if (cls != null) {
- return true;
- }
- //Catch Throwable as ClassLoader can throw an NoClassDefFoundError that
- //does not extend Exception. So we will absorb any Throwable exception here.
- } catch (Throwable e) {
- // Ignore
- }
-
- try {
- Class<?> cls = forName(p + ".package-info", false, cl);
- if (cls != null) {
- return cls.isAnnotationPresent(XmlSchema.class);
- }
- //Catch Throwable as ClassLoader can throw an NoClassDefFoundError that
- //does not extend Exception. So we will absorb any Throwable exception here.
- } catch (Throwable e) {
- // Ignore
- }
-
- return false;
- }
-
- public Marshaller getMarshaller(JAXBContext context) throws JAXBException {
- Marshaller marshaller = mpool.get(context);
- if (marshaller == null) {
- marshaller = context.createMarshaller();
- }
- marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
- return marshaller;
- }
-
- public void releaseJAXBMarshaller(JAXBContext context, Marshaller marshaller) {
- if (marshaller != null) {
- marshaller.setAttachmentMarshaller(null);
- mpool.put(context, marshaller);
- // No point unsetting marshaller's JAXB_FRAGMENT property, since we'll just reset it when
- // doing the next get.
- }
- }
-
- public Unmarshaller getUnmarshaller(JAXBContext context) throws JAXBException {
- Unmarshaller unmarshaller = upool.get(context);
- if (unmarshaller == null) {
- unmarshaller = context.createUnmarshaller();
- }
- return unmarshaller;
- }
-
- public void releaseJAXBUnmarshaller(JAXBContext context, Unmarshaller unmarshaller) {
- if (unmarshaller != null) {
- unmarshaller.setAttachmentUnmarshaller(null);
- upool.put(context, unmarshaller);
- }
- }
-
- public LRUCache<Object, JAXBContext> getCache() {
- return cache;
- }
-
- public JAXBContext getJAXBContext(Class<?> cls) throws JAXBException {
- if (BUILTIN_CLASSES_SET.contains(cls)) {
- return defaultContext;
- }
- synchronized (cache) {
- JAXBContext context = cache.get(cls);
- if (context != null) {
- return context;
- }
- Package pkg = cls.getPackage();
- if (pkg != null) {
- context = cache.get(pkg);
- if (context != null) {
- return context;
- }
- }
-
- if (pkg != null && checkPackage(pkg.getName(), cls.getClassLoader())) {
- context = JAXBContext.newInstance(pkg.getName(), cls.getClassLoader());
- cache.put(pkg, context);
- } else {
- context = JAXBContext.newInstance(cls);
- cache.put(cls, context);
- }
- return context;
-
- }
- }
-
- public JAXBContext getJAXBContext(Class<?>[] classes) throws JAXBException {
- Set<Class<?>> classSet = new HashSet<Class<?>>(Arrays.asList(classes));
- return getJAXBContext(classSet);
- }
-
- public JAXBContext getJAXBContext(Set<Class<?>> classes) throws JAXBException {
- // Remove the JAXB built-in types to maximize the cache hit
- Set<Class<?>> classSet = new HashSet<Class<?>>(classes);
- classSet.removeAll(BUILTIN_CLASSES_SET);
-
- // FIXME: [rfeng] Remove java classes that are mapped to the same XSD type to avoid
- // conflicts
- if (classSet.contains(Date[].class)) {
- classSet.remove(Calendar[].class);
- }
-
- if (classSet.contains(URI[].class)) {
- classSet.remove(UUID[].class);
- }
-
- if (classSet.contains(Source[].class)) {
- classSet.remove(Image[].class);
- classSet.remove(DataHandler[].class);
- }
-
- if(classSet.isEmpty()) {
- return defaultContext;
- }
-
- // For single class
- if (classSet.size() == 1) {
- return getJAXBContext(classSet.iterator().next());
- }
- synchronized (cache) {
- JAXBContext context = cache.get(classSet);
- if (context != null) {
- return context;
- }
- context = JAXBContext.newInstance(classSet.toArray(new Class<?>[classSet.size()]));
- cache.put(classSet, context);
- return context;
- }
- }
-
- public void clear() {
- synchronized (cache) {
- cache.clear();
- }
- /*
- synchronized (upool) {
- upool.clear();
- }
- synchronized (upool) {
- upool.clear();
- }
- */
- }
-
- //
- // This inner class is copied in its entirety from the Axis2 utility class,
- // org.apache.axis2.jaxws.message.databinding.JAXBUtils. We could look into extending but it's such a basic data structure
- // without other dependencies so we might be better off copying it and avoiding a new
- // Axis2 dependency here.
- //
-
- /**
- * Pool a list of items for a specific key
- *
- * @param <K> Key
- * @param <V> Pooled object
- */
- private static class Pool<K,V> {
- private SoftReference<Map<K,List<V>>> softMap =
- new SoftReference<Map<K,List<V>>>(
- new ConcurrentHashMap<K, List<V>>());
-
- // The maps are freed up when a LOAD FACTOR is hit
- private static final int MAX_LIST_FACTOR = 50;
- private static final int MAX_LOAD_FACTOR = 32; // Maximum number of JAXBContext to store
-
- /**
- * @param key
- * @return removed item from pool or null.
- */
- public V get(K key) {
- List<V> values = getValues(key);
- synchronized (values) {
- if (values.size()>0) {
- V v = values.remove(values.size()-1);
- return v;
-
- }
- }
- return null;
- }
-
- /**
- * Add item back to pool
- * @param key
- * @param value
- */
- public void put(K key, V value) {
- adjustSize();
- List<V> values = getValues(key);
- synchronized (values) {
- if (values.size() < MAX_LIST_FACTOR) {
- values.add(value);
- }
- }
- }
-
- /**
- * Get or create a list of the values for the key
- * @param key
- * @return list of values.
- */
- private List<V> getValues(K key) {
- Map<K,List<V>> map = softMap.get();
- List<V> values = null;
- if (map != null) {
- values = map.get(key);
- if(values !=null) {
- return values;
- }
- }
- synchronized (this) {
- if (map != null) {
- values = map.get(key);
- }
- if (values == null) {
- if (map == null) {
- map = new ConcurrentHashMap<K, List<V>>();
- softMap =
- new SoftReference<Map<K,List<V>>>(map);
- }
- values = new ArrayList<V>();
- map.put(key, values);
-
- }
- return values;
- }
- }
-
- /**
- * AdjustSize
- * When the number of keys exceeds the maximum load, half
- * of the entries are deleted.
- *
- * The assumption is that the JAXBContexts, UnMarshallers, Marshallers, etc. require
- * a large footprint.
- */
- private void adjustSize() {
- Map<K,List<V>> map = softMap.get();
- if (map != null && map.size() > MAX_LOAD_FACTOR) {
- // Remove every other Entry in the map.
- Iterator it = map.entrySet().iterator();
- boolean removeIt = false;
- while (it.hasNext()) {
- it.next();
- if (removeIt) {
- it.remove();
- }
- removeIt = !removeIt;
- }
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java
deleted file mode 100644
index 05184f6cd0..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.lang.reflect.WildcardType;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.JAXBIntrospector;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlEnum;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchema;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.databinding.util.LRUCache;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-// FIXME: [rfeng] We probably should turn this into a pluggable system service
-public final class JAXBContextHelper {
- // public static final String JAXB_CLASSES = "jaxb.classes";
-
- // public static final String JAXB_CONTEXT_PATH = "jaxb.contextPath";
-
- private static final JAXBContextCache cache = new JAXBContextCache();
-
- private JAXBContextHelper() {
- }
-
- /**
- * Create a JAXBContext for a given class
- * @param cls
- * @return
- * @throws JAXBException
- */
- public static JAXBContext createJAXBContext(Class<?> cls) throws JAXBException {
- return cache.getJAXBContext(cls);
- }
-
- public static JAXBContext createJAXBContext(TransformationContext tContext, boolean source) throws JAXBException {
- if (tContext == null)
- throw new TransformationException("JAXB context is not set for the transformation.");
-
- // TODO: [rfeng] Need to figure out what's the best granularity to create the JAXBContext
- // per interface, operation or parameter
- Operation op = source ? tContext.getSourceOperation() : tContext.getTargetOperation();
- if (op != null) {
- synchronized (op) {
- JAXBContext context = op.getInputType().getMetaData(JAXBContext.class);
- if (context == null) {
- context = createJAXBContext(getDataTypes(op, true));
- op.getInputType().setMetaData(JAXBContext.class, context);
- }
- return context;
- }
- }
-
- // For property transformation, the operation can be null
- DataType<?> dataType = source ? tContext.getSourceDataType() : tContext.getTargetDataType();
- return createJAXBContext(dataType);
-
- }
-
- public static JAXBContext createJAXBContext(DataType dataType) throws JAXBException {
- return createJAXBContext(findClasses(dataType));
- }
-
- public static Unmarshaller getUnmarshaller(JAXBContext context) throws JAXBException {
- return cache.getUnmarshaller(context);
- }
-
- public static void releaseJAXBUnmarshaller(JAXBContext context, Unmarshaller unmarshaller) {
- cache.releaseJAXBUnmarshaller(context, unmarshaller);
- }
-
- public static Marshaller getMarshaller(JAXBContext context) throws JAXBException {
- return cache.getMarshaller(context);
- }
-
- public static void releaseJAXBMarshaller(JAXBContext context, Marshaller marshaller) {
- cache.releaseJAXBMarshaller(context, marshaller);
- }
-
- @SuppressWarnings("unchecked")
- public static Object createJAXBElement(JAXBContext context, DataType dataType, Object value) {
- Class<?> type = dataType == null ? value.getClass() : dataType.getPhysical();
- QName name = JAXBDataBinding.ROOT_ELEMENT;
- if (context != null) {
- Object logical = dataType == null ? null : dataType.getLogical();
- if (logical instanceof XMLType) {
- XMLType xmlType = (XMLType)logical;
- if (xmlType.isElement()) {
- name = xmlType.getElementName();
- } else {
- /**
- * Set the declared type to Object.class so that xsi:type
- * will be produced
- */
- type = Object.class;
- }
- } else {
- type = Object.class;
- }
- }
-
- JAXBIntrospector introspector = context.createJAXBIntrospector();
- Object element = null;
- if (value != null && introspector.isElement(value)) {
- // NOTE: [rfeng] We cannot wrap an element in a JAXBElement
- element = value;
- }
- if (element == null) {
- element = new JAXBElement(name, type, value);
- }
- return element;
- }
-
- @SuppressWarnings("unchecked")
- public static Object createReturnValue(JAXBContext context, DataType dataType, Object value) {
- Class<?> cls = getJavaType(dataType);
- if (cls == JAXBElement.class) {
- return createJAXBElement(context, dataType, value);
- } else {
- if (value instanceof JAXBElement) {
- return ((JAXBElement)value).getValue();
- } else {
- return value;
- }
- }
- }
-
- /**
- * Create a JAXContext for an array of classes
- * @param classes
- * @return
- * @throws JAXBException
- */
- public static JAXBContext createJAXBContext(Class<?>[] classes) throws JAXBException {
- return cache.getJAXBContext(classes);
- }
-
- public static JAXBContext createJAXBContext(Set<Class<?>> classes) throws JAXBException {
- return cache.getJAXBContext(classes);
- }
-
- /**
- * Create a JAXBContext for a given java interface
- * @param intf
- * @return
- * @throws JAXBException
- */
- public static JAXBContext createJAXBContext(Interface intf, boolean useWrapper) throws JAXBException {
- synchronized (cache) {
- LRUCache<Object, JAXBContext> map = cache.getCache();
- Integer key = new Integer(System.identityHashCode(intf));
- JAXBContext context = map.get(key);
- if (context != null) {
- return context;
- }
- List<DataType> dataTypes = getDataTypes(intf, useWrapper);
- context = createJAXBContext(dataTypes);
- map.put(key, context);
- return context;
- }
- }
-
- public static JAXBContext createJAXBContext(List<DataType> dataTypes) throws JAXBException {
- JAXBContext context;
- Set<Class<?>> classes = new HashSet<Class<?>>();
- Set<Type> visited = new HashSet<Type>();
- for (DataType d : dataTypes) {
- findClasses(d, classes, visited);
- }
-
- context = createJAXBContext(classes);
- return context;
- }
-
- private static Set<Class<?>> findClasses(DataType d) {
- Set<Class<?>> classes = new HashSet<Class<?>>();
- Set<Type> visited = new HashSet<Type>();
- findClasses(d, classes, visited);
- return classes;
- }
-
- private static void findClasses(DataType d, Set<Class<?>> classes, Set<Type> visited) {
- if (d == null) {
- return;
- }
- String db = d.getDataBinding();
- if (JAXBDataBinding.NAME.equals(db) || (db != null && db.startsWith("java:")) || db == null) {
- if (!d.getPhysical().isInterface() && !JAXBElement.class.isAssignableFrom(d.getPhysical())) {
- classes.add(d.getPhysical());
- }
- }
- if (d.getPhysical() != d.getGenericType()) {
- findClasses(d.getGenericType(), classes, visited);
- }
- }
-
- /**
- * Find referenced classes in the generic type
- * @param type
- * @param classSet
- * @param visited
- */
- private static void findClasses(Type type, Set<Class<?>> classSet, Set<Type> visited) {
- if (visited.contains(type) || type == null) {
- return;
- }
- visited.add(type);
- if (type instanceof Class) {
- Class<?> cls = (Class<?>)type;
- if (!cls.isInterface()) {
- classSet.add(cls);
- }
- return;
- } else if (type instanceof ParameterizedType) {
- ParameterizedType pType = (ParameterizedType)type;
- findClasses(pType.getRawType(), classSet, visited);
- for (Type t : pType.getActualTypeArguments()) {
- findClasses(t, classSet, visited);
- }
- } else if (type instanceof TypeVariable) {
- TypeVariable<?> tv = (TypeVariable<?>)type;
- for (Type t : tv.getBounds()) {
- findClasses(t, classSet, visited);
- }
- } else if (type instanceof GenericArrayType) {
- GenericArrayType gType = (GenericArrayType)type;
- findClasses(gType, classSet, visited);
- } else if (type instanceof WildcardType) {
- WildcardType wType = (WildcardType)type;
- for (Type t : wType.getLowerBounds()) {
- findClasses(t, classSet, visited);
- }
- for (Type t : wType.getUpperBounds()) {
- findClasses(t, classSet, visited);
- }
- }
- }
-
- public static JAXBContext createJAXBContext(Interface intf) throws JAXBException {
- return createJAXBContext(intf, true);
- }
-
- /**
- * @param intf
- * @param useWrapper Use wrapper classes?
- * @return
- */
- private static List<DataType> getDataTypes(Interface intf, boolean useWrapper) {
- List<DataType> dataTypes = new ArrayList<DataType>();
- for (Operation op : intf.getOperations()) {
- getDataTypes(dataTypes, op, useWrapper);
- }
- return dataTypes;
- }
-
- private static List<DataType> getDataTypes(Operation op, boolean useWrapper) {
- List<DataType> dataTypes = new ArrayList<DataType>();
- getDataTypes(dataTypes, op, useWrapper);
- return dataTypes;
- }
-
- private static void getDataTypes(List<DataType> dataTypes, Operation op, boolean useWrapper) {
- WrapperInfo wrapper = op.getWrapper();
- if (useWrapper && wrapper != null) {
- DataType dt1 = wrapper.getInputWrapperType();
- if (dt1 != null) {
- dataTypes.add(dt1);
- }
- DataType dt2 = wrapper.getOutputWrapperType();
- if (dt2 != null) {
- dataTypes.add(dt2);
- }
- }
- // FIXME: [rfeng] We may need to find the referenced classes in the child types
- // else
- {
- for (DataType dt1 : op.getInputType().getLogical()) {
- dataTypes.add(dt1);
- }
- DataType dt2 = op.getOutputType();
- if (dt2 != null) {
- dataTypes.add(dt2);
- }
- }
- for (DataType<DataType> dt3 : op.getFaultTypes()) {
- DataType dt4 = dt3.getLogical();
- if (dt4 != null) {
- dataTypes.add(dt4);
- }
- }
- }
-
- public static Class<?> getJavaType(DataType<?> dataType) {
- if (dataType == null) {
- return null;
- }
- Class type = dataType.getPhysical();
- if (JAXBElement.class.isAssignableFrom(type)) {
- Type generic = dataType.getGenericType();
- type = Object.class;
- }
- if (type == Object.class && dataType.getLogical() instanceof XMLType) {
- XMLType xType = (XMLType)dataType.getLogical();
- Class javaType = SimpleTypeMapperImpl.getJavaType(xType.getTypeName());
- if (javaType != null) {
- type = javaType;
- }
- }
- return type;
- }
-
- public static XMLType getXmlTypeName(Class<?> javaType) {
- if (javaType.isInterface()) {
- // JAXB doesn't support interfaces
- return null;
- }
- String namespace = null;
- String name = null;
- Package pkg = javaType.getPackage();
- if (pkg != null) {
- XmlSchema schema = pkg.getAnnotation(XmlSchema.class);
- if (schema != null) {
- namespace = schema.namespace();
- }
- }
-
- QName elementQName = null;
- QName typeQName = null;
- XmlRootElement rootElement = javaType.getAnnotation(XmlRootElement.class);
- if (rootElement != null) {
- String elementName = rootElement.name();
- String elementNamespace = rootElement.namespace();
- if (elementNamespace.equals("##default")) {
- elementNamespace = namespace;
- }
- if (elementName.equals("##default")) {
- elementName = jaxbDecapitalize(javaType.getSimpleName());
- }
- elementQName = new QName(elementNamespace, elementName);
- }
- XmlType type = javaType.getAnnotation(XmlType.class);
- if (type != null) {
- String typeNamespace = type.namespace();
- String typeName = type.name();
-
- if (typeNamespace.equals("##default")) {
- // namespace is from the package
- typeNamespace = namespace;
- }
-
- if (typeName.equals("##default")) {
- typeName = jaxbDecapitalize(javaType.getSimpleName());
- }
- typeQName = new QName(typeNamespace, typeName);
- } else {
- XmlEnum xmlEnum = javaType.getAnnotation(XmlEnum.class);
- if (xmlEnum != null) {
- name = jaxbDecapitalize(javaType.getSimpleName());
- typeQName = new QName(namespace, name);
- }
- }
- if (elementQName == null && typeQName == null) {
- return null;
- }
- return new XMLType(elementQName, typeQName);
- }
-
- /**
- * The JAXB RI doesn't implement the decapitalization algorithm in the
- * JAXB spec. See Sun bug 6505643 for details. This means that instead
- * of calling java.beans.Introspector.decapitalize() as the JAXB spec says,
- * Tuscany needs to mimic the incorrect JAXB RI algorithm.
- */
- public static String jaxbDecapitalize(String name) {
- // find first lower case char in name
- int lower = name.length();
- for (int i = 0; i < name.length(); i++) {
- if (Character.isLowerCase(name.charAt(i))) {
- lower = i;
- break;
- }
- }
-
- int decap;
- if (name.length() == 0) {
- decap = 0; // empty string: nothing to do
- } else if (lower == 0) {
- decap = 0; // first char is lower case: nothing to do
- } else if (lower == 1) {
- decap = 1; // one upper followed by lower: decapitalize 1 char
- } else if (lower < name.length()) {
- decap = lower - 1; // n uppers followed by at least one lower: decapitalize n-1 chars
- } else {
- decap = name.length(); // all upper case: decapitalize all chars
- }
-
- return name.substring(0, decap).toLowerCase() + name.substring(decap);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java
deleted file mode 100644
index 38efd288cb..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.databinding.XMLTypeHelper;
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.w3c.dom.Document;
-
-/**
- * JAXB DataBinding
- *
- * @version $Rev$ $Date$
- */
-public class JAXBDataBinding extends BaseDataBinding {
- public static final String NAME = JAXBElement.class.getName();
-
- public static final String ROOT_NAMESPACE = "http://tuscany.apache.org/xmlns/sca/databinding/jaxb/1.0";
- public static final QName ROOT_ELEMENT = new QName(ROOT_NAMESPACE, "root");
-
- private JAXBWrapperHandler wrapperHandler;
- private JAXBTypeHelper xmlTypeHelper;
-
- public JAXBDataBinding() {
- super(NAME, JAXBElement.class);
- this.wrapperHandler = new JAXBWrapperHandler();
- this.xmlTypeHelper = new JAXBTypeHelper();
- }
-
- @Override
- public boolean introspect(DataType dataType, Operation operation) {
- Class javaType = dataType.getPhysical();
- if (JAXBElement.class.isAssignableFrom(javaType)) {
- Type type = javaType.getGenericSuperclass();
- if (type instanceof ParameterizedType) {
- ParameterizedType parameterizedType = ((ParameterizedType)type);
- Type rawType = parameterizedType.getRawType();
- if (rawType == JAXBElement.class) {
- Type actualType = parameterizedType.getActualTypeArguments()[0];
- if (actualType instanceof Class) {
- XMLType xmlType = JAXBContextHelper.getXmlTypeName((Class)actualType);
- dataType.setLogical(xmlType);
- dataType.setDataBinding(NAME);
- return true;
- }
- }
- }
- if (dataType.getLogical() == null) {
- dataType.setLogical(XMLType.UNKNOWN);
- }
- dataType.setDataBinding(NAME);
- return true;
- }
-
- XMLType xmlType = JAXBContextHelper.getXmlTypeName(javaType);
- if (xmlType == null) {
- return false;
- }
- dataType.setLogical(xmlType);
- dataType.setDataBinding(NAME);
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Object copy(Object arg, DataType dataType, Operation operation) {
- try {
- boolean isElement = false;
- if (dataType == null) {
- Class cls = arg.getClass();
- if (arg instanceof JAXBElement) {
- isElement = true;
- cls = ((JAXBElement)arg).getDeclaredType();
- }
- dataType = new DataTypeImpl<XMLType>(NAME, cls, XMLType.UNKNOWN);
- }
- JAXBContext context = JAXBContextHelper.createJAXBContext(dataType);
- arg = JAXBContextHelper.createJAXBElement(context, dataType, arg);
- Document doc = DOMHelper.newDocument();
- context.createMarshaller().marshal(arg, doc);
- Object value = context.createUnmarshaller().unmarshal(doc, dataType.getPhysical());
- if (isElement && value instanceof JAXBElement) {
- return value;
- }
- return JAXBContextHelper.createReturnValue(context, dataType, value);
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- @Override
- public WrapperHandler getWrapperHandler() {
- return wrapperHandler;
- }
-
- @Override
- public XMLTypeHelper getXMLTypeHelper() {
- // return new JAXBTypeHelper();
- return xmlTypeHelper;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBPropertyDescriptor.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBPropertyDescriptor.java
deleted file mode 100644
index 217345caba..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBPropertyDescriptor.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.beans.IndexedPropertyDescriptor;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Collection;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * A PropertyDescriptor provides access to a bean property. Values can be queried/changed using the
- * read and writer methods of the PropertyDescriptor.
- * <p/>
- * A PropertyDescriptorPlus object wraps a PropertyDescriptor and supplies enhanced set/get methods
- * that match JAXB semantics.
- * <p/>
- * For example, the set(..) method is smart enough to add lists, arrays and atomic values on JAXB
- * beans.
- * <p/>
- * The PropertyDescriptorPlus object also stores the xmlName of the property.
- *
- * @See XMLRootElementUtil.createPropertyDescriptorMap , which creates the PropertyDescriptorPlus
- * objects
- */
-public class JAXBPropertyDescriptor implements Comparable<JAXBPropertyDescriptor> {
- PropertyDescriptor descriptor;
- QName xmlName = null;
- int index;
-
- /**
- * Package protected constructor. Only created by XMLRootElementUtil.createPropertyDescriptorMap
- * @param descriptor
- * @param index TODO
- * @param propertyName
- *
- * @see XMLRootElementUtil.createPropertyDescriptorMap
- */
- JAXBPropertyDescriptor(PropertyDescriptor descriptor, QName xmlName, int index) {
- super();
- this.descriptor = descriptor;
- this.xmlName = xmlName;
- }
-
- /**
- * Package protected constructor. Only created by XMLRootElementUtil.createPropertyDescriptorMap
- * @param descriptor
- * @param index TODO
- * @param propertyName
- *
- * @see XMLRootElementUtil.createPropertyDescriptorMap
- */
- JAXBPropertyDescriptor(PropertyDescriptor descriptor, String xmlName, int index) {
- super();
- this.descriptor = descriptor;
- this.xmlName = new QName("", xmlName);
- }
-
- public int compareTo(JAXBPropertyDescriptor o) {
- return index - o.index;
- }
-
- /** @return xmlname */
- public String getXmlName() {
- return xmlName.getLocalPart();
- }
-
- public QName getXmlQName() {
- return xmlName;
- }
-
- /** @return property type */
- public Class<?> getPropertyType() {
- return descriptor.getPropertyType();
- }
-
- /** @return property name */
- public String getPropertyName() {
- return descriptor.getName();
- }
-
- /**
- * Get the object
- *
- * @param targetBean
- * @return Object for this property or null
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- */
- public Object get(Object targetBean) throws InvocationTargetException, IllegalAccessException {
- Method method = descriptor.getReadMethod();
- if (method == null && descriptor.getPropertyType() == Boolean.class) {
- String propertyName = descriptor.getName();
- if (propertyName != null) {
- String methodName = "is";
- methodName =
- methodName + ((propertyName.length() > 0) ? propertyName.substring(0, 1).toUpperCase() : "");
- methodName = methodName + ((propertyName.length() > 1) ? propertyName.substring(1) : "");
- try {
- method = targetBean.getClass().getMethod(methodName);
- } catch (NoSuchMethodException e) {
- }
- }
- }
- if (method == null) {
- throw new ServiceRuntimeException("No getter is found");
- }
- Object ret = method.invoke(targetBean);
- if (method.getReturnType() == JAXBElement.class) {
- ret = ((JAXBElement<?>)ret).getValue();
- }
- return ret;
- }
-
- /**
- * Set the object
- *
- * @param targetBean
- * @param propValue
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws JAXBWrapperException
- */
- public void set(Object targetBean, Object propValue) throws InvocationTargetException, IllegalAccessException,
- JAXBWrapperException {
-
- Method writeMethod = null;
- try {
- // No set occurs if the value is null
- if (propValue == null) {
- return;
- }
-
- // There are 3 different types of setters that can occur.
- // 1) Normal Attomic Setter : setFoo(type)
- // 2) Indexed Array Setter : setFoo(type[])
- // 3) No Setter case if the property is a List<T>.
-
- writeMethod = descriptor.getWriteMethod();
- if (descriptor instanceof IndexedPropertyDescriptor) {
- // Set for indexed T[]
- setIndexedArray(targetBean, propValue, writeMethod);
- } else if (writeMethod == null) {
- // Set for List<T>
- setList(targetBean, propValue);
- } else if (descriptor.getPropertyType() == JAXBElement.class) {
- if (propValue != null) {
- Class<?> clazz = propValue.getClass();
- JAXBElement<?> element = new JAXBElement(xmlName, clazz, propValue);
- setAtomic(targetBean, element, writeMethod);
- }
- } else {
- // Normal case
- setAtomic(targetBean, propValue, writeMethod);
- }
- } catch (RuntimeException e) {
- throw e;
- }
- }
-
- /**
- * Set the property value onto targetBean using the writeMethod
- *
- * @param targetBean
- * @param propValue
- * @param writeMethod (set(T))
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws JAXBWrapperException
- */
- private void setAtomic(Object targetBean, Object propValue, Method writeMethod) throws InvocationTargetException,
- IllegalAccessException, JAXBWrapperException {
- // JAXB provides setters for atomic value.
-
- if (propValue != null) {
- // Normal case
- Object[] SINGLE_PARAM = new Object[1];
- SINGLE_PARAM[0] = propValue;
- writeMethod.invoke(targetBean, SINGLE_PARAM);
- } else {
- Class<?>[] paramTypes = writeMethod.getParameterTypes();
-
- if (paramTypes != null && paramTypes.length == 1) {
- Class<?> paramType = paramTypes[0];
- if (paramType.isPrimitive() && propValue == null) {
- //Ignoring null value for primitive type, this could potentially be the way of a customer indicating to set
- //default values defined in JAXBObject/xmlSchema.
- return;
- }
- }
- }
-
- }
-
- /**
- * Set the property value using the indexed array setter
- *
- * @param targetBean
- * @param propValue
- * @param writeMethod set(T[])
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws JAXBWrapperException
- */
- private void setIndexedArray(Object targetBean, Object propValue, Method writeMethod)
- throws InvocationTargetException, IllegalAccessException, JAXBWrapperException {
-
- Class<?> paramType = writeMethod.getParameterTypes()[0];
- Object value = asArray(propValue, paramType);
- // JAXB provides setters for atomic value.
- Object[] SINGLE_PARAM = new Object[1];
- SINGLE_PARAM[0] = value;
-
- writeMethod.invoke(targetBean, SINGLE_PARAM);
- }
-
- /**
- * Set the property value for the collection case.
- *
- * @param targetBean
- * @param propValue
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws JAXBWrapperException
- */
- private void setList(Object targetBean, Object propValue) throws InvocationTargetException, IllegalAccessException,
- JAXBWrapperException {
- // For the List<T> case, there is no setter.
- // You are supposed to use the getter to obtain access to the collection and then add the collection
-
- Collection value = asCollection(propValue, descriptor.getPropertyType());
- Collection collection = (Collection)get(targetBean);
-
- // Now add our our object to the collection
- collection.clear();
- if (propValue != null) {
- collection.addAll(value);
- }
- }
-
- /**
- * @param propValue
- * @param destType
- * @return propValue as a Collection
- */
- private static Collection asCollection(Object propValue, Class<?> destType) {
- // TODO Missing function
- // Convert the object into an equivalent object that is a collection
- if (DataConverter.isConvertable(propValue, destType)) {
- return (Collection)DataConverter.convert(propValue, destType);
- } else {
- String objectClass = (propValue == null) ? "null" : propValue.getClass().getName();
- throw new ServiceRuntimeException("Cannot convert " + objectClass);
- }
- }
-
- /**
- * @param propValue
- * @param destType T[]
- * @return array of component type
- */
- private static Object asArray(Object propValue, Class<?> destType) {
- if (DataConverter.isConvertable(propValue, destType)) {
- return DataConverter.convert(propValue, destType);
- } else {
- String objectClass = (propValue == null) ? "null" : propValue.getClass().getName();
- throw new ServiceRuntimeException("Cannot convert " + objectClass);
-
- }
- }
-
- @Override
- public String toString() {
- String value = "PropertyDescriptorPlus[";
- value += " name=" + this.getPropertyName();
- value += " type=" + this.getPropertyType().getName();
- value += " propertyDecriptor=" + this.descriptor;
- return value + "]";
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTypeHelper.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTypeHelper.java
deleted file mode 100644
index e29b634857..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTypeHelper.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.io.IOException;
-import java.io.StringWriter;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.SchemaOutputResolver;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Result;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.databinding.XMLTypeHelper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-import org.oasisopen.sca.ServiceRuntimeException;
-import org.w3c.dom.Document;
-
-public class JAXBTypeHelper implements XMLTypeHelper {
- private static final String SCHEMA_NS = "http://www.w3.org/2001/XMLSchema";
- private static final String ANYTYPE_NAME = "anyType";
- private static final QName ANYTYPE_QNAME = new QName(SCHEMA_NS, ANYTYPE_NAME);
-
- // private List<Class<?>> types = new ArrayList<Class<?>>();
-
- public JAXBTypeHelper() {
- super();
- }
-
- public TypeInfo getTypeInfo(Class javaType, Object logical) {
- QName xmlType = JavaXMLMapper.getXMLType(javaType);
- if (xmlType != null) {
- return new TypeInfo(xmlType, true, null);
- } else if (javaType.isInterface()) {
- return new TypeInfo(ANYTYPE_QNAME, true, null);
- } else {
- // types.add(javaType);
- if (logical instanceof XMLType) {
- xmlType = ((XMLType)logical).getTypeName();
- }
- if (xmlType == null) {
- xmlType = new QName(JAXBContextHelper.jaxbDecapitalize(javaType.getSimpleName()));
- }
- return new TypeInfo(xmlType, false, null);
- }
- }
-
- /*
- public List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver) {
- List<XSDefinition> definitions = new ArrayList<XSDefinition>();
- generateJAXBSchemas(definitions, factory);
- return definitions;
- }
- */
-
- public static Map<String, String> generateSchema(JAXBContext context) throws IOException {
- StringResolverImpl resolver = new StringResolverImpl();
- context.generateSchema(resolver);
- Map<String, String> xsds = new HashMap<String, String>();
- for (Map.Entry<String, StreamResult> xsd : resolver.getResults().entrySet()) {
- xsds.put(xsd.getKey(), xsd.getValue().getWriter().toString());
- }
- return xsds;
- }
-
-// private static class XSDResolver implements URIResolver {
-// private Map<String, String> xsds;
-//
-// public XSDResolver(Map<String, String> xsds) {
-// super();
-// this.xsds = xsds;
-// }
-//
-// public InputSource resolveEntity(java.lang.String namespace,
-// java.lang.String schemaLocation,
-// java.lang.String baseUri) {
-// String xsd = xsds.get(schemaLocation);
-// if (xsd == null) {
-// return null;
-// }
-// return new InputSource(new StringReader(xsd));
-// }
-//
-// }
-
- /*
- private void generateJAXBSchemas1(List<XSDefinition> definitions, XSDFactory factory) {
- if (types.size() > 0) {
- try {
- XmlSchemaCollection collection = new XmlSchemaCollection();
- Class[] typesArray = new Class[types.size()];
- typesArray = types.toArray(typesArray);
- JAXBContext context = JAXBContextHelper.createJAXBContext(typesArray);
- Map<String, String> results = generateSchema(context);
- collection.setSchemaResolver(new XSDResolver(results));
-
- for (Map.Entry<String, String> entry : results.entrySet()) {
- XSDefinition definition = factory.createXSDefinition();
- int index = entry.getKey().lastIndexOf('#');
- String ns = entry.getKey().substring(0, index);
- String file = entry.getKey().substring(index + 1);
- definition.setUnresolved(true);
- definition.setNamespace(ns);
- definition.setSchema(collection.read(new StringReader(entry.getValue()), null));
- definition.setSchemaCollection(collection);
- definition.setUnresolved(false);
- definitions.add(definition);
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
- */
-
- private static class DOMResolverImpl extends SchemaOutputResolver {
- private Map<String, DOMResult> results = new HashMap<String, DOMResult>();
-
- @Override
- public Result createOutput(String ns, String file) throws IOException {
- DOMResult result = new DOMResult();
- // TUSCANY-2498: Set the system id to "" so that the xsd:import doesn't produce
- // an illegal schemaLocation attr
- result.setSystemId("");
- results.put(ns, result);
- return result;
- }
-
- public Map<String, DOMResult> getResults() {
- return results;
- }
- }
-
- /*
- private void generateJAXBSchemas(List<XSDefinition> definitions, XSDFactory factory) {
- if (types.size() > 0) {
- try {
- Class<?>[] typesArray = new Class<?>[types.size()];
- typesArray = types.toArray(typesArray);
- JAXBContext context = JAXBContext.newInstance(typesArray);
- generateSchemas(definitions, factory, context);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
- */
-
- private void generateSchemas(List<XSDefinition> definitions, XSDFactory factory, JAXBContext context)
- throws IOException {
- DOMResolverImpl resolver = new DOMResolverImpl();
- context.generateSchema(resolver);
- Map<String, DOMResult> results = resolver.getResults();
- for (Map.Entry<String, DOMResult> entry : results.entrySet()) {
- XSDefinition definition = factory.createXSDefinition();
- definition.setUnresolved(true);
- definition.setDocument((Document)entry.getValue().getNode());
- definition.setNamespace(entry.getKey());
- URI location = null;
- try {
- location = new URI(entry.getValue().getSystemId());
- } catch (URISyntaxException e) {
- // ignore: use null value
- }
- definition.setLocation(location);
- definitions.add(definition);
- }
- }
-
- private static class StringResolverImpl extends SchemaOutputResolver {
- private Map<String, StreamResult> results = new HashMap<String, StreamResult>();
-
- @Override
- public Result createOutput(String ns, String file) throws IOException {
- StringWriter sw = new StringWriter();
- StreamResult result = new StreamResult(sw);
- String sysId = ns + '#' + file;
- result.setSystemId(sysId);
- results.put(sysId, result);
- return result;
- }
-
- public Map<String, StreamResult> getResults() {
- return results;
- }
- }
-
- public List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver, Interface intf) {
- try {
- JAXBContext context = JAXBContextHelper.createJAXBContext(intf, false);
- List<XSDefinition> definitions = new ArrayList<XSDefinition>();
- generateSchemas(definitions, factory, context);
- return definitions;
- } catch (Throwable e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- public List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver, List<DataType> dataTypes) {
- try {
-
- JAXBContext context = JAXBContextHelper.createJAXBContext(dataTypes);
- List<XSDefinition> definitions = new ArrayList<XSDefinition>();
- generateSchemas(definitions, factory, context);
- return definitions;
- } catch (Throwable e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperException.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperException.java
deleted file mode 100644
index 7473a8e56e..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import org.oasisopen.sca.ServiceRuntimeException;
-
-public class JAXBWrapperException extends ServiceRuntimeException {
- private static final long serialVersionUID = 1L;
-
- /**
- *
- */
- public JAXBWrapperException() {
- super();
-
- }
-
- /**
- * @param message
- * @param cause
- */
- public JAXBWrapperException(String message, Throwable cause) {
- super(message, cause);
-
- }
-
- /** @param message */
- public JAXBWrapperException(String message) {
- super(message);
-
- }
-
- /** @param cause */
- public JAXBWrapperException(Throwable cause) {
- super(cause);
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java
deleted file mode 100644
index a1f4c12c8f..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-
-/**
- * JAXB WrapperHandler implementation
- *
- * @version $Rev$ $Date$
- */
-public class JAXBWrapperHandler implements WrapperHandler<Object> {
- private JAXBWrapperHelper helper = new JAXBWrapperHelper();
-
- public Object create(Operation operation, boolean input) {
- WrapperInfo wrapperInfo = operation.getWrapper();
- ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
- final Class<?> wrapperClass = input ? wrapperInfo.getInputWrapperClass() : wrapperInfo.getOutputWrapperClass();
- try {
- if (wrapperClass == null) {
- return null;
- }
- return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws Exception {
- return wrapperClass.newInstance();
- }
- });
- } catch (PrivilegedActionException e) {
- throw new TransformationException(e);
- }
- }
-
- public void setChildren(Object wrapper, Object[] childObjects, Operation operation, boolean input) {
- List<ElementInfo> childElements =
- input ? operation.getWrapper().getInputChildElements() : operation.getWrapper().getOutputChildElements();
- List<String> childNames = new ArrayList<String>();
- Map<String, Object> values = new HashMap<String, Object>();
- for (int i = 0; i < childElements.size(); i++) {
- ElementInfo e = childElements.get(i);
- String name = e.getQName().getLocalPart();
- childNames.add(name);
- values.put(name, childObjects[i]);
- }
- // Get the property descriptor map
- Map<String, JAXBPropertyDescriptor> pdMap = null;
- try {
- pdMap = XMLRootElementUtil.createPropertyDescriptorMap(wrapper.getClass());
- } catch (Throwable t) {
- throw new JAXBWrapperException(t);
- }
- helper.wrap(wrapper, childNames, values, pdMap);
- }
-
- public void setChild(Object wrapper, int i, ElementInfo childElement, Object value) {
- Object wrapperValue = wrapper;
- Class<?> wrapperClass = wrapperValue.getClass();
-
- // FIXME: We probably should use the jaxb-reflection to handle the properties
- try {
- String prop = childElement.getQName().getLocalPart();
- boolean collection = (value instanceof Collection);
- Method getter = null;
- for (Method m : wrapperClass.getMethods()) {
- Class<?>[] paramTypes = m.getParameterTypes();
- if (paramTypes.length == 1 && m.getName().equals("set" + capitalize(prop))) {
- m.invoke(wrapperValue, new Object[] {value});
- return;
- }
- if (collection && paramTypes.length == 0 && m.getName().equals("get" + capitalize(prop))) {
- getter = m;
- }
- }
- if (getter != null && Collection.class.isAssignableFrom(getter.getReturnType())) {
- ((Collection)getter.invoke(wrapperValue)).addAll((Collection)value);
- }
-
- } catch (Throwable e) {
- throw new TransformationException(e);
- }
- }
-
- private static String capitalize(String name) {
- char first = Character.toUpperCase(name.charAt(0));
- return first + name.substring(1);
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#getChildren(java.lang.Object, Operation, boolean)
- */
- public List getChildren(Object wrapper, Operation operation, boolean input) {
- List<ElementInfo> childElements = input? operation.getWrapper().getInputChildElements():
- operation.getWrapper().getOutputChildElements();
-
- List<String> childNames = new ArrayList<String>();
- for (ElementInfo e : childElements) {
- childNames.add(e.getQName().getLocalPart());
- }
- return Arrays.asList(helper.unwrap(wrapper, childNames));
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
- */
- public DataType getWrapperType(Operation operation, boolean input) {
- WrapperInfo wrapper = operation.getWrapper();
- DataType dt = input ? wrapper.getInputWrapperType() : wrapper.getOutputWrapperType();
- return dt;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#isInstance(java.lang.Object, Operation, boolean)
- */
- public boolean isInstance(Object wrapper, Operation operation, boolean input) {
- Class<?> wrapperClass =
- input ? operation.getWrapper().getInputWrapperClass() : operation.getWrapper().getOutputWrapperClass();
- return wrapperClass == null ? false : wrapperClass.isInstance(wrapper);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHelper.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHelper.java
deleted file mode 100644
index 5f90aa4d7a..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHelper.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-/**
- * The JAXBWrapper tool is used to create a JAXB Object from a series of child objects (wrap) or get
- * the child objects from a JAXB Object (unwrap)
- */
-public class JAXBWrapperHelper {
-
- /**
- * unwrap Returns the list of child objects of the jaxb object
- *
- * @param jaxbObject that represents the type
- * @param childNames list of xml child names as String
- * @param pdMap PropertyDescriptor map for this jaxbObject
- * @return list of Objects in the same order as the element names.
- */
- public Object[] unwrap(Object jaxbObject, List<String> childNames, Map<String, JAXBPropertyDescriptor> pdMap)
- throws JAXBWrapperException {
-
- // Get the object that will have the property descriptors (i.e. the object representing the complexType)
- Object jaxbComplexTypeObj = jaxbObject;
-
- // Get the PropertyDescriptorPlus map.
- // The method makes sure that each child name has a matching jaxb property
- // checkPropertyDescriptorMap(jaxbComplexTypeObj.getClass(), childNames, pdMap);
-
- // Get the corresponsing objects from the jaxb bean
- ArrayList<Object> objList = new ArrayList<Object>();
- int index = 0;
- for (String childName : childNames) {
- JAXBPropertyDescriptor propInfo = getPropertyDescriptor(pdMap, childName, index);
-
- Object object = null;
- try {
- object = propInfo.get(jaxbComplexTypeObj);
- } catch (Throwable e) {
- throw new JAXBWrapperException(e);
- }
-
- objList.add(object);
- index++;
- }
- Object[] jaxbObjects = objList.toArray();
- objList = null;
- return jaxbObjects;
-
- }
-
- private JAXBPropertyDescriptor getPropertyDescriptor(Map<String, JAXBPropertyDescriptor> pdMap,
- String childName,
- int index) {
- JAXBPropertyDescriptor propInfo = pdMap.get(childName);
- if (propInfo == null) {
- // FIXME: [rfeng] Sometimes the child element names don't match. Get chilld by location?
- List<JAXBPropertyDescriptor> props = new ArrayList<JAXBPropertyDescriptor>(pdMap.values());
- // Sort the properties by index. We might need to take propOrder into consideration
- Collections.sort(props);
- propInfo = props.get(index);
- }
- return propInfo;
- }
-
- /**
- * wrap Creates a jaxb object that is initialized with the child objects.
- * <p/>
- * Note that the jaxbClass must be the class the represents the complexType. (It should never be
- * JAXBElement)
- *
- * @param jaxbClass
- * @param childNames list of xml child names as String
- * @param childObjects, component type objects
- * @param pdMap PropertyDescriptor map for this jaxbObject
- */
- public Object wrap(Class<?> jaxbClass,
- List<String> childNames,
- Map<String, Object> childObjects,
- Map<String, JAXBPropertyDescriptor> pdMap) throws JAXBWrapperException {
-
- // Just like unWrap, get the property info map
- // checkPropertyDescriptorMap(jaxbClass, childNames, pdMap);
-
- // The jaxb object always has a default constructor. Create the object
- Object jaxbObject = null;
- try {
- jaxbObject = jaxbClass.newInstance();
- } catch (Throwable t) {
- throw new JAXBWrapperException(t);
- }
-
- wrap(jaxbObject, childNames, childObjects, pdMap);
-
- // Return the jaxb object
- return jaxbObject;
- }
-
- public void wrap(Object jaxbObject,
- List<String> childNames,
- Map<String, Object> childObjects,
- Map<String, JAXBPropertyDescriptor> pdMap) {
- // Now set each object onto the jaxb object
- int index = 0;
- for (String childName : childNames) {
- JAXBPropertyDescriptor propInfo = getPropertyDescriptor(pdMap, childName, index);
- Object value = childObjects.get(childName);
- try {
- propInfo.set(jaxbObject, value);
- } catch (Throwable t) {
- throw new JAXBWrapperException(t);
- }
- index++;
- }
- }
-
- public Object[] unwrap(Object jaxbObject, List<String> childNames) throws JAXBWrapperException {
- // Get the property descriptor map for this JAXBClass
- Class<?> jaxbClass = jaxbObject.getClass();
- Map<String, JAXBPropertyDescriptor> pdMap = null;
- try {
- pdMap = XMLRootElementUtil.createPropertyDescriptorMap(jaxbClass);
- } catch (Throwable t) {
- throw new JAXBWrapperException(t);
- }
-
- // Delegate
- return unwrap(jaxbObject, childNames, pdMap);
- }
-
- public Object wrap(Class<?> jaxbClass, List<String> childNames, Map<String, Object> childObjects)
- throws JAXBWrapperException {
- // Get the property descriptor map
- Map<String, JAXBPropertyDescriptor> pdMap = null;
- try {
- pdMap = XMLRootElementUtil.createPropertyDescriptorMap(jaxbClass);
- } catch (Throwable t) {
- throw new JAXBWrapperException(t);
- }
-
- // Delegate
- return wrap(jaxbClass, childNames, childObjects, pdMap);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java
deleted file mode 100644
index e375a9b85e..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.w3c.dom.Node;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Node2JAXB extends BaseTransformer<Node, Object> implements PullTransformer<Node, Object> {
-
- public Node2JAXB() {
- super();
- }
-
- public Object transform(Node source, TransformationContext context) {
- if (source == null)
- return null;
- try {
- JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context, false);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- Object result = unmarshaller.unmarshal(source, JAXBContextHelper.getJavaType(context.getTargetDataType()));
- return JAXBContextHelper.createReturnValue(jaxbContext, context.getTargetDataType(), result);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- @Override
- public int getWeight() {
- return 30;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JAXBDataBinding.NAME;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java
deleted file mode 100644
index 840edfd234..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.io.Reader;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Reader2JAXB extends BaseTransformer<Reader, Object> implements
- PullTransformer<Reader, Object> {
-
- public Object transform(final Reader source, final TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context, false);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- StreamSource streamSource = new StreamSource(source);
- Object result = unmarshaller.unmarshal(streamSource, JAXBContextHelper.getJavaType(context.getTargetDataType()));
- return JAXBContextHelper.createReturnValue(jaxbContext, context.getTargetDataType(), result);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Reader> getSourceType() {
- return Reader.class;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- @Override
- public int getWeight() {
- return 30;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JAXBDataBinding.NAME;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/String2JAXB.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/String2JAXB.java
deleted file mode 100644
index 5559690de8..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/String2JAXB.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.io.StringReader;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.xml.XMLStringDataBinding;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class String2JAXB extends BaseTransformer<String, Object> implements
- PullTransformer<String, Object> {
-
- public Object transform(final String source, final TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context, false);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- StreamSource streamSource = new StreamSource(new StringReader(source));
- Object result = unmarshaller.unmarshal(streamSource, JAXBContextHelper.getJavaType(context.getTargetDataType()));
- return JAXBContextHelper.createReturnValue(jaxbContext, context.getTargetDataType(), result);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<String> getSourceType() {
- return String.class;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- @Override
- public int getWeight() {
- return 30;
- }
-
- @Override
- public String getSourceDataBinding() {
- return XMLStringDataBinding.NAME;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JAXBDataBinding.NAME;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLAdapterExtensionPoint.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLAdapterExtensionPoint.java
deleted file mode 100644
index 5fa98b5ed1..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLAdapterExtensionPoint.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.util.Map;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface XMLAdapterExtensionPoint {
- /**
- * @param boundType
- * @param adapter
- */
- void addAdapter(Class<?> boundType, Class<? extends XmlAdapter> adapter);
-
- /**
- * @param boundType
- * @return
- */
- Class<? extends XmlAdapter> getAdapter(Class<?> boundType);
-
- /**
- * @param boundType
- * @return
- */
- Class<? extends XmlAdapter> removeAdapter(Class<?> boundType);
-
- /**
- * @return
- */
- Map<Class<?>, Class<? extends XmlAdapter>> getAdapters();
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLRootElementUtil.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLRootElementUtil.java
deleted file mode 100644
index b26c6e7e36..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLRootElementUtil.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlEnumValue;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchema;
-import javax.xml.namespace.QName;
-
-/**
- *
- */
-public final class XMLRootElementUtil {
-
- /** Constructor is intentionally private. This class only provides static utility methods */
- private XMLRootElementUtil() {
-
- }
-
- /**
- * @param clazz
- * @return namespace of root element qname or null if this is not object does not represent a
- * root element
- */
- public static QName getXmlRootElementQNameFromObject(Object obj) {
-
- // A JAXBElement stores its name
- if (obj instanceof JAXBElement) {
- return ((JAXBElement<?>)obj).getName();
- }
-
- Class<?> clazz = (obj instanceof java.lang.Class) ? (Class<?>)obj : obj.getClass();
- return getXmlRootElementQName(clazz);
- }
-
- /**
- * @param clazz
- * @return namespace of root element qname or null if this is not object does not represent a
- * root element
- */
- public static QName getXmlRootElementQName(Class<?> clazz) {
-
- // See if the object represents a root element
- XmlRootElement root = (XmlRootElement)getAnnotation(clazz, XmlRootElement.class);
- if (root == null) {
- return null;
- }
-
- String name = root.name();
- String namespace = root.namespace();
-
- // The name may need to be defaulted
- if (name == null || name.length() == 0 || name.equals("##default")) {
- name = getSimpleName(clazz.getCanonicalName());
- }
-
- // The namespace may need to be defaulted
- if (namespace == null || namespace.length() == 0 || namespace.equals("##default")) {
- Package pkg = clazz.getPackage();
- XmlSchema schema = (XmlSchema)getAnnotation(pkg, XmlSchema.class);
- if (schema != null) {
- namespace = schema.namespace();
- } else {
- namespace = "";
- }
- }
-
- return new QName(namespace, name);
- }
-
- /**
- * @param clazz
- * @return namespace of root element qname or null if this is not object does not represent a root element
- */
- public static String getEnumValue(Enum<?> myEnum) {
- Field f;
- String value;
- try {
- f = myEnum.getClass().getField(myEnum.name());
-
- f.setAccessible(true);
-
- XmlEnumValue xev = (XmlEnumValue)getAnnotation(f, XmlEnumValue.class);
- if (xev == null) {
- value = f.getName();
- } else {
- value = xev.value();
- }
- } catch (SecurityException e) {
- value = null;
- } catch (NoSuchFieldException e) {
- value = null;
- }
-
- return value;
- }
-
- /**
- * utility method to get the last token in a "."-delimited package+classname string
- *
- * @return
- */
- private static String getSimpleName(String in) {
- if (in == null || in.length() == 0) {
- return in;
- }
- String out = null;
- StringTokenizer tokenizer = new StringTokenizer(in, ".");
- if (tokenizer.countTokens() == 0)
- out = in;
- else {
- while (tokenizer.hasMoreTokens()) {
- out = tokenizer.nextToken();
- }
- }
- return out;
- }
-
- /**
- * The JAXBClass has a set of bean properties each represented by a PropertyDescriptor Each of
- * the fields of the class has an associated xml name. The method returns a map where the key is
- * the xml name and value is the PropertyDescriptor
- *
- * @param jaxbClass
- * @return map
- */
- public static Map<String, JAXBPropertyDescriptor> createPropertyDescriptorMap(Class<?> jaxbClass)
- throws NoSuchFieldException, IntrospectionException {
-
- PropertyDescriptor[] pds = Introspector.getBeanInfo(jaxbClass).getPropertyDescriptors();
- Map<String, JAXBPropertyDescriptor> map = new HashMap<String, JAXBPropertyDescriptor>();
-
- // Unfortunately the element names are stored on the fields.
- // Get all of the fields in the class and super classes
-
- List<Field> fields = getFields(jaxbClass);
-
- // Now match up the fields with the property descriptors...Sigh why didn't JAXB put the @XMLElement annotations on the
- // property methods!
- for (PropertyDescriptor pd : pds) {
-
- // Skip over the class property..it is never represented as an xml element
- if (pd.getName().equals("class")) {
- continue;
- }
-
- // For the current property, find a matching field...so that we can get the xml name
- boolean found = false;
-
- int index = 0;
- for (Field field : fields) {
- String fieldName = field.getName();
-
- // Use the name of the field and property to find the match
- if (fieldName.equalsIgnoreCase(pd.getDisplayName()) || fieldName.equalsIgnoreCase(pd.getName())) {
- // Get the xmlElement name for this field
- QName xmlName = getXmlElementRefOrElementQName(field.getDeclaringClass(), field);
- found = true;
- map.put(xmlName.getLocalPart(), new JAXBPropertyDescriptor(pd, xmlName, index));
- index++;
- break;
- }
-
- // Unfortunately, sometimes the field name is preceeded by an underscore
- if (fieldName.startsWith("_")) {
- fieldName = fieldName.substring(1);
- if (fieldName.equalsIgnoreCase(pd.getDisplayName()) || fieldName.equalsIgnoreCase(pd.getName())) {
- // Get the xmlElement name for this field
- QName xmlName = getXmlElementRefOrElementQName(field.getDeclaringClass(), field);
- found = true;
-
- map.put(xmlName.getLocalPart(), new JAXBPropertyDescriptor(pd, xmlName, index));
- index++;
- break;
- }
- }
- }
-
- // We didn't find a field. Default the xmlname to the property name
- if (!found) {
- String xmlName = pd.getName();
-
- map.put(xmlName, new JAXBPropertyDescriptor(pd, xmlName, index));
- index++;
- }
-
- }
- return map;
- }
-
- /**
- * Gets all of the fields in this class and the super classes
- *
- * @param beanClass
- * @return
- */
- private static List<Field> getFields(final Class<?> beanClass) {
- // This class must remain private due to Java 2 Security concerns
- List<Field> fields = AccessController.doPrivileged(new PrivilegedAction<List<Field>>() {
- public List<Field> run() {
- List<Field> fields = new ArrayList<Field>();
- Class<?> cls = beanClass;
- while (cls != null) {
- Field[] fieldArray = cls.getDeclaredFields();
- for (Field field : fieldArray) {
- fields.add(field);
- }
- cls = cls.getSuperclass();
- }
- return fields;
- }
- });
-
- return fields;
- }
-
- /**
- * Get the name of the field by looking at the XmlElement annotation.
- *
- * @param jaxbClass
- * @param fieldName
- * @return
- * @throws NoSuchFieldException
- */
- private static QName getXmlElementRefOrElementQName(Class<?> jaxbClass, Field field) throws NoSuchFieldException {
- XmlElementRef xmlElementRef = (XmlElementRef)getAnnotation(field, XmlElementRef.class);
- if (xmlElementRef != null) {
- return new QName(xmlElementRef.namespace(), xmlElementRef.name());
- }
- XmlElement xmlElement = (XmlElement)getAnnotation(field, XmlElement.class);
-
- // If XmlElement does not exist, default to using the field name
- if (xmlElement == null || xmlElement.name().equals("##default")) {
- return new QName("", field.getName());
- }
- return new QName(xmlElement.namespace(), xmlElement.name());
- }
-
- /**
- * Get an annotation. This is wrappered to avoid a Java2Security violation.
- * @param cls Class that contains annotation
- * @param annotation Class of requested Annotation
- * @return annotation or null
- */
- private static <T extends Annotation> T getAnnotation(final AnnotatedElement element, final Class<T> annotation) {
- return AccessController.doPrivileged(new PrivilegedAction<T>() {
- public T run() {
- return element.getAnnotation(annotation);
- }
- });
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java
deleted file mode 100644
index af3fa3fb66..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class XMLStreamReader2JAXB extends BaseTransformer<XMLStreamReader, Object> implements
- PullTransformer<XMLStreamReader, Object> {
-
- public XMLStreamReader2JAXB() {
- super();
- }
-
- public Object transform(XMLStreamReader source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context, false);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- // FIXME: [rfeng] If the java type is Object.class, the unmarshalled result will be
- // a DOM Node
- Object result = unmarshaller.unmarshal(source, JAXBContextHelper.getJavaType(context.getTargetDataType()));
- source.close();
- return JAXBContextHelper.createReturnValue(jaxbContext, context.getTargetDataType(), result);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public Class<Object> getTargetType() {
- return Object.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JAXBDataBinding.NAME;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
deleted file mode 100644
index 3f2978ad25..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# implementation classes for the databindings
-org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding;name=javax.xml.bind.JAXBElement
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index 4e062e4c22..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation classes for the transformers
-org.apache.tuscany.sca.databinding.jaxb.JAXB2Node;source=javax.xml.bind.JAXBElement,target=org.w3c.dom.Node,weight=500
-org.apache.tuscany.sca.databinding.jaxb.Node2JAXB;source=org.w3c.dom.Node,target=javax.xml.bind.JAXBElement,weight=500
-org.apache.tuscany.sca.databinding.jaxb.Reader2JAXB;source=java.io.Reader,target=javax.xml.bind.JAXBElement,weight=510
-org.apache.tuscany.sca.databinding.jaxb.XMLStreamReader2JAXB;source=javax.xml.stream.XMLStreamReader,target=javax.xml.bind.JAXBElement,weight=490
-
-org.apache.tuscany.sca.databinding.jaxb.JAXB2Node;source=java:complexType,target=org.w3c.dom.Node,weight=90000
-org.apache.tuscany.sca.databinding.jaxb.Node2JAXB;source=org.w3c.dom.Node,target=java:complexType,weight=90000
-
-org.apache.tuscany.sca.databinding.jaxb.Node2JAXB;source=org.w3c.dom.Node,target=java:simpleType,weight=90000
-org.apache.tuscany.sca.databinding.jaxb.JAXB2Node;source=java:simpleType,target=org.w3c.dom.Node,weight=90000
-
-org.apache.tuscany.sca.databinding.jaxb.XMLStreamReader2JAXB;source=javax.xml.stream.XMLStreamReader,target=java:complexType,weight=90000
-org.apache.tuscany.sca.databinding.jaxb.XMLStreamReader2JAXB;source=javax.xml.stream.XMLStreamReader,target=java:simpleType,weight=90000
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint
deleted file mode 100644
index d1f6d9f1e3..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT 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.tuscany.sca.databinding.jaxb.DefaultXMLAdapterExtensionPoint \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/com/example/stock/StockQuoteOffer.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/com/example/stock/StockQuoteOffer.java
deleted file mode 100644
index 5c5c892f33..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/com/example/stock/StockQuoteOffer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.example.stock;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * <p>Java class for anonymous complex type.
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {"input"})
-@XmlRootElement(name = "stockQuoteOffer")
-public class StockQuoteOffer {
-
- protected String input;
-
- public String getInput() {
- return this.input;
- }
-
- public void setInput(String input) {
- this.input = input;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java
deleted file mode 100644
index 1c46765d9f..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.tuscany.sca.databinding.util.LRUCache;
-import org.junit.Assert;
-import org.junit.Test;
-
-import com.example.ipo.jaxb.Address;
-import com.example.ipo.jaxb.PurchaseOrderType;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JAXBContextCacheTestCase {
- @Test
- public void testCache() throws JAXBException {
- JAXBContextCache cache = new JAXBContextCache();
- JAXBContext context1 = cache.getJAXBContext(String.class);
- JAXBContext context2 = cache.getJAXBContext(int.class);
- JAXBContext context3 = cache.getJAXBContext(String[].class);
- JAXBContext context4 = cache.getJAXBContext(Source.class);
- Assert.assertSame(context1, context2);
- Assert.assertNotSame(context2, context3);
- Assert.assertSame(context1, context4);
-
- QName name = new QName("http://example.com/ns1", "e1");
- JAXBElement<String> element = new JAXBElement<String>(name, String.class, "123");
- StringWriter sw = new StringWriter();
- context4.createMarshaller().marshal(element, sw);
- StreamSource source = new StreamSource(new StringReader(sw.toString()), null);
- context4.createUnmarshaller().unmarshal(source, String.class);
-
- JAXBContext context5 = cache.getJAXBContext(Address.class);
- JAXBContext context6 = cache.getJAXBContext(PurchaseOrderType.class);
- Assert.assertSame(context5, context6);
- }
-
- @Test
- public void testLRUCache() {
- LRUCache<String, String> cache = new LRUCache<String, String>(3);
- cache.put("1", "A");
- Assert.assertEquals(1, cache.size());
- cache.put("2", "B");
- Assert.assertEquals(2, cache.size());
- cache.put("3", "C");
- Assert.assertEquals(3, cache.size());
- cache.put("4", "D");
- Assert.assertEquals(3, cache.size());
- String data = cache.get("1");
- Assert.assertNull(data);
- data = cache.get("2");
- Assert.assertEquals("B", data);
- cache.put("5", "E");
- data = cache.get("2");
- Assert.assertEquals("B", data);
- }
-
- @Test
- public void testPerf() throws JAXBException {
- JAXBContextCache cache = new JAXBContextCache();
-
- // Test JAXBContext for simple java classes
- long start = System.currentTimeMillis();
- for (int i = 0; i < 100; i++) {
- JAXBContext context = JAXBContext.newInstance(String.class);
- }
- long end = System.currentTimeMillis();
- long d1 = end - start;
- start = System.currentTimeMillis();
- for (int i = 0; i < 100; i++) {
- JAXBContext context = cache.getJAXBContext(String.class);
- }
- end = System.currentTimeMillis();
- long d2 = end - start;
- System.out.println(d1 + "ms vs. " + d2 + "ms");
-
- // Test JAXBContext for generated JAXB classes
- start = System.currentTimeMillis();
- for (int i = 0; i < 20; i++) {
- JAXBContext context = JAXBContext.newInstance(PurchaseOrderType.class);
- }
- end = System.currentTimeMillis();
- d1 = end - start;
- start = System.currentTimeMillis();
- for (int i = 0; i < 20; i++) {
- JAXBContext context = cache.getJAXBContext(PurchaseOrderType.class);
- }
- end = System.currentTimeMillis();
- d2 = end - start;
- System.out.println(d1 + "ms vs. " + d2 + "ms");
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBindingTestCase.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBindingTestCase.java
deleted file mode 100644
index 97038734f5..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBindingTestCase.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.example.ipo.jaxb.ObjectFactory;
-import com.example.ipo.jaxb.PurchaseOrderType;
-import com.example.ipo.jaxb.USAddress;
-import com.example.ipo.jaxb.USState;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JAXBDataBindingTestCase {
- private JAXBDataBinding binding;
-
- @Before
- public void setUp() throws Exception {
- binding = new JAXBDataBinding();
- }
-
- /**
- * Test method for
- * {@link org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding#introspect(java.lang.Class, Operation)}.
- */
- @Test
- public final void testIntrospect() {
- DataType dataType = new DataTypeImpl<Class>(JAXBElement.class, null);
- Operation op = null;
- boolean yes = binding.introspect(dataType, op);
- assertTrue(yes);
- assertTrue(dataType.getDataBinding().equals(binding.getName()));
- assertTrue(dataType.getPhysical() == JAXBElement.class && dataType.getLogical() == XMLType.UNKNOWN);
- dataType = new DataTypeImpl<Class>(MockJAXBElement.class, null);
- yes = binding.introspect(dataType, op);
- assertTrue(yes);
- assertEquals(MockJAXBElement.class, dataType.getPhysical());
- assertEquals(new QName("http://www.example.com/IPO", "PurchaseOrderType"), ((XMLType)dataType.getLogical())
- .getTypeName());
- dataType = new DataTypeImpl<Class>(USAddress.class, null);
- yes = binding.introspect(dataType, op);
- assertTrue(yes);
- assertEquals(USAddress.class, dataType.getPhysical());
- assertEquals(new QName("http://www.example.com/IPO", "USAddress"), ((XMLType)dataType.getLogical())
- .getTypeName());
- dataType = new DataTypeImpl<Class>(USState.class, null);
- yes = binding.introspect(dataType, op);
- assertTrue(yes);
- assertTrue(dataType.getDataBinding().equals(binding.getName()));
- assertEquals(USState.class, dataType.getPhysical());
- assertEquals(new QName("http://www.example.com/IPO", "USState"), ((XMLType)dataType.getLogical()).getTypeName());
-
- }
-
- private static class MockJAXBElement extends JAXBElement<PurchaseOrderType> {
-
- private static final long serialVersionUID = -2767569071002707973L;
-
- /**
- * @param elementName
- * @param type
- * @param value
- */
- public MockJAXBElement(QName elementName, Class<PurchaseOrderType> type, PurchaseOrderType value) {
- super(elementName, type, value);
- }
-
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testCopy() {
- ObjectFactory factory = new ObjectFactory();
- PurchaseOrderType poType = factory.createPurchaseOrderType();
- JAXBElement<PurchaseOrderType> po = factory.createPurchaseOrder(poType);
- JAXBElement<PurchaseOrderType> copy = (JAXBElement<PurchaseOrderType>)binding.copy(po, null, null);
- assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), copy.getName());
- }
-
- @Test
- public void testCopyNonElement() {
- ObjectFactory factory = new ObjectFactory();
- PurchaseOrderType poType = factory.createPurchaseOrderType();
- poType.setComment("Comment");
- PurchaseOrderType copy = (PurchaseOrderType)binding.copy(poType, null, null);
- assertTrue(copy instanceof PurchaseOrderType);
- assertEquals("Comment", (copy).getComment());
- }
-
- @Test
- public void testCopyNonRoot() {
- ObjectFactory factory = new ObjectFactory();
- USAddress address = factory.createUSAddress();
- address.setCity("San Jose");
- USAddress copy = (USAddress)binding.copy(address, null, null);
- assertTrue(copy instanceof USAddress);
- assertEquals("San Jose", (copy).getCity());
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBReflectionTestCase.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBReflectionTestCase.java
deleted file mode 100644
index f5cff68969..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBReflectionTestCase.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.util.Map;
-
-import javax.xml.bind.JAXBContext;
-
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JAXBReflectionTestCase {
-
- @Test
- public void testGenerateSchema() throws Exception {
- JAXBContext context = JAXBContext.newInstance("com.example.ipo.jaxb");
- Map<String, String> schemas = JAXBTypeHelper.generateSchema(context);
- System.out.println(schemas);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java
deleted file mode 100644
index 61e3fcaaab..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.io.StringReader;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.junit.Assert;
-import org.junit.Test;
-import org.w3c.dom.Node;
-
-import com.example.ipo.jaxb.ObjectFactory;
-import com.example.ipo.jaxb.PurchaseOrderType;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JAXBTestCase {
- private static final String IPO_XML =
- "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
- + " xmlns:ipo=\"http://www.example.com/IPO\""
- + " xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\""
- + " orderDate=\"1999-12-01\">"
- + " <shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\">"
- + " <name>Helen Zoe</name>"
- + " <street>47 Eden Street</street>"
- + " <city>Cambridge</city>"
- + " <postcode>CB1 1JR</postcode>"
- + " </shipTo>"
- + " <billTo xsi:type=\"ipo:USAddress\">"
- + " <name>Robert Smith</name>"
- + " <street>8 Oak Avenue</street>"
- + " <city>Old Town</city>"
- + " <state>PA</state>"
- + " <zip>95819</zip>"
- + " </billTo>"
- + " <items>"
- + " <item partNum=\"833-AA\">"
- + " <productName>Lapis necklace</productName>"
- + " <quantity>1</quantity>"
- + " <USPrice>99.95</USPrice>"
- + " <ipo:comment>Want this for the holidays</ipo:comment>"
- + " <shipDate>1999-12-05</shipDate>"
- + " </item>"
- + " </items>"
- + "</ipo:purchaseOrder>";
-
- @Test
- public void testTransform() throws Exception {
- Reader2JAXB t0 = new Reader2JAXB();
-
- DataType targetDataType = new DataTypeImpl<Class>(PurchaseOrderType.class, null);
-
- TransformationContext tContext = new TransformationContextImpl();
- tContext.setTargetDataType(targetDataType);
-
- Object object1 = t0.transform(new StringReader(IPO_XML), tContext);
-
- DataType sourceDataType = new DataTypeImpl<Class>(PurchaseOrderType.class, null);
-
- TransformationContext tContext1 = new TransformationContextImpl();
- tContext1.setSourceDataType(sourceDataType);
-
- JAXB2Node t1 = new JAXB2Node();
- Node node = t1.transform(object1, tContext1);
-
- Assert.assertNotNull(node);
-
- Node2JAXB t2 = new Node2JAXB();
- Object object2 = t2.transform(node, tContext);
- Assert.assertNotNull(object2);
-
- }
-
- @Test
- public void testTransform2() throws Exception {
- Reader2JAXB t0 = new Reader2JAXB();
-
- QName root = new QName("http://www.example.com/IPO", "purchaseOrder");
- DataType targetDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, new XMLType(root, null));
- // targetDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath);
-
- TransformationContext tContext = new TransformationContextImpl();
- tContext.setTargetDataType(targetDataType);
- Object object1 = t0.transform(new StringReader(IPO_XML), tContext);
-
- DataType sourceDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, new XMLType(root, null));
- // sourceDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath);
-
- TransformationContext tContext1 = new TransformationContextImpl();
- tContext1.setSourceDataType(sourceDataType);
-
- JAXB2Node t1 = new JAXB2Node();
- Node node = t1.transform(object1, tContext1);
-
- Assert.assertNotNull(node);
-
- Node2JAXB t2 = new Node2JAXB();
- Object object2 = t2.transform(node, tContext);
- Assert.assertNotNull(object2);
-
- }
-
- @Test
- public void testTransform3() throws Exception {
-
- DataType sourceDataType = new DataTypeImpl<Class>(PurchaseOrderType.class, null);
-
- TransformationContext tContext1 = new TransformationContextImpl();
- tContext1.setSourceDataType(sourceDataType);
-
-
- JAXB2Node t1 = new JAXB2Node();
- PurchaseOrderType po = new ObjectFactory().createPurchaseOrderType();
- Node node = t1.transform(po, tContext1);
-
- Assert.assertNotNull(node);
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java
deleted file mode 100644
index 6037212e5a..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandlerTestCase.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.example.stock.StockQuoteOffer;
-
-/**
- * Test case for JAXBExceptionHandler
- *
- * @version $Rev$ $Date$
- */
-public class JAXBWrapperHandlerTestCase {
- private static final QName ELEMENT = new QName("http://www.example.com/stock", "stockQuoteOffer");
- private static final QName INPUT = new QName("", "input");
- private JAXBWrapperHandler handler;
-
- @Before
- public void setUp() throws Exception {
- this.handler = new JAXBWrapperHandler();
- }
-
- @Test
- public void testCreate() {
- ElementInfo element = new ElementInfo(ELEMENT, null);
- Operation op = new OperationImpl();
- WrapperInfo wrapperInfo = new WrapperInfo(JAXBDataBinding.NAME, element, null, null, null);
- wrapperInfo.setInputWrapperType(new DataTypeImpl<XMLType>(JAXBDataBinding.NAME, StockQuoteOffer.class,
- XMLType.UNKNOWN));
- op.setWrapper(wrapperInfo);
- Object offer = handler.create(op, true);
- Assert.assertTrue(offer instanceof StockQuoteOffer);
- }
-
- @Test
- public void testSetChild() {
- StockQuoteOffer wrapper = new StockQuoteOffer();
- handler.setChild(wrapper, 0, new ElementInfo(INPUT, null), "IBM");
- Assert.assertEquals("IBM", wrapper.getInput());
- }
-
- @Test
- public void testGetChildren() {
- StockQuoteOffer wrapper = new StockQuoteOffer();
- wrapper.setInput("IBM");
- List<ElementInfo> elements = new ArrayList<ElementInfo>();
- elements.add(new ElementInfo(INPUT, null));
- WrapperInfo wrapperInfo = new WrapperInfo(JAXBDataBinding.NAME, null, null, elements, null);
- Operation op = new OperationImpl();
- op.setWrapper(wrapperInfo);
- List children = handler.getChildren(wrapper, op, true);
- assertNotNull(children);
- assertEquals(1, children.size());
- assertEquals("IBM", children.get(0));
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyBean.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyBean.java
deleted file mode 100644
index 9bdfb108fe..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyBean.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class MyBean {
- private int age;
- private String name;
- private float[] rates = new float[] {1.0f, 2.0f};
- private List<String> notes = new ArrayList<String>();
- private Map<String, Integer> map = new HashMap<String, Integer>();
- private Object service;
- private Object otherService;
- private boolean good;
-
- public int getAge() {
- return age;
- }
-
- public void setAge(int age) {
- this.age = age;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public List<String> getNotes() {
- return notes;
- }
-
- public void setNotes(List<String> notes) {
- this.notes = notes;
- }
-
- public float[] getRates() {
- return rates;
- }
-
- public void setRates(float[] rates) {
- this.rates = rates;
- }
-
- public Map<String, Integer> getMap() {
- return map;
- }
-
- public void setMap(Map<String, Integer> map) {
- this.map = map;
- }
-
- public Object getService() {
- return service;
- }
-
- public void setService(Object service) {
- this.service = service;
- }
-
- public Object getOtherService() {
- return otherService;
- }
-
- public void setOtherService(Object otherService) {
- this.otherService = otherService;
- }
-
- public boolean isGood() {
- return good;
- }
-
- public void setGood(boolean good) {
- this.good = good;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + age;
- result = prime * result + (good ? 1231 : 1237);
- result = prime * result + ((map == null) ? 0 : map.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((notes == null) ? 0 : notes.hashCode());
- result = prime * result + ((otherService == null) ? 0 : otherService.hashCode());
- result = prime * result + Arrays.hashCode(rates);
- result = prime * result + ((service == null) ? 0 : service.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 MyBean other = (MyBean)obj;
- if (age != other.age)
- return false;
- if (good != other.good)
- return false;
- if (map == null) {
- if (other.map != null)
- return false;
- } else if (!map.equals(other.map))
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (notes == null) {
- if (other.notes != null)
- return false;
- } else if (!notes.equals(other.notes))
- return false;
- if (otherService == null) {
- if (other.otherService != null)
- return false;
- } else if (!otherService.equals(other.otherService))
- return false;
- if (!Arrays.equals(rates, other.rates))
- return false;
- if (service == null) {
- if (other.service != null)
- return false;
- } else if (!service.equals(other.service))
- return false;
- return true;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterface.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterface.java
deleted file mode 100644
index b8e9ee7f7d..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterface.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface MyInterface {
- void setId(String id);
-
- String getId();
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterfaceImpl.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterfaceImpl.java
deleted file mode 100644
index 5c511e6ccb..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyInterfaceImpl.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-/**
- * @version $Rev$ $Date$
- */
-public class MyInterfaceImpl implements MyInterface {
- private String id;
-
- /**
- * @see org.apache.tuscany.databinding.jaxb.MyInterface#getId()
- */
- public String getId() {
- return id;
- }
-
- /**
- * @see org.apache.tuscany.databinding.jaxb.MyInterface#setId(java.lang.String)
- */
- public void setId(String id) {
- this.id = id;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((id == null) ? 0 : id.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 MyInterfaceImpl other = (MyInterfaceImpl)obj;
- if (id == null) {
- if (other.id != null)
- return false;
- } else if (!id.equals(other.id))
- return false;
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyJaxbBean.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyJaxbBean.java
deleted file mode 100644
index 3c3992524a..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MyJaxbBean.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.w3c.dom.Element;
-
-/**
- *
- */
-@XmlRootElement(name = "myBean", namespace = "http://ns1")
-public class MyJaxbBean {
- public MyBean myBean;
-
- @XmlJavaTypeAdapter(AnyTypeXmlAdapter.class)
- public MyInterface myInterface;
-
- @XmlElement(type = MyInterfaceImpl.class)
- public MyInterface myInterface1;
-
- @XmlJavaTypeAdapter(MyInterfaceAdapter.class)
- public MyInterface myInterface2;
-
- public Object myObject;
-
- @XmlAnyElement
- public Element anyElement;
-
- public static class MyInterfaceAdapter extends XmlAdapter<MyInterfaceImpl, MyInterface> {
-
- @Override
- public MyInterfaceImpl marshal(MyInterface v) throws Exception {
- return (MyInterfaceImpl) v;
- }
-
- @Override
- public MyInterface unmarshal(MyInterfaceImpl v) throws Exception {
- return (MyInterface) v;
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MySubBean.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MySubBean.java
deleted file mode 100644
index 62dfa6f73c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/MySubBean.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.jaxb;
-
-/**
- * @version $Rev$ $Date$
- */
-public class MySubBean extends MyBean {
- private String addtional;
-
- public String getAddtional() {
- return addtional;
- }
-
- public void setAddtional(String addtional) {
- this.addtional = addtional;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/POJOTestCase.java b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/POJOTestCase.java
deleted file mode 100644
index b9370c9387..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/POJOTestCase.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.jaxb;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.Map;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-import javax.xml.transform.stream.StreamSource;
-
-import org.junit.Test;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class POJOTestCase {
-
- @Test
- public void testAdapter() throws Exception {
- JAXBContext context = JAXBContext.newInstance(MyJaxbBean.class, MyInterfaceImpl.class);
- StringWriter writer = new StringWriter();
- MyJaxbBean bean = new MyJaxbBean();
- bean.myBean = new MySubBean();
- bean.myBean.setName("Ray");
- bean.myInterface = new MyInterfaceImpl();
- bean.myInterface.setId("001");
- bean.myObject = new MyBean();
- ((MyBean) bean.myObject).setName("Y");
- context.createMarshaller().marshal(bean, writer);
- System.out.println(writer.toString());
- Object result = context.createUnmarshaller().unmarshal(new StringReader(writer.toString()));
- assertTrue(result instanceof MyJaxbBean);
- Map<String, String> schemas = JAXBTypeHelper.generateSchema(context);
- System.out.println(schemas);
- }
-
- @Test
- public void testPOJO() throws Exception {
- JAXBContext context = JAXBContext.newInstance(MyBean.class, MyInterfaceImpl.class);
- StringWriter writer = new StringWriter();
- MyBean bean = new MyBean();
- bean.setName("Test");
- bean.setAge(20);
- bean.getNotes().add("1");
- bean.getNotes().add("2");
- bean.getMap().put("1", 1);
- MyInterface service = new MyInterfaceImpl();
- service.setId("ID001");
- bean.setService(service);
- bean.setOtherService(service);
- JAXBElement<Object> element = new JAXBElement<Object>(new QName("http://ns1", "bean"), Object.class, bean);
- context.createMarshaller().marshal(element, writer);
- // System.out.println(writer.toString());
-
- Object result = context.createUnmarshaller().unmarshal(new StringReader(writer.toString()));
- assertTrue(result instanceof JAXBElement);
- JAXBElement e2 = (JAXBElement)result;
- assertTrue(e2.getValue() instanceof MyBean);
- MyBean newBean = (MyBean)e2.getValue();
- assertEquals(bean, newBean);
- }
-
- @Test
- public void testPOJOArray() throws Exception {
- JAXBContext context = JAXBContext.newInstance(MyBean[].class, MySubBean.class);
- StringWriter writer = new StringWriter();
- MySubBean bean = new MySubBean();
- bean.setAddtional("SUB");
- bean.setName("Test");
- bean.setAge(20);
- bean.getNotes().add("1");
- bean.getNotes().add("2");
- bean.getMap().put("1", 1);
-
- JAXBElement<Object> element =
- new JAXBElement<Object>(new QName("http://ns1", "beans"), Object.class, new MyBean[] {bean});
- context.createMarshaller().marshal(element, writer);
- System.out.println(writer.toString());
-
- Object result =
- context.createUnmarshaller().unmarshal(new StreamSource(new StringReader(writer.toString())),
- MyBean[].class);
- assertTrue(result instanceof JAXBElement);
- JAXBElement e2 = (JAXBElement)result;
- assertTrue(e2.getValue() instanceof MyBean[]);
- MyBean newBean = ((MyBean[])e2.getValue())[0];
- assertTrue(newBean instanceof MySubBean);
- }
-
- /*
- public void testXMLStreamReader() throws Exception {
- JAXBContext context = JAXBContext.newInstance(MyBean.class, MyInterfaceImpl.class);
-
- MyBean bean = new MyBean();
- bean.setName("Test");
- bean.setAge(20);
- bean.getNotes().add("1");
- bean.getNotes().add("2");
- bean.getMap().put("1", 1);
- MyInterface service = new MyInterfaceImpl();
- service.setId("ID001");
- bean.setService(service);
- bean.setOtherService(service);
- QName name = new QName("http://ns1", "bean");
- JAXBElement<Object> element = new JAXBElement<Object>(name, Object.class, bean);
- TransformationContext tContext = new TransformationContextImpl();
- XMLStreamReader reader = new JAXB2XMLStreamReader().transform(element, tContext);
-
-// XMLStreamReader2String t2 = new XMLStreamReader2String();
-// String xml = t2.transform(reader, null);
- // System.out.println(xml);
- Object result = context.createUnmarshaller().unmarshal(reader, MyBean.class);
- assertTrue(result instanceof JAXBElement);
- JAXBElement e2 = (JAXBElement)result;
- assertTrue(e2.getValue() instanceof MyBean);
- MyBean newBean = (MyBean)e2.getValue();
- // FIXME :To be implemented
- // assertEquals(bean, newBean);
- }
- */
-
- @Test
- public void testString() throws Exception {
- JAXBContext context = JAXBContext.newInstance(String.class);
- StringWriter writer = new StringWriter();
- JAXBElement<Object> element = new JAXBElement<Object>(new QName("http://ns1", "bean"), Object.class, "ABC");
- context.createMarshaller().marshal(element, writer);
- // System.out.println(writer.toString());
-
- Object result = context.createUnmarshaller().unmarshal(new StringReader(writer.toString()));
- assertTrue(result instanceof JAXBElement);
- JAXBElement e2 = (JAXBElement)result;
- assertEquals("ABC", e2.getValue());
- }
-
- @Test
- public void testNull() throws Exception {
- JAXBContext context = JAXBContext.newInstance(String.class);
- StringWriter writer = new StringWriter();
- JAXBElement<Object> element = new JAXBElement<Object>(new QName("http://ns1", "bean"), Object.class, null);
- element.setNil(true);
- context.createMarshaller().marshal(element, writer);
- // System.out.println(writer.toString());
- StreamSource source = new StreamSource(new StringReader(writer.toString()));
- Object result = context.createUnmarshaller().unmarshal(source, String.class);
- assertTrue(result instanceof JAXBElement);
- JAXBElement e2 = (JAXBElement)result;
- assertNull(e2.getValue());
- }
-
- @Test
- public void testArray() throws Exception {
- JAXBContext context = JAXBContext.newInstance(String[].class);
- StringWriter writer = new StringWriter();
- JAXBElement<Object> element =
- new JAXBElement<Object>(new QName("http://ns1", "bean"), Object.class, new String[] {"ABC", "123"});
- context.createMarshaller().marshal(element, writer);
- // System.out.println(writer.toString());
-
- Object result = context.createUnmarshaller().unmarshal(new StringReader(writer.toString()));
- assertTrue(result instanceof JAXBElement);
- JAXBElement e2 = (JAXBElement)result;
- assertTrue(e2.getValue() instanceof String[]);
- }
-
- @Test
- public void testByteArray() throws Exception {
- JAXBContext context = JAXBContext.newInstance(byte[].class);
- StringWriter writer = new StringWriter();
- JAXBElement<Object> element =
- new JAXBElement<Object>(new QName("http://ns1", "bean"), Object.class, "ABC".getBytes());
- context.createMarshaller().marshal(element, writer);
- String xml = writer.toString();
- assertTrue(xml.contains("QUJD"));
- assertTrue(xml.contains("base64Binary"));
-
- Object result = context.createUnmarshaller().unmarshal(new StringReader(xml));
- assertTrue(result instanceof JAXBElement);
- JAXBElement e2 = (JAXBElement)result;
- assertTrue(e2.getValue() instanceof byte[]);
- }
-
- @Test
- public void testPrimitive() throws Exception {
- JAXBContext context = JAXBContext.newInstance(int.class);
- StringWriter writer = new StringWriter();
- JAXBElement<Object> element = new JAXBElement<Object>(new QName("http://ns1", "bean"), Object.class, 1);
- context.createMarshaller().marshal(element, writer);
- // System.out.println(writer.toString());
-
- Object result = context.createUnmarshaller().unmarshal(new StringReader(writer.toString()));
- assertTrue(result instanceof JAXBElement);
- JAXBElement e2 = (JAXBElement)result;
- assertEquals(1, e2.getValue());
- }
-
- /*
- public void testException() throws Exception {
- JAXBContext context = JAXBContext.newInstance(IllegalArgumentException.class);
- StringWriter writer = new StringWriter();
- Exception e = new IllegalArgumentException("123");
- JAXBElement<Object> element = new JAXBElement<Object>(new QName("http://ns1", "bean"), Object.class, e);
- context.createMarshaller().marshal(element, writer);
- System.out.println(writer.toString());
-
- Object result = context.createUnmarshaller().unmarshal(new StringReader(writer.toString()));
- assertTrue(result instanceof JAXBElement);
- JAXBElement e2 = (JAXBElement)result;
- assertTrue(e2.getValue() instanceof Exception);
- }
- */
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/resources/ipo.xsd b/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/resources/ipo.xsd
deleted file mode 100755
index 241ec15d36..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding-jaxb/src/test/resources/ipo.xsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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/tags/java/sca/2.0-M1/modules/databinding/LICENSE b/tags/java/sca/2.0-M1/modules/databinding/LICENSE
deleted file mode 100644
index 616bec99ed..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/LICENSE
+++ /dev/null
@@ -1,244 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
------------------------------------------------------------------
-The test cases use xmlunit with the following license:
------------------------------------------------------------------
-
-/*
-******************************************************************
-Copyright (c) 2001-2007, Jeff Martin, Tim Bacon
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
- * Neither the name of the xmlunit.sourceforge.net nor the names
- of its contributors may be used to endorse or promote products
- derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-******************************************************************
-*/
-
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/databinding/META-INF/MANIFEST.MF
deleted file mode 100644
index 8dc3e90df5..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,66 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.databinding;uses:="org.apache.t
- uscany.sca.interfacedef.util,org.apache.tuscany.sca.databinding.impl,
- org.apache.tuscany.sca.interfacedef,org.apache.tuscany.sca.extensibil
- ity,javax.xml.namespace,org.apache.tuscany.sca.contribution.resolver,
- org.apache.tuscany.sca.interfacedef.impl,org.apache.tuscany.sca.xsd";
- version="2.0.0",org.apache.tuscany.sca.databinding.xml;uses:="org.apach
- e.tuscany.sca.databinding,org.apache.tuscany.sca.interfacedef.util,or
- g.apache.tuscany.sca.databinding.impl,javax.xml.parsers,javax.xml.tra
- nsform.dom,org.w3c.dom,org.apache.tuscany.sca.interfacedef,org.xml.sa
- x,javax.xml.namespace,javax.xml.stream,javax.xml.stream.util,org.xml.
- sax.ext,javax.xml.transform,javax.xml.transform.stream,org.apache.tus
- cany.sca.interfacedef.impl,javax.xml.transform.sax,org.apache.tuscany
- .sca.databinding.javabeans,org.xml.sax.helpers";version="2.0.0",org.apa
- che.tuscany.sca.databinding.impl;uses:="org.apache.tuscany.sca.databi
- nding,org.apache.tuscany.sca.interfacedef.util,javax.xml.parsers,org.
- apache.tuscany.sca.interfacedef,org.w3c.dom,javax.xml.datatype,javax.
- xml.namespace,javax.xml.transform,org.apache.tuscany.sca.interfacedef
- .impl";version="2.0.0",org.apache.tuscany.sca.databinding.util;uses:="o
- rg.apache.tuscany.sca.interfacedef.util,org.apache.tuscany.sca.interf
- acedef";version="2.0.0",org.apache.tuscany.sca.databinding.annotation;v
- ersion="2.0.0",org.apache.tuscany.sca.databinding.javabeans;uses:="org.
- apache.tuscany.sca.databinding,org.apache.tuscany.sca.databinding.xml
- ,org.apache.tuscany.sca.interfacedef.util,org.apache.tuscany.sca.data
- binding.impl,javax.xml.parsers,org.w3c.dom,org.apache.tuscany.sca.int
- erfacedef,javax.xml.datatype,javax.xml.namespace,javax.xml.stream";ve
- rsion="2.0.0"
-Private-Package: org.apache.tuscany.sca.databinding.externalizable;ver
- sion="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA DataBinding Framework
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397181875
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA DataBinding Framework
-Import-Package: javax.xml.datatype,
- javax.xml.namespace,
- javax.xml.parsers,
- javax.xml.stream,
- javax.xml.stream.util,
- javax.xml.transform,
- javax.xml.transform.dom,
- javax.xml.transform.sax,
- javax.xml.transform.stream,
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.databinding;version="2.0.0",
- org.apache.tuscany.sca.databinding.annotation;version="2.0.0",
- org.apache.tuscany.sca.databinding.impl;version="2.0.0",
- org.apache.tuscany.sca.databinding.javabeans;version="2.0.0",
- org.apache.tuscany.sca.databinding.util;version="2.0.0",
- org.apache.tuscany.sca.databinding.xml;version="2.0.0",
- org.apache.tuscany.sca.extensibility;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.xsd;version="2.0.0",
- org.w3c.dom,
- org.xml.sax,
- org.xml.sax.ext,
- org.xml.sax.helpers
-Bundle-SymbolicName: org.apache.tuscany.sca.databinding
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding/NOTICE b/tags/java/sca/2.0-M1/modules/databinding/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/databinding/pom.xml b/tags/java/sca/2.0-M1/modules/databinding/pom.xml
deleted file mode 100644
index 3ef5e15b06..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/pom.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-databinding</artifactId>
- <name>Apache Tuscany SCA DataBinding Framework</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <!--
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0-2</version>
- </dependency>
- -->
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- <version>1.0.1</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>
-
- <dependency>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
- <version>1.2</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBinding.java
deleted file mode 100644
index 7c4ed35eb3..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBinding.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding;
-
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * DataBinding represents a data representation, for example, SDO, JAXB and AXIOM
- *
- * @version $Rev$ $Date$
- */
-public interface DataBinding {
- /**
- * A special databinding for input message of an operation
- */
- String IDL_INPUT = "idl:input";
- /**
- * A special databinding for output message of an operation
- */
- String IDL_OUTPUT = "idl:output";
- /**
- * A special databinding for fault message of an operation
- */
- String IDL_FAULT = "idl:fault";
- /**
- * The name of a databinding should be case-insensitive and unique
- *
- * @return The name of the databinding
- */
- String getName();
-
- /**
- * Introspect and populate information to a DataType model
- *
- * @param dataType The data type to be introspected
- * @param operation The operation
- * @return true if the databinding has recognized the given data type
- */
- boolean introspect(DataType dataType, Operation operation);
-
- /**
- * Introspect the data to figure out the corresponding data type
- *
- * @param value The object to be checked
- * @param operation The operation
- * @return The DataType or null if the java type is not supported by this databinding
- */
- DataType introspect(Object value, Operation operation);
-
- /**
- * Provide a WrapperHandler for this databinding
- * @return A wrapper handler which can handle wrapping/wrapping for this databinding
- */
- WrapperHandler getWrapperHandler();
-
- /**
- * Make a copy of the object for "pass-by-value" semantics.
- *
- * @param object source object to copy
- * @param dataType The data type
- * @param operation The operation
- * @return copy of the object passed in as argument
- */
- Object copy(Object object, DataType dataType, Operation operation);
-
- /**
- * Get the XML type helper for Java types
- * @return The databinding-specific XML type helper class
- */
- XMLTypeHelper getXMLTypeHelper();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBindingExtensionPoint.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBindingExtensionPoint.java
deleted file mode 100644
index 2ff5d866b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBindingExtensionPoint.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * An extension point for data binding extensions.
- *
- * @version $Rev$ $Date$
- */
-public interface DataBindingExtensionPoint {
-
- /**
- * Register a data binding
- *
- * @param dataBinding
- */
- void addDataBinding(DataBinding dataBinding);
-
- /**
- * Look up a data binding by id
- *
- * @param id The name of the databinding
- * @return The databinding
- */
- DataBinding getDataBinding(String id);
-
- /**
- * Unregister a data binding
- *
- * @param id
- * @return The unregistered databinding
- */
- DataBinding removeDataBinding(String id);
-
- /**
- * Introspect the java class to figure out what DataType supports it.
- *
- * @param dataType The initial data type
- * @param operation TODO
- * @return A DataType representing the java type or null if no databinding
- * recognizes the java type
- */
- boolean introspectType(DataType dataType, Operation operation);
-
- /**
- * Introspect the value to figure out the corresponding DataType
- *
- * @param value The object value
- * @param operation TODO
- * @return A DataType representing the value or null if no databinding
- * recognizes the value
- */
- DataType introspectType(Object value, Operation operation);
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipe.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipe.java
deleted file mode 100644
index 505a810276..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipe.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-/**
- * Data pipe allows a data source pushes data into its sink and pipe the data into its result
- *
- * @param <S> The data binding type of the sink
- * @param <R> The data binding type of the result
- *
- * @version $Rev$ $Date$
- */
-public interface DataPipe<S, R> {
-
- /**
- * Returns a sink (for example, java.io.OutputStream, java.io.Writer or org.xml.sax.ContentHandler) to receive data
- * pushed by the source
- *
- * @return The sink to consume data
- */
- S getSink();
-
- /**
- * Returns the data populated by the sink
- *
- * @return
- */
- R getResult();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipeTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipeTransformer.java
deleted file mode 100644
index 1aac6d48be..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipeTransformer.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-/**
- * Data pipe allows a data source pushes data into its sink and pipe the data into its result
- *
- * @version $Rev$ $Date$
- */
-public interface DataPipeTransformer<S, R> extends Transformer {
-
- DataPipe<S, R> newInstance();
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java
deleted file mode 100644
index d343fb2d46..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding;
-import org.apache.tuscany.sca.databinding.javabeans.JavaExceptionDataBinding;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * The default implementation of a data binding extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultDataBindingExtensionPoint implements DataBindingExtensionPoint {
- private final Map<String, DataBinding> bindings = new HashMap<String, DataBinding>();
- private final List<DataBinding> databindings = new ArrayList<DataBinding>();
- private static final Logger logger = Logger.getLogger(DefaultDataBindingExtensionPoint.class.getName());
- private boolean loadedDataBindings;
-
- public DefaultDataBindingExtensionPoint() {
- }
-
- public DataBinding getDataBinding(String id) {
- if (id == null) {
- return null;
- }
- DataBinding dataBinding = bindings.get(id.toLowerCase());
- if (dataBinding == null) {
- loadDataBindings();
- dataBinding = bindings.get(id.toLowerCase());
- }
- return dataBinding;
- }
-
- public void addDataBinding(DataBinding dataBinding) {
- if (logger.isLoggable(Level.FINE)) {
- String className = dataBinding.getClass().getName();
- boolean lazy = false;
- if (dataBinding instanceof LazyDataBinding) {
- className = ((LazyDataBinding)dataBinding).dataBindingDeclaration.getClassName();
- lazy = true;
- }
- logger.fine("Adding databinding: " + className + ";name=" + dataBinding.getName() + ",lazy=" + lazy);
- }
- databindings.add(dataBinding);
- bindings.put(dataBinding.getName().toLowerCase(), dataBinding);
-
- }
-
- public DataBinding removeDataBinding(String id) {
- if (id == null) {
- return null;
- }
- DataBinding dataBinding = bindings.remove(id.toLowerCase());
- if (dataBinding != null) {
- databindings.remove(dataBinding);
- }
- return dataBinding;
- }
-
- /**
- * Dynamically load data bindings declared under META-INF/services
- */
- private synchronized void loadDataBindings() {
- if (loadedDataBindings)
- return;
-
- // Get the databinding service declarations
- Set<ServiceDeclaration> dataBindingDeclarations;
- try {
- dataBindingDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(DataBinding.class.getName());
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
-
- // Load data bindings
- for (ServiceDeclaration dataBindingDeclaration : dataBindingDeclarations) {
- Map<String, String> attributes = dataBindingDeclaration.getAttributes();
- String name = attributes.get("name");
-
- // Create a data binding wrapper and register it
- DataBinding dataBinding = new LazyDataBinding(name, dataBindingDeclaration);
- addDataBinding(dataBinding);
- }
-
- loadedDataBindings = true;
- }
-
- /**
- * A data binding facade allowing data bindings to be lazily loaded and
- * initialized.
- */
- private static class LazyDataBinding implements DataBinding {
-
- private String name;
- private ServiceDeclaration dataBindingDeclaration;
- private DataBinding dataBinding;
-
- private LazyDataBinding(String type, ServiceDeclaration dataBindingDeclaration) {
- this.name = type;
- this.dataBindingDeclaration = dataBindingDeclaration;
- }
-
- /**
- * Load and instantiate the data binding class.
- *
- * @return The data binding.
- */
- @SuppressWarnings("unchecked")
- private DataBinding getDataBinding() {
- if (dataBinding == null) {
- try {
- Class<DataBinding> dataBindingClass = (Class<DataBinding>)dataBindingDeclaration.loadClass();
- Constructor<DataBinding> constructor = dataBindingClass.getConstructor();
- dataBinding = constructor.newInstance();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return dataBinding;
- }
-
- public Object copy(Object object, DataType dataType, Operation operation) {
- return getDataBinding().copy(object, dataType, operation);
- }
-
- public String getName() {
- return name;
- }
-
- public XMLTypeHelper getXMLTypeHelper() {
- return getDataBinding().getXMLTypeHelper();
- }
-
- public WrapperHandler getWrapperHandler() {
- return getDataBinding().getWrapperHandler();
- }
-
- public boolean introspect(DataType dataType, Operation operation) {
- return getDataBinding().introspect(dataType, operation);
- }
-
- public DataType introspect(Object value, Operation operation) {
- return getDataBinding().introspect(value, operation);
- }
- }
-
- //FIXME The following methods should not be on the extension point
- // they should be on a separate class
- public boolean introspectType(DataType dataType, Operation operation) {
- loadDataBindings();
- for (DataBinding binding : databindings) {
- // don't introspect for JavaBeansDatabinding as all javatypes will
- // anyways match to its basetype
- // which is java.lang.Object. Default to this only if no databinding
- // results
- if (!binding.getName().equals(JavaBeansDataBinding.NAME)) {
- if (binding.introspect(dataType, operation)) {
- return true;
- }
- }
- }
- // FIXME: Should we honor the databinding from operation/interface
- // level?
- Class<?> physical = dataType.getPhysical();
- if (physical == Object.class) {
- dataType.setDataBinding(JavaBeansDataBinding.NAME);
- return false;
- }
- if (dataType.getPhysical().isArray()) {
- introspectArray(dataType, operation);
- return true;
- } else if (Throwable.class.isAssignableFrom(physical)) {
- dataType.setDataBinding(JavaExceptionDataBinding.NAME);
- return true;
- } else {
- dataType.setDataBinding(JavaBeansDataBinding.NAME);
- return false;
- }
- }
-
- private boolean introspectArray(DataType dataType, Operation operation) {
- Class<?> physical = dataType.getPhysical();
- if (!physical.isArray() || physical == byte[].class) {
- return false;
- }
- Class<?> componentType = physical.getComponentType();
- DataType logical = new DataTypeImpl(componentType, dataType.getLogical());
- introspectType(logical, operation);
- dataType.setDataBinding("java:array");
- dataType.setLogical(logical);
- return true;
- }
-
- public DataType introspectType(Object value, Operation operation) {
- loadDataBindings();
- DataType dataType = null;
- for (DataBinding binding : databindings) {
- // don't introspect for JavaBeansDatabinding as all javatypes will
- // anyways match to its basetype
- // which is java.lang.Object. Default to this only if no databinding
- // results
- if (!binding.getName().equals(JavaBeansDataBinding.NAME)) {
- dataType = binding.introspect(value, operation);
- }
- if (dataType != null) {
- return dataType;
- }
- }
- return new DataTypeImpl<XMLType>(JavaBeansDataBinding.NAME, value.getClass(), XMLType.UNKNOWN);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultTransformerExtensionPoint.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultTransformerExtensionPoint.java
deleted file mode 100644
index 3bd729b472..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultTransformerExtensionPoint.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.databinding.impl.DirectedGraph;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DefaultTransformerExtensionPoint implements TransformerExtensionPoint {
- private static final Logger logger = Logger.getLogger(DefaultTransformerExtensionPoint.class.getName());
- private boolean loadedTransformers;
-
- private final DirectedGraph<Object, Transformer> graph = new DirectedGraph<Object, Transformer>();
-
- public DefaultTransformerExtensionPoint() {
- }
-
- public void addTransformer(String sourceType, String resultType, int weight, Transformer transformer, boolean publicTransformer) {
- if (logger.isLoggable(Level.FINE)) {
- String className = transformer.getClass().getName();
- boolean lazy = false;
- boolean pull = (transformer instanceof PullTransformer);
- if (transformer instanceof LazyPullTransformer) {
- className = ((LazyPullTransformer)transformer).transformerDeclaration.getClassName();
- lazy = true;
- }
- if (transformer instanceof LazyPushTransformer) {
- className = ((LazyPushTransformer)transformer).transformerDeclaration.getClassName();
- lazy = true;
- }
-
- logger.fine("Adding transformer: " + className
- + ";source="
- + sourceType
- + ",target="
- + resultType
- + ",weight="
- + weight
- + ",type="
- + (pull ? "pull" : "push")
- + ",lazy="
- + lazy);
- }
- graph.addEdge(sourceType, resultType, transformer, weight, publicTransformer);
- }
-
- public void addTransformer(Transformer transformer, boolean publicTransformer) {
- addTransformer(transformer.getSourceDataBinding(),
- transformer.getTargetDataBinding(),
- transformer.getWeight(),
- transformer, publicTransformer);
- }
-
- public boolean removeTransformer(String sourceType, String resultType) {
- return graph.removeEdge(sourceType, resultType);
- }
-
- public Transformer getTransformer(String sourceType, String resultType) {
- loadTransformers();
-
- DirectedGraph<Object, Transformer>.Edge edge = graph.getEdge(sourceType, resultType);
- return (edge == null) ? null : edge.getValue();
- }
-
- /**
- * Dynamically load transformers registered under META-INF/services.
- *
- */
- private synchronized void loadTransformers() {
- if (loadedTransformers) {
- return;
- }
- loadedTransformers = true;
- loadTransformers(PullTransformer.class);
- loadTransformers(PushTransformer.class);
-
- }
-
- /**
- * Dynamically load transformers registered under META-INF/services.
- *
- * @param transformerClass
- */
- private void loadTransformers(Class<?> transformerClass) {
-
- // Get the transformer service declarations
- Set<ServiceDeclaration> transformerDeclarations;
-
- try {
- transformerDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(transformerClass.getName());
-
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
-
- // Load transformers
- for (ServiceDeclaration transformerDeclaration : transformerDeclarations) {
- Map<String, String> attributes = transformerDeclaration.getAttributes();
-
- String source = attributes.get("source");
- String target = attributes.get("target");
- int weight = Integer.valueOf(attributes.get("weight"));
- String b = attributes.get("public");
- boolean pub = true;
- if (b != null) {
- pub = Boolean.valueOf(b);
- }
-
- // Create a transformer wrapper and register it
- Transformer transformer;
- if (transformerClass == PullTransformer.class) {
- transformer = new LazyPullTransformer(source, target, weight, transformerDeclaration);
- } else {
- transformer = new LazyPushTransformer(source, target, weight, transformerDeclaration);
- }
- addTransformer(transformer, pub);
- }
- }
-
- /**
- * A transformer facade allowing transformers to be lazily loaded
- * and initialized.
- */
- private static class LazyPullTransformer implements PullTransformer<Object, Object> {
-
- private String source;
- private String target;
- private int weight;
- private ServiceDeclaration transformerDeclaration;
- private PullTransformer<Object, Object> transformer;
-
- public LazyPullTransformer(String source, String target, int weight, ServiceDeclaration transformerDeclaration) {
- this.source = source;
- this.target = target;
- this.weight = weight;
- this.transformerDeclaration = transformerDeclaration;
- }
-
- /**
- * Load and instantiate the transformer class.
- *
- * @return The transformer.
- */
- @SuppressWarnings("unchecked")
- private PullTransformer<Object, Object> getTransformer() {
- if (transformer == null) {
- try {
- Class<PullTransformer<Object, Object>> transformerClass =
- (Class<PullTransformer<Object, Object>>)transformerDeclaration.loadClass();
- Constructor<PullTransformer<Object, Object>> constructor = transformerClass.getConstructor();
- transformer = constructor.newInstance();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return transformer;
- }
-
- public String getSourceDataBinding() {
- return source;
- }
-
- public String getTargetDataBinding() {
- return target;
- }
-
- public int getWeight() {
- return weight;
- }
-
- public Object transform(Object source, TransformationContext context) {
- return getTransformer().transform(source, context);
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer(super.toString());
- sb.append(";className=").append(transformerDeclaration.getClassName());
- return sb.toString();
- }
- }
-
- /**
- * A transformer facade allowing transformers to be lazily loaded
- * and initialized.
- */
- private static class LazyPushTransformer implements PushTransformer<Object, Object> {
-
- private String source;
- private String target;
- private int weight;
- private ServiceDeclaration transformerDeclaration;
- private PushTransformer<Object, Object> transformer;
-
- public LazyPushTransformer(String source, String target, int weight, ServiceDeclaration transformerDeclaration) {
- this.source = source;
- this.target = target;
- this.weight = weight;
- this.transformerDeclaration = transformerDeclaration;
- }
-
- /**
- * Load and instantiate the transformer class.
- *
- * @return The transformer.
- */
- @SuppressWarnings("unchecked")
- private PushTransformer<Object, Object> getTransformer() {
- if (transformer == null) {
- try {
- Class<PushTransformer<Object, Object>> transformerClass =
- (Class<PushTransformer<Object, Object>>)transformerDeclaration.loadClass();
- Constructor<PushTransformer<Object, Object>> constructor = transformerClass.getConstructor();
- transformer = constructor.newInstance();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return transformer;
- }
-
- public String getSourceDataBinding() {
- return source;
- }
-
- public String getTargetDataBinding() {
- return target;
- }
-
- public int getWeight() {
- return weight;
- }
-
- public void transform(Object source, Object sink, TransformationContext context) {
- getTransformer().transform(source, sink, context);
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer(super.toString());
- sb.append(";className=").append(transformerDeclaration.getClassName());
- return sb.toString();
- }
- }
-
- //FIXME The following methods should be on a different class from
- // extension point
-
- public List<Transformer> getTransformerChain(String sourceType, String resultType) {
- loadTransformers();
-
- String source = sourceType;
- String result = resultType;
- List<Transformer> transformers = new ArrayList<Transformer>();
- // First check if there is a direct path, if yes, use it regardless of the weight
- DirectedGraph<Object, Transformer>.Edge link = graph.getEdge(sourceType, resultType);
- if (link != null) {
- transformers.add(link.getValue());
- } else {
- DirectedGraph<Object, Transformer>.Path path = graph.getShortestPath(source, result);
- if (path == null) {
- return null;
- }
- for (DirectedGraph<Object, Transformer>.Edge edge : path.getEdges()) {
- transformers.add(edge.getValue());
- }
- }
- return transformers;
- }
-
- @Override
- public String toString() {
- loadTransformers();
-
- return graph.toString();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Mediator.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Mediator.java
deleted file mode 100644
index 6b8acfc7b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Mediator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-import java.util.Map;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-
-/**
- * This interface will be used as a Tuscany system service to perform data mediations
- *
- * Mediate the data from one type to the other one
- *
- * @version $Rev$ $Date$
- */
-public interface Mediator {
-
- /**
- * Mediate the data from the source type to the target type
- * @param source The data to be mediated
- * @param sourceDataType Data type for the source data
- * @param targetDataType Data type for the target data
- * @param context
- * @return
- */
- Object mediate(Object source, DataType sourceDataType, DataType targetDataType, Map<String, Object> context);
- /**
- * Mediate the source data into the target which is a sink to receive the data
- * @param source The data to be mediated
- * @param target The sink to receive data
- * @param sourceDataType Data type for the source data
- * @param targetDataType Data type for the target data
- */
- void mediate(
- Object source,
- Object target,
- DataType sourceDataType,
- DataType targetDataType,
- Map<String, Object> context);
-
- /**
- * Get the DataBindings used by this mediator.
- * @return
- */
- DataBindingExtensionPoint getDataBindings();
-
- /**
- * Get the Transformers used by this mediator.
- * @return
- */
- TransformerExtensionPoint getTransformers();
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PullTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PullTransformer.java
deleted file mode 100644
index 81264923eb..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PullTransformer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-/**
- * PullTransformer transforms data from one binding format to the other one which can be directly consumed
- *
- * @param <S> The source data type
- * @param <R> the target data type
- *
- * @version $Rev$ $Date$
- */
-public interface PullTransformer<S, R> extends Transformer {
- /**
- * Transform source data into the result type.
- *
- * @param source The source data
- * @param context The context for the transformation
- * @return The transformed result
- */
- R transform(S source, TransformationContext context);
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PushTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PushTransformer.java
deleted file mode 100644
index 600a6477f6..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PushTransformer.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-/**
- * A transformer that pushes data from its source into the sink
- *
- * @param <S>
- * @param <R>
- *
- * @version $Rev$ $Date$
- */
-public interface PushTransformer<S, R> extends Transformer {
- /**
- * @param source The source data
- * @param sink The sink to receive the data
- * @param context
- */
- void transform(S source, R sink, TransformationContext context);
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/SimpleTypeMapper.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/SimpleTypeMapper.java
deleted file mode 100644
index 4e6d130aa9..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/SimpleTypeMapper.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding;
-
-import javax.xml.namespace.QName;
-
-/**
- * Type Mapper between XML schema simple data types and java objects
- *
- * @version $Rev$ $Date$
- */
-public interface SimpleTypeMapper {
- /**
- * Parse the XML lexical representation into a java object
- * @param simpleType The XSD simple type
- * @param value the XML lexical representation
- * @param context The context of the transformation
- * @return A java object for the XML value
- */
- Object toJavaObject(QName simpleType, String value, TransformationContext context);
- /**
- * Create the XML lexical representation for a java object
- * @param simpleType The XSD simple type
- * @param obj The java object
- * @param context The context of the transformation
- * @return The XML lexical representation
- */
- String toXMLLiteral(QName simpleType, Object obj, TransformationContext context);
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationContext.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationContext.java
deleted file mode 100644
index 9ffadd1eae..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationContext.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-import java.util.Map;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * Context for data transformation
- *
- * @version $Rev$ $Date$
- */
-public interface TransformationContext {
-
- /**
- * @return
- */
- Operation getSourceOperation();
-
- /**
- * @param sourceOperation
- */
- void setSourceOperation(Operation sourceOperation);
-
- /**
- * @return
- */
- Operation getTargetOperation();
-
- /**
- * @param targetOperation
- */
- void setTargetOperation(Operation targetOperation);
-
- /**
- * Get the source data type
- *
- * @return
- */
- DataType getSourceDataType();
-
- /**
- * Get the target data type
- *
- * @return
- */
- DataType getTargetDataType();
-
- /**
- * Set the source data type
- *
- * @param sourceDataType
- */
- void setSourceDataType(DataType sourceDataType);
-
- /**
- * Set the target data type
- *
- * @param targetDataType
- */
- void setTargetDataType(DataType targetDataType);
-
- /**
- * Get the ClassLoader
- *
- * @return Returns the ClassLoader
- */
- ClassLoader getClassLoader();
-
- /**
- * Get a map of metadata
- *
- * @return Returns a map of the metadata
- */
- Map<String, Object> getMetadata();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationException.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationException.java
deleted file mode 100644
index 4f949f7dff..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-
-/**
- * Reports problems during data transformation
- *
- * @version $Rev$ $Date$
- */
-public class TransformationException extends RuntimeException {
-
- private static final long serialVersionUID = 7662385613693006428L;
- private String sourceDataBinding;
- private String targetDataBinding;
-
- public TransformationException() {
- super();
- }
-
- public TransformationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public TransformationException(String message) {
- super(message);
- }
-
- public TransformationException(Throwable cause) {
- super(cause);
- }
-
- public String getSourceDataBinding() {
- return sourceDataBinding;
- }
-
- public void setSourceDataBinding(String sourceDataBinding) {
- this.sourceDataBinding = sourceDataBinding;
- }
-
- public String getTargetDataBinding() {
- return targetDataBinding;
- }
-
- public void setTargetDataBinding(String targetDataBinding) {
- this.targetDataBinding = targetDataBinding;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Transformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Transformer.java
deleted file mode 100644
index 2aa0ad7c15..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Transformer.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-/**
- * A transformer provides the data transformation from source type to target type. The cost of the transformation is
- * modelled as weight.
- *
- * @version $Rev$ $Date$
- */
-public interface Transformer {
- /**
- * Get the source type that this transformer transforms data from. The type is used as the key when the transformer
- * is registered with TransformerRegistry.
- *
- * @return A key identifying the source type
- */
- String getSourceDataBinding();
-
- /**
- * Get the target type that this transformer transforms data into. The type is used as the key when the transformer
- * is registered with TransformerRegistry.
- *
- * @return A key identifying the target type
- */
- String getTargetDataBinding();
-
- /**
- * Get the cost of the transformation. The weight can be used to choose the most efficient path if there are more
- * than one available from the source to the target.
- *
- * @return An integer representing the cost of the transformation
- */
- int getWeight();
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformerExtensionPoint.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformerExtensionPoint.java
deleted file mode 100644
index ee7efe4860..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformerExtensionPoint.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding;
-
-import java.util.List;
-
-/**
- * An extension point for data transformer extensions.
- *
- * @version $Rev$ $Date$
- */
-public interface TransformerExtensionPoint {
-
- /**
- * Register a transformer
- *
- * @param sourceDataBinding
- * @param targetDataBinding
- * @param weight
- * @param transformer
- * @param publicTransformer TODO
- */
- void addTransformer(String sourceDataBinding,
- String targetDataBinding,
- int weight,
- Transformer transformer,
- boolean publicTransformer);
-
- /**
- * Register a transformer
- *
- * @param transformer
- * @param publicTransformer TODO
- */
- void addTransformer(Transformer transformer, boolean publicTransformer);
-
- /**
- * Unregister a transformer
- *
- * @param sourceDataBinding
- * @param targetDataBinding
- * @return
- */
- boolean removeTransformer(String sourceDataBinding, String targetDataBinding);
-
- /**
- * Get the direct Transformer which can transform data from source type to
- * result type
- *
- * @param sourceDataBinding
- * @param targetDataBinding
- * @return
- */
- Transformer getTransformer(String sourceDataBinding, String targetDataBinding);
-
- /**
- * Get the a chain of Transformers which can transform data from source type
- * to result type
- *
- * @param sourceDataBinding
- * @param targetDataBinding
- * @return
- */
- List<Transformer> getTransformerChain(String sourceDataBinding, String targetDataBinding);
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/WrapperHandler.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/WrapperHandler.java
deleted file mode 100644
index ee4e35555c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/WrapperHandler.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * A contract for transformers to deal with wrapping/unwrapping for WSDL wrapper style operations
- *
- * @version $Rev$ $Date$
- */
-public interface WrapperHandler<T> {
- /**
- * Create a wrapper element
- * @param operation The operation
- * @param input Is it for input or output
- * @return An object representing the wrapper element
- */
- T create(Operation operation, boolean input);
-
- /**
- * Get the data type for the wrapper
- * @param operation The operation
- * @param input Is it for input or output?
- * @return The data type of the wrapper, null if it's not a wrapper type
- */
- DataType getWrapperType(Operation operation, boolean input);
-
- /**
- * Check if the given data is an instance of the wrapper
- * @param wrapper
- * @param operation The operation
- * @param input Input or output
- * @return
- */
- boolean isInstance(Object wrapper, Operation operation, boolean input);
-
- /**
- * Populate the wrapper element with the child objects
- * @param wrapper The wrapper object
- * @param childObjects The child objects
- * @param operation The operation
- * @param input Is it for input or output
- */
- void setChildren(T wrapper,
- Object[] childObjects,
- Operation operation,
- boolean input);
-
- /**
- * Get a list of child elements from the wrapper
- * @param wrapper The wrapper object
- * @param operation The operation
- * @param input Is it for input or output
- * @return child elements under the wrapper
- */
- List getChildren(T wrapper, Operation operation, boolean input);
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/XMLTypeHelper.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/XMLTypeHelper.java
deleted file mode 100644
index e940f8675f..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/XMLTypeHelper.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-
-/**
- * XML and schema helper for Java types
- */
-public interface XMLTypeHelper {
-
- // FIXME: This method seems to require the XMLHelper instance to be stateful
- /**
- * Convert a Java type into XML type information
- * @param javaType the physical Java class
- * @param logical the logical type information
- * @return the XML type information
- */
- TypeInfo getTypeInfo(Class javaType, Object logical);
-
- /**
- * Get schema definitions for the Java types known to this helper
- * @return A list of schema definitions
- */
- // List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver);
-
- /**
- * Get a list of XML schemas for the given data types
- * @param factory
- * @param resolver
- * @param dataTypes
- * @return
- */
- List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver, List<DataType> dataTypes);
- /**
- * Get a list of XML schemas for the given interface
- * @param factory
- * @param resolver
- * @param intf
- * @return
- */
- List<XSDefinition> getSchemaDefinitions(XSDFactory factory, ModelResolver resolver, Interface intf);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataBinding.java
deleted file mode 100644
index 4405077e29..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataBinding.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.annotation;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Used to demarcate the mapping style for an interface or operation
- *
- * @version $Rev$ $Date$
- */
-// FIXME: [rfeng] We should consider to use javax.jws.soap.SOAPBinding
-@Target({TYPE, METHOD})
-@Retention(RUNTIME)
-public @interface DataBinding {
-
- /**
- * Indicate the effective databinding that controls the WSDL/Java mapping of the
- * interface/operation
- *
- * @return the data binding with the MIME media type syntax
- */
- String value();
-
- /**
- * Indicate if the operation is mapped using WRAPPED or BARE style. Originated from
- * javax.jws.soap.SOAPBinding.ParameterStyle: Determines whether method parameters
- * represent the entire message body, or whether the parameters are elements wrapped
- * inside a top-level element named after the operation
- *
- * @return true if the parameter style is WRAPPED, false if BARE
- */
- boolean wrapped() default false;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataType.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataType.java
deleted file mode 100644
index 650e909c61..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataType.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.annotation;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Used to demarcate expected data types for parameters and return type
- *
- * @version $Rev$ $Date$
- */
-@Target( {METHOD, PARAMETER})
-@Retention(RUNTIME)
-public @interface DataType {
-
- /**
- * Returns the data binding configuration in MIME media type syntax
- * @return the data binding
- */
- String value();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/externalizable/ExternalizableDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/externalizable/ExternalizableDataBinding.java
deleted file mode 100644
index 6f3456fdf0..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/externalizable/ExternalizableDataBinding.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseDataBinding.java
deleted file mode 100644
index cb9f2969e2..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseDataBinding.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-
-import org.apache.tuscany.sca.databinding.DataBinding;
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.databinding.XMLTypeHelper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * Base Implementation of DataBinding
- *
- * @version $Rev$ $Date$
- */
-public abstract class BaseDataBinding implements DataBinding {
-
- private Class<?> baseType;
-
- private String name;
-
- /**
- * Create a databinding with the base java type whose name will be used as
- * the name of the databinding
- *
- * @param baseType The base java class or interface representing the
- * databinding, for example, org.w3c.dom.Node
- */
- protected BaseDataBinding(Class<?> baseType) {
- this(baseType.getName(), baseType);
- }
-
- /**
- * Create a databinding with the name and base java type
- *
- * @param name The name of the databinding
- * @param baseType The base java class or interface representing the
- * databinding, for example, org.w3c.dom.Node
- */
- protected BaseDataBinding(String name, Class<?> baseType) {
- this.name = name;
- this.baseType = baseType;
- }
-
- @SuppressWarnings("unchecked")
- public boolean introspect(DataType type, Operation operation) {
- assert type != null;
- Class cls = type.getPhysical();
- if (baseType != null && baseType.isAssignableFrom(cls)) {
- type.setDataBinding(getName());
- if (type.getLogical() == null) {
- type.setLogical(XMLType.UNKNOWN);
- }
- return true;
- }
- return false;
- }
-
- public DataType introspect(Object value, Operation operation) {
- if (value == null) {
- return null;
- } else {
- DataType<Class> dataType = new DataTypeImpl<Class>(value.getClass(), value.getClass());
- if (introspect(dataType, (Operation) null)) {
- return dataType;
- } else {
- return null;
- }
- }
- }
-
- public final String getName() {
- return name;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.DataBinding#getWrapperHandler()
- */
- public WrapperHandler getWrapperHandler() {
- return null;
- }
-
- public Object copy(Object object, DataType dataType, Operation operation) {
- return object;
- }
-
- public XMLTypeHelper getXMLTypeHelper() {
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseTransformer.java
deleted file mode 100644
index 94a2cdb0bb..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseTransformer.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import org.apache.tuscany.sca.databinding.Transformer;
-
-/**
- * Base Implementation of Transformer which provides the registration to the
- * transformer registry
- *
- * @version $Rev$ $Date$
- */
-public abstract class BaseTransformer<S, T> implements Transformer {
-
- protected BaseTransformer() {
- super();
- }
-
- protected abstract Class<S> getSourceType();
-
- protected abstract Class<T> getTargetType();
-
- public String getSourceDataBinding() {
- return getSourceType().getName();
- }
-
- public String getTargetDataBinding() {
- return getTargetType().getName();
- }
-
- public int getWeight() {
- // default to 50
- return 50;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DOMHelper.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DOMHelper.java
deleted file mode 100644
index 64b3d22c10..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DOMHelper.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Helper for DOM
- *
- * @version $Rev$ $Date$
- */
-public final class DOMHelper {
- private static DocumentBuilderFactory FACTORY;
-
- private DOMHelper() {
- }
-
- public static Document newDocument() throws ParserConfigurationException {
- return newDocumentBuilder().newDocument();
- }
-
- public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException {
- init();
- return FACTORY.newDocumentBuilder();
- }
-
- /**
- *
- */
- private static synchronized void init() {
- if (FACTORY == null) {
- FACTORY = DocumentBuilderFactory.newInstance();
- FACTORY.setNamespaceAware(true);
- }
- }
-
- public static QName getQName(Node node) {
- String ns = node.getNamespaceURI();
- if (ns == null) {
- ns = "";
- }
- // node.getLocalName() will return null if it is created using DOM Level
- // 1 method
- // such as createElement()
- return new QName(ns, node.getNodeName());
- }
-
- public static Element createElement(Document document, QName name) {
- String prefix = name.getPrefix();
- String qname =
- (prefix != null && prefix.length() > 0) ? prefix + ":" + name.getLocalPart() : name.getLocalPart();
- return document.createElementNS(name.getNamespaceURI(), qname);
- }
-
- /**
- * Wrap an element as a DOM document
- * @param node
- * @return
- */
- public static Document promote(Node node) {
- if (node instanceof Document) {
- return (Document)node;
- }
- Element element = (Element)node;
- Document doc = element.getOwnerDocument();
- if (doc.getDocumentElement() == element) {
- return doc;
- }
- doc = (Document)element.getOwnerDocument().cloneNode(false);
- Element schema = (Element)doc.importNode(element, true);
- doc.appendChild(schema);
- Node parent = element.getParentNode();
- while (parent instanceof Element) {
- Element root = (Element)parent;
- NamedNodeMap nodeMap = root.getAttributes();
- for (int i = 0; i < nodeMap.getLength(); i++) {
- Attr attr = (Attr)nodeMap.item(i);
- String name = attr.getName();
- if ("xmlns".equals(name) || name.startsWith("xmlns:")) {
- if (schema.getAttributeNode(name) == null) {
- schema.setAttributeNodeNS((Attr)doc.importNode(attr, true));
- }
- }
- }
- parent = parent.getParentNode();
- }
- return doc;
- }
-
- /**
- * @param context
- * @param element
- */
- public static Element adjustElementName(TransformationContext context, Element element) {
- if (context != null) {
- DataType dataType = context.getTargetDataType();
- Object logical = dataType == null ? null : dataType.getLogical();
- if (!(logical instanceof XMLType)) {
- return element;
- }
- XMLType xmlType = (XMLType)logical;
- QName name = new QName(element.getNamespaceURI(), element.getLocalName());
- if (xmlType.isElement() && !xmlType.getElementName().equals(name)) {
- QName newName = xmlType.getElementName();
- String prefix = newName.getPrefix();
- String qname = newName.getLocalPart();
- if (prefix != null && !prefix.equals("")) {
- qname = prefix + ":" + qname;
- }
- Document doc = element.getOwnerDocument();
- Element newElement = doc.createElementNS(newName.getNamespaceURI(), qname);
- // Copy the attributes to the new element
- NamedNodeMap attrs = element.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Attr attr = (Attr)doc.importNode(attrs.item(i), true);
- newElement.getAttributes().setNamedItem(attr);
- }
-
- // Move all the children
- while (element.hasChildNodes()) {
- newElement.appendChild(element.getFirstChild());
- }
-
- // Replace the old node with the new node
- if (element.getParentNode() != null) {
- element.getParentNode().replaceChild(newElement, element);
- }
-
- return newElement;
- }
- }
- return element;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DirectedGraph.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DirectedGraph.java
deleted file mode 100644
index 01916dfb96..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DirectedGraph.java
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Directed, weighted graph
- *
- * @param <V> The type of vertex object
- * @param <E> The type of edge object
- *
- * @version $Rev$ $Date$
- */
-public class DirectedGraph<V, E> implements Cloneable {
- private final Map<V, Vertex> vertices = new HashMap<V, Vertex>();
-
- /**
- * Key for the shortest path cache
- */
- private final class VertexPair {
- private Vertex source;
-
- private Vertex target;
-
- /**
- * @param source
- * @param target
- */
- private VertexPair(Vertex source, Vertex target) {
- super();
- this.source = source;
- this.target = target;
- }
-
- @Override
- public boolean equals(Object object) {
- if (!VertexPair.class.isInstance(object)) {
- return false;
- }
- VertexPair pair = (VertexPair)object;
- return source == pair.source && target == pair.target;
- }
-
- @Override
- public int hashCode() {
- int x = source == null ? 0 : source.hashCode();
- int y = target == null ? 0 : target.hashCode();
- return x ^ y;
- }
-
- }
-
- // Fix for TUSCANY-2069, making the map concurrent
- private final Map<VertexPair, Path> paths = new ConcurrentHashMap<VertexPair, Path>();
- private final Path NULL_PATH = new Path();
-
- /**
- * Vertex of a graph
- */
- public final class Vertex {
- private V value;
-
- // TODO: Do we want to support multiple edges for a vertex pair? If so,
- // we should use a List instead of Map
- private Map<Vertex, Edge> outEdges = new HashMap<Vertex, Edge>();
- private Map<Vertex, Edge> inEdges = new HashMap<Vertex, Edge>();
-
- private Vertex(V value) {
- this.value = value;
- }
-
- @Override
- public String toString() {
- return "(" + value + ")";
- }
-
- public V getValue() {
- return value;
- }
-
- public Map<Vertex, Edge> getOutEdges() {
- return outEdges;
- }
-
- public Map<Vertex, Edge> getInEdges() {
- return inEdges;
- }
-
- }
-
- /**
- * An Edge connects two vertices in one direction
- */
- public final class Edge {
- private Vertex sourceVertex;
-
- private Vertex targetVertex;
-
- private E value;
-
- private int weight;
-
- private boolean pub = true;
-
- public Edge(Vertex source, Vertex target, E value, int weight, boolean pub) {
- this.sourceVertex = source;
- this.targetVertex = target;
- this.value = value;
- this.weight = weight;
- this.pub = pub;
- }
-
- @Override
- public String toString() {
- return sourceVertex + "->" + targetVertex + "[" + value + "," + weight + "]";
- }
-
- public E getValue() {
- return value;
- }
-
- public void setValue(E value) {
- this.value = value;
- }
-
- public Vertex getTargetVertex() {
- return targetVertex;
- }
-
- public void setTargetVertex(Vertex vertex) {
- this.targetVertex = vertex;
- }
-
- public int getWeight() {
- return weight;
- }
-
- public void setWeight(int weight) {
- this.weight = weight;
- }
-
- public Vertex getSourceVertex() {
- return sourceVertex;
- }
-
- public void setSourceVertex(Vertex sourceVertex) {
- this.sourceVertex = sourceVertex;
- }
-
- public boolean isPublic() {
- return pub;
- }
-
- public void setPublic(boolean pub) {
- this.pub = pub;
- }
- }
-
- private final class Node implements Comparable<Node> {
-
- private long distance = Integer.MAX_VALUE;
-
- private Node previous; // NOPMD by rfeng on 9/26/06 9:17 PM
-
- private Vertex vertex; // NOPMD by rfeng on 9/26/06 9:17 PM
-
- private Node(Vertex vertex) {
- this.vertex = vertex;
- }
-
- public int compareTo(Node o) {
- return (distance > o.distance) ? 1 : ((distance == o.distance) ? 0 : -1);
- }
- }
-
- public void addEdge(V source, V target, E edgeValue, int weight, boolean publicEdge) {
- Vertex s = getVertex(source);
- if (s == null) {
- s = new Vertex(source);
- vertices.put(source, s);
- }
- Vertex t = getVertex(target);
- if (t == null) {
- t = new Vertex(target);
- vertices.put(target, t);
- }
- Edge edge = new Edge(s, t, edgeValue, weight, publicEdge);
- s.outEdges.put(t, edge);
- t.inEdges.put(s, edge);
- }
-
- public void addEdge(V soure, V target) {
- addEdge(soure, target, null, 0, true);
- }
-
- public Vertex getVertex(V source) {
- Vertex s = vertices.get(source);
- return s;
- }
-
- public boolean removeEdge(V source, V target) {
- Vertex s = getVertex(source);
- if (s == null) {
- return false;
- }
-
- Vertex t = getVertex(target);
- if (t == null) {
- return false;
- }
-
- return s.outEdges.remove(t) != null && t.inEdges.remove(s) != null;
-
- }
-
- public void removeEdge(Edge edge) {
- edge.sourceVertex.outEdges.remove(edge.targetVertex);
- edge.targetVertex.inEdges.remove(edge.sourceVertex);
- }
-
- public void removeVertex(Vertex vertex) {
- vertices.remove(vertex.getValue());
- for (Edge e : new ArrayList<Edge>(vertex.outEdges.values())) {
- removeEdge(e);
- }
- for (Edge e : new ArrayList<Edge>(vertex.inEdges.values())) {
- removeEdge(e);
- }
- }
-
- public Edge getEdge(Vertex source, Vertex target) {
- return source.outEdges.get(target);
- }
-
- public Edge getEdge(V source, V target) {
- Vertex sv = getVertex(source);
- if (sv == null) {
- return null;
- }
- Vertex tv = getVertex(target);
- if (tv == null) {
- return null;
- }
- return getEdge(getVertex(source), getVertex(target));
- }
-
- /**
- * Get the shortest path from the source vertex to the target vertex using
- * Dijkstra's algorithm. If there's no path, null will be returned. If the
- * source is the same as the target, it returns a path with empty edges with
- * weight 0.
- *
- * @param sourceValue The value identifies the source
- * @param targetValue The value identifies the target
- * @return The shortest path
- */
- public Path getShortestPath(V sourceValue, V targetValue) {
- Vertex source = getVertex(sourceValue);
- if (source == null) {
- return null;
- }
- Vertex target = getVertex(targetValue);
- if (target == null) {
- return null;
- }
-
- VertexPair pair = new VertexPair(source, target);
- Path path = null;
- if (paths.containsKey(pair)) {
- path = paths.get(pair);
- return path == NULL_PATH? null: path;
- }
-
- // Check if there is a direct link, if yes, use it instead
- Edge direct = getEdge(source, target);
- path = new Path();
- if (direct != null) {
- path.addEdge(direct);
- paths.put(pair, path);
- return path;
- }
-
- Map<Vertex, Node> nodes = new HashMap<Vertex, Node>();
- for (Vertex v : vertices.values()) {
- Node node = new Node(v);
- if (v == source) {
- node.distance = 0;
- }
- nodes.put(v, node);
- }
-
- Set<Node> otherNodes = new HashSet<Node>(nodes.values());
- Set<Node> nodesOnPath = new HashSet<Node>();
- Node nextNode = null;
- while (!otherNodes.isEmpty()) {
- nextNode = extractMin(otherNodes);
- if (nextNode.vertex == target) {
- path = getPath(nextNode);
- paths.put(pair, path); // Cache it
- return path == NULL_PATH? null: path;
- }
- nodesOnPath.add(nextNode);
- for (Edge edge : nextNode.vertex.outEdges.values()) {
- Node adjacentNode = nodes.get(edge.targetVertex);
- // The private edge can only be used if the edge connects to the target directly
- if (edge.isPublic() || edge.getTargetVertex() == target) {
- if (nextNode.distance + edge.weight < adjacentNode.distance) {
- adjacentNode.distance = nextNode.distance + edge.weight;
- adjacentNode.previous = nextNode;
- }
- }
- }
- }
- paths.put(pair, NULL_PATH); // Cache it
- return null;
- }
-
- /**
- * Searches for the vertex u in the vertex set Q that has the least d[u]
- * value. That vertex is removed from the set Q and returned to the user.
- *
- * @param nodes
- * @return
- */
- private Node extractMin(Set<Node> nodes) {
- Node node = Collections.min(nodes);
- nodes.remove(node);
- return node;
- }
-
- /**
- * The path between two vertices
- */
- public final class Path {
- private List<Edge> edges = new LinkedList<Edge>();
-
- private int weight;
-
- public int getWeight() {
- return weight;
- }
-
- public List<Edge> getEdges() {
- return edges;
- }
-
- public void addEdge(Edge edge) {
- edges.add(0, edge);
- weight += edge.weight;
- }
-
- @Override
- public String toString() {
- return edges + ", " + weight;
- }
- }
-
- private Path getPath(Node t) {
- if (t.distance == Integer.MAX_VALUE) {
- return NULL_PATH;
- }
- Path path = new Path();
- Node u = t;
- while (u.previous != null) {
- Edge edge = getEdge(u.previous.vertex, u.vertex);
- path.addEdge(edge);
- u = u.previous;
- }
- return path;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- for (Vertex v : vertices.values()) {
- sb.append(v.outEdges.values()).append("\n");
- }
- return sb.toString();
- }
-
- public Map<V, Vertex> getVertices() {
- return vertices;
- }
-
- public void addGraph(DirectedGraph<V, E> otherGraph) {
- for (Vertex v : otherGraph.vertices.values()) {
- for (Edge e : v.outEdges.values()) {
- addEdge(e.sourceVertex.value, e.targetVertex.value, e.value, e.weight, true);
- }
- }
- }
-
- private Vertex getFirst() {
- for (Vertex v : vertices.values()) {
- if (v.inEdges.isEmpty()) {
- return v;
- }
- }
- if (!vertices.isEmpty()) {
- throw new IllegalArgumentException("Circular ordering has been detected: " + toString());
- } else {
- return null;
- }
- }
-
- public List<V> topologicalSort(boolean readOnly) {
- DirectedGraph<V, E> graph = (!readOnly) ? this : (DirectedGraph<V, E>)clone();
- List<V> list = new ArrayList<V>();
- while (true) {
- Vertex v = graph.getFirst();
- if (v == null) {
- break;
- }
- list.add(v.getValue());
- graph.removeVertex(v);
- }
-
- return list;
- }
-
- @Override
- public Object clone() {
- DirectedGraph<V, E> copy = new DirectedGraph<V, E>();
- copy.addGraph(this);
- return copy;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Group2GroupTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Group2GroupTransformer.java
deleted file mode 100644
index cc7b40d06b..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Group2GroupTransformer.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.impl;
-
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.interfacedef.DataType;
-
-/**
- * This is a special transformer to transform the output from one IDL to the
- * other one
- *
- * @version $Rev$ $Date$
- */
-public class Group2GroupTransformer extends BaseTransformer<Object, Object> implements
- PullTransformer<Object, Object> {
-
- protected Mediator mediator;
-
- /**
- * @param wrapperHandler
- */
- public Group2GroupTransformer() {
- super();
- }
-
- /**
- * @param mediator the mediator to set
- */
- public void setMediator(Mediator mediator) {
- this.mediator = mediator;
- }
-
- @Override
- public String getSourceDataBinding() {
- return GroupDataBinding.NAME;
- }
-
- @Override
- public String getTargetDataBinding() {
- return GroupDataBinding.NAME;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getSourceType()
- */
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getTargetType()
- */
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.Transformer#getWeight()
- */
- @Override
- public int getWeight() {
- return 10;
- }
-
- @SuppressWarnings("unchecked")
- public Object transform(Object source, TransformationContext context) {
- DataType<DataType> sourceType = context.getSourceDataType();
- DataType<DataType> targetType = context.getTargetDataType();
-
- return mediator.mediate(source, sourceType.getLogical(), targetType.getLogical(), context.getMetadata());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/GroupDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/GroupDataBinding.java
deleted file mode 100644
index 70efd6a5c5..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/GroupDataBinding.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.impl;
-
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * The base class for a special databinding which represents a group of other databindings
- *
- * @version $Rev$ $Date$
- */
-public abstract class GroupDataBinding extends BaseDataBinding {
- public static final String NAME = "databinding:group";
-
- /**
- * Marker type is a java class or interface representing the data format.
- */
- protected Class[] markerTypes;
-
- public GroupDataBinding(Class[] types) {
- super(NAME, GroupDataBinding.class);
- this.markerTypes = types;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public boolean introspect(DataType type, Operation operation) {
- if (markerTypes == null) {
- return false;
- }
- Type physical = type.getPhysical();
- if (physical instanceof ParameterizedType) {
- physical = ((ParameterizedType)physical).getRawType();
- }
- if (!(physical instanceof Class)) {
- return false;
- }
- Class cls = (Class)physical;
- for (Class<?> c : markerTypes) {
- if (isTypeOf(c, cls)) {
- type.setDataBinding(getDataBinding(c));
- Object logical = getLogical(cls, null);
- if (logical != null) {
- type.setLogical(getLogical(cls, null));
- } else {
- type.setLogical(XMLType.UNKNOWN);
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * Test if the given type is a subtype of the base type
- * @param markerType
- * @param type
- * @return
- */
- protected boolean isTypeOf(Class<?> markerType, Class<?> type) {
- return markerType.isAssignableFrom(type);
- }
-
- /**
- * Derive the databinding name from a base class
- * @param baseType
- * @return
- */
- protected String getDataBinding(Class<?> baseType) {
- return baseType.getName();
- }
-
- /**
- * Get the logical type
- * @param type The java type
- * @param operation TODO
- * @return
- */
- protected abstract Object getLogical(Class<?> type, Operation operation);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Java2SimpleTypeTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Java2SimpleTypeTransformer.java
deleted file mode 100644
index 45896ca6a1..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Java2SimpleTypeTransformer.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.javabeans.SimpleJavaDataBinding;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * Transformer to convert data from a simple java object to a databinding's representation
- *
- * @version $Rev$ $Date$
- */
-public abstract class Java2SimpleTypeTransformer<T> extends BaseTransformer<Object, T> implements
- PullTransformer<Object, T> {
-
- protected SimpleTypeMapper mapper;
-
- public Java2SimpleTypeTransformer() {
- this.mapper = new SimpleTypeMapperImpl();
- }
-
- public Java2SimpleTypeTransformer(SimpleTypeMapper mapper) {
- this.mapper = (mapper != null) ? mapper : new SimpleTypeMapperImpl();
- }
-
- public T transform(Object source, TransformationContext context) {
- XMLType xmlType = (XMLType) context.getTargetDataType().getLogical();
- String text = mapper.toXMLLiteral(xmlType.getTypeName(), source, context);
- return createElement(xmlType.getElementName(), text, context);
- }
-
- @Override
- public Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- public int getWeight() {
- return 10000;
- }
-
- protected abstract T createElement(QName element, String literal, TransformationContext context);
-
- @Override
- public String getSourceDataBinding() {
- return SimpleJavaDataBinding.NAME;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java
deleted file mode 100644
index b7ddf87a41..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.DataPipe;
-import org.apache.tuscany.sca.databinding.DataPipeTransformer;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.Transformer;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-
-/**
- * Default Mediator implementation
- *
- * @version $Rev$ $Date$
- */
-public class MediatorImpl implements Mediator {
-
- private DataBindingExtensionPoint dataBindings;
- private TransformerExtensionPoint transformers;
-
- public MediatorImpl(DataBindingExtensionPoint dataBindings, TransformerExtensionPoint transformers) {
- this.dataBindings = dataBindings;
- this.transformers = transformers;
- }
-
- @SuppressWarnings("unchecked")
- public Object mediate(Object source, DataType sourceDataType, DataType targetDataType, Map<String, Object> metadata) {
- if (sourceDataType == null || sourceDataType.getDataBinding() == null) {
- if (source != null) {
- Operation operation = (Operation) metadata.get("source.operation");
- sourceDataType = dataBindings.introspectType(source, operation);
- }
- }
- if (sourceDataType == null || targetDataType == null) {
- return source;
- } else if (sourceDataType.equals(targetDataType)) {
- return source;
- }
-
- List<Transformer> path = getTransformerChain(sourceDataType, targetDataType);
-
- Object result = source;
- int size = path.size();
- int i = 0;
- while (i < size) {
- Transformer transformer = path.get(i);
- TransformationContext context =
- createTransformationContext(sourceDataType, targetDataType, size, i, transformer, metadata);
- // the source and target type
- if (transformer instanceof PullTransformer) {
- // For intermediate node, set data type to null
- result = ((PullTransformer)transformer).transform(result, context);
- } else if (transformer instanceof PushTransformer) {
- DataPipeTransformer dataPipeFactory = (i < size - 1) ? (DataPipeTransformer)path.get(++i) : null;
- DataPipe dataPipe = dataPipeFactory == null ? null : dataPipeFactory.newInstance();
- ((PushTransformer)transformer).transform(result, dataPipe.getSink(), context);
- result = dataPipe.getResult();
- }
- i++;
- }
-
- return result;
- }
-
- private TransformationContext createTransformationContext(DataType sourceDataType,
- DataType targetDataType,
- int size,
- int index,
- Transformer transformer,
- Map<String, Object> metadata) {
- DataType sourceType =
- (index == 0) ? sourceDataType : new DataTypeImpl<Object>(transformer.getSourceDataBinding(), Object.class,
- sourceDataType.getLogical());
- DataType targetType =
- (index == size - 1) ? targetDataType : new DataTypeImpl<Object>(transformer.getTargetDataBinding(),
- Object.class, targetDataType.getLogical());
-
- //FIXME The ClassLoader should be passed in
- // Allow privileged access to get ClassLoader. Requires RuntimePermission in security
- // policy.
- ClassLoader classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- return Thread.currentThread().getContextClassLoader();
- }
- });
-
- TransformationContext context = new TransformationContextImpl(sourceType, targetType, classLoader, metadata);
- return context;
- }
-
- @SuppressWarnings("unchecked")
- public void mediate(Object source,
- Object target,
- DataType sourceDataType,
- DataType targetDataType,
- Map<String, Object> metadata) {
- if (source == null) {
- // Shortcut for null value
- return;
- }
- if (sourceDataType == null || sourceDataType.getDataBinding() == null) {
- Operation operation = (Operation) metadata.get("source.operation");
- sourceDataType = dataBindings.introspectType(source, operation);
- }
- if (sourceDataType == null) {
- return;
- } else if (sourceDataType.equals(targetDataType)) {
- return;
- }
-
- List<Transformer> path = getTransformerChain(sourceDataType, targetDataType);
- Object result = source;
- int size = path.size();
- for (int i = 0; i < size; i++) {
- Transformer transformer = path.get(i);
- TransformationContext context =
- createTransformationContext(sourceDataType, targetDataType, size, i, transformer, metadata);
-
- if (transformer instanceof PullTransformer) {
- result = ((PullTransformer)transformer).transform(result, context);
- } else if (transformer instanceof PushTransformer) {
- DataPipeTransformer dataPipeFactory = (i < size - 1) ? (DataPipeTransformer)path.get(++i) : null;
- DataPipe dataPipe = dataPipeFactory == null ? null : dataPipeFactory.newInstance();
- Object sink = dataPipe != null ? dataPipe.getSink() : target;
- ((PushTransformer)transformer).transform(result, sink, context);
- result = (dataPipe != null) ? dataPipe.getResult() : null;
- }
- }
- }
-
- private List<Transformer> getTransformerChain(DataType sourceDataType, DataType targetDataType) {
- String sourceId = sourceDataType.getDataBinding();
- String targetId = targetDataType.getDataBinding();
- List<Transformer> path = transformers.getTransformerChain(sourceId, targetId);
- if (path == null) {
- TransformationException ex =
- new TransformationException("No path found for the transformation: " + sourceId + "->" + targetId);
- ex.setSourceDataBinding(sourceId);
- ex.setTargetDataBinding(targetId);
- throw ex;
- }
- return path;
- }
-
- public DataBindingExtensionPoint getDataBindings() {
- return dataBindings;
- }
-
- public TransformerExtensionPoint getTransformers() {
- return transformers;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/PipedTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/PipedTransformer.java
deleted file mode 100644
index a1a89005b3..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/PipedTransformer.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import org.apache.tuscany.sca.databinding.DataPipe;
-import org.apache.tuscany.sca.databinding.DataPipeTransformer;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-
-/**
- * A utility class to connect PushTransformer and DataPipe to create a
- * PullTransformer
- *
- * @param <S> Source type
- * @param <I> Intermediate type
- * @param <R> Result type
- *
- * @version $Rev$ $Date$
- */
-public class PipedTransformer<S, I, R> implements PullTransformer<S, R> {
- private PushTransformer<S, I> pusher;
-
- private DataPipeTransformer<I, R> pipe;
-
- /**
- * @param pumper
- * @param pipe
- */
- public PipedTransformer(PushTransformer<S, I> pumper, DataPipeTransformer<I, R> pipe) {
- super();
- this.pusher = pumper;
- this.pipe = pipe;
- }
-
- public R transform(S source, TransformationContext context) {
- DataPipe<I, R> dataPipe = pipe.newInstance();
- pusher.transform(source, dataPipe.getSink(), context);
- return dataPipe.getResult();
- }
-
- public String getSourceDataBinding() {
- return pusher.getSourceDataBinding();
- }
-
- public String getTargetDataBinding() {
- return pipe.getTargetDataBinding();
- }
-
- public int getWeight() {
- return pusher.getWeight() + pipe.getWeight();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleType2JavaTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleType2JavaTransformer.java
deleted file mode 100644
index c91176fc2c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleType2JavaTransformer.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.javabeans.SimpleJavaDataBinding;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * Transformer to convert data from a databinding's representation of simple
- * types to Java Objects
- *
- * @version $Rev$ $Date$
- */
-public abstract class SimpleType2JavaTransformer<T> extends BaseTransformer<T, Object> implements
- PullTransformer<T, Object> {
-
- protected SimpleTypeMapper mapper;
-
- public SimpleType2JavaTransformer() {
- this.mapper = new SimpleTypeMapperImpl();
- }
-
- public SimpleType2JavaTransformer(SimpleTypeMapper mapper) {
- this.mapper = (mapper != null) ? mapper : new SimpleTypeMapperImpl();
- }
-
- public Object transform(T source, TransformationContext context) {
- XMLType xmlType = (XMLType)context.getSourceDataType().getLogical();
- QName type = (xmlType != null) ? xmlType.getTypeName() : null;
- if (type == null) {
- xmlType = (XMLType)context.getTargetDataType().getLogical();
- type = (xmlType != null) ? xmlType.getTypeName() : null;
- }
- Object result = mapper.toJavaObject(type, getText(source), context);
- close(source);
- return result;
- }
-
- @Override
- protected Class<Object> getTargetType() {
- return Object.class;
- }
-
- @Override
- public int getWeight() {
- // Cannot be used for intermediate
- return 10000;
- }
-
- /**
- * Get the string value from the source
- * @param source
- * @return A string
- */
- protected abstract String getText(T source);
-
- /**
- * To be overrided by the subclass
- * @param source
- */
- protected void close(T source) {
- }
-
- @Override
- public String getTargetDataBinding() {
- return SimpleJavaDataBinding.NAME;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleTypeMapperImpl.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleTypeMapperImpl.java
deleted file mode 100644
index 32a2313f59..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleTypeMapperImpl.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.impl;
-
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.XMLGregorianCalendar;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-
-/**
- * Simple type mapper that maps from XSD types to Java Classes and Java Classes to XSD types.
- *
- * @version $Rev$ $Date$
- */
-public class SimpleTypeMapperImpl extends XSDDataTypeConverter implements SimpleTypeMapper {
-
- public static final Map<Class, String> JAVA2XML = new HashMap<Class, String>();
-
- public static final String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
-
- public static final Map<String, Class> XML2JAVA = new HashMap<String, Class>();
-
- public static final QName XSD_ANY = new QName(URI_2001_SCHEMA_XSD, "any");
-
- public static final QName XSD_ANYSIMPLETYPE = new QName(URI_2001_SCHEMA_XSD, "anySimpleType");
-
- public static final QName XSD_ANYTYPE = new QName(URI_2001_SCHEMA_XSD, "anyType");
-
- public static final QName XSD_ANYURI = new QName(URI_2001_SCHEMA_XSD, "anyURI");
-
- public static final QName XSD_BASE64 = new QName(URI_2001_SCHEMA_XSD, "base64Binary");
-
- public static final QName XSD_BOOLEAN = new QName(URI_2001_SCHEMA_XSD, "boolean");
-
- public static final QName XSD_BYTE = new QName(URI_2001_SCHEMA_XSD, "byte");
-
- public static final QName XSD_DATE = new QName(URI_2001_SCHEMA_XSD, "date");
-
- public static final QName XSD_DATETIME = new QName(URI_2001_SCHEMA_XSD, "dateTime");
-
- public static final QName XSD_DAY = new QName(URI_2001_SCHEMA_XSD, "gDay");
-
- public static final QName XSD_DECIMAL = new QName(URI_2001_SCHEMA_XSD, "decimal");
-
- public static final QName XSD_DOUBLE = new QName(URI_2001_SCHEMA_XSD, "double");
-
- public static final QName XSD_DURATION = new QName(URI_2001_SCHEMA_XSD, "duration");
-
- public static final QName XSD_ENTITIES = new QName(URI_2001_SCHEMA_XSD, "ENTITIES");
-
- public static final QName XSD_ENTITY = new QName(URI_2001_SCHEMA_XSD, "ENTITY");
-
- public static final QName XSD_FLOAT = new QName(URI_2001_SCHEMA_XSD, "float");
-
- public static final QName XSD_HEXBIN = new QName(URI_2001_SCHEMA_XSD, "hexBinary");
-
- public static final QName XSD_IDREF = new QName(URI_2001_SCHEMA_XSD, "IDREF");
-
- public static final QName XSD_IDREFS = new QName(URI_2001_SCHEMA_XSD, "IDREFS");
-
- public static final QName XSD_INT = new QName(URI_2001_SCHEMA_XSD, "int");
-
- public static final QName XSD_INTEGER = new QName(URI_2001_SCHEMA_XSD, "integer");
-
- public static final QName XSD_LONG = new QName(URI_2001_SCHEMA_XSD, "long");
-
- public static final QName XSD_MONTH = new QName(URI_2001_SCHEMA_XSD, "gMonth");
-
- public static final QName XSD_MONTHDAY = new QName(URI_2001_SCHEMA_XSD, "gMonthDay");
-
- public static final QName XSD_NAME = new QName(URI_2001_SCHEMA_XSD, "Name");
-
- public static final QName XSD_NCNAME = new QName(URI_2001_SCHEMA_XSD, "NCName");
-
- public static final QName XSD_NEGATIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "negativeInteger");
-
- public static final QName XSD_NMTOKEN = new QName(URI_2001_SCHEMA_XSD, "NMTOKEN");
-
- public static final QName XSD_NMTOKENS = new QName(URI_2001_SCHEMA_XSD, "NMTOKENS");
-
- public static final QName XSD_NONNEGATIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "nonNegativeInteger");
-
- public static final QName XSD_NONPOSITIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "nonPositiveInteger");
-
- public static final QName XSD_NORMALIZEDSTRING = new QName(URI_2001_SCHEMA_XSD, "normalizedString");
-
- public static final QName XSD_NOTATION = new QName(URI_2001_SCHEMA_XSD, "NOTATION");
-
- public static final QName XSD_POSITIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "positiveInteger");
-
- public static final QName XSD_QNAME = new QName(URI_2001_SCHEMA_XSD, "QName");
-
- public static final QName XSD_SHORT = new QName(URI_2001_SCHEMA_XSD, "short");
-
- public static final Map<String, TypeInfo> XSD_SIMPLE_TYPES = new HashMap<String, TypeInfo>();
-
- public static final QName XSD_STRING = new QName(URI_2001_SCHEMA_XSD, "string");
-
- public static final QName XSD_TIME = new QName(URI_2001_SCHEMA_XSD, "time");
-
- public static final QName XSD_TOKEN = new QName(URI_2001_SCHEMA_XSD, "token");
-
- public static final QName XSD_UNSIGNEDBYTE = new QName(URI_2001_SCHEMA_XSD, "unsignedByte");
-
- public static final QName XSD_UNSIGNEDINT = new QName(URI_2001_SCHEMA_XSD, "unsignedInt");
-
- public static final QName XSD_UNSIGNEDLONG = new QName(URI_2001_SCHEMA_XSD, "unsignedLong");
-
- public static final QName XSD_UNSIGNEDSHORT = new QName(URI_2001_SCHEMA_XSD, "unsignedShort");
-
- public static final QName XSD_YEAR = new QName(URI_2001_SCHEMA_XSD, "gYear");
-
- public static final QName XSD_YEARMONTH = new QName(URI_2001_SCHEMA_XSD, "gYearMonth");
-
- private static final String[] XSD_TYPE_NAMES =
- {"string", "boolean", "double", "float", "int", "integer", "long", "short", "byte", "decimal", "base64Binary",
- "hexBinary", "anySimpleType", "anyType", "any", "QName", "dateTime", "date", "time", "normalizedString",
- "token", "unsignedLong", "unsignedInt", "unsignedShort", "unsignedByte", "positiveInteger", "negativeInteger",
- "nonNegativeInteger", "nonPositiveInteger", "gYearMonth", "gMonthDay", "gYear", "gMonth", "gDay", "duration",
- "Name", "NCName", "NMTOKEN", "NMTOKENS", "NOTATION", "ENTITY", "ENTITIES", "IDREF", "IDREFS", "anyURI",
- "language", "ID"};
-
- static {
- for (String type : XSD_TYPE_NAMES) {
- TypeInfo simpleType = new TypeInfo(new QName(URI_2001_SCHEMA_XSD, type), true, null);
- XSD_SIMPLE_TYPES.put(type, simpleType);
- }
- }
-
- static {
- JAVA2XML.put(boolean.class, "boolean");
- JAVA2XML.put(byte.class, "byte");
- JAVA2XML.put(short.class, "short");
- JAVA2XML.put(int.class, "int");
- JAVA2XML.put(long.class, "long");
- JAVA2XML.put(float.class, "float");
- JAVA2XML.put(double.class, "double");
- JAVA2XML.put(Boolean.class, "boolean");
- JAVA2XML.put(Byte.class, "byte");
- JAVA2XML.put(Short.class, "short");
- JAVA2XML.put(Integer.class, "int");
- JAVA2XML.put(Long.class, "long");
- JAVA2XML.put(Float.class, "float");
- JAVA2XML.put(Double.class, "double");
- JAVA2XML.put(java.lang.String.class, "string");
- JAVA2XML.put(java.math.BigInteger.class, "integer");
- JAVA2XML.put(java.math.BigDecimal.class, "decimal");
- JAVA2XML.put(java.util.Calendar.class, "dateTime");
- JAVA2XML.put(java.util.Date.class, "dateTime");
- JAVA2XML.put(javax.xml.namespace.QName.class, "QName");
- JAVA2XML.put(java.net.URI.class, "string");
- JAVA2XML.put(javax.xml.datatype.XMLGregorianCalendar.class, "anySimpleType");
- JAVA2XML.put(javax.xml.datatype.Duration.class, "duration");
- JAVA2XML.put(java.lang.Object.class, "anyType");
- JAVA2XML.put(java.awt.Image.class, "base64Binary");
- JAVA2XML.put(byte[].class, "base64Binary");
- // java2XSD.put(javax.activation.DataHandler.class, "base64Binary");
- JAVA2XML.put(javax.xml.transform.Source.class, "base64Binary");
- JAVA2XML.put(java.util.UUID.class, "string");
- }
-
- static {
- XML2JAVA.put("string", java.lang.String.class);
- XML2JAVA.put("integer", java.math.BigInteger.class);
- XML2JAVA.put("int", int.class);
- XML2JAVA.put("long", long.class);
- XML2JAVA.put("short", short.class);
- XML2JAVA.put("decimal", java.math.BigDecimal.class);
- XML2JAVA.put("float", float.class);
- XML2JAVA.put("double", double.class);
- XML2JAVA.put("boolean", boolean.class);
- XML2JAVA.put("byte", byte.class);
- XML2JAVA.put("QName", javax.xml.namespace.QName.class);
- XML2JAVA.put("dateTime", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("base64Binary", byte[].class);
- XML2JAVA.put("hexBinary", byte[].class);
- XML2JAVA.put("unsignedInt", long.class);
- XML2JAVA.put("unsignedShort", int.class);
- XML2JAVA.put("unsignedByte", short.class);
- XML2JAVA.put("time", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("date", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("gDay", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("gMonth", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("gYear", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("gYearMonth", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("gMonthDay", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("anySimpleType", java.lang.Object.class); // For elements
- // XML2JAVA.put("anySimpleType", java.lang.String.class); // For
- // attributes
- XML2JAVA.put("duration", javax.xml.datatype.Duration.class);
- XML2JAVA.put("NOTATION", javax.xml.namespace.QName.class);
- }
-
- private DatatypeFactory factory;
-
- public SimpleTypeMapperImpl() {
- super();
- try {
- this.factory = DatatypeFactory.newInstance();
- } catch (DatatypeConfigurationException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public static Class getJavaType(QName xmlType) {
- if (xmlType != null && URI_2001_SCHEMA_XSD.equals(xmlType.getNamespaceURI())) {
- return XML2JAVA.get(xmlType.getLocalPart());
- } else {
- return null;
- }
- }
-
- public static TypeInfo getXMLType(Class javaType) {
- return XSD_SIMPLE_TYPES.get(JAVA2XML.get(javaType));
- }
-
- public Object toJavaObject(QName simpleType, String literal, TransformationContext context) {
- /**
- * <ul>
- * <li>xsd:string --- java.lang.String
- * <li>xsd:integer --- java.math.BigInteger
- * <li>xsd:int --- int
- * <li>xsd:long --- long
- * <li>xsd:short --- short
- * <li>xsd:decimal --- java.math.BigDecimal
- * <li>xsd:float --- float
- * <li>xsd:double --- double
- * <li>xsd:boolean --- boolean
- * <li>xsd:byte --- byte
- * <li>xsd:QName --- javax.xml.namespace.QName
- * <li>xsd:dateTime --- javax.xml.datatype.XMLGregorianCalendar
- * <li>xsd:base64Binary --- byte[]
- * <li>xsd:hexBinary --- byte[]
- * <li>xsd:unsignedInt --- long
- * <li>xsd:unsignedShort --- int
- * <li>xsd:unsignedByte --- short
- * <li>xsd:time --- javax.xml.datatype.XMLGregorianCalendar
- * <li>xsd:date --- javax.xml.datatype.XMLGregorianCalendar
- * <li>xsd:g* --- javax.xml.datatype.XMLGregorianCalendar
- * <li>xsd:anySimpleType (for xsd:element of this type)a
- * java.lang.Object
- * <li>xsd:anySimpleType (for xsd:attribute of this type)
- * java.lang.String
- * <li>xsd:duration javax.xml.datatype.Duration
- * <li>xsd:NOTATION javax.xml.namespace.QName
- * </ul>
- */
-
- if (literal == null) {
- return null;
- }
- String value = literal.trim();
-
- QName type = simpleType;
- if (type.equals(XSD_STRING)) {
- return parseString(value);
- } else if (type.equals(XSD_INT)) {
- return parseInt(value);
- } else if (type.equals(XSD_INTEGER)) {
- return parseInteger(value);
- } else if (type.equals(XSD_INT)) {
- return parseInt(value);
- } else if (type.equals(XSD_FLOAT)) {
- return parseFloat(value);
- } else if (type.equals(XSD_DOUBLE)) {
- return parseDouble(value);
- } else if (type.equals(XSD_SHORT)) {
- return parseShort(value);
- } else if (type.equals(XSD_DECIMAL)) {
- return parseDecimal(value);
- } else if (type.equals(XSD_BOOLEAN)) {
- return parseBoolean(value);
- } else if (type.equals(XSD_BYTE)) {
- return parseByte(value);
- } else if (type.equals(XSD_LONG)) {
- return parseLong(value);
- } else if (type.equals(XSD_UNSIGNEDBYTE)) {
- return parseUnsignedShort(value);
- } else if (type.equals(XSD_UNSIGNEDSHORT)) {
- return parseUnsignedShort(value);
- } else if (type.equals(XSD_UNSIGNEDINT)) {
- return parseUnsignedInt(value);
- } else if (type.equals(XSD_UNSIGNEDLONG)) {
- return parseUnsignedInt(value);
- } else if (type.equals(XSD_DATETIME)) {
- return parseDateTime(value);
- } else if (type.equals(XSD_DATE)) {
- return parseDate(value);
- } else if (type.equals(XSD_TIME)) {
- return parseTime(value);
- } else if (type.equals(XSD_DURATION)) {
- return parseDuration(value);
- } else if (type.equals(XSD_HEXBIN)) {
- return parseHexBinary(value);
- } else if (type.equals(XSD_BASE64)) {
- return parseBase64Binary(value);
- } else if (type.equals(XSD_QNAME)) {
- NamespaceContext namespaceContext =
- (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null);
- return parseQName(value, namespaceContext);
- } else if (type.equals(XSD_NOTATION)) {
- NamespaceContext namespaceContext =
- (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null);
- return parseQName(value, namespaceContext);
- } else if (type.equals(XSD_YEAR)) {
- return factory.newXMLGregorianCalendar(value);
- } else if (type.equals(XSD_MONTH)) {
- return factory.newXMLGregorianCalendar(value);
- } else if (type.equals(XSD_DAY)) {
- return factory.newXMLGregorianCalendar(value);
- } else if (type.equals(XSD_YEARMONTH)) {
- return factory.newXMLGregorianCalendar(value);
- } else if (type.equals(XSD_MONTHDAY)) {
- return factory.newXMLGregorianCalendar(value);
- } else {
- return value;
- }
- }
-
- @SuppressWarnings("deprecation")
- private XMLGregorianCalendar toXMLGregorianCalendar(Date date) {
- GregorianCalendar c =
- new GregorianCalendar(date.getYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(),
- date.getSeconds());
- return factory.newXMLGregorianCalendar(c);
- }
-
- private XMLGregorianCalendar toXMLGregorianCalendar(GregorianCalendar calendar) {
- return factory.newXMLGregorianCalendar(calendar);
- }
-
- public String toXMLLiteral(QName simpleType, Object obj, TransformationContext context) {
- if(obj == null) {
- // It could be null if nilable=true
- return null;
- }
- if (obj instanceof Float || obj instanceof Double) {
- if (obj instanceof Float) {
- return printDouble(((Float)obj).floatValue());
- } else {
- return printDouble(((Double)obj).doubleValue());
- }
- } else if (obj instanceof GregorianCalendar) {
- GregorianCalendar calendar = (GregorianCalendar)obj;
- return toXMLGregorianCalendar(calendar).toXMLFormat();
- } else if (obj instanceof Date) {
- return toXMLGregorianCalendar((Date)obj).toXMLFormat();
- } else if (obj instanceof XMLGregorianCalendar) {
- return ((XMLGregorianCalendar)obj).toXMLFormat();
- } else if (obj instanceof byte[]) {
- if (simpleType != null) {
- if (simpleType.equals(XSD_BASE64)) {
- return printBase64Binary((byte[])obj);
- } else if (simpleType.equals(XSD_HEXBIN)) {
- return printHexBinary((byte[])obj);
- }
- }
- } else if (obj instanceof QName) {
- NamespaceContext namespaceContext =
- (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null);
- return printQName((QName)obj, namespaceContext);
- }
- return obj.toString();
- }
-
- public static boolean isSimpleXSDType(QName typeName) {
- if (typeName == null) {
- return false;
- }
- return typeName.getNamespaceURI().equals(URI_2001_SCHEMA_XSD)
- && XSD_SIMPLE_TYPES.get(typeName.getLocalPart()) != null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/TransformationContextImpl.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/TransformationContextImpl.java
deleted file mode 100644
index a6c0639411..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/TransformationContextImpl.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import java.lang.ref.WeakReference;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-public class TransformationContextImpl implements TransformationContext {
- private DataType sourceDataType;
-
- private DataType targetDataType;
-
- private final Map<String, Object> metadata = new HashMap<String, Object>();
-
- private WeakReference<ClassLoader> classLoaderRef;
-
- public TransformationContextImpl() {
- super();
- // This is used only for testing
- setClassLoader(Thread.currentThread().getContextClassLoader());
- }
-
- public TransformationContextImpl(DataType sourceDataType,
- DataType targetDataType,
- ClassLoader classLoader,
- Map<String, Object> metadata) {
- super();
- this.sourceDataType = sourceDataType;
- this.targetDataType = targetDataType;
- setClassLoader(classLoader);
- if (metadata != null) {
- this.metadata.putAll(metadata);
- }
- }
-
- public DataType getSourceDataType() {
- return sourceDataType;
- }
-
- public DataType getTargetDataType() {
- return targetDataType;
- }
-
- public void setSourceDataType(DataType sourceDataType) {
- this.sourceDataType = sourceDataType;
- }
-
- public void setTargetDataType(DataType targetDataType) {
- this.targetDataType = targetDataType;
- }
-
- public final void setClassLoader(ClassLoader classLoader) {
- this.classLoaderRef = new WeakReference<ClassLoader>(classLoader);
- }
-
- public ClassLoader getClassLoader() {
- return classLoaderRef.get();
- }
-
- public Map<String, Object> getMetadata() {
- return metadata;
- }
-
- /**
- * @return the sourceOperation
- */
- public Operation getSourceOperation() {
- return (Operation) metadata.get("source.operation");
- }
-
- /**
- * @param sourceOperation the sourceOperation to set
- */
- public void setSourceOperation(Operation sourceOperation) {
- this.metadata.put("source.operation", sourceOperation);
- }
-
- /**
- * @return the targetOperation
- */
- public Operation getTargetOperation() {
- return (Operation) metadata.get("target.operation");
- }
-
- /**
- * @param targetOperation the targetOperation to set
- */
- public void setTargetOperation(Operation targetOperation) {
- this.metadata.put("target.operation", targetOperation);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/XSDDataTypeConverter.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/XSDDataTypeConverter.java
deleted file mode 100644
index fb747864e7..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/XSDDataTypeConverter.java
+++ /dev/null
@@ -1,945 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.impl;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.text.FieldPosition;
-import java.text.Format;
-import java.text.ParsePosition;
-import java.util.Calendar;
-import java.util.TimeZone;
-
-import javax.xml.XMLConstants;
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.Duration;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-
-/**
- * Utility class for XSD data type conversions
- *
- * @version $Rev$ $Date$
- */
-public class XSDDataTypeConverter {
- public static final class Base64Binary {
- private static final char[] S_BASE64CHAR =
- {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
- 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
- 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4',
- '5', '6', '7', '8', '9', '+', '/'};
-
- private static final char S_BASE64PAD = '=';
-
- private static final byte[] S_DECODETABLE = new byte[128];
-
- static {
- for (int i = 0; i < S_DECODETABLE.length; i++) {
- S_DECODETABLE[i] = Byte.MAX_VALUE; // 127
- }
- for (int i = 0; i < S_BASE64CHAR.length; i++) {
- // 0 to 63
- S_DECODETABLE[S_BASE64CHAR[i]] = (byte) i;
- }
- }
-
- private Base64Binary() {
- }
-
- /**
- *
- */
- public static byte[] decode(char[] data, int off, int len) {
- char[] ibuf = new char[4];
- int ibufcount = 0;
- byte[] obuf = new byte[len / 4 * 3 + 3];
- int obufcount = 0;
- for (int i = off; i < off + len; i++) {
- char ch = data[i];
- if (ch == S_BASE64PAD || ch < S_DECODETABLE.length && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
- ibuf[ibufcount++] = ch;
- if (ibufcount == ibuf.length) {
- ibufcount = 0;
- obufcount += decode0(ibuf, obuf, obufcount);
- }
- }
- }
- if (obufcount == obuf.length) {
- return obuf;
- }
- byte[] ret = new byte[obufcount];
- System.arraycopy(obuf, 0, ret, 0, obufcount);
- return ret;
- }
-
- /**
- *
- */
- public static void decode(char[] data, int off, int len, OutputStream ostream) throws IOException {
- char[] ibuf = new char[4];
- int ibufcount = 0;
- byte[] obuf = new byte[3];
- for (int i = off; i < off + len; i++) {
- char ch = data[i];
- if (ch == S_BASE64PAD || ch < S_DECODETABLE.length && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
- ibuf[ibufcount++] = ch;
- if (ibufcount == ibuf.length) {
- ibufcount = 0;
- int obufcount = decode0(ibuf, obuf, 0);
- ostream.write(obuf, 0, obufcount);
- }
- }
- }
- }
-
- /**
- *
- */
- public static byte[] decode(String data) {
- char[] ibuf = new char[4];
- int ibufcount = 0;
- byte[] obuf = new byte[data.length() / 4 * 3 + 3];
- int obufcount = 0;
- for (int i = 0; i < data.length(); i++) {
- char ch = data.charAt(i);
- if (ch == S_BASE64PAD || ch < S_DECODETABLE.length && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
- ibuf[ibufcount++] = ch;
- if (ibufcount == ibuf.length) {
- ibufcount = 0;
- obufcount += decode0(ibuf, obuf, obufcount);
- }
- }
- }
- if (obufcount == obuf.length) {
- return obuf;
- }
- byte[] ret = new byte[obufcount];
- System.arraycopy(obuf, 0, ret, 0, obufcount);
- return ret;
- }
-
- /**
- *
- */
- public static void decode(String data, OutputStream ostream) throws IOException {
- char[] ibuf = new char[4];
- int ibufcount = 0;
- byte[] obuf = new byte[3];
- for (int i = 0; i < data.length(); i++) {
- char ch = data.charAt(i);
- if (ch == S_BASE64PAD || ch < S_DECODETABLE.length && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
- ibuf[ibufcount++] = ch;
- if (ibufcount == ibuf.length) {
- ibufcount = 0;
- int obufcount = decode0(ibuf, obuf, 0);
- ostream.write(obuf, 0, obufcount);
- }
- }
- }
- }
-
- private static int decode0(char[] ibuf, byte[] obuf, int index) {
- int wp = index;
- int outlen = 3;
- if (ibuf[3] == S_BASE64PAD) {
- outlen = 2;
- }
- if (ibuf[2] == S_BASE64PAD) {
- outlen = 1;
- }
- int b0 = S_DECODETABLE[ibuf[0]];
- int b1 = S_DECODETABLE[ibuf[1]];
- int b2 = S_DECODETABLE[ibuf[2]];
- int b3 = S_DECODETABLE[ibuf[3]];
- switch (outlen) {
- case 1:
- obuf[wp] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
- return 1;
- case 2:
- obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
- obuf[wp] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
- return 2;
- case 3:
- obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
- obuf[wp++] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
- obuf[wp] = (byte) (b2 << 6 & 0xc0 | b3 & 0x3f);
- return 3;
- default:
- throw new IllegalArgumentException("The character sequence is not base64 encoded.");
- }
- }
-
- /**
- * Returns base64 representation of specified byte array.
- */
- public static String encode(byte[] data) {
- return encode(data, 0, data.length);
- }
-
- /**
- * Returns base64 representation of specified byte array.
- */
- public static String encode(byte[] data, int off, int len) {
- if (len <= 0) {
- return "";
- }
- char[] out = new char[len / 3 * 4 + 4];
- int rindex = off;
- int windex = 0;
- int rest = len - off;
- while (rest >= 3) {
- int i =
- ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8)
- + (data[rindex + 2] & 0xff);
- out[windex++] = S_BASE64CHAR[i >> 18];
- out[windex++] = S_BASE64CHAR[(i >> 12) & 0x3f];
- out[windex++] = S_BASE64CHAR[(i >> 6) & 0x3f];
- out[windex++] = S_BASE64CHAR[i & 0x3f];
- rindex += 3;
- rest -= 3;
- }
- if (rest == 1) {
- int i = data[rindex] & 0xff;
- out[windex++] = S_BASE64CHAR[i >> 2];
- out[windex++] = S_BASE64CHAR[(i << 4) & 0x3f];
- out[windex++] = S_BASE64PAD;
- out[windex++] = S_BASE64PAD;
- } else if (rest == 2) {
- int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
- out[windex++] = S_BASE64CHAR[i >> 10];
- out[windex++] = S_BASE64CHAR[(i >> 4) & 0x3f];
- out[windex++] = S_BASE64CHAR[(i << 2) & 0x3f];
- out[windex++] = S_BASE64PAD;
- }
- return new String(out, 0, windex);
- }
-
- /**
- * Outputs base64 representation of the specified byte array to a byte stream.
- */
- public static void encode(byte[] data, int off, int len, OutputStream ostream) throws IOException {
- if (len <= 0) {
- return;
- }
- byte[] out = new byte[4];
- int rindex = off;
- int rest = len - off;
- while (rest >= 3) {
- int i =
- ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8)
- + (data[rindex + 2] & 0xff);
- out[0] = (byte) S_BASE64CHAR[i >> 18];
- out[1] = (byte) S_BASE64CHAR[(i >> 12) & 0x3f];
- out[2] = (byte) S_BASE64CHAR[(i >> 6) & 0x3f];
- out[3] = (byte) S_BASE64CHAR[i & 0x3f];
- ostream.write(out, 0, 4);
- rindex += 3;
- rest -= 3;
- }
- if (rest == 1) {
- int i = data[rindex] & 0xff;
- out[0] = (byte) S_BASE64CHAR[i >> 2];
- out[1] = (byte) S_BASE64CHAR[(i << 4) & 0x3f];
- out[2] = (byte) S_BASE64PAD;
- out[3] = (byte) S_BASE64PAD;
- ostream.write(out, 0, 4);
- } else if (rest == 2) {
- int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
- out[0] = (byte) S_BASE64CHAR[i >> 10];
- out[1] = (byte) S_BASE64CHAR[(i >> 4) & 0x3f];
- out[2] = (byte) S_BASE64CHAR[(i << 2) & 0x3f];
- out[3] = (byte) S_BASE64PAD;
- ostream.write(out, 0, 4);
- }
- }
-
- /**
- * Outputs base64 representation of the specified byte array to a character stream.
- */
- public static void encode(byte[] data, int off, int len, Writer writer) throws IOException {
- if (len <= 0) {
- return;
- }
- char[] out = new char[4];
- int rindex = off;
- int rest = len - off;
- int output = 0;
- while (rest >= 3) {
- int i =
- ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8)
- + (data[rindex + 2] & 0xff);
- out[0] = S_BASE64CHAR[i >> 18];
- out[1] = S_BASE64CHAR[(i >> 12) & 0x3f];
- out[2] = S_BASE64CHAR[(i >> 6) & 0x3f];
- out[3] = S_BASE64CHAR[i & 0x3f];
- writer.write(out, 0, 4);
- rindex += 3;
- rest -= 3;
- output += 4;
- if (output % 76 == 0) {
- writer.write("\n");
- }
- }
- if (rest == 1) {
- int i = data[rindex] & 0xff;
- out[0] = S_BASE64CHAR[i >> 2];
- out[1] = S_BASE64CHAR[(i << 4) & 0x3f];
- out[2] = S_BASE64PAD;
- out[3] = S_BASE64PAD;
- writer.write(out, 0, 4);
- } else if (rest == 2) {
- int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
- out[0] = S_BASE64CHAR[i >> 10];
- out[1] = S_BASE64CHAR[(i >> 4) & 0x3f];
- out[2] = S_BASE64CHAR[(i << 2) & 0x3f];
- out[3] = S_BASE64PAD;
- writer.write(out, 0, 4);
- }
- }
- }
-
- /**
- * <p/>
- * Utility class for xs:hexbinary. </p>
- */
- public static final class HexBinary {
- private HexBinary() {
- }
-
- /**
- * Converts the string <code>pValue</code> into an array of hex bytes.
- */
- public static byte[] decode(String pValue) {
- if ((pValue.length() % 2) != 0) {
- throw new IllegalArgumentException("A HexBinary string must have even length.");
- }
- byte[] result = new byte[pValue.length() / 2];
- int j = 0;
- int i = 0;
- while (i < pValue.length()) {
- byte b;
- char c = pValue.charAt(i++);
- char d = pValue.charAt(i++);
- if (c >= '0' && c <= '9') {
- b = (byte) ((c - '0') << 4);
- } else if (c >= 'A' && c <= 'F') {
- b = (byte) ((c - 'A' + 10) << 4);
- } else if (c >= 'a' && c <= 'f') {
- b = (byte) ((c - 'a' + 10) << 4);
- } else {
- throw new IllegalArgumentException("Invalid hex digit: " + c);
- }
- if (d >= '0' && d <= '9') {
- b += (byte) (d - '0');
- } else if (d >= 'A' && d <= 'F') {
- b += (byte) (d - 'A' + 10);
- } else if (d >= 'a' && d <= 'f') {
- b += (byte) (d - 'a' + 10);
- } else {
- throw new IllegalArgumentException("Invalid hex digit: " + d);
- }
- result[j++] = b;
- }
- return result;
- }
-
- /**
- * Converts the byte array <code>pHexBinary</code> into a string.
- */
- public static String encode(byte[] pHexBinary) {
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < pHexBinary.length; i++) {
- byte b = pHexBinary[i];
- byte c = (byte) ((b & 0xf0) >> 4);
- if (c <= 9) {
- result.append((char) ('0' + c));
- } else {
- result.append((char) ('A' + c - 10));
- }
- c = (byte) (b & 0x0f);
- if (c <= 9) {
- result.append((char) ('0' + c));
- } else {
- result.append((char) ('A' + c - 10));
- }
- }
- return result.toString();
- }
-
- /**
- * Creates a clone of the given byte array.
- */
- public static byte[] getClone(byte[] pHexBinary) {
- byte[] result = new byte[pHexBinary.length];
- System.arraycopy(pHexBinary, 0, result, 0, pHexBinary.length);
- return result;
- }
- }
-
- public class XSDDateFormat extends XSDDateTimeFormat {
- private static final long serialVersionUID = -1629412916827246627L;
-
- /**
- * Creates a new instance.
- */
- public XSDDateFormat() {
- super(true, false);
- }
- }
-
- /**
- * <p/>
- * An instance of {@link java.text.Format}, which may be used to parse and format <code>xs:dateTime</code> values.
- * </p>
- */
- public static class XSDDateTimeFormat extends Format {
- private static final long serialVersionUID = -1148332471737068969L;
-
- final boolean parseDate;
-
- final boolean parseTime;
-
- /**
- * Creates a new instance.
- */
- public XSDDateTimeFormat() {
- this(true, true);
- }
-
- XSDDateTimeFormat(boolean pParseDate, boolean pParseTime) {
- parseDate = pParseDate;
- parseTime = pParseTime;
- }
-
- private void append(StringBuffer pBuffer, int pNum, int pMinLen) {
- String s = Integer.toString(pNum);
- for (int i = s.length(); i < pMinLen; i++) {
- pBuffer.append('0');
- }
- pBuffer.append(s);
- }
-
- @Override
- public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) {
- assert pCalendar != null : "The Calendar argument must not be null.";
- assert pBuffer != null : "The StringBuffer argument must not be null.";
- assert pPos != null : "The FieldPosition argument must not be null.";
-
- Calendar cal = (Calendar) pCalendar;
- if (parseDate) {
- int year = cal.get(Calendar.YEAR);
- if (year < 0) {
- pBuffer.append('-');
- year = -year;
- }
- append(pBuffer, year, 4);
- pBuffer.append('-');
- append(pBuffer, cal.get(Calendar.MONTH) + 1, 2);
- pBuffer.append('-');
- append(pBuffer, cal.get(Calendar.DAY_OF_MONTH), 2);
- if (parseTime) {
- pBuffer.append('T');
- }
- }
- if (parseTime) {
- append(pBuffer, cal.get(Calendar.HOUR_OF_DAY), 2);
- pBuffer.append(':');
- append(pBuffer, cal.get(Calendar.MINUTE), 2);
- pBuffer.append(':');
- append(pBuffer, cal.get(Calendar.SECOND), 2);
- int millis = cal.get(Calendar.MILLISECOND);
- if (millis > 0) {
- pBuffer.append('.');
- append(pBuffer, millis, 3);
- }
- }
- TimeZone tz = cal.getTimeZone();
- // JDK 1.4: int offset = tz.getOffset(cal.getTimeInMillis());
- int offset = cal.get(Calendar.ZONE_OFFSET);
- if (tz.inDaylightTime(cal.getTime())) {
- offset += cal.get(Calendar.DST_OFFSET);
- }
- if (offset == 0) {
- pBuffer.append('Z');
- } else {
- if (offset < 0) {
- pBuffer.append('-');
- offset = -offset;
- } else {
- pBuffer.append('+');
- }
- int minutes = offset / (60 * 1000);
- int hours = minutes / 60;
- minutes -= hours * 60;
- append(pBuffer, hours, 2);
- pBuffer.append(':');
- append(pBuffer, minutes, 2);
- }
- return pBuffer;
- }
-
- private int parseInt(String pString, int offset, StringBuffer pDigits) {
- int length = pString.length();
- int pOffset = offset;
- pDigits.setLength(0);
- while (pOffset < length) {
- char c = pString.charAt(pOffset);
- if (Character.isDigit(c)) {
- pDigits.append(c);
- ++pOffset;
- } else {
- break;
- }
- }
- return pOffset;
- }
-
- @Override
- public Object parseObject(String pString, ParsePosition pParsePosition) {
- assert pString != null : "The String argument must not be null.";
- assert pParsePosition != null : "The ParsePosition argument must not be null.";
- int offset = pParsePosition.getIndex();
- int length = pString.length();
-
- boolean isMinus = false;
- StringBuffer digits = new StringBuffer();
- int year = 0;
- int month = 0;
- int mday = 0;
- if (parseDate) {
- // Sign
- if (offset < length) {
- char c = pString.charAt(offset);
- if (c == '+') {
- ++offset;
- } else if (c == '-') {
- ++offset;
- isMinus = true;
- }
- }
-
- offset = parseInt(pString, offset, digits);
- if (digits.length() < 4) {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
- year = Integer.parseInt(digits.toString());
-
- if (offset < length && pString.charAt(offset) == '-') {
- ++offset;
- } else {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
-
- offset = parseInt(pString, offset, digits);
- if (digits.length() != 2) {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
- month = Integer.parseInt(digits.toString());
-
- if (offset < length && pString.charAt(offset) == '-') {
- ++offset;
- } else {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
-
- offset = parseInt(pString, offset, digits);
- if (digits.length() != 2) {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
- mday = Integer.parseInt(digits.toString());
-
- if (parseTime) {
- if (offset < length && pString.charAt(offset) == 'T') {
- ++offset;
- } else {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
- }
- } else {
- year = month = mday = 0;
- }
-
- int hour = 0;
- int minute = 0;
- int second = 0;
- int millis = 0;
- if (parseTime) {
- offset = parseInt(pString, offset, digits);
- if (digits.length() != 2) {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
- hour = Integer.parseInt(digits.toString());
-
- if (offset < length && pString.charAt(offset) == ':') {
- ++offset;
- } else {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
-
- offset = parseInt(pString, offset, digits);
- if (digits.length() != 2) {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
- minute = Integer.parseInt(digits.toString());
-
- if (offset < length && pString.charAt(offset) == ':') {
- ++offset;
- } else {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
-
- offset = parseInt(pString, offset, digits);
- if (digits.length() != 2) {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
- second = Integer.parseInt(digits.toString());
-
- if (offset < length && pString.charAt(offset) == '.') {
- ++offset;
- offset = parseInt(pString, offset, digits);
- if (digits.length() > 0) {
- millis = Integer.parseInt(digits.toString());
- } else {
- millis = 0;
- }
- } else {
- millis = 0;
- }
- } else {
- hour = minute = second = millis = 0;
- }
-
- digits.setLength(0);
- digits.append("GMT");
- if (offset < length) {
- char c = pString.charAt(offset);
- if (c == 'Z') {
- // Ignore UTC, it is the default
- ++offset;
- } else if (c == '+' || c == '-') {
- digits.append(c);
- ++offset;
- for (int i = 0; i < 5; i++) {
- if (offset >= length) {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
- c = pString.charAt(offset);
- if ((i != 2 && Character.isDigit(c)) || (i == 2 && c == ':')) {
- digits.append(c);
- } else {
- pParsePosition.setErrorIndex(offset);
- return null;
- }
- ++offset;
- }
- }
- }
-
- Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(digits.toString()));
- cal.set(isMinus ? -year : year, parseDate ? month - 1 : month, mday, hour, minute, second);
- cal.set(Calendar.MILLISECOND, millis);
- pParsePosition.setIndex(offset);
- return cal;
- }
- }
-
- public static class XSDTimeFormat extends XSDDateTimeFormat {
- private static final long serialVersionUID = 1346506860724640517L;
-
- /**
- * Creates a new instance.
- */
- public XSDTimeFormat() {
- super(false, true);
- }
- }
-
- private static final long MAX_UNSIGNED_INT = (((long) Integer.MAX_VALUE) * 2) + 1;
-
- private static final int MAX_UNSIGNED_SHORT = Short.MAX_VALUE * 2 + 1;
-
- public String parseAnySimpleType(String value) {
- return value;
- }
-
- public byte[] parseBase64Binary(String value) {
- return Base64Binary.decode(value);
- }
-
- public boolean parseBoolean(String value) {
- return Boolean.valueOf(value).booleanValue();
- }
-
- public byte parseByte(String value) {
- return Byte.parseByte(value);
- }
-
- public Calendar parseDate(String value) {
- XSDDateFormat format = new XSDDateFormat();
- ParsePosition pos = new ParsePosition(0);
- Calendar cal = (Calendar) format.parseObject(value, pos);
- if (cal == null) {
- throw new IllegalArgumentException("Failed to parse date " + value + " at:"
- + value.substring(pos.getErrorIndex()));
- }
- return cal;
- }
-
- public Calendar parseDateTime(String value) {
- XSDDateTimeFormat format = new XSDDateTimeFormat();
- ParsePosition pos = new ParsePosition(0);
- Calendar cal = (Calendar) format.parseObject(value, pos);
- if (cal == null) {
- throw new IllegalArgumentException("Failed to parse dateTime " + value + " at:"
- + value.substring(pos.getErrorIndex()));
- }
- return cal;
- }
-
- public BigDecimal parseDecimal(String value) {
- return new BigDecimal(value);
- }
-
- public double parseDouble(String value) {
- if ("INF".equals(value)) {
- return Double.POSITIVE_INFINITY;
- } else if ("-INF".equals(value)) {
- return Double.NEGATIVE_INFINITY;
- } else if ("NaN".equals(value)) {
- return Double.NaN;
- } else {
- return Double.parseDouble(value);
- }
- }
-
- public Duration parseDuration(String pDuration) {
- try {
- return DatatypeFactory.newInstance().newDuration(pDuration);
- } catch (DatatypeConfigurationException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public float parseFloat(String value) {
- if ("INF".equals(value)) {
- return Float.POSITIVE_INFINITY;
- } else if ("-INF".equals(value)) {
- return Float.NEGATIVE_INFINITY;
- } else if ("NaN".equals(value)) {
- return Float.NaN;
- } else {
- return Float.parseFloat(value);
- }
- }
-
- public byte[] parseHexBinary(String value) {
- return HexBinary.decode(value);
- }
-
- public int parseInt(String value) {
- return Integer.parseInt(value);
- }
-
- public BigInteger parseInteger(String value) {
- return new BigInteger(value);
- }
-
- public long parseLong(String value) {
- return Long.parseLong(value);
- }
-
- public QName parseQName(String value, NamespaceContext context) {
- int offset = value.indexOf(':');
- String uri;
- String localName;
- switch (offset) {
- case -1:
- localName = value;
- uri = context.getNamespaceURI("");
- if (uri == null) {
- // Should not happen, indicates an error in the
- // NamespaceContext
- // implementation
- throw new IllegalArgumentException("The default prefix is not bound.");
- }
- break;
- case 0:
- throw new IllegalArgumentException("Default prefix must be indicated by not using a colon: "
- + value);
- default:
- String prefix = value.substring(0, offset);
- localName = value.substring(offset + 1);
- uri = context.getNamespaceURI(prefix);
- if (uri == null) {
- throw new IllegalArgumentException("The prefix " + prefix + " is not bound.");
- }
- }
- return new QName(uri, localName);
- }
-
- public short parseShort(String value) {
- return Short.parseShort(value);
- }
-
- public String parseString(String value) {
- return value;
- }
-
- public Calendar parseTime(String value) {
- XSDTimeFormat format = new XSDTimeFormat();
- ParsePosition pos = new ParsePosition(0);
- Calendar cal = (Calendar) format.parseObject(value, pos);
- if (cal == null) {
- throw new IllegalArgumentException("Failed to parse time " + value + " at:"
- + value.substring(pos.getErrorIndex()));
- }
- return cal;
- }
-
- public long parseUnsignedInt(String value) {
- long l = Long.parseLong(value);
- if (l < 0) {
- throw new IllegalArgumentException("Failed to parse UnsignedInt " + value
- + ": result is negative");
- }
- if (l > MAX_UNSIGNED_INT) {
- throw new IllegalArgumentException("Failed to parse UnsignedInt " + value
- + ": result exceeds maximum value " + MAX_UNSIGNED_INT);
- }
- return l;
- }
-
- public int parseUnsignedShort(String value) {
- int i = Integer.parseInt(value);
- if (i < 0) {
- throw new IllegalArgumentException("Failed to parse UnsignedShort " + value
- + ": result is negative");
- }
- if (i > MAX_UNSIGNED_SHORT) {
- throw new IllegalArgumentException("Failed to parse UnsignedShort " + value
- + ": result exceeds maximum value " + MAX_UNSIGNED_SHORT);
- }
- return i;
- }
-
- public String printAnySimpleType(String value) {
- return value;
- }
-
- public String printBase64Binary(byte[] value) {
- return Base64Binary.encode(value);
- }
-
- public String printBoolean(boolean value) {
- return (value ? Boolean.TRUE : Boolean.FALSE).toString();
- }
-
- public String printByte(byte value) {
- return Byte.toString(value);
- }
-
- public String printDate(Calendar value) {
- return new XSDDateFormat().format(value);
- }
-
- public String printDateTime(Calendar value) {
- return new XSDDateTimeFormat().format(value);
- }
-
- public String printDecimal(BigDecimal value) {
- return value.toString();
- }
-
- public String printDouble(double value) {
- return Double.toString(value);
- }
-
- public String printDuration(Duration pDuration) {
- return pDuration.toString();
- }
-
- public String printFloat(float value) {
- return Float.toString(value);
- }
-
- public String printHexBinary(byte[] value) {
- return HexBinary.encode(value);
- }
-
- public String printInt(int value) {
- return Integer.toString(value);
- }
-
- public String printInteger(BigInteger value) {
- return value.toString();
- }
-
- public String printLong(long value) {
- return Long.toString(value);
- }
-
- public String printQName(QName value, NamespaceContext context) {
- String prefix = context.getPrefix(value.getNamespaceURI());
- if (prefix == null) {
- throw new IllegalArgumentException("The namespace URI " + value.getNamespaceURI()
- + " is not bound.");
- } else if (XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) {
- return value.getLocalPart();
- } else {
- return prefix + ":" + value.getLocalPart();
- }
- }
-
- public String printShort(short value) {
- return Short.toString(value);
- }
-
- public String printString(String value) {
- return value;
- }
-
- public String printTime(Calendar value) {
- return new XSDTimeFormat().format(value);
- }
-
- public String printUnsignedInt(long value) {
- return Long.toString(value);
- }
-
- public String printUnsignedShort(int value) {
- return Integer.toString(value);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java
deleted file mode 100644
index 2f95c2a9c6..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java
deleted file mode 100644
index 9615f43572..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.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/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java
deleted file mode 100644
index 58f594751a..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.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/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLStreamReaderTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLStreamReaderTransformer.java
deleted file mode 100644
index 4942fef0da..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLStreamReaderTransformer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.javabeans;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.xml.BeanXMLStreamReaderImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * Transformer to convert data from a JavaBean object to XMLStreamReader.
- *
- * @version $Rev$ $Date$
- */
-public class JavaBean2XMLStreamReaderTransformer extends BaseTransformer<Object, XMLStreamReader> implements
- PullTransformer<Object, XMLStreamReader> {
-
- public XMLStreamReader transform(Object source, TransformationContext context) {
- try {
- javax.xml.namespace.QName name = null;
- if (context != null) {
- Object logical = context.getSourceDataType().getLogical();
- if (logical instanceof XMLType) {
- name = ((XMLType)logical).getElementName();
- }
- }
- return new BeanXMLStreamReaderImpl(name, source);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Object> getSourceType() {
- return Object.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 50;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java
deleted file mode 100644
index b96b394bb8..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.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/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java
deleted file mode 100644
index c7d21ebc66..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.javabeans;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamClass;
-import java.io.OutputStream;
-import java.io.Serializable;
-
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-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 {
- /**
- * 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 {
- // return arg;
- throw new IllegalArgumentException("Argument type '" + arg.getClass().getCanonicalName() + "' is not Serializable. " +
- " Pass-by-value cannot be performed on this argument");
- }
- } catch (Exception e) {
- throw new IllegalArgumentException("Pass-by-value is not supported for the given object", e);
- }
- }
-
- protected ObjectOutputStream getObjectOutputStream(OutputStream os) throws IOException {
- return new ObjectOutputStream(os);
- }
-
- protected ObjectInputStream getObjectInputStream(InputStream is, final ClassLoader cl) throws IOException {
- ObjectInputStream ois = new ObjectInputStream(is) {
- @Override
- protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
- try {
- return Class.forName(desc.getName(), false, cl);
- } catch (ClassNotFoundException e) {
- 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/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaExceptionDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaExceptionDataBinding.java
deleted file mode 100644
index 7ae64c6a27..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaExceptionDataBinding.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/SimpleJavaDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/SimpleJavaDataBinding.java
deleted file mode 100644
index 61a2189c72..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/SimpleJavaDataBinding.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.javabeans;
-
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.databinding.xml.XMLStringDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * DataBinding for Java simple types
- *
- * @version $Rev$ $Date$
- */
-public class SimpleJavaDataBinding extends BaseDataBinding {
- public static final String NAME = "java:simpleType";
-
- public SimpleJavaDataBinding() {
- super(NAME, Object.class);
- }
-
- @Override
- public Object copy(Object arg, DataType dataType, Operation operation) {
- if (arg instanceof byte[]) {
- return ((byte[])arg).clone();
- }
- return arg;
- }
-
- @Override
- public boolean introspect(DataType type, Operation operation) {
- Class<?> cls = type.getPhysical();
- if (cls == Object.class) {
- return false;
- }
- // HACK: [rfeng] By pass the one know to XMLString
- String db = type.getDataBinding();
- if (db != null && (XMLStringDataBinding.NAME.equals(db))) {
- return false;
- }
- if (SimpleTypeMapperImpl.JAVA2XML.keySet().contains(cls)) {
- type.setDataBinding(NAME);
- QName elementName = null;
- Object logical = type.getLogical();
- if (logical instanceof XMLType) {
- elementName = ((XMLType)logical).getElementName();
- }
- TypeInfo typeInfo = SimpleTypeMapperImpl.getXMLType(cls);
- type.setLogical(new XMLType(elementName, typeInfo == null ? null : typeInfo.getQName()));
- return true;
- } else {
- return false;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java
deleted file mode 100644
index 01dd8fe963..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 && SimpleTypeMapperImpl.isSimpleXSDType(xmlType)) {
- return mapper.toJavaObject(xmlType, getText(xmlElement), context);
- } else {
- Class<?> javaType = (Class<?>)context.getTargetDataType().getPhysical();
- return createJavaObject(xmlElement, javaType, context);
- }
- }
-
- @SuppressWarnings("unchecked")
- private <L> L createJavaObject(T element, Class<L> javaType, TransformationContext context)
- throws XML2JavaMapperException {
- if (isTextOnly(element)) {
- return (L) mapper.toJavaObject(SimpleTypeMapperImpl.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/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java
deleted file mode 100644
index a723fd445c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.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/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/DataTypeHelper.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/DataTypeHelper.java
deleted file mode 100644
index 847fcf226c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/DataTypeHelper.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.util;
-
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.lang.reflect.WildcardType;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public final class DataTypeHelper {
- private DataTypeHelper() {
- }
-
- /**
- * Find all classes referenced by this data type though java generics
- * @param d
- * @return
- */
- public static Set<Class<?>> findClasses(DataType d) {
- Set<Class<?>> classes = new HashSet<Class<?>>();
- Set<Type> visited = new HashSet<Type>();
- findClasses(d, classes, visited);
- return classes;
- }
-
- private static void findClasses(DataType d, Set<Class<?>> classes, Set<Type> visited) {
- if (d == null) {
- return;
- }
- classes.add(d.getPhysical());
- if (d.getPhysical() != d.getGenericType()) {
- findClasses(d.getGenericType(), classes, visited);
- }
- }
-
- /**
- * Find referenced classes in the generic type
- * @param type
- * @param classSet
- * @param visited
- */
- private static void findClasses(Type type, Set<Class<?>> classSet, Set<Type> visited) {
- if (visited.contains(type) || type == null) {
- return;
- }
- visited.add(type);
- if (type instanceof Class) {
- Class<?> cls = (Class<?>)type;
- if (!cls.isInterface()) {
- classSet.add(cls);
- }
- return;
- } else if (type instanceof ParameterizedType) {
- ParameterizedType pType = (ParameterizedType)type;
- findClasses(pType.getRawType(), classSet, visited);
- for (Type t : pType.getActualTypeArguments()) {
- findClasses(t, classSet, visited);
- }
- } else if (type instanceof TypeVariable) {
- TypeVariable<?> tv = (TypeVariable<?>)type;
- for (Type t : tv.getBounds()) {
- findClasses(t, classSet, visited);
- }
- } else if (type instanceof GenericArrayType) {
- GenericArrayType gType = (GenericArrayType)type;
- findClasses(gType, classSet, visited);
- } else if (type instanceof WildcardType) {
- WildcardType wType = (WildcardType)type;
- for (Type t : wType.getLowerBounds()) {
- findClasses(t, classSet, visited);
- }
- for (Type t : wType.getUpperBounds()) {
- findClasses(t, classSet, visited);
- }
- }
- }
-
- /**
- * Get all the data types in the interface
- * @param intf The interface
- * @param useWrapper Use wrapper classes?
- * @return A list of DataTypes
- */
- public static List<DataType> getDataTypes(Interface intf, boolean useWrapper) {
- List<DataType> dataTypes = new ArrayList<DataType>();
- for (Operation op : intf.getOperations()) {
- getDataTypes(dataTypes, op, useWrapper);
- }
- return dataTypes;
- }
-
- /**
- * Get all the data types in the operation
- * @param op The operation
- * @param useWrapper Use wrapper classes?
- * @return A list of DataTypes
- */
- public static List<DataType> getDataTypes(Operation op, boolean useWrapper) {
- List<DataType> dataTypes = new ArrayList<DataType>();
- getDataTypes(dataTypes, op, useWrapper);
- return dataTypes;
- }
-
- private static void getDataTypes(List<DataType> dataTypes, Operation op, boolean useWrapper) {
- WrapperInfo wrapper = op.getWrapper();
- if (useWrapper && wrapper != null) {
- DataType dt1 = wrapper.getInputWrapperType();
- if (dt1 != null) {
- dataTypes.add(dt1);
- }
- DataType dt2 = wrapper.getOutputWrapperType();
- if (dt2 != null) {
- dataTypes.add(dt2);
- }
- }
- // FIXME: [rfeng] We may need to find the referenced classes in the child types
- // else
- {
- for (DataType dt1 : op.getInputType().getLogical()) {
- dataTypes.add(dt1);
- }
- DataType dt2 = op.getOutputType();
- if (dt2 != null) {
- dataTypes.add(dt2);
- }
- }
- for (DataType<DataType> dt3 : op.getFaultTypes()) {
- DataType dt4 = dt3.getLogical();
- if (dt4 != null) {
- dataTypes.add(dt4);
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/LRUCache.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/LRUCache.java
deleted file mode 100644
index 34a82fd2d3..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/util/LRUCache.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.util;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * A Simple LRU Cache
- *
- * @version $Revision$
- * @param <K>
- * @param <V>
- */
-
-public class LRUCache<K, V> extends LinkedHashMap<K, V> {
- private static final long serialVersionUID = -342098639681884413L;
- protected int maxCacheSize = 4096;
-
- /**
- * Default constructor for an LRU Cache The default capacity is 10000
- */
- public LRUCache() {
- this(0, 4096, 0.75f, true);
- }
-
- /**
- * Constructs a LRUCache with a maximum capacity
- *
- * @param maximumCacheSize
- */
- public LRUCache(int maximumCacheSize) {
- this(0, maximumCacheSize, 0.75f, true);
- }
-
- /**
- * Constructs an empty <tt>LRUCache</tt> instance with the specified
- * initial capacity, maximumCacheSize,load factor and ordering mode.
- *
- * @param initialCapacity the initial capacity.
- * @param maximumCacheSize
- * @param loadFactor the load factor.
- * @param accessOrder the ordering mode - <tt>true</tt> for access-order,
- * <tt>false</tt> for insertion-order.
- * @throws IllegalArgumentException if the initial capacity is negative or
- * the load factor is non-positive.
- */
-
- public LRUCache(int initialCapacity, int maximumCacheSize, float loadFactor, boolean accessOrder) {
- super(initialCapacity, loadFactor, accessOrder);
- this.maxCacheSize = maximumCacheSize;
- }
-
- /**
- * @return Returns the maxCacheSize.
- */
- public int getMaxCacheSize() {
- return maxCacheSize;
- }
-
- /**
- * @param maxCacheSize The maxCacheSize to set.
- */
- public void setMaxCacheSize(int maxCacheSize) {
- this.maxCacheSize = maxCacheSize;
- }
-
- @Override
- protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
- return size() > maxCacheSize;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderImpl.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderImpl.java
deleted file mode 100644
index 3423d3e3b0..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderImpl.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.beans.BeanInfo;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BeanXMLStreamReaderImpl extends XmlTreeStreamReaderImpl {
- private static final Comparator<Accessor> COMPARATOR = new Comparator<Accessor>() {
- public int compare(Accessor o1, Accessor o2) {
- return o1.getName().compareTo(o2.getName());
- }
- };
-
- public static class BeanXmlNodeImpl extends SimpleXmlNodeImpl implements XmlNode {
- private static final Object[] NULL = null;
- private static final SimpleTypeMapperImpl MAPPER = new SimpleTypeMapperImpl();
-
- public BeanXmlNodeImpl(Object bean) {
- super(getName(bean == null ? null : bean.getClass()), bean);
- }
-
- public BeanXmlNodeImpl(QName name, Object bean) {
- super(name, bean);
- }
-
- private static boolean isSimpleType(Class<?> javaType) {
- return SimpleTypeMapperImpl.getXMLType(javaType) != null;
- }
-
- private static String getStringValue(Object o) {
- if (o == null) {
- return null;
- }
- TypeInfo info = SimpleTypeMapperImpl.getXMLType(o.getClass());
- if (info != null) {
- return MAPPER.toXMLLiteral(info.getQName(), o, null);
- } else {
- return String.valueOf(o);
- }
- }
-
- @Override
- public Iterator<XmlNode> children() {
- if (name == null) {
- return null;
- }
- if (value == null) {
- return super.children();
- }
- if (isSimpleType(value.getClass())) {
- XmlNode textNode = new BeanXmlNodeImpl(null, value);
- return Arrays.asList(textNode).iterator();
- }
- if (Map.class.isAssignableFrom(value.getClass())) {
- List<XmlNode> entries = new ArrayList<XmlNode>();
- QName entryName = new QName(name.getNamespaceURI(), "entry");
- Map map = (Map)value;
- if (map != null) {
- for (Object e : map.entrySet()) {
- Map.Entry entry = (Map.Entry)e;
- entries.add(new BeanXmlNodeImpl(entryName, entry));
- }
- }
- return entries.iterator();
- }
- try {
- Map<String, Accessor> accessorMap = getAccessors(value);
- List<Accessor> accessorList = new ArrayList<Accessor>(accessorMap.values());
- Collections.sort(accessorList, COMPARATOR);
-
- List<XmlNode> props = new ArrayList<XmlNode>();
- for (Accessor accessor : accessorList) {
- Class<?> pType = accessor.getType();
-
- QName pName = new QName(name.getNamespaceURI(), accessor.getName());
- Object pValue = accessor.getValue();
- if (pType.isArray()) {
- if (pValue != null) {
- int i1 = Array.getLength(pValue);
- for (int j = 0; j < i1; j++) {
- Object o = Array.get(pValue, j);
- props.add(new BeanXmlNodeImpl(pName, o));
- }
- } else {
- // TODO: How to handle null?
- }
- } else if (Collection.class.isAssignableFrom(pType)) {
- Collection objList = (Collection)pValue;
- if (objList != null && objList.size() > 0) {
- for (Iterator j = objList.iterator(); j.hasNext();) {
- Object o = j.next();
- props.add(new BeanXmlNodeImpl(pName, o));
- }
-
- } else {
- // How to handle null
- }
- } else {
- props.add(new BeanXmlNodeImpl(pName, pValue));
- }
- }
- return props.iterator();
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- @Override
- public QName getName() {
- return name;
- }
-
- @Override
- public String getValue() {
- return getStringValue(value);
- }
-
- private static String getPackageName(Class<?> cls) {
- String name = cls.getName();
- int index = name.lastIndexOf('.');
- return index == -1 ? "" : name.substring(0, index);
- }
-
- public static QName getName(Class<?> cls) {
- if (cls == null) {
- return null;
- }
-
- String packageName = getPackageName(cls);
-
- if ("".equals(packageName)) {
- return new QName("", cls.getSimpleName());
- }
- StringBuffer ns = new StringBuffer("http://");
- String[] names = packageName.split("\\.");
- for (int i = names.length - 1; i >= 0; i--) {
- ns.append(names[i]);
- if (i != 0) {
- ns.append('.');
- }
- }
- ns.append('/');
- return new QName(ns.toString(), cls.getSimpleName());
- }
-
- }
-
- public BeanXMLStreamReaderImpl(QName name, Object bean) {
- super(getXmlNode(name, bean));
- }
-
- private static BeanXmlNodeImpl getXmlNode(QName name, Object bean) {
- BeanXmlNodeImpl root = null;
- if (name != null) {
- root = new BeanXmlNodeImpl(name, bean);
- } else {
- root = new BeanXmlNodeImpl(bean);
- }
- return root;
- }
-
- public static interface Accessor {
- String getName();
-
- Class<?> getType();
-
- Object getValue() throws Exception;
-
- void setValue(Object value) throws Exception;
- }
-
- private static class FieldAccessor implements Accessor {
- private Object target;
- private Field field;
-
- public FieldAccessor(Object target, Field field) {
- super();
- this.target = target;
- this.field = field;
- this.field.setAccessible(true);
- }
-
- public String getName() {
- return field.getName();
- }
-
- public Object getValue() throws Exception {
- return field.get(target);
- }
-
- public void setValue(Object value) throws Exception {
- field.set(target, value);
- }
-
- public Class<?> getType() {
- return field.getType();
- }
-
- }
-
- private static class PropertyAccessor implements Accessor {
- private Object target;
- private PropertyDescriptor prop;
-
- public PropertyAccessor(Object target, PropertyDescriptor prop) {
- super();
- this.target = target;
- this.prop = prop;
- }
-
- public String getName() {
- return prop.getName();
- }
-
- public Class<?> getType() {
- return prop.getPropertyType();
- }
-
- public Object getValue() throws Exception {
- Method getter = prop.getReadMethod();
- if (getter != null) {
- getter.setAccessible(true);
- return getter.invoke(target);
- }
- throw new IllegalAccessException("The property cannot be read: " + getName());
- }
-
- public void setValue(Object value) throws Exception {
- Method setter = prop.getWriteMethod();
- if (setter != null) {
- setter.setAccessible(true);
- setter.invoke(target);
- }
- throw new IllegalAccessException("The property cannot be written: " + getName());
- }
-
- }
-
- private static Map<String, Accessor> getAccessors(Object target) throws Exception {
- if (target == null) {
- return Collections.emptyMap();
- }
- Map<String, Accessor> map = new HashMap<String, Accessor>();
- Class<?> type = target.getClass();
- for (Field f : type.getFields()) {
- map.put(f.getName(), new FieldAccessor(target, f));
- }
- BeanInfo info = Introspector.getBeanInfo(type, Object.class);
- for (PropertyDescriptor p : info.getPropertyDescriptors()) {
- // if (p.getReadMethod() != null && p.getWriteMethod() != null) {
- map.put(p.getName(), new PropertyAccessor(target, p));
- // }
- }
- return map;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMDataBinding.java
deleted file mode 100644
index e029604722..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMDataBinding.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-
-import javax.xml.namespace.QName;
-
-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;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.w3c.dom.Node;
-
-/**
- * DOM DataBinding
- *
- * @version $Rev$ $Date$
- */
-public class DOMDataBinding extends BaseDataBinding {
- public static final String NAME = Node.class.getName();
-
- public static final String ROOT_NAMESPACE = "http://tuscany.apache.org/xmlns/sca/databinding/dom/1.0";
- public static final QName ROOT_ELEMENT = new QName(ROOT_NAMESPACE, "root");
-
- public DOMDataBinding() {
- super(NAME, Node.class);
- }
-
- @Override
- public WrapperHandler getWrapperHandler() {
- return new DOMWrapperHandler();
- }
-
- @Override
- public Object copy(Object source, DataType dataType, Operation operation) {
- if (Node.class.isAssignableFrom(source.getClass())) {
- Node nodeSource = (Node)source;
- return nodeSource.cloneNode(true);
- }
- return super.copy(source, dataType, operation);
- }
-
- @Override
- public boolean introspect(DataType type, Operation operation) {
- if (Node.class.isAssignableFrom(type.getPhysical())) {
- if (type.getLogical() == null) {
- type.setLogical(new XMLType(ROOT_ELEMENT, null));
- }
- type.setDataBinding(NAME);
- return true;
- }
- return false;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java
deleted file mode 100644
index 9e1ebb3522..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class DOMWrapperHandler implements WrapperHandler<Node> {
-
- public DOMWrapperHandler() {
- super();
- }
-
- public Node create(Operation operation, boolean input) {
- try {
- WrapperInfo wrapperInfo = operation.getWrapper();
- ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
- // Class<?> wrapperClass = input ? wrapperInfo.getInputWrapperClass() : wrapperInfo.getOutputWrapperClass();
- Document document = DOMHelper.newDocument();
- QName name = element.getQName();
- return DOMHelper.createElement(document, name);
- } catch (ParserConfigurationException e) {
- throw new TransformationException(e);
- }
- }
-
- public void setChildren(Node wrapper,
- Object[] childObjects,
- Operation operation, boolean input) {
- List<ElementInfo> childElements = input? operation.getWrapper().getInputChildElements():
- operation.getWrapper().getOutputChildElements();
- for (int i = 0; i < childElements.size(); i++) {
- setChild(wrapper, i, childElements.get(i), childObjects[i]);
- }
-
- }
- public void setChild(Node wrapper, int i, ElementInfo childElement, Object value) {
- Node node = (Node)value;
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- node = ((Document)node).getDocumentElement();
- }
- wrapper.appendChild(wrapper.getOwnerDocument().importNode(node, true));
- }
-
- public List getChildren(Node wrapper, Operation operation, boolean input) {
- assert wrapper != null;
- List<ElementInfo> childElements = input? operation.getWrapper().getInputChildElements():
- operation.getWrapper().getOutputChildElements();
- if (wrapper.getNodeType() == Node.DOCUMENT_NODE) {
- wrapper = ((Document)wrapper).getDocumentElement();
- }
- List<Node> elements = new ArrayList<Node>();
- NodeList nodes = wrapper.getChildNodes();
- for (int j = 0; j < nodes.getLength(); j++) {
- Node node = nodes.item(j);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- elements.add(node);
- }
- }
- return elements;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
- */
- public DataType getWrapperType(Operation operation, boolean input) {
- WrapperInfo wrapper = operation.getWrapper();
- ElementInfo element = input? wrapper.getInputWrapperElement(): wrapper.getOutputWrapperElement();
- DataType<XMLType> wrapperType =
- new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class, new XMLType(element));
- return wrapperType;
- }
-
- public boolean isInstance(Object wrapperObj,
- Operation operation,
- boolean input) {
- WrapperInfo wrapperInfo = operation.getWrapper();
- ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
- List<ElementInfo> childElements =
- input ? wrapperInfo.getInputChildElements() : wrapperInfo.getOutputChildElements();
- Node wrapper = (Node)wrapperObj;
- if (wrapper.getNodeType() == Node.DOCUMENT_NODE) {
- wrapper = ((Document)wrapper).getDocumentElement();
- }
- QName elementName = new QName(wrapper.getNamespaceURI(), wrapper.getLocalName());
- if (!element.getQName().equals(elementName)) {
- return false;
- }
- Set<QName> names = new HashSet<QName>();
- for (ElementInfo e : childElements) {
- names.add(e.getQName());
- }
- NodeList nodes = wrapper.getChildNodes();
- for (int j = 0; j < nodes.getLength(); j++) {
- Node node = nodes.item(j);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- elementName = new QName(wrapper.getNamespaceURI(), wrapper.getLocalName());
- if (!names.contains(elementName)) {
- return false;
- }
- }
- }
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXMLStreamReader.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXMLStreamReader.java
deleted file mode 100644
index 8c7a742cdd..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXMLStreamReader.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import org.w3c.dom.Node;
-
-public class DOMXMLStreamReader extends XmlTreeStreamReaderImpl {
-
- public DOMXMLStreamReader(Node node) {
- super(new DOMXmlNodeImpl(node));
- switch (node.getNodeType()) {
- case Node.DOCUMENT_NODE:
- break;
- case Node.ELEMENT_NODE:
- break;
- default:
- throw new IllegalArgumentException("Illegal node type: " + node);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXmlNodeImpl.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXmlNodeImpl.java
deleted file mode 100644
index 507c141c33..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXmlNodeImpl.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DOMXmlNodeImpl implements XmlNode {
- private Node node;
- private Map<String, String> namespaces;
- private Type type;
-
- /**
- * @param element
- */
- public DOMXmlNodeImpl(Node element) {
- super();
- if (element.getNodeType() == Node.DOCUMENT_NODE) {
- this.node = ((Document)element).getDocumentElement();
- } else {
- this.node = element;
- }
- switch (node.getNodeType()) {
- case Node.CDATA_SECTION_NODE:
- this.type = Type.CHARACTERS;
- break;
- case Node.ELEMENT_NODE:
- this.type = Type.ELEMENT;
- break;
- case Node.TEXT_NODE:
- this.type = Type.CHARACTERS;
- break;
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#attributes()
- */
- public List<XmlNode> attributes() {
- if (type != Type.ELEMENT) {
- return null;
- }
- NamedNodeMap attrs = node.getAttributes();
- List<XmlNode> xmlAttrs = new ArrayList<XmlNode>();
- for (int i = 0; i < attrs.getLength(); i++) {
- Attr attr = (Attr)attrs.item(i);
- if (!attr.getName().equals("xmlns") && !attr.getName().startsWith("xmlns:")) {
- xmlAttrs.add(new SimpleXmlNodeImpl(getQName(attr), attr.getValue(), XmlNode.Type.ATTRIBUTE));
- }
- }
- return xmlAttrs;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#children()
- */
- public Iterator<XmlNode> children() {
- if (type != Type.ELEMENT) {
- return null;
- }
- NodeList nodes = node.getChildNodes();
- List<XmlNode> xmlNodes = new ArrayList<XmlNode>();
- for (int i = 0; i < nodes.getLength(); i++) {
- Node child = (Node)nodes.item(i);
- int nodeType = child.getNodeType();
- if (nodeType == Node.ELEMENT_NODE || nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
- xmlNodes.add(new DOMXmlNodeImpl(child));
- }
- }
- return xmlNodes.iterator();
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#getName()
- */
- public QName getName() {
- return getQName(node);
- }
-
- private static QName getQName(Node node) {
- int type = node.getNodeType();
- if (type == Node.ELEMENT_NODE || type == Node.ATTRIBUTE_NODE) {
- String ns = node.getNamespaceURI();
- String prefix = node.getPrefix();
- String localName = node.getLocalName();
- return new QName(ns == null ? "" : ns, localName, prefix == null ? "" : prefix);
- }
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#getValue()
- */
- public String getValue() {
- return node.getNodeValue();
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#namespaces()
- */
- public Map<String, String> namespaces() {
- if (type != Type.ELEMENT) {
- return null;
- }
- if (namespaces == null) {
- namespaces = new HashMap<String, String>();
- NamedNodeMap attrs = node.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Attr attr = (Attr)attrs.item(i);
- if ("xmlns".equals(attr.getPrefix())) {
- namespaces.put(attr.getLocalName(), attr.getValue());
- }
- if ("xmlns".equals(attr.getName())) {
- namespaces.put("", attr.getValue());
- }
- }
- }
- return namespaces;
- }
-
- public Type getType() {
- return type;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DelegatingNamespaceContext.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DelegatingNamespaceContext.java
deleted file mode 100644
index 7f49a50e1e..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DelegatingNamespaceContext.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.ArrayList;
-import java.util.EmptyStackException;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.NamespaceContext;
-
-public class DelegatingNamespaceContext implements NamespaceContext {
- private static int count;
-
- private class WrappingIterator implements Iterator {
-
- private Iterator containedIterator;
-
- public WrappingIterator(Iterator containedIterator) {
- this.containedIterator = containedIterator;
- }
-
- public Iterator getContainedIterator() {
- return containedIterator;
- }
-
- public boolean hasNext() {
- return containedIterator.hasNext();
- }
-
- public Object next() {
- return containedIterator.next();
- }
-
- /**
- * As per the contract on the API of Namespace context the returned iterator should be immutable
- */
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public void setContainedIterator(Iterator containedIterator) {
- this.containedIterator = containedIterator;
- }
- }
-
- private NamespaceContext parentNsContext;
-
- private FastStack<String> prefixStack = new FastStack<String>();
-
- // Keep two ArrayLists for the prefixes and namespaces. They should be in
- // sync
- // since the index of the entry will be used to relate them
- // use the minimum initial capacity to let things handle memory better
-
- private FastStack<String> uriStack = new FastStack<String>();
-
- /**
- * Generates a unique namespace prefix that is not in the scope of the NamespaceContext
- *
- * @return string
- */
- public String generateUniquePrefix() {
- String prefix = "p" + count++;
- // null should be returned if the prefix is not bound!
- while (getNamespaceURI(prefix) != null) {
- prefix = "p" + count++;
- }
-
- return prefix;
- }
-
- public String getNamespaceURI(String prefix) {
- // do the corrections as per the Javadoc
- int index = prefixStack.search(prefix);
- if (index != -1) {
- return uriStack.get(index);
- }
- if (parentNsContext != null) {
- return parentNsContext.getPrefix(prefix);
- }
- return null;
- }
-
- public NamespaceContext getParentNsContext() {
- return parentNsContext;
- }
-
- public String getPrefix(String uri) {
- // do the corrections as per the Javadoc
- int index = uriStack.search(uri);
- if (index != -1) {
- return prefixStack.get(index);
- }
-
- if (parentNsContext != null) {
- return parentNsContext.getPrefix(uri);
- }
- return null;
- }
-
- public Iterator getPrefixes(String uri) {
- // create an ArrayList that contains the relevant prefixes
- String[] uris = uriStack.toArray(new String[uriStack.size()]);
- List<String> tempList = new ArrayList<String>();
- for (int i = uris.length - 1; i >= 0; i--) {
- if (uris[i].equals(uri)) {
- tempList.add(prefixStack.get(i));
- // we assume that array conversion preserves the order
- }
- }
- // by now all the relevant prefixes are collected
- // make a new iterator and provide a wrapper iterator to
- // obey the contract on the API
- return new WrappingIterator(tempList.iterator());
- }
-
- /**
- * Pop a namespace
- */
- public void popNamespace() {
- prefixStack.pop();
- uriStack.pop();
- }
-
- /**
- * Register a namespace in this context
- *
- * @param prefix
- * @param uri
- */
- public void pushNamespace(String prefix, String uri) {
- prefixStack.push(prefix);
- uriStack.push(uri);
-
- }
-
- public void setParentNsContext(NamespaceContext parentNsContext) {
- this.parentNsContext = parentNsContext;
- }
-
- /**
- * An implementation of the {@link java.util.Stack} API that is based on an <code>ArrayList</code> instead of a
- * <code>Vector</code>, so it is not synchronized to protect against multi-threaded access. The implementation is
- * therefore operates faster in environments where you do not need to worry about multiple thread contention.
- * <p>
- * The removal order of an <code>ArrayStack</code> is based on insertion order: The most recently added element is
- * removed first. The iteration order is <i>not</i> the same as the removal order. The iterator returns elements
- * from the bottom up, whereas the {@link #remove()} method removes them from the top down.
- * <p>
- * Unlike <code>Stack</code>, <code>ArrayStack</code> accepts null entries.
- */
- public static class FastStack<T> extends ArrayList<T> {
-
- /** Ensure Serialization compatibility */
- private static final long serialVersionUID = 2130079159931574599L;
-
- /**
- * Constructs a new empty <code>ArrayStack</code>. The initial size is controlled by <code>ArrayList</code>
- * and is currently 10.
- */
- public FastStack() {
- super();
- }
-
- /**
- * Constructs a new empty <code>ArrayStack</code> with an initial size.
- *
- * @param initialSize the initial size to use
- * @throws IllegalArgumentException if the specified initial size is negative
- */
- public FastStack(int initialSize) {
- super(initialSize);
- }
-
- /**
- * Return <code>true</code> if this stack is currently empty.
- * <p>
- * This method exists for compatibility with <code>java.util.Stack</code>. New users of this class should use
- * <code>isEmpty</code> instead.
- *
- * @return true if the stack is currently empty
- */
- public boolean empty() {
- return isEmpty();
- }
-
- /**
- * Returns the top item off of this stack without removing it.
- *
- * @return the top item on the stack
- * @throws EmptyStackException if the stack is empty
- */
- public T peek() throws EmptyStackException {
- int n = size();
- if (n <= 0) {
- throw new EmptyStackException();
- } else {
- return get(n - 1);
- }
- }
-
- /**
- * Returns the n'th item down (zero-relative) from the top of this stack without removing it.
- *
- * @param n the number of items down to go
- * @return the n'th item on the stack, zero relative
- * @throws EmptyStackException if there are not enough items on the stack to satisfy this request
- */
- public T peek(int n) throws EmptyStackException {
- int m = (size() - n) - 1;
- if (m < 0) {
- throw new EmptyStackException();
- } else {
- return get(m);
- }
- }
-
- /**
- * Pops the top item off of this stack and return it.
- *
- * @return the top item on the stack
- * @throws EmptyStackException if the stack is empty
- */
- public T pop() throws EmptyStackException {
- int n = size();
- if (n <= 0) {
- throw new EmptyStackException();
- } else {
- return remove(n - 1);
- }
- }
-
- /**
- * Pushes a new item onto the top of this stack. The pushed item is also returned. This is equivalent to calling
- * <code>add</code>.
- *
- * @param item the item to be added
- * @return the item just pushed
- */
- public Object push(T item) {
- add(item);
- return item;
- }
-
- /**
- * Returns the top-most index for the object in the stack
- *
- * @param object the object to be searched for
- * @return top-most index, or -1 if not found
- */
- public int search(T object) {
- int i = size() - 1; // Current index
- while (i >= 0) {
- T current = get(i);
- if ((object == null && current == null) || (object != null && object.equals(current))) {
- return i;
- }
- i--;
- }
- return -1;
- }
-
- /**
- * Returns the element on the top of the stack.
- *
- * @return the element on the top of the stack
- * @throws EmptyStackException if the stack is empty
- */
- public T get() {
- int size = size();
- if (size == 0) {
- throw new EmptyStackException();
- }
- return get(size - 1);
- }
-
- /**
- * Removes the element on the top of the stack.
- *
- * @return the removed element
- * @throws EmptyStackException if the stack is empty
- */
- public T remove() {
- int size = size();
- if (size == 0) {
- throw new EmptyStackException();
- }
- return remove(size - 1);
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2Node.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2Node.java
deleted file mode 100644
index 5f583da283..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2Node.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-/**
- * Push DOM InputSource to Node
- *
- * @version $Rev$ $Date$
- */
-public class InputSource2Node extends BaseTransformer<InputSource, Node> implements
- PullTransformer<InputSource, Node> {
- private static final Source2ResultTransformer TRANSFORMER = new Source2ResultTransformer();
-
- public Node transform(InputSource source, TransformationContext context) {
- try {
- Source streamSource = new StreamSource(source.getCharacterStream());
- DOMResult result = new DOMResult();
- TRANSFORMER.transform(streamSource, result, context);
- return result.getNode();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public Class<InputSource> getSourceType() {
- return InputSource.class;
- }
-
- @Override
- public Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2SAX.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2SAX.java
deleted file mode 100644
index 39116ba4a1..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2SAX.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * Push InputSource to SAX
- *
- * @version $Rev$ $Date$
- */
-public class InputSource2SAX extends BaseTransformer<InputSource, ContentHandler> implements
- PushTransformer<InputSource, ContentHandler> {
-
- public void transform(InputSource source, ContentHandler target, TransformationContext context) {
- try {
- XMLReader reader = XMLReaderFactory.createXMLReader();
- reader.setFeature("http://xml.org/sax/features/namespaces", true);
- reader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
- reader.setContentHandler(target);
- reader.parse(source);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public Class<InputSource> getSourceType() {
- return InputSource.class;
- }
-
- @Override
- public Class<ContentHandler> getTargetType() {
- return ContentHandler.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2Node.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2Node.java
deleted file mode 100644
index e40c3006fb..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2Node.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.InputStream;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXSource;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-/**
- * Push DOM InputSource to Node
- *
- * @version $Rev$ $Date$
- */
-public class InputStream2Node extends BaseTransformer<InputStream, Node> implements
- PullTransformer<InputStream, Node> {
- private static final Source2ResultTransformer TRANSFORMER = new Source2ResultTransformer();
-
- public Node transform(InputStream source, TransformationContext context) {
- try {
- Source streamSource = new SAXSource(new InputSource(source));
- DOMResult result = new DOMResult();
- TRANSFORMER.transform(streamSource, result, context);
- return result.getNode();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public Class<InputStream> getSourceType() {
- return InputStream.class;
- }
-
- @Override
- public Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2SAX.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2SAX.java
deleted file mode 100644
index 3b7bd3088a..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2SAX.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.InputStream;
-
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * Push InputStream to SAX
- *
- * @version $Rev$ $Date$
- */
-public class InputStream2SAX extends BaseTransformer<InputStream, ContentHandler> implements
- PushTransformer<InputStream, ContentHandler> {
- public void transform(InputStream source, ContentHandler target, TransformationContext context) {
- try {
- XMLReader reader = XMLReaderFactory.createXMLReader();
- reader.setContentHandler(target);
- reader.parse(new InputSource(source));
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public Class<InputStream> getSourceType() {
- return InputStream.class;
- }
-
- @Override
- public Class<ContentHandler> getTargetType() {
- return ContentHandler.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValueArrayStreamReader.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValueArrayStreamReader.java
deleted file mode 100644
index 5a31d9db91..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValueArrayStreamReader.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-
-public class NameValueArrayStreamReader implements XMLFragmentStreamReader {
-
- private static final int START_ELEMENT_STATE = 0;
- private static final int TEXT_STATE = 1;
- private static final int END_ELEMENT_STATE = 2;
- private static final int FINAL_END_ELEMENT_STATE = 3;
- private static final int START_ELEMENT_STATE_WITH_NULL = 4;
-
- private DelegatingNamespaceContext namespaceContext = new DelegatingNamespaceContext();
- // the index of the array
- private int arrayIndex;
-
- private QName name;
- private String[] values;
-
- // start element is the default state
- private int state = START_ELEMENT_STATE;
-
- public NameValueArrayStreamReader(QName name, String[] values) {
- this.name = name;
- this.values = values;
- }
-
- public void setParentNamespaceContext(NamespaceContext nsContext) {
- this.namespaceContext.setParentNsContext(nsContext);
- }
-
- public void init() {
- // TODO what if the QName namespace has not been declared
- }
-
- public Object getProperty(String string) throws IllegalArgumentException {
- return null;
- }
-
- /**
- * @throws XMLStreamException
- */
- public int next() throws XMLStreamException {
- switch (state) {
- case START_ELEMENT_STATE:
- if (values.length > 0) {
- state = TEXT_STATE;
- return CHARACTERS;
- } else {
- state = FINAL_END_ELEMENT_STATE;
- return END_ELEMENT;
- }
-
- case START_ELEMENT_STATE_WITH_NULL:
- if (arrayIndex == (values.length - 1)) {
- state = FINAL_END_ELEMENT_STATE;
- } else {
- state = END_ELEMENT_STATE;
- }
- return END_ELEMENT;
- case FINAL_END_ELEMENT_STATE:
- // oops, not supposed to happen!
- throw new XMLStreamException("end already reached!");
- case END_ELEMENT_STATE:
- // we've to have more values since this is not the
- // last value
- // increment the counter
- arrayIndex++;
- if (values[arrayIndex] == null) {
- state = START_ELEMENT_STATE_WITH_NULL;
- } else {
- state = START_ELEMENT_STATE;
- }
- return START_ELEMENT;
- case TEXT_STATE:
- if (arrayIndex == (values.length - 1)) {
- state = FINAL_END_ELEMENT_STATE;
- return END_ELEMENT;
- } else {
- state = END_ELEMENT_STATE;
- return END_ELEMENT;
- }
-
- default:
- throw new XMLStreamException("unknown event type!");
- }
- }
-
- public void require(int i, String string, String string1) throws XMLStreamException {
- // nothing done here
- }
-
- public String getElementText() throws XMLStreamException {
- return null; // not implemented
- }
-
- public int nextTag() throws XMLStreamException {
- return 0; // not implemented
- }
-
- public String getAttributeValue(String string, String string1) {
- if (state == TEXT_STATE) {
- // TODO something
- return null;
- } else {
- return null;
- }
-
- }
-
- public int getAttributeCount() {
- if (state == START_ELEMENT_STATE_WITH_NULL) {
- return 1;
- }
- if (state == START_ELEMENT_STATE) {
- return 0;
- } else {
- throw new IllegalStateException();
- }
-
- }
-
- public QName getAttributeName(int i) {
- if (state == START_ELEMENT_STATE_WITH_NULL && i == 0) {
- return NIL_QNAME;
- }
- if (state == START_ELEMENT_STATE) {
- return null;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeNamespace(int i) {
- if (state == START_ELEMENT_STATE_WITH_NULL && i == 0) {
- return NIL_QNAME.getNamespaceURI();
- }
- if (state == START_ELEMENT_STATE) {
- return null;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeLocalName(int i) {
- if (state == START_ELEMENT_STATE_WITH_NULL && i == 0) {
- return NIL_QNAME.getLocalPart();
- }
- if (state == START_ELEMENT_STATE) {
- return null;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributePrefix(int i) {
- if (state == START_ELEMENT_STATE_WITH_NULL && i == 0) {
- return NIL_QNAME.getPrefix();
- }
- if (state == START_ELEMENT_STATE) {
- return null;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeType(int i) {
- return null; // not implemented
- }
-
- public String getAttributeValue(int i) {
- if (state == START_ELEMENT_STATE_WITH_NULL && i == 0) {
- return NIL_VALUE_TRUE;
- }
- if (state == START_ELEMENT_STATE) {
- return null;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public boolean isAttributeSpecified(int i) {
- return false; // not supported
- }
-
- public int getNamespaceCount() {
- if (state == START_ELEMENT_STATE_WITH_NULL && isXsiNamespacePresent()) {
- return 1;
- } else {
- return 0;
- }
-
- }
-
- public String getNamespacePrefix(int i) {
- if (state == START_ELEMENT_STATE_WITH_NULL && isXsiNamespacePresent() && i == 0) {
- return NIL_QNAME.getPrefix();
- } else {
- return null;
- }
- }
-
- public String getNamespaceURI(int i) {
- if (state == START_ELEMENT_STATE_WITH_NULL && isXsiNamespacePresent() && i == 0) {
- return NIL_QNAME.getNamespaceURI();
- } else {
- return null;
- }
- }
-
- public NamespaceContext getNamespaceContext() {
- return this.namespaceContext;
- }
-
- public boolean isDone() {
- return state == FINAL_END_ELEMENT_STATE;
- }
-
- public int getEventType() {
- switch (state) {
- case START_ELEMENT_STATE:
- return START_ELEMENT;
- case END_ELEMENT_STATE:
- return END_ELEMENT;
- case TEXT_STATE:
- return CHARACTERS;
- case FINAL_END_ELEMENT_STATE:
- return END_ELEMENT;
- default:
- throw new UnsupportedOperationException();
- // we've no idea what this is!!!!!
- }
-
- }
-
- public String getText() {
- if (state == TEXT_STATE) {
- return values[arrayIndex];
- } else {
- throw new IllegalStateException();
- }
- }
-
- public char[] getTextCharacters() {
- if (state == TEXT_STATE) {
- return values[arrayIndex].toCharArray();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
- // not implemented
- throw new UnsupportedOperationException();
- }
-
- public int getTextStart() {
- if (state == TEXT_STATE) {
- return 0;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextLength() {
- if (state == TEXT_STATE) {
- return values[arrayIndex].length();
- } else {
- throw new IllegalStateException();
- }
-
- }
-
- public String getEncoding() {
- return null;
- }
-
- public boolean hasText() {
- return state == TEXT_STATE;
- }
-
- public Location getLocation() {
- return null; // not supported
- }
-
- public QName getName() {
- if (state != TEXT_STATE) {
- return name;
- } else {
- return null;
- }
- }
-
- public String getLocalName() {
- if (state != TEXT_STATE) {
- return name.getLocalPart();
- } else {
- return null;
- }
- }
-
- public boolean hasName() {
- return state != TEXT_STATE;
-
- }
-
- public String getNamespaceURI() {
- if (state != TEXT_STATE) {
- return name.getNamespaceURI();
- } else {
- return null;
- }
-
- }
-
- public String getPrefix() {
- if (state != TEXT_STATE) {
- return name.getPrefix();
- } else {
- return null;
- }
- }
-
- public String getVersion() {
- return null; // TODO 1.0 ?
- }
-
- public boolean isStandalone() {
- return false;
- }
-
- public boolean standaloneSet() {
- return false;
- }
-
- public String getCharacterEncodingScheme() {
- return null;
- }
-
- public String getPITarget() {
- return null;
- }
-
- public String getPIData() {
- return null;
- }
-
- public boolean hasNext() throws XMLStreamException {
- return state != FINAL_END_ELEMENT_STATE;
- }
-
- public void close() throws XMLStreamException {
- // Do nothing - we've nothing to free here
- }
-
- public String getNamespaceURI(String prefix) {
- return namespaceContext.getNamespaceURI(prefix);
- }
-
- public boolean isStartElement() {
- return state == START_ELEMENT_STATE;
- }
-
- public boolean isEndElement() {
- return state == END_ELEMENT_STATE;
- }
-
- public boolean isCharacters() {
- return state == TEXT_STATE;
- }
-
- public boolean isWhiteSpace() {
- return false; // no whitespaces here
- }
-
- /**
- * Test whether the xsi namespace is present
- */
- private boolean isXsiNamespacePresent() {
- return namespaceContext.getNamespaceURI(NIL_QNAME.getPrefix()) != null;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValuePairStreamReader.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValuePairStreamReader.java
deleted file mode 100644
index fdc3c4139b..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValuePairStreamReader.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-
-
-public class NameValuePairStreamReader implements XMLFragmentStreamReader {
-
- private static final int START_ELEMENT_STATE = 0;
- private static final int TEXT_STATE = 1;
- private static final int END_ELEMENT_STATE = 2;
-
- private DelegatingNamespaceContext namespaceContext = new DelegatingNamespaceContext();
-
- private QName name;
- private String value;
-
- private int state = START_ELEMENT_STATE;
- // initiate at the start element state
-
- // keeps track whether the namespace is declared
- // false by default
- private boolean nsDeclared;
-
- public NameValuePairStreamReader(QName name, String value) {
- this.name = name;
- this.value = value;
- }
-
- public Object getProperty(String key) throws IllegalArgumentException {
- return null;
- }
-
- public int next() throws XMLStreamException {
- // no need to handle null here. it should have been handled
- // already
- switch (state) {
- case START_ELEMENT_STATE:
- state = TEXT_STATE;
- return CHARACTERS;
- case END_ELEMENT_STATE:
- // oops, not supposed to happen!
- throw new XMLStreamException("end already reached!");
- case TEXT_STATE:
- state = END_ELEMENT_STATE;
- return END_ELEMENT;
- default:
- throw new XMLStreamException("unknown event type!");
- }
- }
-
- public void require(int i, String string, String string1) throws XMLStreamException {
- // not implemented
- }
-
- public String getElementText() throws XMLStreamException {
- if (state == START_ELEMENT) {
- // move to the end state and return the value
- state = END_ELEMENT_STATE;
- return value;
- } else {
- throw new XMLStreamException();
- }
-
- }
-
- public int nextTag() throws XMLStreamException {
- return 0; // TODO
- }
-
- public boolean hasNext() throws XMLStreamException {
- return state != END_ELEMENT_STATE;
- }
-
- public void close() throws XMLStreamException {
- // Do nothing - we've nothing to free here
- }
-
- public String getNamespaceURI(String prefix) {
- return namespaceContext.getNamespaceURI(prefix);
- }
-
- public boolean isStartElement() {
- return state == START_ELEMENT_STATE;
- }
-
- public boolean isEndElement() {
- return state == END_ELEMENT_STATE;
- }
-
- public boolean isCharacters() {
- return state == TEXT_STATE;
- }
-
- public boolean isWhiteSpace() {
- return false; // no whitespaces here
- }
-
- public String getAttributeValue(String string, String string1) {
- return null;
- }
-
- public int getAttributeCount() {
- return 0;
- }
-
- public QName getAttributeName(int i) {
- return null;
- }
-
- public String getAttributeNamespace(int i) {
- return null;
- }
-
- public String getAttributeLocalName(int i) {
- return null;
- }
-
- public String getAttributePrefix(int i) {
- return null;
- }
-
- public String getAttributeType(int i) {
- return null;
- }
-
- public String getAttributeValue(int i) {
- return null;
- }
-
- public boolean isAttributeSpecified(int i) {
- return false; // no attributes here
- }
-
- public int getNamespaceCount() {
- return nsDeclared ? 1 : 0;
- }
-
- public String getNamespacePrefix(int i) {
- return (nsDeclared && i == 0) ? name.getPrefix() : null;
- }
-
- public String getNamespaceURI(int i) {
- return (nsDeclared && i == 0) ? name.getNamespaceURI() : null;
- }
-
- public NamespaceContext getNamespaceContext() {
- return this.namespaceContext;
- }
-
- public int getEventType() {
- switch (state) {
- case START_ELEMENT_STATE:
- return START_ELEMENT;
- case END_ELEMENT_STATE:
- return END_ELEMENT;
- case TEXT_STATE:
- return CHARACTERS;
- default:
- throw new UnsupportedOperationException();
- // we've no idea what this is!!!!!
- }
-
- }
-
- public String getText() {
- if (state == TEXT_STATE) {
- return value;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public char[] getTextCharacters() {
- if (state == TEXT_STATE) {
- return value.toCharArray();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
- // not implemented
- throw new UnsupportedOperationException();
- }
-
- public int getTextStart() {
- if (state == TEXT_STATE) {
- return 0;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextLength() {
- if (state == TEXT_STATE) {
- return value.length();
- } else {
- throw new IllegalStateException();
- }
-
- }
-
- public String getEncoding() {
- return null;
- }
-
- public boolean hasText() {
- return state == TEXT_STATE;
- }
-
- public Location getLocation() {
- return new Location() {
- public int getLineNumber() {
- return 0;
- }
-
- public int getColumnNumber() {
- return 0;
- }
-
- public int getCharacterOffset() {
- return 0;
- }
-
- public String getPublicId() {
- return null;
- }
-
- public String getSystemId() {
- return null;
- }
- };
- }
-
- public QName getName() {
- if (state != TEXT_STATE) {
- return name;
- } else {
- return null;
- }
- }
-
- public String getLocalName() {
- if (state != TEXT_STATE) {
- return name.getLocalPart();
- } else {
- return null;
- }
- }
-
- public boolean hasName() {
- return state != TEXT_STATE;
-
- }
-
- public String getNamespaceURI() {
- if (state != TEXT_STATE) {
- return name.getNamespaceURI();
- } else {
- return null;
- }
-
- }
-
- public String getPrefix() {
- if (state != TEXT_STATE) {
- return name.getPrefix();
- } else {
- return null;
- }
- }
-
- public String getVersion() {
- return null; // TODO 1.0 ?
- }
-
- public boolean isStandalone() {
- return false;
- }
-
- public boolean standaloneSet() {
- return false;
- }
-
- public String getCharacterEncodingScheme() {
- return null;
- }
-
- public String getPITarget() {
- return null;
- }
-
- public String getPIData() {
- return null;
- }
-
- public boolean isDone() {
- return state == END_ELEMENT_STATE;
- }
-
- public void setParentNamespaceContext(NamespaceContext nsContext) {
- this.namespaceContext.setParentNsContext(nsContext);
- }
-
- public void init() {
- // just add the current elements namespace and prefix to the this
- // elements nscontext
- addToNsMap(name.getPrefix(), name.getNamespaceURI());
-
- }
-
- /**
- * @param prefix
- * @param uri
- */
- private void addToNsMap(String prefix, String uri) {
- // TODO - need to fix this up to cater for cases where
- // namespaces are having no prefixes
- if (!uri.equals(namespaceContext.getNamespaceURI(prefix))) {
- // this namespace is not there. Need to declare it
- namespaceContext.pushNamespace(prefix, uri);
- nsDeclared = true;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NamedProperty.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NamedProperty.java
deleted file mode 100644
index 04d7d65a0d..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NamedProperty.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-/**
- * A named property
- *
- * @version $Rev$ $Date$
- */
-public class NamedProperty implements Map.Entry<QName, Object> {
- private QName key;
-
- private Object value;
-
- public NamedProperty(QName key, Object value) {
- this.key = key;
- this.value = value;
- }
-
- public NamedProperty(String key, Object value) {
- this.key = new QName(key);
- this.value = value;
- }
-
- public QName getKey() {
- return key;
- }
-
- public Object getValue() {
- return value;
- }
-
- public Object setValue(Object value) {
- Object v = this.value;
- this.value = value;
- return v;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NilElementStreamReader.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NilElementStreamReader.java
deleted file mode 100644
index abc4bf3785..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NilElementStreamReader.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-
-public class NilElementStreamReader implements XMLFragmentStreamReader {
-
- private static final int END_ELEMENT_STATE = 2;
-
- private static final int START_ELEMENT_STATE = 1;
- private int currentState = START_ELEMENT;
-
- private QName elementQName;
-
- public NilElementStreamReader(QName elementQName) {
- this.elementQName = elementQName;
- }
-
- public void setParentNamespaceContext(NamespaceContext nsContext) {
- // NOOP
- }
-
- public void close() throws XMLStreamException {
- // do nothing
- }
-
- public int getAttributeCount() {
- return 1;
- }
-
- public String getAttributeLocalName(int i) {
- return (i == 0) ? NIL_QNAME.getLocalPart() : null;
- }
-
- public QName getAttributeName(int i) {
- return (i == 0) ? NIL_QNAME : null;
- }
-
- public String getAttributeNamespace(int i) {
- return (i == 0) ? NIL_QNAME.getNamespaceURI() : null;
- }
-
- public String getAttributePrefix(int i) {
- return (i == 0) ? NIL_QNAME.getPrefix() : null;
- }
-
- public String getAttributeType(int i) {
- throw new UnsupportedOperationException();
- }
-
- public String getAttributeValue(int i) {
- return (i == 0) ? NIL_VALUE_TRUE : null;
- }
-
- public String getAttributeValue(String string, String string1) {
- if (string == null && NIL_QNAME.getLocalPart().equals(string1)) {
- return NIL_VALUE_TRUE;
- }
- return null;
- }
-
- public String getCharacterEncodingScheme() {
- throw new UnsupportedOperationException();
- }
-
- public String getElementText() throws XMLStreamException {
- return null;
- }
-
- public String getEncoding() {
- return null;
- }
-
- public int getEventType() {
- int returnEvent = START_DOCUMENT;
- switch (currentState) {
- case START_ELEMENT_STATE:
- returnEvent = START_ELEMENT;
- break;
- case END_ELEMENT_STATE:
- returnEvent = END_ELEMENT;
- break;
- }
- return returnEvent;
- }
-
- public String getLocalName() {
- return elementQName.getLocalPart();
- }
-
- public Location getLocation() {
- return new Location() {
- public int getCharacterOffset() {
- return 0;
- }
-
- public int getColumnNumber() {
- return 0;
- }
-
- public int getLineNumber() {
- return 0;
- }
-
- public String getPublicId() {
- return null;
- }
-
- public String getSystemId() {
- return null;
- }
- };
- }
-
- public QName getName() {
- return elementQName;
- }
-
- public NamespaceContext getNamespaceContext() {
- throw new UnsupportedOperationException();
- }
-
- public int getNamespaceCount() {
- return 0;
- }
-
- public String getNamespacePrefix(int i) {
- return null;
- }
-
- public String getNamespaceURI() {
- return elementQName.getNamespaceURI();
- }
-
- public String getNamespaceURI(int i) {
- return null;
- }
-
- public String getNamespaceURI(String string) {
- if (elementQName.getPrefix() != null && elementQName.getPrefix().equals(string)) {
- return elementQName.getNamespaceURI();
- } else {
- return null;
- }
- }
-
- public String getPIData() {
- throw new UnsupportedOperationException();
- }
-
- public String getPITarget() {
- throw new UnsupportedOperationException();
- }
-
- public String getPrefix() {
- return elementQName.getPrefix();
- }
-
- public Object getProperty(String key) throws IllegalArgumentException {
- // since optimization is a global property
- // we've to implement it everywhere
- return null;
- }
-
- public String getText() {
- return null;
- }
-
- public char[] getTextCharacters() {
- return new char[0];
- }
-
- public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
- return 0;
- }
-
- public int getTextLength() {
- return 0;
- }
-
- public int getTextStart() {
- return 0;
- }
-
- public String getVersion() {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasName() {
- return true;
- }
-
- public boolean hasNext() throws XMLStreamException {
- return currentState != END_ELEMENT_STATE;
-
- }
-
- public boolean hasText() {
- return false;
- }
-
- public void init() {
- // NOOP
- }
-
- public boolean isAttributeSpecified(int i) {
- return i == 0;
- }
-
- public boolean isCharacters() {
- return false;
- }
-
- public boolean isDone() {
- return currentState == END_ELEMENT_STATE;
- }
-
- public boolean isEndElement() {
- return currentState == END_ELEMENT_STATE;
- }
-
- public boolean isStandalone() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isStartElement() {
- return currentState == START_ELEMENT_STATE;
- }
-
- public boolean isWhiteSpace() {
- return false;
- }
-
- public int next() throws XMLStreamException {
- int returnEvent = START_DOCUMENT;
- switch (currentState) {
- case START_ELEMENT_STATE:
- currentState = END_ELEMENT_STATE;
- returnEvent = END_ELEMENT;
- break;
- case END_ELEMENT_STATE:
- throw new XMLStreamException("parser completed!");
-
- }
- return returnEvent;
- }
-
- public int nextTag() throws XMLStreamException {
- throw new UnsupportedOperationException();
- }
-
- public void require(int i, String string, String string1) throws XMLStreamException {
- // nothing
- }
-
- public boolean standaloneSet() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2OutputStream.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2OutputStream.java
deleted file mode 100644
index 5500d0bcca..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2OutputStream.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.OutputStream;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.w3c.dom.Node;
-
-/**
- * Push DOM Node to OutputStream
- *
- * @version $Rev$ $Date$
- */
-public class Node2OutputStream extends BaseTransformer<Node, OutputStream> implements
- PushTransformer<Node, OutputStream> {
- private static final Source2ResultTransformer TRANSFORMER = new Source2ResultTransformer();
-
- public void transform(Node source, OutputStream writer, TransformationContext context) {
- try {
- Source domSource = new DOMSource(source);
- Result result = new StreamResult(writer);
- TRANSFORMER.transform(domSource, result, context);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- protected Class<OutputStream> getTargetType() {
- return OutputStream.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2SimpleJavaType.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2SimpleJavaType.java
deleted file mode 100644
index d5bf7e76b5..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2SimpleJavaType.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import org.apache.tuscany.sca.databinding.impl.SimpleType2JavaTransformer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Transformer to convert data from a simple java Object to OMElement.
- *
- * @version $Rev$ $Date$
- */
-public class Node2SimpleJavaType extends SimpleType2JavaTransformer<Node> {
-
- @Override
- protected String getText(Node source) {
- if (source instanceof Document) {
- source = ((Document)source).getDocumentElement();
- }
- return source.getTextContent();
-
- }
-
- @Override
- public Class getSourceType() {
- return Node.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2SourceTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2SourceTransformer.java
deleted file mode 100644
index 3c9022bc3c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2SourceTransformer.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.w3c.dom.Node;
-
-/**
- * Transform TrAX Node to Source
- *
- * @version $Rev$ $Date$
- */
-public class Node2SourceTransformer extends BaseTransformer<Node, Source> implements
- PullTransformer<Node, Source> {
-
- public Source transform(Node source, TransformationContext context) {
- try {
- return new DOMSource(source);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- protected Class<Source> getTargetType() {
- return Source.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2String.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2String.java
deleted file mode 100644
index 1b54b1fd1e..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2String.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.StringWriter;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.w3c.dom.Node;
-
-/**
- * Transform DOM Node to XML String
- *
- * @version $Rev$ $Date$
- */
-public class Node2String extends BaseTransformer<Node, String> implements PullTransformer<Node, String> {
- private static final Node2Writer TRANSFORMER = new Node2Writer();
-
- public String transform(Node source, TransformationContext context) {
- try {
- StringWriter writer = new StringWriter();
- TRANSFORMER.transform(source, writer, context);
- return writer.toString();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- public Class<String> getTargetType() {
- return String.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2Writer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2Writer.java
deleted file mode 100644
index c9631595dc..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2Writer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.Writer;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.w3c.dom.Node;
-
-/**
- * Push DOM Node to Writer
- *
- * @version $Rev$ $Date$
- */
-public class Node2Writer extends BaseTransformer<Node, Writer> implements PushTransformer<Node, Writer> {
- private static final Source2ResultTransformer TRANSFORMER = new Source2ResultTransformer();
-
- public void transform(Node source, Writer writer, TransformationContext context) {
- try {
- Source domSource = new DOMSource(source);
- Result result = new StreamResult(writer);
- TRANSFORMER.transform(domSource, result, context);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- protected Class<Writer> getTargetType() {
- return Writer.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2XMLStreamReader.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2XMLStreamReader.java
deleted file mode 100644
index 1e8d14a151..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2XMLStreamReader.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.w3c.dom.Node;
-
-/**
- * Transform DOM Node to XML XMLStreamReader
- *
- * @version $Rev$ $Date$
- */
-public class Node2XMLStreamReader extends BaseTransformer<Node, XMLStreamReader> implements
- PullTransformer<Node, XMLStreamReader> {
-
- public XMLStreamReader transform(Node source, TransformationContext context) {
- if (source == null) {
- return null;
- }
- try {
- DOMXMLStreamReader reader = new DOMXMLStreamReader(source);
- return reader;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2Node.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2Node.java
deleted file mode 100644
index 70387fa862..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2Node.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.Reader;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.w3c.dom.Node;
-
-/**
- * Push DOM Reader to Node
- *
- * @version $Rev$ $Date$
- */
-public class Reader2Node extends BaseTransformer<Reader, Node> implements PullTransformer<Reader, Node> {
- private static final Source2ResultTransformer TRANSFORMER = new Source2ResultTransformer();
-
- public Node transform(Reader source, TransformationContext context) {
- try {
- Source streamSource = new StreamSource(source);
- DOMResult result = new DOMResult();
- TRANSFORMER.transform(streamSource, result, context);
- return result.getNode();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Reader> getSourceType() {
- return Reader.class;
- }
-
- @Override
- protected Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2SAX.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2SAX.java
deleted file mode 100644
index 188ecaffa3..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2SAX.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.Reader;
-
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-
-/**
- * Transform XML string to SAX
- *
- * @version $Rev$ $Date$
- */
-public class Reader2SAX extends BaseTransformer<Reader, ContentHandler> implements
- PushTransformer<Reader, ContentHandler> {
- public void transform(Reader source, ContentHandler target, TransformationContext context) {
- try {
- new InputSource2SAX().transform(new InputSource(source), target, context);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Reader> getSourceType() {
- return Reader.class;
- }
-
- @Override
- protected Class<ContentHandler> getTargetType() {
- return ContentHandler.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOM.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOM.java
deleted file mode 100644
index 38c61d64c8..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOM.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Stack;
-
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * SAX2DOM adapter
- *
- * @version $Rev$ $Date$
- */
-public class SAX2DOM implements ContentHandler, LexicalHandler {
- public static final String EMPTYSTRING = "";
- public static final String XML_PREFIX = "xml";
- public static final String XMLNS_PREFIX = "xmlns";
- public static final String XMLNS_STRING = "xmlns:";
- public static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";
-
- private Node root;
-
- private Document document;
-
- private Node nextSibling;
-
- private Stack<Node> nodeStk = new Stack<Node>();
-
- private List<String> namespaceDecls;
-
- private Node lastSibling;
-
- public SAX2DOM() throws ParserConfigurationException {
- this.document = DOMHelper.newDocument();
- this.root = document;
- }
-
- public SAX2DOM(Node root, Node nextSibling) throws ParserConfigurationException {
- this.root = root;
- if (root instanceof Document) {
- this.document = (Document)root;
- } else if (root != null) {
- this.document = root.getOwnerDocument();
- } else {
- this.document = DOMHelper.newDocument();
- this.root = document;
- }
-
- this.nextSibling = nextSibling;
- }
-
- public SAX2DOM(Node root) throws ParserConfigurationException {
- this(root, null);
- }
-
- public Node getDOM() {
- return root;
- }
-
- public void characters(char[] ch, int start, int length) {
- final Node last = nodeStk.peek();
-
- // No text nodes can be children of root (DOM006 exception)
- if (last != document) {
- final String text = new String(ch, start, length);
- if (lastSibling != null && lastSibling.getNodeType() == Node.TEXT_NODE) {
- ((Text)lastSibling).appendData(text);
- } else if (last == root && nextSibling != null) {
- lastSibling = last.insertBefore(document.createTextNode(text), nextSibling);
- } else {
- lastSibling = last.appendChild(document.createTextNode(text));
- }
-
- }
- }
-
- public void startDocument() {
- nodeStk.push(root);
- }
-
- public void endDocument() {
- nodeStk.pop();
- }
-
- public void startElement(String namespace, String localName, String qName, Attributes attrs) {
- final Element tmp = document.createElementNS(namespace, qName);
-
- // Add namespace declarations first
- if (namespaceDecls != null) {
- final int nDecls = namespaceDecls.size();
- for (int i = 0; i < nDecls; i++) {
- final String prefix = namespaceDecls.get(i++);
-
- if (prefix == null || prefix.equals(EMPTYSTRING)) {
- tmp.setAttributeNS(XMLNS_URI, XMLNS_PREFIX, namespaceDecls.get(i));
- } else {
- tmp.setAttributeNS(XMLNS_URI, XMLNS_STRING + prefix, namespaceDecls.get(i));
- }
- }
- namespaceDecls.clear();
- }
-
- // Add attributes to element
- final int nattrs = attrs.getLength();
- for (int i = 0; i < nattrs; i++) {
- if (attrs.getLocalName(i) == null) {
- tmp.setAttribute(attrs.getQName(i), attrs.getValue(i));
- } else {
- tmp.setAttributeNS(attrs.getURI(i), attrs.getQName(i), attrs.getValue(i));
- }
- }
-
- // Append this new node onto current stack node
- Node last = nodeStk.peek();
-
- // If the SAX2DOM is created with a non-null next sibling node,
- // insert the result nodes before the next sibling under the root.
- if (last == root && nextSibling != null) {
- last.insertBefore(tmp, nextSibling);
- } else {
- last.appendChild(tmp);
- }
-
- // Push this node onto stack
- nodeStk.push(tmp);
- lastSibling = null;
- }
-
- public void endElement(String namespace, String localName, String qName) {
- nodeStk.pop();
- lastSibling = null;
- }
-
- public void startPrefixMapping(String prefix, String uri) {
- if (namespaceDecls == null) {
- namespaceDecls = new ArrayList<String>(2);
- }
- namespaceDecls.add(prefix);
- namespaceDecls.add(uri);
- }
-
- public void endPrefixMapping(String prefix) {
- // do nothing
- }
-
- /**
- * This class is only used internally so this method should never be called.
- */
- public void ignorableWhitespace(char[] ch, int start, int length) {
- }
-
- /**
- * adds processing instruction node to DOM.
- */
- public void processingInstruction(String target, String data) {
- final Node last = nodeStk.peek();
- ProcessingInstruction pi = document.createProcessingInstruction(target, data);
- if (pi != null) {
- if (last == root && nextSibling != null) {
- last.insertBefore(pi, nextSibling);
- } else {
- last.appendChild(pi);
- }
-
- lastSibling = pi;
- }
- }
-
- /**
- * This class is only used internally so this method should never be called.
- */
- public void setDocumentLocator(Locator locator) {
- }
-
- /**
- * This class is only used internally so this method should never be called.
- */
- public void skippedEntity(String name) {
- }
-
- /**
- * Lexical Handler method to create comment node in DOM tree.
- */
- public void comment(char[] ch, int start, int length) {
- final Node last = nodeStk.peek();
- Comment comment = document.createComment(new String(ch, start, length));
- if (comment != null) {
- if (last == root && nextSibling != null) {
- last.insertBefore(comment, nextSibling);
- } else {
- last.appendChild(comment);
- }
-
- lastSibling = comment;
- }
- }
-
- // Lexical Handler methods- not implemented
- public void startCDATA() {
- }
-
- public void endCDATA() {
- }
-
- public void startEntity(java.lang.String name) {
- }
-
- public void endDTD() {
- }
-
- public void endEntity(String name) {
- }
-
- public void startDTD(String name, String publicId, String systemId) throws SAXException {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOMPipe.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOMPipe.java
deleted file mode 100644
index cb9d538389..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOMPipe.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.tuscany.sca.databinding.DataPipe;
-import org.apache.tuscany.sca.databinding.DataPipeTransformer;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-
-public class SAX2DOMPipe extends BaseTransformer<ContentHandler, Node> implements DataPipeTransformer<ContentHandler, Node> {
-
- /**
- *
- */
- public SAX2DOMPipe() {
- super();
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.DataPipeTransformer#newInstance()
- */
- public DataPipe<ContentHandler, Node> newInstance() {
- return new Pipe();
- }
-
- @Override
- protected Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- protected Class<ContentHandler> getSourceType() {
- return ContentHandler.class;
- }
-
- @Override
- public int getWeight() {
- return 30;
- }
-
- private static class Pipe implements DataPipe<ContentHandler, Node> {
- private SAX2DOM pipe;
-
- public Pipe() {
- super();
- try {
- this.pipe = new SAX2DOM();
- } catch (ParserConfigurationException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public Node getResult() {
- return pipe.getDOM();
- }
-
- public ContentHandler getSink() {
- return pipe;
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SimpleJavaType2Node.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SimpleJavaType2Node.java
deleted file mode 100644
index d2625fba11..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SimpleJavaType2Node.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.apache.tuscany.sca.databinding.impl.Java2SimpleTypeTransformer;
-import org.apache.tuscany.sca.databinding.javabeans.Java2XMLMapperException;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Transformer to convert data from an simple OMElement to Java Object
- *
- * @version $Rev$ $Date$
- */
-public class SimpleJavaType2Node extends Java2SimpleTypeTransformer<Node> {
-
- private Document factory;
-
- public SimpleJavaType2Node() {
- super();
- try {
- factory = DOMHelper.newDocument();
- } catch (ParserConfigurationException e) {
- throw new Java2XMLMapperException(e);
- }
- }
-
- @Override
- protected Node createElement(QName element, String text, TransformationContext context) {
- if (element == null) {
- element = DOMDataBinding.ROOT_ELEMENT;
- }
- Node root = DOMHelper.createElement(factory, element);
- if (text != null) {
- root.appendChild(factory.createTextNode(text));
- } else {
- Attr nil = factory.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:nil");
- nil.setValue("true");
- root.appendChild(nil);
- }
- return root;
- }
-
- @Override
- public Class getTargetType() {
- return Node.class;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SimpleXmlNodeImpl.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SimpleXmlNodeImpl.java
deleted file mode 100644
index e041f85214..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SimpleXmlNodeImpl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SimpleXmlNodeImpl implements XmlNode {
- private static final String XSI_PREFIX = "xsi";
- private static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance";
- private static final QName XSI_NIL = new QName(XSI_NS, "nil", XSI_PREFIX);
- private static final Map<String, String> NS_MAP = new HashMap<String, String>();
- static {
- NS_MAP.put(XSI_PREFIX, XSI_NS);
- }
-
- protected Type type;
- protected QName name;
- protected Object value;
-
- public SimpleXmlNodeImpl(QName name, Object value) {
- this(name, value, name != null ? Type.ELEMENT : Type.CHARACTERS);
- }
-
- public SimpleXmlNodeImpl(QName name, Object value, Type type) {
- super();
- this.type = type;
- this.name = name;
- this.value = value;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#attributes()
- */
- public List<XmlNode> attributes() {
- if (type == Type.ELEMENT && value == null) {
- // Nil element
- XmlNode attr = new SimpleXmlNodeImpl(XSI_NIL, "true");
- return Arrays.asList(attr);
- }
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#children()
- */
- public Iterator<XmlNode> children() {
- if (type == Type.ELEMENT && value != null) {
- // Nil element
- XmlNode node = new SimpleXmlNodeImpl(null, value);
- return Arrays.asList(node).iterator();
- }
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#getName()
- */
- public QName getName() {
- return name;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#getValue()
- */
- public String getValue() {
- return value == null ? null : String.valueOf(value);
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#namespaces()
- */
- public Map<String, String> namespaces() {
- if (type == Type.ELEMENT && value == null) {
- return NS_MAP;
- }
- return null;
- }
-
- public Type getType() {
- return type;
- }
-
- public void setType(Type type) {
- this.type = type;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2NodeTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2NodeTransformer.java
deleted file mode 100644
index ee9aa1bb76..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2NodeTransformer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMResult;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Transform TrAX Source to Node
- *
- * @version $Rev$ $Date$
- */
-public class Source2NodeTransformer extends BaseTransformer<Source, Node> implements
- PullTransformer<Source, Node> {
- private static final TransformerFactory FACTORY = TransformerFactory.newInstance();
-
- public Node transform(Source source, TransformationContext context) {
- try {
- javax.xml.transform.Transformer transformer = FACTORY.newTransformer();
- DOMResult result = new DOMResult();
- transformer.transform(source, result);
- Document doc = (Document) result.getNode();
- return DOMHelper.adjustElementName(context, doc.getDocumentElement());
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Source> getSourceType() {
- return Source.class;
- }
-
- @Override
- protected Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2ResultTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2ResultTransformer.java
deleted file mode 100644
index 8a2b6b39aa..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2ResultTransformer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-/**
- * Transform TrAX Source to Result
- *
- * @version $Rev$ $Date$
- */
-public class Source2ResultTransformer extends BaseTransformer<Source, Result> implements
- PushTransformer<Source, Result> {
- private static final TransformerFactory FACTORY = TransformerFactory.newInstance();
-
- public void transform(Source source, Result result, TransformationContext context) {
- try {
- javax.xml.transform.Transformer transformer = FACTORY.newTransformer();
- transformer.transform(source, result);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Source> getSourceType() {
- return Source.class;
- }
-
- @Override
- protected Class<Result> getTargetType() {
- return Result.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2StringTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2StringTransformer.java
deleted file mode 100644
index 2ed548ad76..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2StringTransformer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.StringWriter;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-
-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;
-
-/**
- * Transform TrAX Source to String
- *
- * @version $Rev$ $Date$
- */
-public class Source2StringTransformer extends BaseTransformer<Source, String> implements
- PullTransformer<Source, String> {
- private static final TransformerFactory FACTORY = TransformerFactory.newInstance();
-
- public String transform(Source source, TransformationContext context) {
- try {
- javax.xml.transform.Transformer transformer = FACTORY.newTransformer();
- StringWriter sw = new StringWriter();
- StreamResult result = new StreamResult(sw);
- transformer.transform(source, result);
- return sw.toString();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<Source> getSourceType() {
- return Source.class;
- }
-
- @Override
- protected Class<String> getTargetType() {
- return String.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAX2SAXAdapter.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAX2SAXAdapter.java
deleted file mode 100644
index 6257681091..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAX2SAXAdapter.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * Adapter that converts from StAX to SAX event streams. Currently the following
- * SAX events are not generated:
- * <ul>
- * <li>ignorableWhitespace</li>
- * <li>skippedEntity</li>
- * <ul>
- * Also the following StAX events are not mapped:
- * <ul>
- * <li>CDATA</li>
- * <li>COMMENT</li>
- * <li>DTD</li>
- * <li>ENTITY_DECLARATION</li>
- * <li>ENTITY_REFERENCE</li>
- * <li>NOTATION_DECLARATION</li>
- * <li>SPACE</li>
- * </ul>
- * StAX ATTRIBUTE events are ignored but the equivalent attributes (derived from
- * the START_ELEMENT event) are supplied in the SAX startElement event's
- * Attributes parameter. If the adaptor is configured to pass namespace prefixes
- * then namespace information will also be included in the Attributes; StAX
- * NAMESPACE events are ignored. <p/> Another issue is namespace processing. If
- * the reader is positioned at a sub-node, we cannot capture all the in-scope
- * namespace bindings. Therefore we cannot re-create a proper SAX event stream
- * from a StAX parser. <p/> For example <p/> &lt;a:root xmlns:a="foo"
- * xmlns:b="bar"&gt;&lt;b:sub&gt;a:foo&lt;/b:sub&gt;&lt;/a:root&gt; <p/> And if
- * you are handed a parser at &lt;b:sub&gt;, then your SAX events should look
- * like: <p/> &lt;b:sub xmlns:a="foo" xmlns:b="bar"&gt;a:foo&lt;/b:sub&gt; <p/>
- * not: <p/> &lt;b:sub&gt;a:foo&lt;/b:sub&gt; <p/> <p/> Proposal: we change the
- * receiver of SAX events (SDOXMLResourceImpl) so that it uses NamespaceContext
- * to resolve prefix (as opposed to record start/endPrefixMappings and use it
- * for resolution.)
- *
- * @version $Rev$ $Date$
- */
-public class StAX2SAXAdapter {
- private final boolean namespacePrefixes;
-
- /**
- * Construct a new StAX to SAX adapter that will convert a StAX event stream
- * into a SAX event stream.
- *
- * @param namespacePrefixes whether xmlns attributes should be included in
- * startElement events;
- */
- public StAX2SAXAdapter(boolean namespacePrefixes) {
- this.namespacePrefixes = namespacePrefixes;
- }
-
- /**
- * Pull events from the StAX stream and dispatch to the SAX ContentHandler.
- * The StAX stream would typically be located on a START_DOCUMENT or
- * START_ELEMENT event and when this method returns it will be located on
- * the associated END_DOCUMENT or END_ELEMENT event. Behaviour with other
- * start events is undefined.
- *
- * @param reader StAX event source to read
- * @param handler SAX ContentHandler for processing events
- * @throws XMLStreamException if there was a problem reading the stream
- * @throws SAXException passed through from the ContentHandler
- */
- public void parse(XMLStreamReader reader, ContentHandler handler) throws XMLStreamException, SAXException {
- handler.setDocumentLocator(new LocatorAdaptor(reader.getLocation()));
-
- // remembers the nest level of elements to know when we are done
- int level = 0;
- int event = reader.getEventType();
- while (true) {
- switch (event) {
- case XMLStreamConstants.START_DOCUMENT:
- level++;
- handler.startDocument();
- break;
- case XMLStreamConstants.START_ELEMENT:
- level++;
- handleStartElement(reader, handler);
- break;
- case XMLStreamConstants.PROCESSING_INSTRUCTION:
- handler.processingInstruction(reader.getPITarget(), reader.getPIData());
- break;
- case XMLStreamConstants.CHARACTERS:
- handler.characters(reader.getTextCharacters(), reader.getTextStart(), reader
- .getTextLength());
- break;
- case XMLStreamConstants.END_ELEMENT:
- handleEndElement(reader, handler);
- level--;
- if (level == 0) {
- return;
- }
- break;
- case XMLStreamConstants.END_DOCUMENT:
- handler.endDocument();
- return;
- /*
- * uncomment to handle all events rather than just mapped
- * ones // StAX events that are not mapped to SAX case
- * XMLStreamConstants.COMMENT: case
- * XMLStreamConstants.SPACE: case
- * XMLStreamConstants.ENTITY_REFERENCE: case
- * XMLStreamConstants.DTD: case XMLStreamConstants.CDATA:
- * case XMLStreamConstants.NOTATION_DECLARATION: case
- * XMLStreamConstants.ENTITY_DECLARATION: break; // StAX
- * events handled in START_ELEMENT case
- * XMLStreamConstants.ATTRIBUTE: case
- * XMLStreamConstants.NAMESPACE: break; default: throw new
- * AssertionError("Unknown StAX event: " + event);
- */
- }
- event = reader.next();
- }
- }
-
- private void handleStartElement(XMLStreamReader reader, ContentHandler handler) throws SAXException {
- // send startPrefixMapping events immediately before startElement event
- int nsCount = reader.getNamespaceCount();
- for (int i = 0; i < nsCount; i++) {
- String prefix = reader.getNamespacePrefix(i);
- if (prefix == null) { // true for default namespace
- prefix = "";
- }
- handler.startPrefixMapping(prefix, reader.getNamespaceURI(i));
- }
-
- // fire startElement
- QName qname = reader.getName();
- String prefix = qname.getPrefix();
- String rawname;
- if (prefix == null || prefix.length() == 0) {
- rawname = qname.getLocalPart();
- } else {
- rawname = prefix + ':' + qname.getLocalPart();
- }
- Attributes attrs = getAttributes(reader);
- handler.startElement(qname.getNamespaceURI(), qname.getLocalPart(), rawname, attrs);
- }
-
- private static void handleEndElement(XMLStreamReader reader, ContentHandler handler) throws SAXException {
- // fire endElement
- QName qname = reader.getName();
- handler.endElement(qname.getNamespaceURI(), qname.getLocalPart(), qname.toString());
-
- // send endPrefixMapping events immediately after endElement event
- // we send them in the opposite order to that returned but this is not
- // actually required by SAX
- int nsCount = reader.getNamespaceCount();
- for (int i = nsCount - 1; i >= 0; i--) {
- String prefix = reader.getNamespacePrefix(i);
- if (prefix == null) { // true for default namespace
- prefix = "";
- }
- handler.endPrefixMapping(prefix);
- }
- }
-
- /**
- * Get the attributes associated with the current START_ELEMENT event.
- *
- * @return the StAX attributes converted to org.xml.sax.Attributes
- */
- private Attributes getAttributes(XMLStreamReader reader) {
- assert reader.getEventType() == XMLStreamConstants.START_ELEMENT;
-
- AttributesImpl attrs = new AttributesImpl();
-
- // add namespace declarations if required
- if (namespacePrefixes) {
- for (int i = 0; i < reader.getNamespaceCount(); i++) {
- String prefix = reader.getNamespacePrefix(i);
- String uri = reader.getNamespaceURI(i);
- attrs.addAttribute(null, prefix, "xmlns:" + prefix, "CDATA", uri);
- }
- }
-
- // Regular attributes
- for (int i = 0; i < reader.getAttributeCount(); i++) {
- String uri = reader.getAttributeNamespace(i);
- if (uri == null) {
- uri = "";
- }
- String localName = reader.getAttributeLocalName(i);
- String prefix = reader.getAttributePrefix(i);
- String qname;
- if (prefix == null || prefix.length() == 0) {
- qname = localName;
- } else {
- qname = prefix + ':' + localName;
- }
- String type = reader.getAttributeType(i);
- String value = reader.getAttributeValue(i);
-
- attrs.addAttribute(uri, localName, qname, type, value);
- }
-
- return attrs;
- }
-
- /**
- * Adaptor for mapping Locator information.
- */
- private static final class LocatorAdaptor implements Locator {
- private final Location location;
-
- private LocatorAdaptor(Location location) {
- this.location = location;
- }
-
- public int getColumnNumber() {
- return location == null ? 0 : location.getColumnNumber();
- }
-
- public int getLineNumber() {
- return location == null ? 0 : location.getLineNumber();
- }
-
- public String getPublicId() {
- return location == null ? "" : location.getPublicId();
- }
-
- public String getSystemId() {
- return location == null ? "" : location.getSystemId();
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAXDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAXDataBinding.java
deleted file mode 100644
index ed57992910..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAXDataBinding.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * A DataBinding for the StAX
- *
- * @version $Rev$ $Date$
- */
-public class StAXDataBinding extends BaseDataBinding {
- public static final String NAME = XMLStreamReader.class.getName();
-
- public StAXDataBinding() {
- super(NAME, XMLStreamReader.class);
- }
-
- @Override
- public boolean introspect(DataType type, Operation operation) {
- if (super.introspect(type, operation)) {
- type.setLogical(XMLType.UNKNOWN);
- type.setDataBinding(NAME);
- return true;
- } else {
- return false;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAXHelper.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAXHelper.java
deleted file mode 100644
index 103ecbd7d1..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAXHelper.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.Source;
-
-
-public final class StAXHelper {
- private static final XMLInputFactory INPUT_FACTORY = XMLInputFactory.newInstance();
- private static final XMLOutputFactory OUTPUT_FACTORY = XMLOutputFactory.newInstance();
-
- private StAXHelper() {
- }
-
- public static XMLStreamReader createXMLStreamReader(InputStream inputStream) throws XMLStreamException {
- return INPUT_FACTORY.createXMLStreamReader(inputStream);
- }
-
- public static XMLStreamReader createXMLStreamReader(Reader reader) throws XMLStreamException {
- return INPUT_FACTORY.createXMLStreamReader(reader);
- }
-
- public static XMLStreamReader createXMLStreamReader(Source source) throws XMLStreamException {
- return INPUT_FACTORY.createXMLStreamReader(source);
- }
-
- public static XMLStreamReader createXMLStreamReader(String string) throws XMLStreamException {
- StringReader reader = new StringReader(string);
- return createXMLStreamReader(reader);
- }
-
- public static String save(XMLStreamReader reader) throws XMLStreamException {
- StringWriter writer = new StringWriter();
- save(reader, writer);
- return writer.toString();
- }
-
- public static void save(XMLStreamReader reader, OutputStream outputStream) throws XMLStreamException {
- XMLStreamSerializer serializer = new XMLStreamSerializer();
- XMLStreamWriter streamWriter = OUTPUT_FACTORY.createXMLStreamWriter(outputStream);
- serializer.serialize(reader, streamWriter);
- streamWriter.flush();
- }
-
- public static void save(XMLStreamReader reader, Writer writer) throws XMLStreamException {
- XMLStreamSerializer serializer = new XMLStreamSerializer();
- XMLStreamWriter streamWriter = OUTPUT_FACTORY.createXMLStreamWriter(writer);
- serializer.serialize(reader, streamWriter);
- streamWriter.flush();
- }
-
- public static void save(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
- XMLStreamSerializer serializer = new XMLStreamSerializer();
- serializer.serialize(reader, writer);
- writer.flush();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StreamDataPipe.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StreamDataPipe.java
deleted file mode 100644
index f8967e35b6..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StreamDataPipe.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.apache.tuscany.sca.databinding.DataPipe;
-import org.apache.tuscany.sca.databinding.DataPipeTransformer;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-public class StreamDataPipe extends BaseTransformer<OutputStream, InputStream> implements
- DataPipeTransformer<OutputStream, InputStream> {
-
- public DataPipe<OutputStream, InputStream> newInstance() {
- return new Pipe();
- }
-
- @Override
- protected Class<InputStream> getTargetType() {
- return InputStream.class;
- }
-
- @Override
- public int getWeight() {
- return 50;
- }
-
- @Override
- protected Class<OutputStream> getSourceType() {
- return OutputStream.class;
- }
-
- public static class Pipe implements DataPipe<OutputStream, InputStream> {
- private ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-
- public InputStream getResult() {
- return new ByteArrayInputStream(outputStream.toByteArray());
- }
-
- public OutputStream getSink() {
- return outputStream;
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2Node.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2Node.java
deleted file mode 100644
index 062e10cc45..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2Node.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.StringReader;
-
-import javax.xml.parsers.DocumentBuilder;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-public class String2Node extends BaseTransformer<String, Node> implements PullTransformer<String, Node> {
-
- public Node transform(String source, TransformationContext context) {
- try {
- DocumentBuilder builder = DOMHelper.newDocumentBuilder();
- InputSource inputSource = new InputSource(new StringReader(source));
- return builder.parse(inputSource);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<String> getSourceType() {
- return String.class;
- }
-
- @Override
- protected Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 50;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2SAX.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2SAX.java
deleted file mode 100644
index c56dba1843..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2SAX.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.StringReader;
-
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-
-/**
- * Transform XML string to SAX
- *
- * @version $Rev$ $Date$
- */
-public class String2SAX extends BaseTransformer<String, ContentHandler> implements
- PushTransformer<String, ContentHandler> {
-
- public void transform(String source, ContentHandler target, TransformationContext context) {
- try {
- new InputSource2SAX().transform(new InputSource(new StringReader(source)), target, context);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<String> getSourceType() {
- return String.class;
- }
-
- @Override
- protected Class<ContentHandler> getTargetType() {
- return ContentHandler.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2SourceTransformer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2SourceTransformer.java
deleted file mode 100644
index c2de202a9b..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2SourceTransformer.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.StringReader;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-/**
- * Transform XML String to Source
- *
- * @version $Rev$ $Date$
- */
-public class String2SourceTransformer extends BaseTransformer<String, Source> implements
- PullTransformer<String, Source> {
-
- public Source transform(String source, TransformationContext context) {
- try {
- return new StreamSource(new StringReader(source));
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<String> getSourceType() {
- return String.class;
- }
-
- @Override
- protected Class<Source> getTargetType() {
- return Source.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2XMLStreamReader.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2XMLStreamReader.java
deleted file mode 100644
index a7364006d0..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2XMLStreamReader.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-public class String2XMLStreamReader extends BaseTransformer<String, XMLStreamReader> implements
- PullTransformer<String, XMLStreamReader> {
-
- public XMLStreamReader transform(String source, TransformationContext context) {
- try {
- return StAXHelper.createXMLStreamReader(source);
- } catch (XMLStreamException e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<String> getSourceType() {
- return String.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- @Override
- public int getWeight() {
- return 50;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/WrappingXMLStreamReader.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/WrappingXMLStreamReader.java
deleted file mode 100644
index d73e495798..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/WrappingXMLStreamReader.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.util.StreamReaderDelegate;
-
-public class WrappingXMLStreamReader extends StreamReaderDelegate implements XMLFragmentStreamReader {
-
- private boolean done;
- private int level;
-
- public WrappingXMLStreamReader(XMLStreamReader realReader) throws XMLStreamException {
- super(realReader);
- if (realReader == null) {
- throw new UnsupportedOperationException("Reader cannot be null");
- }
-
- if (realReader instanceof XMLFragmentStreamReader) {
- ((XMLFragmentStreamReader)realReader).init();
- }
-
- if (realReader.getEventType() == START_DOCUMENT) {
- // Position to the 1st element
- realReader.nextTag();
- }
- if (realReader.getEventType() != START_ELEMENT) {
- throw new IllegalStateException("The reader is not positioned at START_DOCUMENT or START_ELEMENT");
- }
- this.done = false;
- this.level = 1;
- }
-
- @Override
- public boolean hasNext() throws XMLStreamException {
- return !done && super.hasNext();
- }
-
- @Override
- public int next() throws XMLStreamException {
- if (!hasNext()) {
- throw new IllegalStateException("No more events");
- }
- int event = super.next();
- if (!super.hasNext()) {
- done = true;
- }
- if (event == START_ELEMENT) {
- level++;
- } else if (event == END_ELEMENT) {
- level--;
- if (level == 0) {
- done = true;
- }
- }
- return event;
- }
-
- @Override
- public int nextTag() throws XMLStreamException {
- int event = 0;
- while (true) {
- event = next();
- if (event == START_ELEMENT || event == END_ELEMENT) {
- return event;
- }
- }
- }
-
- public void setParentNamespaceContext(NamespaceContext nsContext) {
- // nothing to do here
- }
-
- public void init() {
- // Nothing to do here
- }
-
- public boolean isDone() {
- return done;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Writer2ReaderDataPipe.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Writer2ReaderDataPipe.java
deleted file mode 100644
index 5ab7272d58..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Writer2ReaderDataPipe.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
-
-import org.apache.tuscany.sca.databinding.DataPipe;
-import org.apache.tuscany.sca.databinding.DataPipeTransformer;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-public class Writer2ReaderDataPipe extends BaseTransformer<Writer, Reader> implements DataPipeTransformer<Writer, Reader> {
-
- public DataPipe<Writer, Reader> newInstance() {
- return new Pipe();
- }
-
- @Override
- protected Class<Reader> getTargetType() {
- return Reader.class;
- }
-
- @Override
- public int getWeight() {
- return 50;
- }
-
- @Override
- protected Class<Writer> getSourceType() {
- return Writer.class;
- }
-
- private static class Pipe implements DataPipe<Writer, Reader> {
- private StringWriter writer = new StringWriter();
-
- public Reader getResult() {
- return new StringReader(writer.toString());
- }
-
- public Writer getSink() {
- return writer;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLDocumentStreamReader.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLDocumentStreamReader.java
deleted file mode 100644
index a7088eada3..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLDocumentStreamReader.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.NoSuchElementException;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-/**
- * This class is derived from Apache Axis2 class
- * org.apache.axis2.util.StreamWrapper</a>. It's used wrap a XMLStreamReader to
- * create a XMLStreamReader representing a document and it will produce
- * START_DOCUMENT, END_DOCUMENT events.
- *
- * @version $Rev$ $Date$
- */
-public class XMLDocumentStreamReader implements XMLStreamReader {
- private static final int STATE_COMPLETE_AT_NEXT = 2; // The wrapper
- // will produce
- // END_DOCUMENT
-
- private static final int STATE_COMPLETED = 3; // Done
-
- private static final int STATE_INIT = 0; // The wrapper will produce
- // START_DOCUMENT
-
- private static final int STATE_SWITCHED = 1; // The real reader will
- // produce events
-
- private XMLStreamReader realReader;
- private boolean fragment;
- private int level = 1;
-
- private int state = STATE_INIT;
-
- public XMLDocumentStreamReader(XMLStreamReader realReader) {
- if (realReader == null) {
- throw new UnsupportedOperationException("Reader cannot be null");
- }
-
- this.realReader = realReader;
-
- if (realReader instanceof XMLFragmentStreamReader) {
- ((XMLFragmentStreamReader)realReader).init();
- }
-
- // If the real reader is positioned at START_DOCUMENT, always use
- // the real reader
- if (realReader.getEventType() == START_DOCUMENT) {
- fragment = false;
- state = STATE_SWITCHED;
- }
- }
-
- public void close() throws XMLStreamException {
- realReader.close();
- }
-
- public int getAttributeCount() {
- if (isDelegating()) {
- return realReader.getAttributeCount();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeLocalName(int i) {
- if (isDelegating()) {
- return realReader.getAttributeLocalName(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public QName getAttributeName(int i) {
- if (isDelegating()) {
- return realReader.getAttributeName(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeNamespace(int i) {
- if (isDelegating()) {
- return realReader.getAttributeNamespace(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributePrefix(int i) {
- if (isDelegating()) {
- return realReader.getAttributePrefix(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeType(int i) {
- if (isDelegating()) {
- return realReader.getAttributeType(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeValue(int i) {
- if (isDelegating()) {
- return realReader.getAttributeValue(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeValue(String s, String s1) {
- if (isDelegating()) {
- return realReader.getAttributeValue(s, s1);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getCharacterEncodingScheme() {
- return realReader.getCharacterEncodingScheme();
- }
-
- public String getElementText() throws XMLStreamException {
- if (isDelegating()) {
- return realReader.getElementText();
- } else {
- throw new XMLStreamException();
- }
- }
-
- public String getEncoding() {
- return realReader.getEncoding();
- }
-
- public int getEventType() {
- int event = -1;
- switch (state) {
- case STATE_SWITCHED:
- case STATE_COMPLETE_AT_NEXT:
- event = realReader.getEventType();
- break;
- case STATE_INIT:
- event = START_DOCUMENT;
- break;
- case STATE_COMPLETED:
- event = END_DOCUMENT;
- break;
- }
- return event;
- }
-
- public String getLocalName() {
- if (isDelegating()) {
- return realReader.getLocalName();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public Location getLocation() {
- if (isDelegating()) {
- return realReader.getLocation();
- } else {
- return null;
- }
- }
-
- public QName getName() {
- if (isDelegating()) {
- return realReader.getName();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public NamespaceContext getNamespaceContext() {
- return realReader.getNamespaceContext();
- }
-
- public int getNamespaceCount() {
- if (isDelegating()) {
- return realReader.getNamespaceCount();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getNamespacePrefix(int i) {
- if (isDelegating()) {
- return realReader.getNamespacePrefix(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getNamespaceURI() {
- if (isDelegating()) {
- return realReader.getNamespaceURI();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getNamespaceURI(int i) {
- if (isDelegating()) {
- return realReader.getNamespaceURI(i);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getNamespaceURI(String s) {
- if (isDelegating()) {
- return realReader.getNamespaceURI(s);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getPIData() {
- if (isDelegating()) {
- return realReader.getPIData();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getPITarget() {
- if (isDelegating()) {
- return realReader.getPITarget();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getPrefix() {
- if (isDelegating()) {
- return realReader.getPrefix();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public Object getProperty(String s) throws IllegalArgumentException {
- if (isDelegating()) {
- return realReader.getProperty(s);
- } else {
- throw new IllegalArgumentException();
- }
- }
-
- public String getText() {
- if (isDelegating()) {
- return realReader.getText();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public char[] getTextCharacters() {
- if (isDelegating()) {
- return realReader.getTextCharacters();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
- if (isDelegating()) {
- return realReader.getTextCharacters(i, chars, i1, i2);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextLength() {
- if (isDelegating()) {
- return realReader.getTextLength();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextStart() {
- if (isDelegating()) {
- return realReader.getTextStart();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getVersion() {
- if (isDelegating()) {
- return realReader.getVersion();
- } else {
- return null;
- }
- }
-
- public boolean hasName() {
- if (isDelegating()) {
- return realReader.hasName();
- } else {
- return false;
- }
- }
-
- public boolean hasNext() throws XMLStreamException {
- if (state == STATE_COMPLETE_AT_NEXT) {
- return true;
- } else if (state == STATE_COMPLETED) {
- return false;
- } else if (state == STATE_SWITCHED) {
- return realReader.hasNext();
- } else {
- return true;
- }
- }
-
- public boolean hasText() {
- if (isDelegating()) {
- return realReader.hasText();
- } else {
- return false;
- }
- }
-
- public boolean isAttributeSpecified(int i) {
- if (isDelegating()) {
- return realReader.isAttributeSpecified(i);
- } else {
- return false;
- }
- }
-
- public boolean isCharacters() {
- if (isDelegating()) {
- return realReader.isCharacters();
- } else {
- return false;
- }
- }
-
- private boolean isDelegating() {
- return state == STATE_SWITCHED || state == STATE_COMPLETE_AT_NEXT;
- }
-
- public boolean isEndElement() {
- if (isDelegating()) {
- return realReader.isEndElement();
- } else {
- return false;
- }
- }
-
- public boolean isStandalone() {
- if (isDelegating()) {
- return realReader.isStandalone();
- } else {
- return false;
- }
- }
-
- public boolean isStartElement() {
- if (isDelegating()) {
- return realReader.isStartElement();
- } else {
- return false;
- }
- }
-
- public boolean isWhiteSpace() {
- if (isDelegating()) {
- return realReader.isWhiteSpace();
- } else {
- return false;
- }
- }
-
- public int next() throws XMLStreamException {
- int returnEvent;
-
- switch (state) {
- case STATE_SWITCHED:
- returnEvent = realReader.next();
- if (returnEvent == END_DOCUMENT) {
- state = STATE_COMPLETED;
- } else if (!realReader.hasNext()) {
- state = STATE_COMPLETE_AT_NEXT;
- }
- if (fragment && returnEvent == END_ELEMENT) {
- level--;
- if (level == 0) {
- // We are now at the end of the top-level element in the fragment
- state = STATE_COMPLETE_AT_NEXT;
- }
- }
- if (fragment && returnEvent == START_ELEMENT) {
- level++;
- }
- break;
- case STATE_INIT:
- state = STATE_SWITCHED;
- returnEvent = realReader.getEventType();
- if (returnEvent == START_ELEMENT) {
- // The real reader is positioned at the top-level element in the fragment
- level = 0;
- fragment = true;
- }
- break;
- case STATE_COMPLETE_AT_NEXT:
- state = STATE_COMPLETED;
- returnEvent = END_DOCUMENT;
- break;
- case STATE_COMPLETED:
- // oops - no way we can go beyond this
- throw new NoSuchElementException("End of stream has reached.");
- default:
- throw new UnsupportedOperationException();
- }
-
- return returnEvent;
- }
-
- public int nextTag() throws XMLStreamException {
- if (isDelegating()) {
- int returnEvent = realReader.nextTag();
- if (fragment && returnEvent == END_ELEMENT) {
- level--;
- if (level == 0) {
- // We are now at the end of the top-level element in the fragment
- state = STATE_COMPLETE_AT_NEXT;
- }
- }
- if (fragment && returnEvent == START_ELEMENT) {
- level++;
- }
- return returnEvent;
- } else {
- throw new XMLStreamException();
- }
- }
-
- public void require(int i, String s, String s1) throws XMLStreamException {
- if (isDelegating()) {
- realReader.require(i, s, s1);
- }
- }
-
- public boolean standaloneSet() {
- if (isDelegating()) {
- return realReader.standaloneSet();
- } else {
- return false;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLFragmentStreamReader.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLFragmentStreamReader.java
deleted file mode 100644
index a42d6acc9a..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLFragmentStreamReader.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-
-public interface XMLFragmentStreamReader extends XMLStreamReader {
- QName NIL_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance", "nil", "xsi");
- String NIL_VALUE_TRUE = "true";
-
- /**
- * this will help to handle Text within the current element. user should
- * pass the element text to the property list as this ELEMENT_TEXT as the
- * key. This key deliberately has a space in it so that it is not a valid
- * XML name
- */
- String ELEMENT_TEXT = "Element Text";
-
- /**
- * Extra method to query the state of the pullparser
- */
- boolean isDone();
-
- /**
- * add the parent namespace context to this parser
- */
- void setParentNamespaceContext(NamespaceContext nsContext);
-
- /**
- * Initiate the parser - this will do whatever the needed tasks to initiate
- * the parser and must be called before attempting any specific parsing
- * using this parser
- */
- void init();
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLFragmentStreamReaderImpl.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLFragmentStreamReaderImpl.java
deleted file mode 100644
index f1084cf2a3..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLFragmentStreamReaderImpl.java
+++ /dev/null
@@ -1,857 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-/**
- * This is the new implementation of the XMLFramentStreamReader. The approach
- * here is simple When the pull parser needs to generate events for a particular
- * name-value(s) pair it always hands over (delegates) the task to another pull
- * parser which knows how to deal with it The common types of name value pairs
- * we'll come across are
- * <ul>
- * <li> String name/QName name - String value
- * <li> String name/QName name - String[] value
- * <li> QName name/String name - XMLStreamReader value
- * <li> QName name/String name - XMLStreamable value
- * <li> QName name/String name - Java bean
- * <li> QName name/String name - Datahandler
- *
- * </ul>
- * <p/> As for the attributes, these are the possible combinations in the array
- * <ul>
- * <li> String name/QName name - String value
- * </ul>
- * Note that certain array methods have been deliberately removed to avoid
- * complications. The generated code will take the trouble to lay the elements
- * of the array in the correct order <p/> <p/> Hence there will be a parser impl
- * that knows how to handle these types, and this parent parser will always
- * delegate these tasks to the child pullparasers in effect this is one huge
- * state machine that has only a few states and delegates things down to the
- * child parsers whenever possible <p/>
- *
- * @version $Rev$ $Date$
- */
-public class XMLFragmentStreamReaderImpl implements XMLFragmentStreamReader {
-
- private static final int DELEGATED_STATE = 2;
- private static final int END_ELEMENT_STATE = 1;
- // states for this pullparser - it can only have four states
- private static final int START_ELEMENT_STATE = 0;
- private static final int TEXT_STATE = 3;
-
- protected NamedProperty[] attributes;
-
- // reference to the child reader
- protected XMLFragmentStreamReader childReader;
- // current property index
- // initialized at zero
- protected int index;
- protected Map<String, String> declaredNamespaceMap = new HashMap<String, String>();
- protected QName elementQName;
-
- // we always create a new namespace context
- protected DelegatingNamespaceContext namespaceContext = new DelegatingNamespaceContext();
-
- protected NamedProperty[] elements;
-
- // integer field that keeps the state of this
- // parser.
- protected int state = START_ELEMENT_STATE;
-
- /*
- * we need to pass in a namespace context since when delegated, we've no
- * idea of the current namespace context. So it needs to be passed on here!
- */
- public XMLFragmentStreamReaderImpl(QName elementQName, NamedProperty[] elements, NamedProperty[] attributes) {
- // validate the lengths, since both the arrays are supposed
- // to have
- this.elements = elements == null ? new NamedProperty[0] : elements;
- this.elementQName = elementQName;
- this.attributes = attributes == null ? new NamedProperty[0] : attributes;
- }
-
- protected XMLFragmentStreamReaderImpl(QName elementQName) {
- this.elementQName = elementQName;
- }
-
- /**
- * add the namespace context
- */
-
- public void setParentNamespaceContext(NamespaceContext nsContext) {
- // register the namespace context passed in to this
- this.namespaceContext.setParentNsContext(nsContext);
-
- }
-
- protected NamedProperty[] getElements() {
- return elements;
- }
-
- protected NamedProperty[] getAttributes() {
- return attributes;
- }
-
- protected QName[] getNamespaces() {
- return new QName[0];
- }
-
- /**
- * @param prefix
- * @param uri
- */
- protected void addToNsMap(String prefix, String uri) {
- if (!uri.equals(namespaceContext.getNamespaceURI(prefix))) {
- namespaceContext.pushNamespace(prefix, uri);
- declaredNamespaceMap.put(prefix, uri);
- }
- }
-
- public void close() throws XMLStreamException {
- // do nothing here - we have no resources to free
- }
-
- public int getAttributeCount() {
- return (state == DELEGATED_STATE) ? childReader.getAttributeCount() : (state == START_ELEMENT_STATE
- ? getAttributes().length : 0);
- }
-
- public String getAttributeLocalName(int i) {
- if (state == DELEGATED_STATE) {
- return childReader.getAttributeLocalName(i);
- } else if (state == START_ELEMENT_STATE) {
- QName name = getAttributeName(i);
- if (name == null) {
- return null;
- } else {
- return name.getLocalPart();
- }
- } else {
- throw new IllegalStateException();
- }
- }
-
- /**
- * @param i
- */
- public QName getAttributeName(int i) {
- if (state == DELEGATED_STATE) {
- return childReader.getAttributeName(i);
- } else if (state == START_ELEMENT_STATE) {
- if ((i >= (getAttributes().length)) || i < 0) { // out of range
- return null;
- } else {
- // get the attribute pointer
- QName attribPointer = getAttributes()[i].getKey();
- // case one - attrib name is null
- // this should be the pointer to the OMAttribute then
- if (attribPointer == null) {
- throw new UnsupportedOperationException();
- } else if (attribPointer instanceof QName) {
- return attribPointer;
- } else {
- return null;
- }
- }
- } else {
- throw new IllegalStateException(); // as per the API contract
- }
-
- }
-
- public String getAttributeNamespace(int i) {
- if (state == DELEGATED_STATE) {
- return childReader.getAttributeNamespace(i);
- } else if (state == START_ELEMENT_STATE) {
- QName name = getAttributeName(i);
- if (name == null) {
- return null;
- } else {
- return name.getNamespaceURI();
- }
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributePrefix(int i) {
- if (state == DELEGATED_STATE) {
- return childReader.getAttributePrefix(i);
- } else if (state == START_ELEMENT_STATE) {
- QName name = getAttributeName(i);
- if (name == null) {
- return null;
- } else {
- return name.getPrefix();
- }
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getAttributeType(int i) {
- return null; // not supported
- }
-
- public String getAttributeValue(int i) {
- if (state == DELEGATED_STATE) {
- return childReader.getAttributeValue(i);
- } else if (state == START_ELEMENT_STATE) {
- if ((i >= (getAttributes().length)) || i < 0) { // out of range
- return null;
- } else {
- // get the attribute pointer
- QName attribPointer = getAttributes()[i].getKey();
- Object omAttribObj = getAttributes()[i].getValue();
- // case one - attrib name is null
- // this should be the pointer to the OMAttribute then
- if (attribPointer == null) {
- throw new UnsupportedOperationException();
- } else if (attribPointer instanceof QName) {
- return (String)omAttribObj;
- } else {
- return null;
- }
- }
- } else {
- throw new IllegalStateException();
- }
-
- }
-
- public String getAttributeValue(String nsUri, String localName) {
-
- int attribCount = getAttributeCount();
- String returnValue = null;
- QName attribQualifiedName;
- for (int i = 0; i < attribCount; i++) {
- attribQualifiedName = getAttributeName(i);
- if (nsUri == null) {
- if (localName.equals(attribQualifiedName.getLocalPart())) {
- returnValue = getAttributeValue(i);
- break;
- }
- } else {
- if (localName.equals(attribQualifiedName.getLocalPart()) && nsUri.equals(attribQualifiedName
- .getNamespaceURI())) {
- returnValue = getAttributeValue(i);
- break;
- }
- }
-
- }
-
- return returnValue;
- }
-
- public String getCharacterEncodingScheme() {
- return null; // TODO - should we return something for this ?
- }
-
- /**
- * TODO implement the right contract for this
- *
- * @throws XMLStreamException
- */
- public String getElementText() throws XMLStreamException {
- if (state == DELEGATED_STATE) {
- return childReader.getElementText();
- } else {
- return null;
- }
-
- }
-
- // /////////////////////////////////////////////////////////////////////////
- // / attribute handling
- // /////////////////////////////////////////////////////////////////////////
-
- public String getEncoding() {
- if (state == DELEGATED_STATE) {
- return childReader.getEncoding();
- } else {
- // we've no idea what the encoding is going to be in this case
- // perhaps we ought to return some constant here, which the user
- // might
- // have access to change!
- return null;
- }
- }
-
- public int getEventType() {
- if (state == START_ELEMENT_STATE) {
- return START_ELEMENT;
- } else if (state == END_ELEMENT_STATE) {
- return END_ELEMENT;
- } else if (state == TEXT_STATE) {
- return CHARACTERS;
- } else { // this is the delegated state
- return childReader.getEventType();
- }
- }
-
- public String getLocalName() {
- if (state == DELEGATED_STATE) {
- return childReader.getLocalName();
- } else if (state != TEXT_STATE) {
- return elementQName.getLocalPart();
- } else {
- throw new IllegalStateException();
- }
- }
-
- /**
- */
- public Location getLocation() {
- // return a default location
- return new Location() {
- public int getCharacterOffset() {
- return 0;
- }
-
- public int getColumnNumber() {
- return 0;
- }
-
- public int getLineNumber() {
- return 0;
- }
-
- public String getPublicId() {
- return null;
- }
-
- public String getSystemId() {
- return null;
- }
- };
- }
-
- public QName getName() {
- if (state == DELEGATED_STATE) {
- return childReader.getName();
- } else if (state != TEXT_STATE) {
- return elementQName;
- } else {
- throw new IllegalStateException();
- }
-
- }
-
- public NamespaceContext getNamespaceContext() {
- if (state == DELEGATED_STATE) {
- return childReader.getNamespaceContext();
- } else {
- return namespaceContext;
- }
-
- }
-
- public int getNamespaceCount() {
- if (state == DELEGATED_STATE) {
- return childReader.getNamespaceCount();
- } else {
- return declaredNamespaceMap.size();
- }
- }
-
- /**
- * @param i
- */
- public String getNamespacePrefix(int i) {
- if (state == DELEGATED_STATE) {
- return childReader.getNamespacePrefix(i);
- } else if (state != TEXT_STATE) {
- // order the prefixes
- String[] prefixes = makePrefixArray();
- if ((i >= prefixes.length) || (i < 0)) {
- return null;
- } else {
- return prefixes[i];
- }
-
- } else {
- throw new IllegalStateException();
- }
-
- }
-
- public String getNamespaceURI() {
- if (state == DELEGATED_STATE) {
- return childReader.getNamespaceURI();
- } else if (state == TEXT_STATE) {
- return null;
- } else {
- return elementQName.getNamespaceURI();
- }
- }
-
- // /////////////////////////////////////////////////////////////////////////
- // //////////// end of attribute handling
- // /////////////////////////////////////////////////////////////////////////
-
- // //////////////////////////////////////////////////////////////////////////
- // //////////// namespace handling
- // //////////////////////////////////////////////////////////////////////////
-
- public String getNamespaceURI(int i) {
- if (state == DELEGATED_STATE) {
- return childReader.getNamespaceURI(i);
- } else if (state != TEXT_STATE) {
- String namespacePrefix = getNamespacePrefix(i);
- return namespacePrefix == null ? null : (String)declaredNamespaceMap.get(namespacePrefix);
- } else {
- throw new IllegalStateException();
- }
-
- }
-
- public String getNamespaceURI(String prefix) {
- return namespaceContext.getNamespaceURI(prefix);
- }
-
- public String getPIData() {
- throw new UnsupportedOperationException("Yet to be implemented !!");
- }
-
- public String getPITarget() {
- throw new UnsupportedOperationException("Yet to be implemented !!");
- }
-
- public String getPrefix() {
- if (state == DELEGATED_STATE) {
- return childReader.getPrefix();
- } else if (state == TEXT_STATE) {
- return null;
- } else {
- String prefix = elementQName.getPrefix();
- return "".equals(prefix) ? null : prefix;
- }
- }
-
- // /////////////////////////////////////////////////////////////////////////
- // /////// end of namespace handling
- // /////////////////////////////////////////////////////////////////////////
-
- /**
- * @param key
- * @throws IllegalArgumentException
- */
- public Object getProperty(String key) throws IllegalArgumentException {
- if (state == START_ELEMENT_STATE || state == END_ELEMENT_STATE) {
- return null;
- } else if (state == TEXT_STATE) {
- return null;
- } else if (state == DELEGATED_STATE) {
- return childReader.getProperty(key);
- } else {
- return null;
- }
-
- }
-
- public String getText() {
- if (state == DELEGATED_STATE) {
- return childReader.getText();
- } else if (state == TEXT_STATE) {
- return (String)getElements()[index - 1].getValue();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public char[] getTextCharacters() {
- if (state == DELEGATED_STATE) {
- return childReader.getTextCharacters();
- } else if (state == TEXT_STATE) {
- return getElements()[index - 1].getValue() == null ? new char[0] : ((String)getElements()[index - 1]
- .getValue()).toCharArray();
- } else {
- throw new IllegalStateException();
- }
- }
-
- private int copy(int sourceStart, char[] target, int targetStart, int length) {
- char[] source = getTextCharacters();
- if (sourceStart > source.length) {
- throw new IndexOutOfBoundsException("source start > source length");
- }
- int sourceLen = source.length - sourceStart;
- if (length > sourceLen) {
- length = sourceLen;
- }
- System.arraycopy(source, sourceStart, target, targetStart, length);
- return sourceLen;
- }
-
- public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
- if (state == DELEGATED_STATE) {
- return childReader.getTextCharacters(i, chars, i1, i2);
- } else if (state == TEXT_STATE) {
- return copy(i, chars, i1, i2);
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextLength() {
- if (state == DELEGATED_STATE) {
- return childReader.getTextLength();
- } else if (state == TEXT_STATE) {
- return getTextCharacters().length;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextStart() {
- if (state == DELEGATED_STATE) {
- return childReader.getTextStart();
- } else if (state == TEXT_STATE) {
- return 0; // assume text always starts at 0
- } else {
- throw new IllegalStateException();
- }
- }
-
- public String getVersion() {
- return null;
- }
-
- public boolean hasName() {
- // since this parser always has a name, the hasName
- // has to return true if we are still navigating this element
- // if not we should ask the child reader for it.
- if (state == DELEGATED_STATE) {
- return childReader.hasName();
- } else {
- return state != TEXT_STATE;
- }
- }
-
- /**
- * @throws XMLStreamException
- */
- public boolean hasNext() throws XMLStreamException {
- if (state == DELEGATED_STATE) {
- if (childReader.isDone()) {
- // the child reader is done. We shouldn't be getting the
- // hasNext result from the child pullparser then
- return true;
- } else {
- return childReader.hasNext();
- }
- } else {
- return state == START_ELEMENT_STATE || state == TEXT_STATE;
-
- }
- }
-
- /**
- * check the validity of this implementation
- */
- public boolean hasText() {
- if (state == DELEGATED_STATE) {
- return childReader.hasText();
- } else {
- return state == TEXT_STATE;
- }
-
- }
-
- /**
- * we need to split out the calling to the populate namespaces separately
- * since this needs to be done *after* setting the parent namespace context.
- * We cannot assume it will happen at construction!
- */
- public void init() {
- // here we have an extra issue to attend to. we need to look at the
- // prefixes and URIs (the combination) and populate a HashMap of
- // namespaces. The HashMap of namespaces will be used to serve the
- // namespace context
-
- populateNamespaceContext();
- }
-
- public boolean isAttributeSpecified(int i) {
- return false; // not supported
- }
-
- public boolean isCharacters() {
- if (state == START_ELEMENT_STATE || state == END_ELEMENT_STATE) {
- return false;
- }
- return childReader.isCharacters();
- }
-
- /**
- * are we done ?
- */
- public boolean isDone() {
- return state == END_ELEMENT_STATE;
- }
-
- public boolean isEndElement() {
- if (state == START_ELEMENT_STATE) {
- return false;
- } else if (state == END_ELEMENT_STATE) {
- return true;
- }
- return childReader.isEndElement();
- }
-
- public boolean isStandalone() {
- return true;
- }
-
- public boolean isStartElement() {
- if (state == START_ELEMENT_STATE) {
- return true;
- } else if (state == END_ELEMENT_STATE) {
- return false;
- }
- return childReader.isStartElement();
- }
-
- public boolean isWhiteSpace() {
- if (state == START_ELEMENT_STATE || state == END_ELEMENT_STATE) {
- return false;
- }
- return childReader.isWhiteSpace();
- }
-
- /**
- * Get the prefix list from the HashTable and take that into an array
- */
- private String[] makePrefixArray() {
- String[] prefixes = declaredNamespaceMap.keySet().toArray(new String[declaredNamespaceMap.size()]);
- Arrays.sort(prefixes);
- return prefixes;
- }
-
- /**
- * By far this should be the most important method in this class this method
- * changes the state of the parser
- */
- public int next() throws XMLStreamException {
- int returnEvent = -1; // invalid state is the default state
- switch (state) {
- case START_ELEMENT_STATE:
- // current element is start element. We should be looking at the
- // property list and making a pullparser for the property value
- if (getElements() == null || getElements().length == 0) {
- // no properties - move to the end element state
- // straight away
- state = END_ELEMENT_STATE;
- returnEvent = END_ELEMENT;
- } else {
- // there are properties. now we should delegate this task to
- // a
- // child reader depending on the property type
- returnEvent = processProperties();
-
- }
- break;
- case END_ELEMENT_STATE:
- // we've reached the end element already. If the user tries to
- // push
- // further ahead then it is an exception
- throw new XMLStreamException("Trying to go beyond the end of the pullparser");
-
- case DELEGATED_STATE:
- if (childReader.isDone()) {
- // we've reached the end!
- if (index > (getElements().length - 1)) {
- state = END_ELEMENT_STATE;
- returnEvent = END_ELEMENT;
- } else {
- returnEvent = processProperties();
- }
- } else {
- returnEvent = childReader.next();
- }
- break;
-
- case TEXT_STATE:
- // if there are any more event we should be delegating to
- // processProperties. if not we just return an end element
- if (index > (getElements().length - 1)) {
- state = END_ELEMENT_STATE;
- returnEvent = END_ELEMENT;
- } else {
- returnEvent = processProperties();
- }
- break;
- }
- return returnEvent;
- }
-
- // /////////////////////////////////////////////////////////////////////////
- // / Other utility methods
- // ////////////////////////////////////////////////////////////////////////
-
- /**
- * TODO implement this
- *
- * @throws XMLStreamException
- */
- public int nextTag() throws XMLStreamException {
- return 0;
- }
-
- /**
- * Populates a namespace context
- */
- private void populateNamespaceContext() {
-
- // first add the current element namespace to the namespace context
- // declare it if not found
- addToNsMap(elementQName.getPrefix(), elementQName.getNamespaceURI());
-
- for (QName n : getNamespaces()) {
- addToNsMap(n.getPrefix(), n.getNamespaceURI());
- }
-
- // traverse through the attributes and populate the namespace context
- // the attrib list can be of many combinations
- // the valid combinations are
- // String - String
- // QName - QName
- // null - OMAttribute
-
- for (int i = 0; i < getAttributes().length; i++) { // jump in two
- QName attrQName = getAttributes()[i].getKey();
- if (!"".equals(attrQName.getNamespaceURI())) {
- addToNsMap(attrQName.getPrefix(), attrQName.getNamespaceURI());
- }
- }
- }
-
- /**
- * A convenient method to reuse the properties
- *
- * @return event to be thrown
- * @throws XMLStreamException
- */
- private int processProperties() throws XMLStreamException {
- // move to the next property depending on the current property
- // index
- QName propertyQName = getElements()[index].getKey();
- boolean textFound = false;
- if (propertyQName == null) {
- throw new XMLStreamException("property key cannot be null!");
- } else if (ELEMENT_TEXT.equals(propertyQName.getLocalPart())) {
- // propPointer being a String has a special case
- // that is it can be a the special constant ELEMENT_TEXT that
- // says this text event
- textFound = true;
- }
-
- // OK! we got the key. Now look at the value
- Object propertyValue = getElements()[index].getValue();
- // cater for the special case now
- if (textFound) {
- // no delegation here - make the parser null and immediately
- // return with the event characters
- childReader = null;
- state = TEXT_STATE;
- ++index;
- return CHARACTERS;
- } else if (propertyValue == null) {
- // if the value is null we delegate the work to a nullable
- // parser
- childReader = new NilElementStreamReader(propertyQName);
- childReader.setParentNamespaceContext(this.namespaceContext);
- childReader.init();
- } else if (propertyValue instanceof String) {
- // strings are handled by the NameValuePairStreamReader
- childReader = new NameValuePairStreamReader(propertyQName, (String)propertyValue);
- childReader.setParentNamespaceContext(this.namespaceContext);
- childReader.init();
- } else if (propertyValue instanceof String[]) {
- // string[] are handled by the NameValueArrayStreamReader
- // if the array is empty - skip it
- if (((String[])propertyValue).length == 0) {
- // advance the index
- ++index;
- return processProperties();
- } else {
- childReader = new NameValueArrayStreamReader(propertyQName, (String[])propertyValue);
- childReader.setParentNamespaceContext(this.namespaceContext);
- childReader.init();
- }
-
- } else if (propertyValue instanceof XMLStreamable) {
- // ADBbean has it's own method to get a reader
- XMLStreamReader reader = ((XMLStreamable)propertyValue).getXMLStreamReader(propertyQName);
- // we know for sure that this is an ADB XMLStreamreader.
- // However we need to make sure that it is compatible
- if (reader instanceof XMLFragmentStreamReader) {
- childReader = (XMLFragmentStreamReader)reader;
- childReader.setParentNamespaceContext(this.namespaceContext);
- childReader.init();
- } else {
- // wrap it to make compatible
- childReader = new WrappingXMLStreamReader(reader);
- }
- } else if (propertyValue instanceof XMLStreamReader) {
- XMLStreamReader reader = (XMLStreamReader)propertyValue;
- if (reader instanceof XMLFragmentStreamReader) {
- childReader = (XMLFragmentStreamReader)reader;
- childReader.setParentNamespaceContext(this.namespaceContext);
- childReader.init();
- } else {
- // wrap it to make compatible
- childReader = new WrappingXMLStreamReader(reader);
- }
-
- } else {
- // all special possibilities has been tried! Let's treat
- // the thing as a bean and try generating events from it
- childReader = new WrappingXMLStreamReader(new BeanXMLStreamReaderImpl(propertyQName, propertyValue));
- // we cannot register the namespace context here
- }
-
- // set the state here
- state = DELEGATED_STATE;
- // we are done with the delegation
- // increment the property index
- ++index;
- return childReader.getEventType();
- }
-
- public void require(int i, String string, String string1) throws XMLStreamException {
- throw new UnsupportedOperationException();
- }
-
- public boolean standaloneSet() {
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLGroupDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLGroupDataBinding.java
deleted file mode 100644
index f7c895db1e..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLGroupDataBinding.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Writer;
-
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.databinding.impl.GroupDataBinding;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-
-/**
- * A Group DataBinding
- *
- * @version $Rev$ $Date$
- */
-public class XMLGroupDataBinding extends GroupDataBinding {
-
- public XMLGroupDataBinding() {
- super(new Class[] {InputStream.class, OutputStream.class, Reader.class, Writer.class,
- // Source.class, Result.class,
- InputSource.class, ContentHandler.class, XMLStreamReader.class,
- XMLStreamWriter.class, XMLEventReader.class, XMLEventWriter.class});
- }
-
- @Override
- protected Object getLogical(Class<?> markerType, Operation operation) {
- return XMLType.UNKNOWN;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2Node.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2Node.java
deleted file mode 100644
index e2d0416aec..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2Node.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.DataPipe;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-
-/**
- * Transform DOM Node to XML XMLStreamReader
- *
- * @version $Rev$ $Date$
- */
-public class XMLStreamReader2Node extends BaseTransformer<XMLStreamReader, Node> implements
- PullTransformer<XMLStreamReader, Node> {
-
- private XMLStreamReader2SAX stax2sax = new XMLStreamReader2SAX();
-
- public Node transform(XMLStreamReader source, TransformationContext context) {
- try {
- DataPipe<ContentHandler, Node> pipe = new SAX2DOMPipe().newInstance();
- stax2sax.transform(source, pipe.getSink(), context);
- Node node = pipe.getResult();
- source.close();
- if (node instanceof Document) {
- Document doc = (Document)node;
- return DOMHelper.adjustElementName(context, doc.getDocumentElement());
- } else {
- return node;
- }
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- @Override
- protected Class<Node> getTargetType() {
- return Node.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2SAX.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2SAX.java
deleted file mode 100644
index 9b39f039b1..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2SAX.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PushTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.xml.sax.ContentHandler;
-
-/**
- * XMLStreamReader to SAX events
- *
- * @version $Rev$ $Date$
- */
-public class XMLStreamReader2SAX extends BaseTransformer<XMLStreamReader, ContentHandler> implements
- PushTransformer<XMLStreamReader, ContentHandler> {
-
- @Override
- protected Class<ContentHandler> getTargetType() {
- return ContentHandler.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.PushTransformer#getWeight()
- */
- @Override
- public int getWeight() {
- return 20;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object,
- * java.lang.Object,
- * org.apache.tuscany.sca.databinding.TransformationContext)
- */
- public void transform(XMLStreamReader source, ContentHandler sink, TransformationContext context) {
- StAX2SAXAdapter adapter = new StAX2SAXAdapter(false);
- try {
- adapter.parse(source, sink);
- source.close();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2String.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2String.java
deleted file mode 100644
index 6db731bc9f..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2String.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-public class XMLStreamReader2String extends BaseTransformer<XMLStreamReader, String> implements
- PullTransformer<XMLStreamReader, String> {
-
- public String transform(XMLStreamReader source, TransformationContext context) {
- try {
- String str = StAXHelper.save(source);
- source.close();
- return str;
- } catch (XMLStreamException e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<XMLStreamReader> getSourceType() {
- return XMLStreamReader.class;
- }
-
- @Override
- protected Class<String> getTargetType() {
- return String.class;
- }
-
- @Override
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamSerializer.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamSerializer.java
deleted file mode 100644
index 920ebb511c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamSerializer.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.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/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamable.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamable.java
deleted file mode 100644
index f32f93d098..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamable.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-
-/**
- * An interface represents data that can be read using StAX streaming
- *
- * @version $Rev$ $Date$
- */
-public interface XMLStreamable {
- /**
- * Get the XMLStreamReader for StAX processing
- *
- * @param rootElementName the name of the element to be generated
- * @return Returns a pull parser.
- */
- XMLStreamReader getXMLStreamReader(QName rootElementName);
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStringDataBinding.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStringDataBinding.java
deleted file mode 100644
index 22b173dce5..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStringDataBinding.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * A DataBinding for the XML string
- *
- * @version $Rev$ $Date$
- */
-public class XMLStringDataBinding extends BaseDataBinding {
- public static final String NAME = String.class.getName();
-
- public XMLStringDataBinding() {
- super(NAME, String.class);
- }
-
- @Override
- public boolean introspect(DataType type, Operation operation) {
- if (type.getPhysical() == String.class && NAME.equals(type.getDataBinding())) {
- type.setDataBinding(NAME);
- type.setLogical(XMLType.UNKNOWN);
- return true;
- } else {
- return false;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlNode.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlNode.java
deleted file mode 100644
index 86ebd627f7..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlNode.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface XmlNode {
- enum Type {ELEMENT, ATTRIBUTE, CHARACTERS, READER};
- /**
- * Returns the children of the receiver as an <code>Iterator</code>.
- */
- Iterator<XmlNode> children();
-
- /**
- * Returns the attributes of the element as an <code>List</code>. Namespace declarations
- * should be excluded.
- *
- * @return
- */
- List<XmlNode> attributes();
-
- /**
- * Returns a map of prefix to namespace URI
- * @return
- */
- Map<String, String> namespaces();
-
- /**
- * Return the QName of the element. If it's for a text node, the name is null.
- * @return
- */
- QName getName();
-
- /**
- * Return the text value of the leaf element
- * @return
- */
- <T> T getValue();
-
- /**
- * Return the type of the XML node
- * @return
- */
- Type getType();
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlNodeIterator.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlNodeIterator.java
deleted file mode 100644
index d1632befe1..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlNodeIterator.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.ArrayList;
-import java.util.EmptyStackException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.NamespaceContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class XmlNodeIterator implements Iterator<XmlNode> {
- public static final int START = 0;
- public static final int END = 1;
-
- protected FastStack<ElementHolder> stack;
- protected int state;
- protected NamespaceContextImpl nsContext;
-
- public XmlNodeIterator(XmlNode rootNode) {
- super();
- List<XmlNode> v = new ArrayList<XmlNode>(1);
- v.add(rootNode);
- stack = new FastStack<ElementHolder>();
- Iterator<XmlNode> i = v.iterator();
- stack.push(new ElementHolder(null, i));
- this.state = START;
- this.nsContext = new NamespaceContextImpl(null);
- }
-
- public boolean hasNext() {
- return !(stack.empty() || (state == END && stack.peek().parent == null));
- }
-
- public XmlNode next() {
- this.state = START;
- ElementHolder element = stack.peek();
- Iterator<XmlNode> it = element.children;
- if (it == null || (!it.hasNext())) {
- // End of the children, return END event of parent
- stack.pop();
- this.state = END;
- this.nsContext = (NamespaceContextImpl)nsContext.getParent();
- return element.parent;
- }
- XmlNode node = it.next();
- stack.push(new ElementHolder(node, node.children()));
- this.nsContext = new NamespaceContextImpl(this.nsContext);
- populateNamespaces(node);
- return node;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public int getState() {
- return state;
- }
-
- public NamespaceContext getNamespaceContext() {
- return nsContext;
- }
-
- private void populateNamespaces(XmlNode element) {
- if (element.getName() != null) {
- if (element.namespaces() != null) {
- for (Map.Entry<String, String> e : element.namespaces().entrySet()) {
- nsContext.register(e.getKey(), e.getValue());
- }
- }
- }
- }
-
- private static class ElementHolder {
- private XmlNode parent;
- private Iterator<XmlNode> children;
-
- public ElementHolder(XmlNode parent, Iterator<XmlNode> children) {
- this.parent = parent;
- this.children = children;
- }
- }
-
- private static class NamespaceContextImpl implements NamespaceContext {
- private NamespaceContext parent;
- private Map<String, String> map = new HashMap<String, String>();
-
- /**
- * @param parent
- */
- public NamespaceContextImpl(NamespaceContext parent) {
- super();
- this.parent = parent;
- if (parent == null) {
- map.put("xml", "http://www.w3.org/XML/1998/namespace");
- map.put("xmlns", "http://www.w3.org/2000/xmlns/");
- }
- }
-
- public String getNamespaceURI(String prefix) {
- if (prefix == null) {
- throw new IllegalArgumentException("Prefix is null");
- }
-
- String ns = (String)map.get(prefix);
- if (ns != null) {
- return ns;
- }
- if (parent != null) {
- return parent.getNamespaceURI(prefix);
- }
- return null;
- }
-
- public String getPrefix(String nsURI) {
- if (nsURI == null)
- throw new IllegalArgumentException("Namespace is null");
- for (Iterator<Map.Entry<String, String>> i = map.entrySet().iterator(); i.hasNext();) {
- Map.Entry<String, String> entry = i.next();
- if (entry.getValue().equals(nsURI)) {
- return entry.getKey();
- }
- }
- if (parent != null) {
- return parent.getPrefix(nsURI);
- }
- return null;
- }
-
- public Iterator getPrefixes(String nsURI) {
- List<String> prefixList = new ArrayList<String>();
- for (Iterator<Map.Entry<String, String>> i = map.entrySet().iterator(); i.hasNext();) {
- Map.Entry<String, String> entry = i.next();
- if (entry.getValue().equals(nsURI)) {
- prefixList.add(entry.getKey());
- }
- }
- final Iterator<String> currentIterator = prefixList.iterator();
- final Iterator parentIterator = parent != null ? null : parent.getPrefixes(nsURI);
- return new Iterator() {
-
- public boolean hasNext() {
- return currentIterator.hasNext() || (parentIterator != null && parentIterator.hasNext());
- }
-
- public Object next() {
- if (!hasNext()) {
- throw new IllegalStateException("End of iterator has reached");
- }
- return currentIterator.hasNext() ? currentIterator.next() : parentIterator.next();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- };
-
- }
-
- public void register(String prefix, String ns) {
- map.put(prefix, ns);
- }
-
- public NamespaceContext getParent() {
- return parent;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer(map.toString());
- if (parent != null) {
- sb.append("\nParent: ");
- sb.append(parent);
- }
- return sb.toString();
- }
- }
-
- /**
- * An implementation of the {@link java.util.Stack} API that is based on an <code>ArrayList</code> instead of a
- * <code>Vector</code>, so it is not synchronized to protect against multi-threaded access. The implementation is
- * therefore operates faster in environments where you do not need to worry about multiple thread contention.
- * <p>
- * The removal order of an <code>ArrayStack</code> is based on insertion order: The most recently added element is
- * removed first. The iteration order is <i>not</i> the same as the removal order. The iterator returns elements
- * from the bottom up, whereas the {@link #remove()} method removes them from the top down.
- * <p>
- * Unlike <code>Stack</code>, <code>ArrayStack</code> accepts null entries.
- */
- public static class FastStack<T> extends ArrayList<T> {
-
- /** Ensure Serialization compatibility */
- private static final long serialVersionUID = 2130079159931574599L;
-
- /**
- * Constructs a new empty <code>ArrayStack</code>. The initial size is controlled by <code>ArrayList</code>
- * and is currently 10.
- */
- public FastStack() {
- super();
- }
-
- /**
- * Constructs a new empty <code>ArrayStack</code> with an initial size.
- *
- * @param initialSize the initial size to use
- * @throws IllegalArgumentException if the specified initial size is negative
- */
- public FastStack(int initialSize) {
- super(initialSize);
- }
-
- /**
- * Return <code>true</code> if this stack is currently empty.
- * <p>
- * This method exists for compatibility with <code>java.util.Stack</code>. New users of this class should use
- * <code>isEmpty</code> instead.
- *
- * @return true if the stack is currently empty
- */
- public boolean empty() {
- return isEmpty();
- }
-
- /**
- * Returns the top item off of this stack without removing it.
- *
- * @return the top item on the stack
- * @throws EmptyStackException if the stack is empty
- */
- public T peek() throws EmptyStackException {
- int n = size();
- if (n <= 0) {
- throw new EmptyStackException();
- } else {
- return get(n - 1);
- }
- }
-
- /**
- * Returns the n'th item down (zero-relative) from the top of this stack without removing it.
- *
- * @param n the number of items down to go
- * @return the n'th item on the stack, zero relative
- * @throws EmptyStackException if there are not enough items on the stack to satisfy this request
- */
- public T peek(int n) throws EmptyStackException {
- int m = (size() - n) - 1;
- if (m < 0) {
- throw new EmptyStackException();
- } else {
- return get(m);
- }
- }
-
- /**
- * Pops the top item off of this stack and return it.
- *
- * @return the top item on the stack
- * @throws EmptyStackException if the stack is empty
- */
- public T pop() throws EmptyStackException {
- int n = size();
- if (n <= 0) {
- throw new EmptyStackException();
- } else {
- return remove(n - 1);
- }
- }
-
- /**
- * Pushes a new item onto the top of this stack. The pushed item is also returned. This is equivalent to calling
- * <code>add</code>.
- *
- * @param item the item to be added
- * @return the item just pushed
- */
- public Object push(T item) {
- add(item);
- return item;
- }
-
- /**
- * Returns the top-most index for the object in the stack
- *
- * @param object the object to be searched for
- * @return top-most index, or -1 if not found
- */
- public int search(T object) {
- int i = size() - 1; // Current index
- while (i >= 0) {
- T current = get(i);
- if ((object == null && current == null) || (object != null && object.equals(current))) {
- return i;
- }
- i--;
- }
- return -1;
- }
-
- /**
- * Returns the element on the top of the stack.
- *
- * @return the element on the top of the stack
- * @throws EmptyStackException if the stack is empty
- */
- public T get() {
- int size = size();
- if (size == 0) {
- throw new EmptyStackException();
- }
- return get(size - 1);
- }
-
- /**
- * Removes the element on the top of the stack.
- *
- * @return the removed element
- * @throws EmptyStackException if the stack is empty
- */
- public T remove() {
- int size = size();
- if (size == 0) {
- throw new EmptyStackException();
- }
- return remove(size - 1);
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlTreeStreamReaderImpl.java b/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlTreeStreamReaderImpl.java
deleted file mode 100644
index f4bc357c7d..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XmlTreeStreamReaderImpl.java
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class XmlTreeStreamReaderImpl implements XMLStreamReader {
-
- protected int state;
- protected XmlNodeIterator iterator;
- protected XmlNode current;
-
- protected XMLStreamReader reader;
-
- /*
- * we need to pass in a namespace context since when delegated, we've no
- * idea of the current namespace context. So it needs to be passed on here!
- */
- public XmlTreeStreamReaderImpl(XmlNode root) {
- this.iterator = new XmlNodeIterator(root);
- this.current = null;
- this.state = START_DOCUMENT;
- this.reader = null;
- }
-
- public void close() throws XMLStreamException {
- if (reader != null) {
- reader.close();
- }
- }
-
- private void checkElementState() {
- if (getEventType() != START_ELEMENT && getEventType() != END_ELEMENT) {
- throw new IllegalStateException();
- }
- }
-
- private List<XmlNode> getAttributes() {
- if (current != null && current.attributes() != null) {
- return current.attributes();
- } else {
- return Collections.emptyList();
- }
- }
-
- public int getAttributeCount() {
- checkElementState();
- if (reader != null) {
- return reader.getAttributeCount();
- }
- return getAttributes().size();
- }
-
- public String getAttributeLocalName(int i) {
- checkElementState();
- if (reader != null) {
- return reader.getAttributeLocalName(i);
- }
- return getAttributes().get(i).getName().getLocalPart();
- }
-
- /**
- * @param i
- */
- public QName getAttributeName(int i) {
- checkElementState();
- if (reader != null) {
- return reader.getAttributeName(i);
- }
- return getAttributes().get(i).getName();
- }
-
- public String getAttributeNamespace(int i) {
- checkElementState();
- if (reader != null) {
- return reader.getAttributeNamespace(i);
- }
- return getAttributes().get(i).getName().getNamespaceURI();
- }
-
- public String getAttributePrefix(int i) {
- checkElementState();
- if (reader != null) {
- return reader.getAttributePrefix(i);
- }
- return getAttributes().get(i).getName().getPrefix();
- }
-
- public String getAttributeType(int i) {
- if (reader != null) {
- return reader.getAttributeType(i);
- }
- return null; // not supported
- }
-
- public String getAttributeValue(int i) {
- checkElementState();
- if (reader != null) {
- return reader.getAttributeValue(i);
- }
- return getAttributes().get(i).getValue();
- }
-
- public String getAttributeValue(String nsUri, String localName) {
- checkElementState();
- if (reader != null) {
- return reader.getAttributeValue(nsUri, localName);
- }
- int count = getAttributeCount();
- String value = null;
- QName attrQName;
- for (int i = 0; i < count; i++) {
- attrQName = getAttributeName(i);
- if (nsUri == null) {
- if (localName.equals(attrQName.getLocalPart())) {
- value = getAttributeValue(i);
- break;
- }
- } else {
- if (localName.equals(attrQName.getLocalPart()) && nsUri.equals(attrQName.getNamespaceURI())) {
- value = getAttributeValue(i);
- break;
- }
- }
-
- }
-
- return value;
- }
-
- public String getCharacterEncodingScheme() {
- if (reader != null) {
- return reader.getCharacterEncodingScheme();
- }
- return "UTF-8";
- }
-
- public String getElementText() throws XMLStreamException {
- checkElementState();
- if (reader != null) {
- return reader.getElementText();
- }
- return current.getValue();
- }
-
- public String getEncoding() {
- if (reader != null) {
- return reader.getEncoding();
- }
- return "UTF-8";
- }
-
- public int getEventType() {
- return state;
- }
-
- public String getLocalName() {
- checkElementState();
- if (reader != null) {
- return reader.getLocalName();
- }
- return current.getName().getLocalPart();
- }
-
- /**
- */
- public Location getLocation() {
- if (reader != null) {
- return reader.getLocation();
- }
- // return a default location
- return new Location() {
- public int getCharacterOffset() {
- return 0;
- }
-
- public int getColumnNumber() {
- return 0;
- }
-
- public int getLineNumber() {
- return 0;
- }
-
- public String getPublicId() {
- return null;
- }
-
- public String getSystemId() {
- return null;
- }
- };
- }
-
- public QName getName() {
- checkElementState();
- if (reader != null) {
- return reader.getName();
- }
- return current.getName();
- }
-
- public NamespaceContext getNamespaceContext() {
- if (reader != null) {
- return reader.getNamespaceContext();
- }
- return iterator.getNamespaceContext();
- }
-
- private Map<String, String> getNamespaces() {
- if (current != null && current.namespaces() != null) {
- return current.namespaces();
- } else {
- return Collections.emptyMap();
- }
- }
-
- public int getNamespaceCount() {
- checkElementState();
- if (reader != null) {
- return reader.getNamespaceCount();
- }
- return getNamespaces().size();
- }
-
- /**
- * @param i
- */
- public String getNamespacePrefix(int i) {
- checkElementState();
- if (reader != null) {
- return reader.getNamespacePrefix(i);
- }
- return new ArrayList<Map.Entry<String, String>>(getNamespaces().entrySet()).get(i).getKey();
- }
-
- public String getNamespaceURI() {
- checkElementState();
- if (reader != null) {
- return reader.getNamespaceURI();
- }
- return current.getName().getNamespaceURI();
- }
-
- public String getNamespaceURI(int i) {
- checkElementState();
- if (reader != null) {
- return reader.getNamespaceURI(i);
- }
- return new ArrayList<Map.Entry<String, String>>(getNamespaces().entrySet()).get(i).getValue();
- }
-
- public String getNamespaceURI(String prefix) {
- if (reader != null) {
- return reader.getNamespaceURI(prefix);
- }
- return getNamespaceContext().getNamespaceURI(prefix);
- }
-
- public String getPIData() {
- if (reader != null) {
- return reader.getPIData();
- }
- throw new UnsupportedOperationException("Yet to be implemented !!");
- }
-
- public String getPITarget() {
- if (reader != null) {
- return reader.getPITarget();
- }
- throw new UnsupportedOperationException("Yet to be implemented !!");
- }
-
- public String getPrefix() {
- if (reader != null) {
- return reader.getPrefix();
- }
- if (state == START_ELEMENT || state == END_ELEMENT) {
- String prefix = current.getName().getPrefix();
- return "".equals(prefix) ? null : prefix;
- } else if (state == START_DOCUMENT) {
- return null;
- } else {
- throw new IllegalStateException("State==" + state);
- }
- }
-
- /**
- * @param key
- * @throws IllegalArgumentException
- */
- public Object getProperty(String key) throws IllegalArgumentException {
- if (reader != null) {
- return reader.getProperty(key);
- }
- return null;
- }
-
- public String getText() {
- if (reader != null) {
- return reader.getText();
- }
- return current.getValue();
- }
-
- public char[] getTextCharacters() {
- if (reader != null) {
- return reader.getTextCharacters();
- }
- String value = current.getValue();
- return value == null ? new char[0] : value.toCharArray();
- }
-
- private int copy(int sourceStart, char[] target, int targetStart, int length) {
- char[] source = getTextCharacters();
- if (sourceStart > source.length) {
- throw new IndexOutOfBoundsException("source start > source length");
- }
- int sourceLen = source.length - sourceStart;
- if (length > sourceLen) {
- length = sourceLen;
- }
- System.arraycopy(source, sourceStart, target, targetStart, length);
- return sourceLen;
- }
-
- public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
- if (reader != null) {
- return reader.getTextCharacters(i, chars, i1, i2);
- }
- return copy(i, chars, i1, i2);
- }
-
- public int getTextLength() {
- if (reader != null) {
- return reader.getTextLength();
- }
- return getTextCharacters().length;
- }
-
- public int getTextStart() {
- if (reader != null) {
- return reader.getTextStart();
- }
- return 0;
- }
-
- public String getVersion() {
- return "1.0";
- }
-
- public boolean hasName() {
- if (reader != null) {
- return reader.hasName();
- }
- return current.getName() != null;
- }
-
- /**
- * @throws XMLStreamException
- */
- public boolean hasNext() throws XMLStreamException {
- return iterator.hasNext() || state != END_DOCUMENT || (reader != null && reader.hasNext());
- }
-
- public boolean hasText() {
- if (reader != null) {
- return reader.hasText();
- }
- return current.getType() == XmlNode.Type.CHARACTERS;
- }
-
- public boolean isAttributeSpecified(int i) {
- if (reader != null) {
- return reader.isAttributeSpecified(i);
- }
- return false; // not supported
- }
-
- public boolean isCharacters() {
- if (reader != null) {
- return reader.isCharacters();
- }
- return current.getType() == XmlNode.Type.CHARACTERS;
- }
-
- public boolean isEndElement() {
- if (reader != null) {
- return reader.isEndElement();
- }
- return getEventType() == END_ELEMENT;
- }
-
- public boolean isStandalone() {
- return true;
- }
-
- public boolean isStartElement() {
- if (reader != null) {
- return reader.isStartElement();
- }
- return getEventType() == START_ELEMENT;
- }
-
- public boolean isWhiteSpace() {
- if (reader != null) {
- return reader.isWhiteSpace();
- }
- return false;
- }
-
- /**
- * By far this should be the most important method in this class this method
- * changes the state of the parser
- */
- public int next() throws XMLStreamException {
- if (!hasNext()) {
- throw new IllegalStateException("No more events");
- }
- if (reader != null) {
- if (!reader.hasNext()) {
- this.reader = null;
- } else {
- // Go to the delegation mode
- state = reader.next();
- return state;
- }
- }
- if (!iterator.hasNext()) {
- state = END_DOCUMENT;
- current = null;
- return state;
- }
- current = iterator.next();
- XmlNode.Type type = current.getType();
-
- int itState = iterator.getState();
- if (itState == XmlNodeIterator.END) {
- if (type == XmlNode.Type.ELEMENT) {
- state = END_ELEMENT;
- } else {
- // Ignore the pop
- state = next();
- }
- }
- if (itState == XmlNodeIterator.START) {
- if (type == XmlNode.Type.ELEMENT) {
- state = START_ELEMENT;
- } else if (type == XmlNode.Type.CHARACTERS) {
- state = CHARACTERS;
- } else if (type == XmlNode.Type.READER) {
- XMLStreamReader value = current.getValue();
- this.reader = new WrappingXMLStreamReader(value);
- state = reader.getEventType();
- return state;
- }
- }
- return state;
- }
-
- /**
- * TODO implement this
- *
- * @throws XMLStreamException
- */
- public int nextTag() throws XMLStreamException {
- while (true) {
- int event = next();
- if (event == START_ELEMENT || event == END_ELEMENT) {
- return event;
- }
- }
- }
-
- public void require(int i, String ns, String localPart) throws XMLStreamException {
- if (reader != null) {
- reader.require(i, ns, localPart);
- return;
- }
- int event = getEventType();
- if (event != i) {
- throw new IllegalStateException("Event type is " + event + " (!=" + i + ")");
- }
- QName name = getName();
- String ns1 = name.getNamespaceURI();
- String localName1 = name.getLocalPart();
-
- if (ns != null && !ns.equals(ns1)) {
- throw new IllegalStateException("Namespace URI is " + ns1 + " (!=" + ns + ")");
- }
-
- if (localPart != null && !localPart.equals(localName1)) {
- throw new IllegalStateException("Local name is " + localName1 + " (!=" + localPart + ")");
- }
-
- }
-
- public boolean standaloneSet() {
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding b/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
deleted file mode 100644
index afb00c91ee..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBinding
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# implementation classes for the databindings
-org.apache.tuscany.sca.databinding.xml.DOMDataBinding;name=org.w3c.dom.Node
-org.apache.tuscany.sca.databinding.xml.XMLStringDataBinding;name=java.lang.String
-org.apache.tuscany.sca.databinding.xml.XMLGroupDataBinding;name=databinding:group
-org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding;name=java:complexType
-org.apache.tuscany.sca.databinding.javabeans.SimpleJavaDataBinding;name=java:simpleType
-org.apache.tuscany.sca.databinding.javabeans.JavaExceptionDataBinding;name=java:exception
-org.apache.tuscany.sca.databinding.externalizable.ExternalizableDataBinding;name=java.io.Externalizable
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBindingExtensionPoint b/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBindingExtensionPoint
deleted file mode 100644
index 568e04f9de..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.DataBindingExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer b/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
deleted file mode 100644
index 96115be404..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer
+++ /dev/null
@@ -1,40 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation classes for the transformers
-org.apache.tuscany.sca.databinding.xml.InputSource2Node;source=org.xml.sax.InputSource,target=org.w3c.dom.Node,weight=80
-org.apache.tuscany.sca.databinding.xml.InputStream2Node;source=java.io.InputStream,target=org.w3c.dom.Node,weight=80
-# org.apache.tuscany.sca.databinding.javabeans.DOMNode2JavaBeanTransformer;source=org.w3c.dom.Node,target=java:complexType,weight=80000
-org.apache.tuscany.sca.databinding.xml.Node2String;source=org.w3c.dom.Node,target=java.lang.String,weight=80
-org.apache.tuscany.sca.databinding.xml.Node2XMLStreamReader;source=org.w3c.dom.Node,target=javax.xml.stream.XMLStreamReader,weight=80
-# org.apache.tuscany.sca.databinding.javabeans.JavaBean2DOMNodeTransformer;source=java:complexType,target=org.w3c.dom.Node,weight=80000
-# org.apache.tuscany.sca.databinding.javabeans.JavaBean2XMLStreamReaderTransformer;source=java:complexType,target=javax.xml.stream.XMLStreamReader,weight=79000
-org.apache.tuscany.sca.databinding.xml.Reader2Node;source=java.io.Reader,target=org.w3c.dom.Node,weight=80
-org.apache.tuscany.sca.databinding.xml.SAX2DOMPipe;source=org.xml.sax.ContentHandler,target=org.w3c.dom.Node,weight=70
-org.apache.tuscany.sca.databinding.xml.StreamDataPipe;source=java.io.OutputStream,target=java.io.InputStream,weight=90
-org.apache.tuscany.sca.databinding.xml.String2Node;source=java.lang.String,target=org.w3c.dom.Node,weight=90
-org.apache.tuscany.sca.databinding.xml.String2XMLStreamReader;source=java.lang.String,target=javax.xml.stream.XMLStreamReader,weight=90
-org.apache.tuscany.sca.databinding.xml.Writer2ReaderDataPipe;source=java.io.Writer,target=java.io.Reader,weight=90
-org.apache.tuscany.sca.databinding.xml.XMLStreamReader2Node;source=javax.xml.stream.XMLStreamReader,target=org.w3c.dom.Node,weight=80
-org.apache.tuscany.sca.databinding.xml.XMLStreamReader2String;source=javax.xml.stream.XMLStreamReader,target=java.lang.String,weight=80
-# org.apache.tuscany.sca.databinding.xml.Node2SimpleJavaType;source=org.w3c.dom.Node,target=java:simpleType,weight=80000
-# org.apache.tuscany.sca.databinding.xml.SimpleJavaType2Node;source=java:simpleType,target=org.w3c.dom.Node,weight=80000
-org.apache.tuscany.sca.databinding.xml.Source2NodeTransformer;source=javax.xml.transform.Source,target=org.w3c.dom.Node,weight=80
-org.apache.tuscany.sca.databinding.xml.Source2StringTransformer;source=javax.xml.transform.Source,target=java.lang.String,weight=80
-
-org.apache.tuscany.sca.databinding.xml.Node2SourceTransformer;source=org.w3c.dom.Node,target=javax.xml.transform.Source,weight=80
-org.apache.tuscany.sca.databinding.xml.String2SourceTransformer;source=java.lang.String,target=javax.xml.transform.Source,weight=80
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer b/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer
deleted file mode 100644
index e02cd5c934..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation classes for the transformers
-org.apache.tuscany.sca.databinding.xml.InputSource2SAX;source=org.xml.sax.InputSource,target=org.xml.sax.ContentHandler,weight=80
-org.apache.tuscany.sca.databinding.xml.InputStream2SAX;source=java.io.InputStream,target=org.xml.sax.ContentHandler,weight=80
-org.apache.tuscany.sca.databinding.xml.Node2OutputStream;source=org.w3c.dom.Node,target=java.io.OutputStream,weight=80
-org.apache.tuscany.sca.databinding.xml.Node2Writer;source=org.w3c.dom.Node,target=java.io.Writer,weight=80
-org.apache.tuscany.sca.databinding.xml.Reader2SAX;source=java.io.Reader,target=org.xml.sax.ContentHandler,weight=80
-org.apache.tuscany.sca.databinding.xml.Source2ResultTransformer;source=javax.xml.transform.Source,target=javax.xml.transform.Result,weight=80
-org.apache.tuscany.sca.databinding.xml.String2SAX;source=java.lang.String,target=org.xml.sax.ContentHandler,weight=80
-org.apache.tuscany.sca.databinding.xml.XMLStreamReader2SAX;source=javax.xml.stream.XMLStreamReader,target=org.xml.sax.ContentHandler,weight=70
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.TransformerExtensionPoint b/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.TransformerExtensionPoint
deleted file mode 100644
index 7d8642fb1e..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.TransformerExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DOMHelperTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DOMHelperTestCase.java
deleted file mode 100644
index 5e57f64b5f..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DOMHelperTestCase.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.extension;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DOMHelperTestCase {
- private static final QName FOO_NAME = new QName("http://foo", "foo");
-
- @Test
- public void testDOM() throws Exception {
- DocumentBuilder builder = DOMHelper.newDocumentBuilder();
- assertNotNull(builder);
- Document document = DOMHelper.newDocument();
- assertNotNull(document);
- Element element = DOMHelper.createElement(document, FOO_NAME);
- document.appendChild(element);
- QName name = DOMHelper.getQName(element);
- assertEquals(FOO_NAME, name);
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DataBindingExtensionTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DataBindingExtensionTestCase.java
deleted file mode 100644
index 7d14cd9dd1..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DataBindingExtensionTestCase.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.extension;
-
-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 org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.junit.Test;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DataBindingExtensionTestCase {
-
- @Test
- @SuppressWarnings("unchecked")
- public void testExtension() {
- DataBinding1 binding1 = new DataBinding1(Node.class);
- assertEquals(Node.class.getName(), binding1.getName());
- DataType dt1 = new DataTypeImpl<Class>(Element.class, null);
- assertTrue(binding1.introspect(dt1, null));
- DataType dt2 = new DataTypeImpl<Class>(String.class, null);
- assertFalse(binding1.introspect(dt2, null));
- assertNull(binding1.getWrapperHandler());
-
- DataBindingExtensionPoint registry = new DefaultDataBindingExtensionPoint();
- registry.addDataBinding(binding1);
-
- assertNotNull(registry.getDataBinding(Node.class.getName()));
-
- DataBinding1 binding2 = new DataBinding1("dom", Node.class);
- assertEquals("dom", binding2.getName());
- }
-
- private static class DataBinding1 extends BaseDataBinding {
-
- /**
- * @param baseType
- */
- public DataBinding1(Class<?> baseType) {
- super(baseType);
- }
-
- /**
- * @param name
- * @param baseType
- */
- public DataBinding1(String name, Class<?> baseType) {
- super(name, baseType);
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/SimpleTypeMapperExtensionTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/SimpleTypeMapperExtensionTestCase.java.fixme
deleted file mode 100644
index 562c22354c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/SimpleTypeMapperExtensionTestCase.java.fixme
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.extension;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.NamespaceContext;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.easymock.EasyMock;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class SimpleTypeMapperExtensionTestCase extends TestCase {
-
- private static final Map<String, Object> SAMPLE_VALUES = new HashMap<String, Object>();
-
- static {
- SAMPLE_VALUES.put("anyURI", "http://www.w3.com");
- SAMPLE_VALUES.put("boolean", new String[] {"true", "false", "1", "0"});
- SAMPLE_VALUES.put("byte", new String[] {"-128", "127"});
- SAMPLE_VALUES.put("date", new String[] {"2004-03-15", "2002-09-24-06:00"});
- SAMPLE_VALUES.put("dateTime", "2003-12-25T08:30:00");
- SAMPLE_VALUES.put("decimal", "3.1415292");
- SAMPLE_VALUES.put("double", new String[] {"3.1415292", "INF", "NaN"});
- SAMPLE_VALUES.put("duration", new String[] {"P8M3DT7H33M2S", "P5Y2M10DT15H"});
- SAMPLE_VALUES.put("float", new String[] {"3.1415292", "INF", "NaN"});
- SAMPLE_VALUES.put("gDay", "---11");
- if (System.getProperty("java.vendor").toUpperCase().contains("SUN") && System.getProperty("java.version").contains("1.5.0")
- ||
- System.getProperty("java.vendor").toUpperCase().contains("APPLE INC.") && System.getProperty("java.version").contains("1.5.0")) {
-
- // Work around a bug in SUN JDK (including Mac OS JDK)
- SAMPLE_VALUES.put("gMonth", "--02--");
- } else {
- SAMPLE_VALUES.put("gMonth", "--02");
- }
- SAMPLE_VALUES.put("gMonthDay", "--02-14");
- SAMPLE_VALUES.put("gYear", "1999");
- SAMPLE_VALUES.put("gYearMonth", "1972-08");
- SAMPLE_VALUES.put("ID", "id-102");
- SAMPLE_VALUES.put("IDREF", "id-102");
- SAMPLE_VALUES.put("IDREFS", "id-102 id-103 id-100");
- SAMPLE_VALUES.put("int", "77");
- SAMPLE_VALUES.put("integer", "77");
- SAMPLE_VALUES.put("long", "214");
- SAMPLE_VALUES.put("negativeInteger", "-123");
- SAMPLE_VALUES.put("nonNegativeInteger", "2");
- SAMPLE_VALUES.put("nonPositiveInteger", "0");
- SAMPLE_VALUES.put("positiveInteger", "500");
- SAMPLE_VALUES.put("short", "476");
- SAMPLE_VALUES.put("string", "Joeseph");
- SAMPLE_VALUES.put("time", "13:02:00");
- SAMPLE_VALUES.put("base64Binary", "TWFu");
- SAMPLE_VALUES.put("hexBinary", "2CDB5F");
- SAMPLE_VALUES.put("QName", "f:foo");
- SAMPLE_VALUES.put("NOTATION", "f:bar");
- }
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- public void testMap() throws Exception {
- SimpleTypeMapperImpl extension = new SimpleTypeMapperImpl();
- TransformationContext context = EasyMock.createMock(TransformationContext.class);
- Map<String, Object> metaData = new HashMap<String, Object>();
- EasyMock.expect(context.getMetadata()).andReturn(metaData).anyTimes();
- EasyMock.replay(context);
-
- NamespaceContext namespaceContext = EasyMock.createMock(NamespaceContext.class);
- EasyMock.expect(namespaceContext.getNamespaceURI(EasyMock.eq("f"))).andReturn("http://foo").anyTimes();
- EasyMock.expect(namespaceContext.getPrefix(EasyMock.eq("http://foo"))).andReturn("f").anyTimes();
- EasyMock.replay(namespaceContext);
- context.getMetadata().put(NamespaceContext.class.getName(), namespaceContext);
- for (TypeInfo simpleType : SimpleTypeMapperImpl.XSD_SIMPLE_TYPES.values()) {
- String name = simpleType.getQName().getLocalPart();
- Object value = SAMPLE_VALUES.get(name);
- if (value instanceof String[]) {
- for (String s : (String[])value) {
- Object obj = extension.toJavaObject(simpleType.getQName(), s, context);
- String str = extension.toXMLLiteral(simpleType.getQName(), obj, context);
- assertNotNull(str);
- // assertTrue("[" + name + "] " + s + " " + str,
- // str.contains((String) s));
- }
- } else if (value instanceof String) {
- Object obj = extension.toJavaObject(simpleType.getQName(), (String)value, context);
- String str = extension.toXMLLiteral(simpleType.getQName(), obj, context);
- assertNotNull(str);
- // assertTrue("[" + name + "] " + value + " " + str,
- // str.contains((String) value));
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/TransformerExtensionTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/TransformerExtensionTestCase.java.fixme
deleted file mode 100644
index 243ac71201..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/TransformerExtensionTestCase.java.fixme
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.extension;
-
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.Transformer;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.easymock.EasyMock;
-import org.w3c.dom.Node;
-
-/**
- * Test case for TransformerExtension
- *
- * @version $Rev$ $Date$
- */
-public class TransformerExtensionTestCase extends TestCase {
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- public void testExtension() {
- MyTransformer transformer = new MyTransformer();
- assertEquals(Node.class.getName(), transformer.getSourceDataBinding());
- assertEquals(XMLStreamReader.class.getName(), transformer.getTargetDataBinding());
- assertEquals(50, transformer.getWeight());
- TransformerExtensionPoint registry = EasyMock.createMock(TransformerExtensionPoint.class);
- registry.addTransformer(EasyMock.isA(Transformer.class), EasyMock.eq(true));
- EasyMock
- .expect(registry.getTransformer(transformer.getSourceDataBinding(), transformer.getTargetDataBinding()))
- .andReturn(transformer);
- EasyMock.replay(registry);
- registry.addTransformer(transformer, true);
- assertSame(transformer, registry.getTransformer(transformer.getSourceDataBinding(), transformer
- .getTargetDataBinding()));
- }
-
- private static class MyTransformer extends BaseTransformer<Node, XMLStreamReader> {
-
- @Override
- protected Class<Node> getSourceType() {
- return Node.class;
- }
-
- @Override
- protected Class<XMLStreamReader> getTargetType() {
- return XMLStreamReader.class;
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/XSDDataTypeConverterTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/XSDDataTypeConverterTestCase.java
deleted file mode 100644
index a337dc113c..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/XSDDataTypeConverterTestCase.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.extension;
-
-import static org.junit.Assert.assertEquals;
-
-import java.math.BigInteger;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
-import org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter;
-import org.junit.Test;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class XSDDataTypeConverterTestCase {
-
- @Test
- public void testConvert() throws Exception {
- XSDDataTypeConverter c = new XSDDataTypeConverter();
- assertEquals("123", c.parseAnySimpleType(c.printAnySimpleType("123")));
- assertEquals(true, c.parseBoolean(c.printBoolean(true)));
- assertEquals(false, c.parseBoolean(c.printBoolean(false)));
- assertEquals(123.0, c.parseDouble(c.printDouble(123.0)), 0);
- assertEquals(123.0f, c.parseFloat(c.printFloat(123.0f)), 0);
- assertEquals(64, c.parseByte(c.printByte((byte)64)));
- assertEquals(123, c.parseInt(c.printInt(123)));
- assertEquals(new BigInteger("123456"), c.parseInteger(c.printInteger(new BigInteger("123456"))));
- assertEquals(123456L, c.parseLong(c.printLong(123456L)));
- assertEquals((short)123, c.parseShort(c.printShort((short)123)));
-
- Calendar calendar = new GregorianCalendar();
- String s = c.printDate(calendar);
- calendar = c.parseDate(s);
- assertEquals(s, c.printDate(calendar));
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingRegistryImplTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingRegistryImplTestCase.java.fixme
deleted file mode 100644
index db210683dd..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingRegistryImplTestCase.java.fixme
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.DataBinding;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.easymock.EasyMock;
-import org.xml.sax.ContentHandler;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DataBindingRegistryImplTestCase extends TestCase {
- private DataBindingExtensionPoint registry;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- registry = new DefaultDataBindingExtensionPoint();
- }
-
- @SuppressWarnings("unchecked")
- public void testRegistry() {
- DataBinding db1 = createMock(DataBinding.class);
- expect(db1.getAliases()).andReturn(new String[] {"db1"}).anyTimes();
- expect(db1.getName()).andReturn(ContentHandler.class.getName()).anyTimes();
- DataType<Class> dataType1 = new DataTypeImpl<Class>(ContentHandler.class, ContentHandler.class);
- expect(db1.introspect(dataType1, null)).andReturn(true);
- expect(db1.introspect(EasyMock.not(EasyMock.same(dataType1)), (Operation) EasyMock.isNull()))
- .andReturn(false).anyTimes();
- replay(db1);
-
- registry.addDataBinding(db1);
-
- DataBinding db2 = createMock(DataBinding.class);
- expect(db2.getAliases()).andReturn(new String[] {"db2"}).anyTimes();
- expect(db2.getName()).andReturn(XMLStreamReader.class.getName()).anyTimes();
- DataType<Class> dataType2 = new DataTypeImpl<Class>(XMLStreamReader.class, XMLStreamReader.class);
- expect(db2.introspect(dataType2, null)).andReturn(true);
- expect(db2.introspect(EasyMock.not(EasyMock.same(dataType2)), (Operation) EasyMock.isNull()))
- .andReturn(false).anyTimes();
- replay(db2);
-
- registry.addDataBinding(db2);
-
- // Lookup by name
- String name = db1.getName();
- DataBinding db3 = registry.getDataBinding(name);
- assertSame(db1, db3);
-
- // Look up by alias
- DataBinding db5 = registry.getDataBinding("db1");
- assertSame(db1, db5);
-
- DataType dt = new DataTypeImpl<Class>(ContentHandler.class, null);
- registry.introspectType(dt, null);
- assertEquals(dataType1.getLogical(), ContentHandler.class);
- //FIXME does not match with dynamically loaded databindings
- //assertTrue(dt.getDataBinding().equalsIgnoreCase("java.lang.Object"));
-
- registry.removeDataBinding(name);
- DataBinding db4 = registry.getDataBinding(name);
- assertNull(db4);
-
- dt = new DataTypeImpl<Class>(null, String.class, null);
- registry.introspectType(dt, null);
- //FIXME does not match with dynamically loaded databindings
- //assertEquals("java.lang.Object", dt.getDataBinding());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingTestCase.java
deleted file mode 100644
index 9f5ead2ea5..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingTestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.databinding.annotation.DataBinding;
-import static org.junit.Assert.assertEquals;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DataBindingTestCase {
- @org.junit.Test
- public void testDataType() throws Exception {
- Class<Test> testClass = Test.class;
- DataBinding d = testClass.getAnnotation(DataBinding.class);
- assertEquals(d.value(), "sdo");
-
- Method method = testClass.getMethod("test", new Class[] {Object.class});
- DataBinding d2 = method.getAnnotation(DataBinding.class);
- assertEquals(d2.value(), "jaxb");
- }
-
- @DataBinding("sdo")
- private static interface Test {
- @DataBinding("jaxb")
- Object test(Object object);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DirectedGraphTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DirectedGraphTestCase.java
deleted file mode 100644
index d48711cd64..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DirectedGraphTestCase.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.tuscany.sca.databinding.impl.DirectedGraph.Edge;
-import org.apache.tuscany.sca.databinding.impl.DirectedGraph.Vertex;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DirectedGraphTestCase {
- private DirectedGraph<String, Object> graph;
-
- @Before
- public void setUp() throws Exception {
- graph = new DirectedGraph<String, Object>();
- }
-
- @Test
- public void testGraph() {
- graph.addEdge("a", "b", null, 3, true);
- graph.addEdge("b", "c", null, 1, true);
- // graph.addEdge("a", "c", null, 8, true);
- graph.addEdge("a", "d", null, 3, true);
- graph.addEdge("b", "d", null, 2, true);
- graph.addEdge("d", "c", null, 3, true);
- graph.addEdge("c", "b", null, 1, true);
- graph.addEdge("c", "d", null, 2, true);
- graph.addEdge("d", "b", null, 1, true);
- graph.addEdge("a", "e", null, 8, true);
- graph.addEdge("c", "c", null, 2, true);
- graph.addEdge("f", "g", null, 2, false);
- graph.addEdge("f", "h", null, 8, true);
- graph.addEdge("g", "j", null, 2, false);
- graph.addEdge("j", "i", null, 2, true);
- graph.addEdge("h", "i", null, 8, true);
-
- Vertex vertex = graph.getVertex("a");
- Assert.assertNotNull(vertex);
- Assert.assertEquals(vertex.getValue(), "a");
-
- Assert.assertNull(graph.getVertex("1"));
-
- Edge edge = graph.getEdge("a", "b");
- Assert.assertNotNull(edge);
- Assert.assertEquals(edge.getWeight(), 3);
-
- edge = graph.getEdge("b", "a");
- Assert.assertNull(edge);
-
- DirectedGraph<String, Object>.Path path = graph.getShortestPath("a", "c");
-
- List<DirectedGraph<String, Object>.Edge> edges = path.getEdges();
- Assert.assertEquals(edges.size(), 2);
- Assert.assertEquals(edges.get(0), graph.getEdge("a", "b"));
- Assert.assertEquals(edges.get(1), graph.getEdge("b", "c"));
-
- Assert.assertEquals(path.getWeight(), 4);
-
- DirectedGraph<String, Object>.Path path2 = graph.getShortestPath("b", "e");
- Assert.assertNull(path2);
-
- DirectedGraph<String, Object>.Path path3 = graph.getShortestPath("a", "a");
- Assert.assertTrue(path3.getWeight() == 0 && path3.getEdges().isEmpty());
-
- DirectedGraph<String, Object>.Path path4 = graph.getShortestPath("c", "c");
- Assert.assertTrue(path4.getWeight() == 2 && path4.getEdges().size() == 1);
-
- DirectedGraph<String, Object>.Path path5 = graph.getShortestPath("f", "i");
- Assert.assertTrue(path5.getWeight() == 16 && path5.getEdges().size() == 2);
-
- }
-
- @Test
- public void testSort() {
- graph.addEdge("a", "b");
- graph.addEdge("a", "c");
- graph.addEdge("c", "d");
- graph.addEdge("b", "c");
- List<String> order = graph.topologicalSort(true);
- assertEquals(Arrays.asList("a", "b", "c", "d"), order);
- assertTrue(!graph.getVertices().isEmpty());
-
- graph.addEdge("d", "a");
- try {
- order = graph.topologicalSort(true);
- assertTrue("Should have failed", false);
- } catch (IllegalArgumentException e) {
- assertTrue(true);
- }
-
- graph.removeEdge("d", "a");
- order = graph.topologicalSort(false);
- assertEquals(Arrays.asList("a", "b", "c", "d"), order);
- assertTrue(graph.getVertices().isEmpty());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java
deleted file mode 100644
index 3bb1ed7376..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.impl;
-
-import java.io.StringWriter;
-import java.io.Writer;
-
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.xml.Node2String;
-import org.apache.tuscany.sca.databinding.xml.Node2Writer;
-import org.apache.tuscany.sca.databinding.xml.SAX2DOMPipe;
-import org.apache.tuscany.sca.databinding.xml.String2SAX;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Test case for MediatorImpl
- *
- * @version $Rev$ $Date$
- */
-public class MediatorImplTestCase {
- private static final String IPO_XML =
- "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
- + " xmlns:ipo=\"http://www.example.com/IPO\""
- + " xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\""
- + " orderDate=\"1999-12-01\">"
- + " <shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\">"
- + " <name>Helen Zoe</name>"
- + " <street>47 Eden Street</street>"
- + " <city>Cambridge</city>"
- + " <postcode>CB1 1JR</postcode>"
- + " </shipTo>"
- + " <billTo xsi:type=\"ipo:USAddress\">"
- + " <name>Robert Smith</name>"
- + " <street>8 Oak Avenue</street>"
- + " <city>Old Town</city>"
- + "<state>PA</state>"
- + " <zip>95819</zip>"
- + " </billTo>"
- + " <items>"
- + " <item partNum=\"833-AA\">"
- + " <productName>Lapis necklace</productName>"
- + " <quantity>1</quantity>"
- + "<USPrice>99.95</USPrice>"
- + " <ipo:comment>Want this for the holidays</ipo:comment>"
- + " <shipDate>1999-12-05</shipDate>"
- + " </item>"
- + " </items>"
- + "</ipo:purchaseOrder>";
-
- private MediatorImpl mediator;
-
- @Before
- public void setUp() throws Exception {
- DataBindingExtensionPoint dataBindingRegistry = new DefaultDataBindingExtensionPoint();
- TransformerExtensionPoint registry = new DefaultTransformerExtensionPoint();
-
- registry.addTransformer(new String2SAX(), true);
- registry.addTransformer(new SAX2DOMPipe(), true);
- registry.addTransformer(new Node2String(), true);
- registry.addTransformer(new Node2Writer(), true);
-
- mediator = new MediatorImpl(dataBindingRegistry, registry);
- }
-
- private TransformationContext createTransformationContext(Class sourceType, Class targetType) {
- TransformationContext context = new TransformationContextImpl();
- DataType sourceDataType = new DataTypeImpl<Class>(sourceType.getName(), sourceType, sourceType);
- DataType targetDataType = new DataTypeImpl<Class>(targetType.getName(), targetType, targetType);
- context.setSourceDataType(sourceDataType);
- context.setTargetDataType(targetDataType);
- return context;
- }
-
- @Test
- public void testTransform1() {
- TransformationContext context = createTransformationContext(String.class, Node.class);
- Object node =
- mediator.mediate(IPO_XML, context.getSourceDataType(), context.getTargetDataType(), null);
- Assert.assertTrue(node instanceof Document);
- Element root = ((Document)node).getDocumentElement();
- Assert.assertEquals(root.getNamespaceURI(), "http://www.example.com/IPO");
- Assert.assertEquals(root.getLocalName(), "purchaseOrder");
- }
-
- @Test
- public void testTransform2() {
- TransformationContext context = createTransformationContext(String.class, Writer.class);
- Writer writer = new StringWriter();
- mediator.mediate(IPO_XML, writer, context.getSourceDataType(), context.getTargetDataType(), null);
- String str = writer.toString();
- Assert.assertTrue(str != null && str.indexOf("<shipDate>1999-12-05</shipDate>") != -1);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/TransformerRegistryImplTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/TransformerRegistryImplTestCase.java.fixme
deleted file mode 100644
index 31c3fd4f00..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/TransformerRegistryImplTestCase.java.fixme
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.impl;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-
-import java.util.List;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.Transformer;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class TransformerRegistryImplTestCase extends TestCase {
- private TransformerExtensionPoint registry;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- registry = new DefaultTransformerExtensionPoint();
- }
-
- public void testRegisterTransformer1() {
- Transformer transformer = createMock(Transformer.class);
- registry.addTransformer("a", "b", 10, transformer, true);
- Transformer t = registry.getTransformer("a", "b");
- Assert.assertSame(t, transformer);
- }
-
- public void testRegisterTransformerTransformer() {
- Transformer transformer = createMock(Transformer.class);
- expect(transformer.getSourceDataBinding()).andReturn("a");
- expect(transformer.getTargetDataBinding()).andReturn("b");
- expect(transformer.getWeight()).andReturn(10);
- replay(transformer);
- registry.addTransformer(transformer, true);
- Transformer t = registry.getTransformer("a", "b");
- Assert.assertSame(t, transformer);
- }
-
- public void testUnregisterTransformer() {
- Transformer transformer = createMock(Transformer.class);
- registry.addTransformer("a", "b", 10, transformer, true);
- boolean result = registry.removeTransformer("a", "b");
- Assert.assertTrue(result);
- Transformer t = registry.getTransformer("a", "b");
- Assert.assertNull(t);
- }
-
- public void testGetTransformerChain() {
- Transformer t1 = createMock(Transformer.class);
- expect(t1.getSourceDataBinding()).andReturn("a");
- expect(t1.getTargetDataBinding()).andReturn("b");
- expect(t1.getWeight()).andReturn(10);
- replay(t1);
- Transformer t2 = createMock(Transformer.class);
- expect(t2.getSourceDataBinding()).andReturn("b");
- expect(t2.getTargetDataBinding()).andReturn("c");
- expect(t2.getWeight()).andReturn(20);
- replay(t2);
-
- Transformer t3 = createMock(Transformer.class);
- expect(t3.getSourceDataBinding()).andReturn("a");
- expect(t3.getTargetDataBinding()).andReturn("c");
- expect(t3.getWeight()).andReturn(120);
- replay(t3);
-
- registry.addTransformer(t1, true);
- registry.addTransformer(t2, true);
- registry.addTransformer(t3, true);
-
- List<Transformer> l1 = registry.getTransformerChain("a", "b");
- Assert.assertTrue(l1.size() == 1 && l1.get(0) == t1);
- List<Transformer> l2 = registry.getTransformerChain("a", "c");
- Assert.assertTrue(l2.size() == 1 && l2.get(0) == t3);
- List<Transformer> l3 = registry.getTransformerChain("a", "d");
- Assert.assertNull(l3);
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/XMLDocumentStreamReaderTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/XMLDocumentStreamReaderTestCase.java
deleted file mode 100644
index ea6f34d6fb..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/XMLDocumentStreamReaderTestCase.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.impl;
-
-import java.io.StringReader;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.xml.XMLDocumentStreamReader;
-import org.apache.tuscany.sca.databinding.xml.XMLStreamReader2String;
-import org.junit.Assert;
-
-/**
- * @version $Rev$ $Date$
- */
-public class XMLDocumentStreamReaderTestCase {
- private static final String xml = "<e1><e2 a2=\"a2\"><e4>E4</e4></e2><e3 a3=\"a3\"/></e1>";
-
- @org.junit.Test
- public void testReader() throws Exception {
- XMLInputFactory factory = XMLInputFactory.newInstance();
- XMLStreamReader r1 = factory.createXMLStreamReader(new StringReader(xml));
- XMLDocumentStreamReader r2 = new XMLDocumentStreamReader(r1);
- XMLStreamReader2String t1 = new XMLStreamReader2String();
- String result = t1.transform(r2, null);
- System.out.println(result);
- XMLStreamReader r3 = factory.createXMLStreamReader(new StringReader(xml));
- r3.nextTag();
- r3.nextTag();
- Assert.assertEquals(XMLStreamConstants.START_ELEMENT, r3.getEventType());
- Assert.assertEquals(new QName(null, "e2"), r3.getName());
- XMLDocumentStreamReader r4 = new XMLDocumentStreamReader(r3);
- result = t1.transform(r4, null);
- System.out.println(result);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderTestCase.java
deleted file mode 100644
index aa785a5e48..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderTestCase.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.custommonkey.xmlunit.Diff;
-import org.junit.Test;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class BeanXMLStreamReaderTestCase {
- private static final String XML_RESULT =
- "<?xml version='1.0' encoding='UTF-8'?>" + "<MyBean xmlns=\"http://xml.databinding.sca.tuscany.apache.org/\">"
- + "<arr>1</arr><arr>2</arr><arr>3</arr><bean><name>Name</name></bean><i>1</i>"
- + "<list>Item1</list><list>Item2</list>"
- + "<map><entry><key>key1</key><value>value1</value></entry>"
- + "<entry><key>key2</key><value>value2</value></entry></map>"
- + "<nil xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"true\" />"
- + "<str>ABC</str></MyBean>";
-
- // The map entries can come in a different order
- private static final String XML_RESULT1 =
- "<?xml version='1.0' encoding='UTF-8'?>" + "<MyBean xmlns=\"http://xml.databinding.sca.tuscany.apache.org/\">"
- + "<arr>1</arr><arr>2</arr><arr>3</arr><bean><name>Name</name></bean><i>1</i>"
- + "<list>Item1</list><list>Item2</list>"
- + "<map><entry><key>key2</key><value>value2</value></entry>"
- + "<entry><key>key1</key><value>value1</value></entry></map>"
- + "<nil xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"true\" />"
- + "<str>ABC</str></MyBean>";
-
-
- @Test
- public void testTransformation() throws Exception {
- MyBean bean = new MyBean();
- bean.str = "ABC";
- bean.i = 1;
- bean.arr = new long[] {1, 2, 3};
- bean.bean = new AnotherBean();
- bean.bean.setName("Name");
- bean.list.add("Item1");
- bean.list.add("Item2");
- bean.map.put("key1", "value1");
- bean.map.put("key2", "value2");
- XMLStreamReader reader = new BeanXMLStreamReaderImpl(null, bean);
- XMLStreamReader2String t3 = new XMLStreamReader2String();
- String xml = t3.transform(reader, null);
- Diff diff = new Diff(XML_RESULT, xml);
- Diff diff1 = new Diff(XML_RESULT1, xml);
- assertTrue(diff.similar() || diff1.similar());
- }
-
- private static class MyBean {
- private long arr[];
- private String str;
- private int i;
- private String nil;
- private List<String> list = new ArrayList<String>();
- private AnotherBean bean;
- private Map<String, String> map = new HashMap<String, String>();
-
- /**
- * @return the i
- */
- public int getI() {
- return i;
- }
-
- /**
- * @param i the i to set
- */
- public void setI(int i) {
- this.i = i;
- }
-
- /**
- * @return the arr
- */
- public long[] getArr() {
- return arr;
- }
-
- /**
- * @param arr the arr to set
- */
- public void setArr(long[] arr) {
- this.arr = arr;
- }
-
- /**
- * @return the str
- */
- public String getStr() {
- return str;
- }
-
- /**
- * @param str the str to set
- */
- public void setStr(String str) {
- this.str = str;
- }
-
- /**
- * @return the bean
- */
- public AnotherBean getBean() {
- return bean;
- }
-
- /**
- * @param bean the bean to set
- */
- public void setBean(AnotherBean bean) {
- this.bean = bean;
- }
-
- public List<String> getList() {
- return list;
- }
-
- public void setList(List<String> list) {
- this.list = list;
- }
-
- public String getNil() {
- return nil;
- }
-
- public void setNil(String nil) {
- this.nil = nil;
- }
-
- public Map<String, String> getMap() {
- return map;
- }
-
- public void setMap(Map<String, String> map) {
- this.map = map;
- }
-
- }
-
- private static class AnotherBean {
- private String name;
-
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOM2StAXTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOM2StAXTestCase.java
deleted file mode 100644
index 7665eaa8ec..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOM2StAXTestCase.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import static org.junit.Assert.assertTrue;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.custommonkey.xmlunit.XMLAssert;
-import org.junit.Test;
-import org.w3c.dom.Node;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class DOM2StAXTestCase {
- private static final String IPO_XML =
- "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
- + " xmlns:ipo=\"http://www.example.com/IPO\""
- + " xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\""
- + " orderDate=\"1999-12-01\">"
- + " <shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\">"
- + " <name>Helen Zoe</name>"
- + " <street>47 Eden Street</street>"
- + " <city>Cambridge</city>"
- + " <postcode>CB1 1JR</postcode>"
- + " </shipTo>"
- + " <billTo xsi:type=\"ipo:USAddress\">"
- + " <name>Robert Smith</name>"
- + " <street>8 Oak Avenue</street>"
- + " <city>Old Town</city>"
- + " <state>PA</state>"
- + " <zip>95819</zip>"
- + " </billTo>"
- + " <items>"
- + " <item partNum=\"833-AA\">"
- + " <productName>Lapis necklace</productName>"
- + " <quantity>1</quantity>"
- + " <USPrice>99.95</USPrice>"
- + " <ipo:comment>Want this for the holidays</ipo:comment>"
- + " <shipDate>1999-12-05</shipDate>"
- + " </item>"
- + " </items>"
- + "</ipo:purchaseOrder>";
-
- private static final String CRAZY_XML =
- "<p:e1 xmlns=\"http://ns0\" xmlns:p=\"http://p1\">" + "<p:e2 xmlns:p=\"http://p2\"/><e3/><e4 xmlns=\"\">E4</e4></p:e1>";
-
- @Test
- public void testTransformation() throws Exception {
- String2Node t1 = new String2Node();
- Node node = t1.transform(IPO_XML, null);
- Node2XMLStreamReader t2 = new Node2XMLStreamReader();
- XMLStreamReader reader = t2.transform(node, null);
- XMLStreamReader2String t3 = new XMLStreamReader2String();
- String xml = t3.transform(reader, null);
- XMLAssert.assertXMLEqual(IPO_XML, xml);
- // assertTrue(xml != null && xml.indexOf("<shipDate>1999-12-05</shipDate>") != -1);
- }
-
- @Test
- public void testTransformation2() throws Exception {
- String2Node t1 = new String2Node();
- Node node = t1.transform(CRAZY_XML, null);
- Node2XMLStreamReader t2 = new Node2XMLStreamReader();
- XMLStreamReader reader = t2.transform(node, null);
- XMLStreamReader2String t3 = new XMLStreamReader2String();
- String xml = t3.transform(reader, null);
- // System.out.println(xml);
- XMLAssert.assertXMLEqual(CRAZY_XML, xml);
- assertTrue(xml.contains("<p:e2 xmlns:p=\"http://p2\""));
- }
-
- @Test
- public void testTransformation3() throws Exception {
- String2Node t1 = new String2Node();
- Node node = t1.transform(IPO_XML, null);
- DOMXmlNodeImpl element = new DOMXmlNodeImpl(node);
- XmlTreeStreamReaderImpl reader = new XmlTreeStreamReaderImpl(element);
- XMLStreamReader2String t3 = new XMLStreamReader2String();
- String xml = t3.transform(reader, null);
- XMLAssert.assertXMLEqual(IPO_XML, xml);
- // assertTrue(xml != null && xml.indexOf("<shipDate>1999-12-05</shipDate>") != -1);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java
deleted file mode 100644
index a120b313ff..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Writer;
-
-import org.apache.tuscany.sca.databinding.DataPipe;
-import org.apache.tuscany.sca.databinding.DataPipeTransformer;
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.apache.tuscany.sca.databinding.impl.PipedTransformer;
-import org.junit.Assert;
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Test case for DataPipe
- *
- * @version $Rev$ $Date$
- */
-public class DataPipeTestCase {
-
- @Test
- public final void testStreamPipe() throws IOException {
- byte[] bytes = new byte[] {1, 2, 3};
- DataPipeTransformer<OutputStream, InputStream> pipe = new StreamDataPipe();
- DataPipe<OutputStream, InputStream> dataPipe = pipe.newInstance();
- OutputStream os = dataPipe.getSink();
- os.write(bytes);
- byte[] newBytes = new byte[16];
- int count = dataPipe.getResult().read(newBytes);
- Assert.assertEquals(3, count);
- for (int i = 0; i < bytes.length; i++) {
- Assert.assertEquals(bytes[i], newBytes[i]);
- }
- }
-
- @Test
- public final void testWriter2ReaderPipe() throws IOException {
- String str = "ABC";
- Writer2ReaderDataPipe pipe = new Writer2ReaderDataPipe();
- Assert.assertSame(Writer.class, pipe.getSourceType());
- Assert.assertSame(Reader.class, pipe.getTargetType());
- DataPipe<Writer, Reader> dataPipe = pipe.newInstance();
- dataPipe.getSink().write(str);
- char[] buf = new char[16];
- int count = dataPipe.getResult().read(buf);
- Assert.assertEquals(3, count);
- for (int i = 0; i < str.length(); i++) {
- Assert.assertEquals(str.charAt(i), buf[i]);
- }
- }
-
- @Test
- public final void testPiped() throws Exception {
- Node2Writer node2Writer = new Node2Writer();
- Writer2ReaderDataPipe pipe = new Writer2ReaderDataPipe();
- PipedTransformer<Node, Writer, Reader> transformer =
- new PipedTransformer<Node, Writer, Reader>(node2Writer, pipe);
- Document document = DOMHelper.newDocument();
- Element element = document.createElementNS("http://ns1", "root");
- document.appendChild(element);
- Reader reader = transformer.transform(document, null);
- Assert.assertEquals(transformer.getWeight(), node2Writer.getWeight() + pipe.getWeight());
- Assert.assertEquals(transformer.getSourceDataBinding(), node2Writer.getSourceDataBinding());
- Assert.assertEquals(transformer.getTargetDataBinding(), pipe.getTargetDataBinding());
- char[] buf = new char[120];
- int count = reader.read(buf);
- String xml = new String(buf, 0, count);
- Assert.assertTrue(xml.contains("<root xmlns=\"http://ns1\"/>"));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/JavaBean2XMLStreamReaderTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/JavaBean2XMLStreamReaderTestCase.java
deleted file mode 100644
index 66cb12c19b..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/JavaBean2XMLStreamReaderTestCase.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.javabeans.JavaBean2XMLStreamReaderTransformer;
-import org.custommonkey.xmlunit.XMLAssert;
-import org.junit.Test;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaBean2XMLStreamReaderTestCase {
- private static final String XML_RESULT =
- "<?xml version='1.0' encoding='UTF-8'?>"
- + "<MyBean xmlns=\"http://xml.databinding.sca.tuscany.apache.org/\">"
- + "<arr>1</arr><arr>2</arr><arr>3</arr><bean><name>Name</name></bean><i>1</i><str>ABC</str>"
- + "</MyBean>";
-
- @Test
- public void testTransformation() throws Exception {
- JavaBean2XMLStreamReaderTransformer t2 = new JavaBean2XMLStreamReaderTransformer();
- MyBean bean = new MyBean();
- bean.str = "ABC";
- bean.i = 1;
- bean.arr = new long[] {1, 2, 3};
- bean.bean = new AnotherBean();
- bean.bean.setName("Name");
- XMLStreamReader reader = t2.transform(bean, null);
- XMLStreamReader2String t3 = new XMLStreamReader2String();
- String xml = t3.transform(reader, null);
- XMLAssert.assertXMLEqual(XML_RESULT, xml);
-
- }
-
- private static class MyBean {
- private String str;
- private int i;
- private long arr[];
- private AnotherBean bean;
-
- /**
- * @return the arr
- */
- public long[] getArr() {
- return arr;
- }
-
- /**
- * @param arr the arr to set
- */
- public void setArr(long[] arr) {
- this.arr = arr;
- }
-
- /**
- * @return the i
- */
- public int getI() {
- return i;
- }
-
- /**
- * @param i the i to set
- */
- public void setI(int i) {
- this.i = i;
- }
-
- /**
- * @return the str
- */
- public String getStr() {
- return str;
- }
-
- /**
- * @param str the str to set
- */
- public void setStr(String str) {
- this.str = str;
- }
-
- /**
- * @return the bean
- */
- public AnotherBean getBean() {
- return bean;
- }
-
- /**
- * @param bean the bean to set
- */
- public void setBean(AnotherBean bean) {
- this.bean = bean;
- }
-
- }
-
- private static class AnotherBean {
- private String name;
-
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java
deleted file mode 100644
index 1ca420a18a..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Node2StringTestCase {
-
- @Test
- public void testTransformation() throws Exception {
- Document document = DOMHelper.newDocument();
- Element element = document.createElementNS("http://ns1", "test");
- document.appendChild(element);
-
- new Node2String().transform(document, null);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java
deleted file mode 100644
index ad1bebfc8a..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.xml;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.impl.PipedTransformer;
-import org.junit.Assert;
-import org.junit.Test;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class PushTransformationTestCase {
- private static final String IPO_XML =
- "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
- + " xmlns:ipo=\"http://www.example.com/IPO\""
- + " xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\""
- + " orderDate=\"1999-12-01\">"
- + " <shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\">"
- + " <name>Helen Zoe</name>"
- + " <street>47 Eden Street</street>"
- + " <city>Cambridge</city>"
- + " <postcode>CB1 1JR</postcode>"
- + " </shipTo>"
- + " <billTo xsi:type=\"ipo:USAddress\">"
- + " <name>Robert Smith</name>"
- + " <street>8 Oak Avenue</street>"
- + " <city>Old Town</city>"
- + " <state>PA</state>"
- + " <zip>95819</zip>"
- + " </billTo>"
- + " <items>"
- + " <item partNum=\"833-AA\">"
- + " <productName>Lapis necklace</productName>"
- + " <quantity>1</quantity>"
- + " <USPrice>99.95</USPrice>"
- + " <ipo:comment>Want this for the holidays</ipo:comment>"
- + " <shipDate>1999-12-05</shipDate>"
- + " </item>"
- + " </items>"
- + "</ipo:purchaseOrder>";
-
- @Test
- public void testTransformation() {
- String2XMLStreamReader t1 = new String2XMLStreamReader();
- XMLStreamReader reader = t1.transform(IPO_XML, null);
- XMLStreamReader2SAX t2 = new XMLStreamReader2SAX();
- PipedTransformer<XMLStreamReader, ContentHandler, Node> t3 =
- new PipedTransformer<XMLStreamReader, ContentHandler, Node>(t2, new SAX2DOMPipe());
- Node node = t3.transform(reader, null);
- Assert.assertNotNull(node);
- Node2String t4 = new Node2String();
- String xml = t4.transform(node, null);
- Assert.assertTrue(xml != null && xml.indexOf("<shipDate>1999-12-05</shipDate>") != -1);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/StAXHelperTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/StAXHelperTestCase.java
deleted file mode 100644
index 264eb1a228..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/StAXHelperTestCase.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import static org.junit.Assert.assertNotNull;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.custommonkey.xmlunit.XMLAssert;
-import org.junit.Test;
-
-/**
- * Test Case for StAXHelper
- *
- * @version $Rev$ $Date$
- */
-public class StAXHelperTestCase {
- private static final String XML =
- "<a:foo xmlns:a='http://a' name='foo'><bar name='bar'>"
- + "<doo a:name='doo' xmlns:a='http://doo'/>"
- + "</bar></a:foo>";
-
- @Test
- public void testHelper() throws Exception {
- XMLStreamReader reader = StAXHelper.createXMLStreamReader(XML);
- String xml = StAXHelper.save(reader);
- XMLAssert.assertXMLEqual(XML, xml);
- reader = StAXHelper.createXMLStreamReader(xml);
- assertNotNull(reader);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java
deleted file mode 100644
index fb9895f120..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URL;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class TraxTransformerTestCase {
- private URL url;
-
- @Before
- public void setUp() throws Exception {
- url = getClass().getResource("foo.xml");
- }
-
- @Test
- public void testTransformDOM() throws IOException {
- InputStream is = url.openStream();
- InputStream2Node t1 = new InputStream2Node();
- Node node = t1.transform(is, null);
- is.close();
- Writer writer = new StringWriter();
- Node2Writer t2 = new Node2Writer();
- t2.transform(node, writer, null);
- String str = writer.toString();
- StringReader reader = new StringReader(str);
- Reader2Node t3 = new Reader2Node();
- node = t3.transform(reader, null);
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- Node2OutputStream t4 = new Node2OutputStream();
- t4.transform(node, os, null);
- InputSource inputSource = new InputSource(new ByteArrayInputStream(os.toByteArray()));
- InputSource2Node t5 = new InputSource2Node();
- node = t5.transform(inputSource, null);
- }
-
- @Test
- public void testTransformSAX() throws IOException {
- MyContentHandler handler = new MyContentHandler();
- InputStream is = url.openStream();
- InputStream2SAX t1 = new InputStream2SAX();
- t1.transform(is, handler, null);
- is.close();
-
- String xml = "<foo xmlns=\"http://foo\">bar</foo>";
-
- InputSource inputSource = new InputSource(new StringReader(xml));
- InputSource2SAX t2 = new InputSource2SAX();
- MyContentHandler handler2 = new MyContentHandler();
- t2.transform(inputSource, handler2, null);
-
- }
-
- private static class MyContentHandler extends DefaultHandler {
-
- @Override
- public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
- throws SAXException {
- super.startElement(namespaceURI, localName, qName, atts);
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/XmlTreeStreamReaderTestCase.java b/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/XmlTreeStreamReaderTestCase.java
deleted file mode 100644
index 45ee53314e..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/XmlTreeStreamReaderTestCase.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.xml;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.custommonkey.xmlunit.XMLAssert;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class XmlTreeStreamReaderTestCase {
- private static final String IPO_XML =
- "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
- + " xmlns:ipo=\"http://www.example.com/IPO\""
- + " xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\""
- + " orderDate=\"1999-12-01\">"
- + " <shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\">"
- + " <name>Helen Zoe</name>"
- + " <street>47 Eden Street</street>"
- + " <city>Cambridge</city>"
- + " <postcode>CB1 1JR</postcode>"
- + " </shipTo>"
- + " <billTo xsi:type=\"ipo:USAddress\">"
- + " <name>Robert Smith</name>"
- + " <street>8 Oak Avenue</street>"
- + " <city>Old Town</city>"
- + " <state>PA</state>"
- + " <zip>95819</zip>"
- + " </billTo>"
- + " <items>"
- + " <item partNum=\"833-AA\">"
- + " <productName>Lapis necklace</productName>"
- + " <quantity>1</quantity>"
- + " <USPrice>99.95</USPrice>"
- + " <ipo:comment>Want this for the holidays</ipo:comment>"
- + " <shipDate>1999-12-05</shipDate>"
- + " </item>"
- + " </items>"
- + "</ipo:purchaseOrder>";
-
- private static final String XML_RESULT =
- "<?xml version='1.0' encoding='UTF-8'?>" + "<p1:e1 xmlns:p1=\"http://ns\">"
- + "<p2:e11 xmlns:p2=\"http://ns1\">MyText</p2:e11>"
- + "<p1:e12><p1:e121 /></p1:e12>"
- + "<ipo:purchaseOrder xmlns:ipo=\"http://www.example.com/IPO\" "
- + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
- + "xsi:schemaLocation=\"http://www.example.com/IPO ipo.xsd\" orderDate=\"1999-12-01\"> "
- + "<shipTo exportCode=\"1\" xsi:type=\"ipo:UKAddress\"> "
- + "<name>Helen Zoe</name> <street>47 Eden Street</street> "
- + "<city>Cambridge</city> <postcode>CB1 1JR</postcode> </shipTo> "
- + "<billTo xsi:type=\"ipo:USAddress\"> <name>Robert Smith</name> "
- + "<street>8 Oak Avenue</street> <city>Old Town</city> <state>PA</state> "
- + "<zip>95819</zip> </billTo> <items> <item partNum=\"833-AA\"> "
- + "<productName>Lapis necklace</productName> <quantity>1</quantity> "
- + "<USPrice>99.95</USPrice> <ipo:comment>Want this for the holidays</ipo:comment> "
- + "<shipDate>1999-12-05</shipDate> </item> </items></ipo:purchaseOrder></p1:e1>";
- private XmlNodeImpl root;
-
- @Before
- public void setUp() throws Exception {
- root = new XmlNodeImpl();
- root.name = new QName("http://ns", "e1", "p1");
-
- XmlNodeImpl e11 = new XmlNodeImpl();
- e11.name = new QName("http://ns1", "e11", "p2");
-
- XmlNodeImpl e12 = new XmlNodeImpl();
- e12.name = new QName("http://ns", "e12");
-
- root.children.add(e11);
- root.children.add(e12);
-
- XmlNodeImpl e121 = new XmlNodeImpl();
- e121.name = new QName("http://ns", "e121");
- e12.children.add(e121);
-
- XmlNodeImpl e111 = new XmlNodeImpl();
- e111.value = "MyText";
- e11.children.add(e111);
-
- XmlNodeImpl e13 = new XmlNodeImpl();
- e13.value = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(IPO_XML));
- root.children.add(e13);
-
- }
-
- @Test
- public void testIterator() {
- List<QName> elements = new ArrayList<QName>();
- XmlNodeIterator i = new XmlNodeIterator(root);
- for (; i.hasNext();) {
- XmlNode e = i.next();
- elements.add(e.getName());
- }
- // System.out.println(elements);
- QName[] names =
- {new QName("http://ns", "e1"), new QName("http://ns1", "e11"), null, null, new QName("http://ns1", "e11"),
- new QName("http://ns", "e12"), new QName("http://ns", "e121"), new QName("http://ns", "e121"),
- new QName("http://ns", "e12"), null, null, new QName("http://ns", "e1")};
- Assert.assertEquals(Arrays.asList(names), elements);
- }
-
- @Test
- public void testReader() throws Exception {
- XmlTreeStreamReaderImpl reader = new XmlTreeStreamReaderImpl(root);
- XMLStreamReader2String t = new XMLStreamReader2String();
- String xml = t.transform(reader, null);
- XMLAssert.assertXMLEqual(XML_RESULT, xml);
- }
-
- private static class XmlNodeImpl implements XmlNode {
- private List<XmlNode> children = new ArrayList<XmlNode>();
- private List<XmlNode> attrs = new ArrayList<XmlNode>();
- private Map<String, String> namespaces = new HashMap<String, String>();
- private QName name;
- private Object value = "123";
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#attributes()
- */
- public List<XmlNode> attributes() {
- return attrs;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#children()
- */
- public Iterator<XmlNode> children() {
- return children.iterator();
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#getName()
- */
- public QName getName() {
- return name;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#getValue()
- */
- public <T> T getValue() {
- return (T)value;
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.xml.XmlNode#namespaces()
- */
- public Map<String, String> namespaces() {
- return namespaces;
- }
-
- @Override
- public String toString() {
- return String.valueOf(name);
- }
-
- public Type getType() {
- if (value instanceof XMLStreamReader) {
- return Type.READER;
- }
- return name == null ? Type.CHARACTERS : Type.ELEMENT;
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/ipo.xsd b/tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/ipo.xsd
deleted file mode 100644
index 92a576fb98..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/ipo.xsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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/tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/order.wsdl b/tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/order.wsdl
deleted file mode 100644
index 100890e10b..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/order.wsdl
+++ /dev/null
@@ -1,76 +0,0 @@
-<?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/tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/xml/foo.xml b/tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/xml/foo.xml
deleted file mode 100644
index 0ba8ade1e0..0000000000
--- a/tags/java/sca/2.0-M1/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/xml/foo.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<f:foo xmlns:f="http://foo" name="foo">
- <b:bar xmlns:b="http://bar">bar</b:bar>
-</f:foo> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/LICENSE b/tags/java/sca/2.0-M1/modules/definitions-xml/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/definitions-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index e51884fee7..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.definitions.xml;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Definitions XML Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397117406
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Definitions XML Model
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0",
- org.apache.tuscany.sca.definitions.util;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.definitions.xml
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/NOTICE b/tags/java/sca/2.0-M1/modules/definitions-xml/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/pom.xml b/tags/java/sca/2.0-M1/modules/definitions-xml/pom.xml
deleted file mode 100644
index 93ae210895..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xsd</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java b/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java
deleted file mode 100644
index 6c3dca7bab..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.HashMap;
-import java.util.Map;
-
-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.StAXArtifactProcessor;
-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.definitions.Definitions;
-import org.apache.tuscany.sca.definitions.DefinitionsFactory;
-import org.apache.tuscany.sca.definitions.util.DefinitionsUtil;
-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.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * A SCA Definitions Document processor.
- *
- * @version $Rev$ $Date$
- */
-public class DefinitionsDocumentProcessor implements URLArtifactProcessor<Definitions> {
- private StAXArtifactProcessor<Object> extensionProcessor;
- private XMLInputFactory inputFactory;
- private DefinitionsFactory definitionsFactory;
- private static final String TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- private static final String DEFINITIONS = "definitions";
- private static final QName DEFINITIONS_QNAME = new QName(TUSCANY_NS, DEFINITIONS);
- private Monitor monitor;
-
- /**
- * Construct a new SCADefinitions processor
- * @param assemblyFactory
- * @param policyFactory
- * @param staxProcessor
- */
- public DefinitionsDocumentProcessor(StAXArtifactProcessor<Object> staxProcessor,
- XMLInputFactory inputFactory,
- DefinitionsFactory definitionsFactory,
- Monitor monitor) {
- this.extensionProcessor = (StAXArtifactProcessor<Object>)staxProcessor;
- this.inputFactory = inputFactory;
- this.definitionsFactory = definitionsFactory;
- this.monitor = monitor;
- }
-
- /**
- * Constructs a new SCADefinitions processor.
- *
- * @param modelFactories
- * @param staxProcessor
- */
- public DefinitionsDocumentProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor<Object> staxProcessor,
- Monitor monitor) {
- this.extensionProcessor = (StAXArtifactProcessor<Object>)staxProcessor;
- this.inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- this.definitionsFactory = modelFactories.getFactory(DefinitionsFactory.class);
- this.monitor = monitor;
- }
-
- /**
- * 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(),
- "definitions-xml-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(),
- "definitions-xml-validation-messages",
- Severity.ERROR,
- model,
- message,
- ex);
- monitor.problem(problem);
- }
- }
-
- public Definitions read(URL contributionURL, final URI uri, final URL url) throws ContributionReadException {
- InputStream urlStream = null;
- try {
- // Allow privileged access to open URL stream. Add FilePermission to added to security
- // policy file.
- try {
- urlStream = AccessController.doPrivileged(new PrivilegedExceptionAction<InputStream>() {
- public InputStream run() throws IOException {
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- return connection.getInputStream();
- }
- });
- } catch (PrivilegedActionException e) {
- error("PrivilegedActionException", url, (IOException)e.getException());
- throw (IOException)e.getException();
- }
-
- //urlStream = createInputStream(url);
- XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
-
- Definitions definitions = definitionsFactory.createDefinitions();
- QName name = null;
- int event;
- while (reader.hasNext()) {
- event = reader.next();
-
- if (event == XMLStreamConstants.START_ELEMENT || event == XMLStreamConstants.END_ELEMENT) {
- name = reader.getName();
- if (name.equals(DEFINITIONS_QNAME)) {
- if (event == XMLStreamConstants.END_ELEMENT) {
- return definitions;
- }
- } else {
- Definitions aDefn = (Definitions)extensionProcessor.read(reader);
- DefinitionsUtil.aggregate(aDefn, definitions);
- }
- }
- }
-
- return definitions;
- } catch (XMLStreamException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", inputFactory, ce);
- throw ce;
- } catch (IOException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", inputFactory, ce);
- throw ce;
- } finally {
-
- try {
- if (urlStream != null) {
- urlStream.close();
- urlStream = null;
- }
- } catch (IOException ioe) {
- //ignore
- }
- }
- }
-
- private static void stripDuplicates(Definitions scaDefns) {
- 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, IntentAttachPointType> definedBindingTypes = new HashMap<QName, IntentAttachPointType>();
- for (IntentAttachPointType bindingType : scaDefns.getBindingTypes()) {
- definedBindingTypes.put(bindingType.getName(), bindingType);
- }
-
- Map<QName, IntentAttachPointType> definedImplTypes = new HashMap<QName, IntentAttachPointType>();
- for (IntentAttachPointType implType : scaDefns.getImplementationTypes()) {
- definedImplTypes.put(implType.getName(), implType);
- }
-
- scaDefns.getIntents().clear();
- scaDefns.getIntents().addAll(definedIntents.values());
- scaDefns.getPolicySets().clear();
- scaDefns.getPolicySets().addAll(definedPolicySets.values());
- scaDefns.getBindingTypes().clear();
- scaDefns.getBindingTypes().addAll(definedBindingTypes.values());
- scaDefns.getImplementationTypes().clear();
- scaDefns.getImplementationTypes().addAll(definedImplTypes.values());
- }
-
- public void resolve(Definitions scaDefinitions, ModelResolver resolver) throws ContributionResolveException {
- stripDuplicates(scaDefinitions);
- extensionProcessor.resolve(scaDefinitions, resolver);
- }
-
- public String getArtifactType() {
- return "definitions.xml";
- }
-
- public Class<Definitions> getModelType() {
- return Definitions.class;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java b/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java
deleted file mode 100644
index c65a9626ab..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.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.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.definitions.DefinitionsFactory;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.ProfileIntent;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
-
-/**
- * Processor for SCA Definitions
- *
- * @version $Rev$ $Date$
- */
-public class DefinitionsProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<Definitions> {
-
- private StAXArtifactProcessor<Object> extensionProcessor;
- private DefinitionsFactory definitionsFactory;
- private Monitor monitor;
-
- public static final String BINDING = "binding";
- public static final String IMPLEMENTATION = "implementation";
- public static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- public static final String SCA_DEFINITIONS = "definitions";
- public static final QName SCA_DEFINITIONS_QNAME = new QName(SCA10_NS, SCA_DEFINITIONS);
- public static final String TARGET_NAMESPACE = "targetNamespace";
- public static final String NAME = "name";
-
- public DefinitionsProcessor(FactoryExtensionPoint factoryExtensionPoint,
- StAXArtifactProcessor<Object> extensionProcessor,
- Monitor monitor) {
- this.extensionProcessor = extensionProcessor;
- this.monitor = monitor;
- this.definitionsFactory = factoryExtensionPoint.getFactory(DefinitionsFactory.class);
- }
-
- public Definitions read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- QName name = null;
- Definitions definitions = null;
- String targetNamespace = null;
-
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT: {
- name = reader.getName();
- if (SCA_DEFINITIONS_QNAME.equals(name)) {
- definitions = definitionsFactory.createDefinitions();
- targetNamespace = reader.getAttributeValue(null, TARGET_NAMESPACE);
- definitions.setTargetNamespace(targetNamespace);
- } else {
- Object extension = extensionProcessor.read(reader);
- if (extension != null) {
- if (extension instanceof Intent) {
- Intent intent = (Intent)extension;
- intent.setName(new QName(targetNamespace, intent.getName().getLocalPart()));
- if (intent instanceof QualifiedIntent) {
- QualifiedIntent qualifiedIntent = (QualifiedIntent)intent;
- qualifiedIntent.getQualifiableIntent()
- .setName(new QName(targetNamespace, qualifiedIntent.getQualifiableIntent()
- .getName().getLocalPart()));
- }
-
- // FIXME: Workaround for TUSCANY-2499
- intent.setUnresolved(false);
-
- definitions.getIntents().add(intent);
- } else if (extension instanceof PolicySet) {
- PolicySet policySet = (PolicySet)extension;
- policySet.setName(new QName(targetNamespace, policySet.getName().getLocalPart()));
- definitions.getPolicySets().add(policySet);
- } else if (extension instanceof Binding) {
- Binding binding = (Binding)extension;
- definitions.getBindings().add(binding);
- } else if (extension instanceof IntentAttachPointType) {
- IntentAttachPointType type = (IntentAttachPointType)extension;
- if (type.getName().getLocalPart().startsWith(BINDING)) {
- definitions.getBindingTypes().add((IntentAttachPointType)extension);
- } else if (type.getName().getLocalPart().startsWith(IMPLEMENTATION)) {
- definitions.getImplementationTypes().add((IntentAttachPointType)extension);
- }
- }
- }
- break;
- }
- }
-
- case XMLStreamConstants.CHARACTERS:
- break;
-
- case END_ELEMENT:
- name = reader.getName();
- if (SCA_DEFINITIONS_QNAME.equals(name)) {
- return definitions;
- }
- break;
- }
-
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- return definitions;
- }
-
- public void write(Definitions definitions, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
-
- writeStartDocument(writer, SCA10_NS, SCA_DEFINITIONS, new XAttr(TARGET_NAMESPACE, definitions
- .getTargetNamespace()));
-
- for (Intent policyIntent : definitions.getIntents()) {
- extensionProcessor.write(policyIntent, writer);
- }
-
- for (PolicySet policySet : definitions.getPolicySets()) {
- extensionProcessor.write(policySet, writer);
- }
-
- for (IntentAttachPointType bindingType : definitions.getBindingTypes()) {
- extensionProcessor.write(bindingType, writer);
- }
-
- for (IntentAttachPointType implType : definitions.getImplementationTypes()) {
- extensionProcessor.write(implType, writer);
- }
-
- writeEndDocument(writer);
- }
-
- public void resolve(Definitions scaDefns, ModelResolver resolver) throws ContributionResolveException {
- // start by adding all of the top level artifacts into the resolver as there
- // are many cross artifact references in a definitions file and we don't want
- // to be dependent on the order things appear
-
- List<Intent> simpleIntents = new ArrayList<Intent>();
- List<ProfileIntent> profileIntents = new ArrayList<ProfileIntent>();
- List<QualifiedIntent> qualifiedIntents = new ArrayList<QualifiedIntent>();
- List<PolicySet> simplePolicySets = new ArrayList<PolicySet>();
- List<PolicySet> referredPolicySets = new ArrayList<PolicySet>();
-
- for (Intent policyIntent : scaDefns.getIntents()) {
- if (policyIntent instanceof ProfileIntent)
- profileIntents.add((ProfileIntent)policyIntent);
- else if (policyIntent instanceof QualifiedIntent)
- qualifiedIntents.add((QualifiedIntent)policyIntent);
- else
- simpleIntents.add(policyIntent);
-
- resolver.addModel(policyIntent);
- }
-
- for (PolicySet policySet : scaDefns.getPolicySets()) {
- if (policySet.getReferencedPolicySets().isEmpty())
- simplePolicySets.add(policySet);
- else
- referredPolicySets.add(policySet);
-
- resolver.addModel(policySet);
- }
-
- for (IntentAttachPointType bindingType : scaDefns.getBindingTypes()) {
- resolver.addModel(bindingType);
- }
-
- for (IntentAttachPointType implType : scaDefns.getImplementationTypes()) {
- resolver.addModel(implType);
- }
-
- // now resolve everything to ensure that any references between
- // artifacts are satisfied
-
- for (Intent policyIntent : simpleIntents)
- extensionProcessor.resolve(policyIntent, resolver);
-
- for (ProfileIntent policyIntent : profileIntents)
- extensionProcessor.resolve(policyIntent, resolver);
-
- for (QualifiedIntent policyIntent : qualifiedIntents)
- extensionProcessor.resolve(policyIntent, resolver);
-
- for (PolicySet policySet : simplePolicySets)
- extensionProcessor.resolve(policySet, resolver);
-
- for (PolicySet policySet : referredPolicySets)
- extensionProcessor.resolve(policySet, resolver);
-
- for (int count = 0, size = scaDefns.getBindingTypes().size(); count < size; count++) {
- IntentAttachPointType bindingType = scaDefns.getBindingTypes().get(count);
- extensionProcessor.resolve(bindingType, resolver);
- }
-
- for (int count = 0, size = scaDefns.getImplementationTypes().size(); count < size; count++) {
- IntentAttachPointType implType = scaDefns.getImplementationTypes().get(count);
- extensionProcessor.resolve(implType, resolver);
- }
- }
-
- public QName getArtifactType() {
- return SCA_DEFINITIONS_QNAME;
- }
-
- public Class<Definitions> getModelType() {
- return Definitions.class;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index fa33150e87..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.definitions.xml.DefinitionsProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#definitions,model=org.apache.tuscany.sca.definitions.Definitions
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
deleted file mode 100644
index 677aff9918..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.definitions.xml.DefinitionsDocumentProcessor;type=definitions.xml,model=org.apache.tuscany.sca.definitions.Definitions
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/definitions-xml-validation-messages.properties b/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/definitions-xml-validation-messages.properties
deleted file mode 100644
index 857887ec3f..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/src/main/resources/definitions-xml-validation-messages.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-ContributionReadException = ContributionReadException occured due to :
-PrivilegedActionException = Privileged Action Exception occured due to FilePermission in security policy file: \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/Policy.java b/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/Policy.java
deleted file mode 100644
index 187b7fa9f8..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/Policy.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.definitions;
-
-import javax.xml.namespace.QName;
-
-/**
- * Interface that will abstract various types of policy specifications
- * and attachments for example WS-Policy
- *
- * @version $Rev$ $Date$
- */
-public interface Policy {
- QName getSchemaName();
- void setUnresolved(boolean unresolved);
- boolean isUnresolved();
-}
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/ReadDocumentTestCase.java b/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/ReadDocumentTestCase.java
deleted file mode 100644
index 2614bbacb4..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/ReadDocumentTestCase.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.ProfileIntent;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
-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, IntentAttachPointType> bindingTypesTable = new Hashtable<QName, IntentAttachPointType>();
- private static Map<QName, IntentAttachPointType> implTypesTable = new Hashtable<QName, IntentAttachPointType>();
- public static final String scaNamespace = "http://www.osoa.org/xmlns/sca/1.0";
- 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 ( PolicySet policySet : definitions.getPolicySets() ) {
- policySetTable.put(policySet.getName(), policySet);
- }
-
- for ( IntentAttachPointType bindingType : definitions.getBindingTypes() ) {
- bindingTypesTable.put(bindingType.getName(), bindingType);
- }
-
- for ( IntentAttachPointType implType : definitions.getImplementationTypes() ) {
- implTypesTable.put(implType.getName(), 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(policySetTable.get(secureMessagingPolicies).getMappedPolicies().size(), 3);
- //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));
- }
-
- @Test
- public void testResolveSCADefinitions() throws Exception {
- assertTrue(intentTable.get(messageProtection) instanceof ProfileIntent);
- ProfileIntent profileIntent = (ProfileIntent)intentTable.get(new QName(namespace, "messageProtection"));
- assertNull(profileIntent.getRequiredIntents().get(0).getDescription());
-
- QName confidentiality_transport = new QName(namespace, "confidentiality.transport");
- assertTrue(intentTable.get(confidentiality_transport) instanceof QualifiedIntent);
- QualifiedIntent qualifiedIntent = (QualifiedIntent)intentTable.get(new QName(namespace, "confidentiality.transport"));
- assertNull(qualifiedIntent.getQualifiableIntent().getDescription());
-
- 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(securityPolicySet.getMappedPolicies().size(), 5);
-
- //testing to ensure that inclusion of referred policy sets has not happened
- PolicySet basicAuthMsgProtSecurityPolicySet = policySetTable.get(basicAuthMsgProtSecurity);
- assertTrue(basicAuthMsgProtSecurityPolicySet.getPolicies().isEmpty());
- assertTrue(basicAuthMsgProtSecurityPolicySet.getMappedPolicies().isEmpty());
-
- IntentAttachPointType wsBindingType = bindingTypesTable.get(wsBinding);
- assertNull(wsBindingType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNull(wsBindingType.getMayProvideIntents().get(0).getDescription());
-
- IntentAttachPointType javaImplType = implTypesTable.get(javaImpl);
- assertNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNull(javaImplType.getMayProvideIntents().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(profileIntent.getRequiredIntents().get(0).getDescription());
- assertNotNull(qualifiedIntent.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());
- assertNotNull(secureMessagingPolicySet.getMappedPolicies().get(intentTable.get(confidentiality)));
- assertNotNull(secureMessagingPolicySet.getMappedPolicies().get(intentTable.get(confidentiality_transport)));
-
- //testing if intent maps have been properly mapped to policies
- assertFalse(securityPolicySet.isUnresolved());
- assertNotNull(securityPolicySet.getMappedPolicies().get(intentTable.get(confidentiality)));
- assertNotNull(securityPolicySet.getMappedPolicies().get(intentTable.get(confidentiality_message)));
-
- //testing for inclusion of referred policysets
- assertFalse(basicAuthMsgProtSecurityPolicySet.getPolicies().isEmpty());
- assertFalse(basicAuthMsgProtSecurityPolicySet.getMappedPolicies().isEmpty());
- assertNotNull(basicAuthMsgProtSecurityPolicySet.getMappedPolicies().get(intentTable.get(confidentiality_transport)));
-
- assertNotNull(wsBindingType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNotNull(wsBindingType.getMayProvideIntents().get(0).getDescription());
-
- assertNotNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNotNull(javaImplType.getMayProvideIntents().get(0).getDescription());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java
deleted file mode 100644
index 3ff8f294f8..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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;
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * A PolicyProcessor used for testing.
- *
- * @version $Rev$ $Date$
- */
-public class TestPolicyProcessor implements StAXArtifactProcessor<Policy> {
-
- public QName getArtifactType() {
- return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
- }
-
- public Policy read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
- return new MockPolicyImplOne();
- }
-
- public void write(Policy arg0, XMLStreamWriter arg1) throws ContributionWriteException,
- XMLStreamException {
- }
-
- public Class<Policy> getModelType() {
- // TODO Auto-generated method stub
- return Policy.class;
- }
-
- public void resolve(Policy arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
-
- public class MockPolicyImplOne implements Policy {
- public QName getSchemaName() {
- 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/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/resources/org/apache/tuscany/sca/definitions/test_definitions.xml b/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/resources/org/apache/tuscany/sca/definitions/test_definitions.xml
deleted file mode 100644
index f60047e769..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions-xml/src/test/resources/org/apache/tuscany/sca/definitions/test_definitions.xml
+++ /dev/null
@@ -1,255 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://test"
- xmlns:test="http://test"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
-
-<!-- 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://www.osoa.org/xmlns/sca/1.0"
- 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>
-
-
- <!-- qualified intents -->
- <intent name="confidentiality.transport" />
- <intent name="confidentiality.message" />
- <intent name="confidentiality.message.whole" />
- <intent name="confidentiality.message.body" />
-
- <!-- POLICY SETS -->
- <policySet name="SecureReliablePolicy"
- provides="test:confidentiality.transport test:integrity"
- appliesTo="sca:binding.ws"
- xmlns="http://www.osoa.org/xmlns/sca/1.0"
- 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://www.osoa.org/xmlns/sca/1.0"
- 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" >
- <intentMap provides="test:confidentiality" default="message">
- <qualifier name="message">
- <intentMap provides="message" default="whole">
- <qualifier name="body">
- <wsp:PolicyAttachment>
- <!-- policy attachment for body encryption -->
- </wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="whole">
- <wsp:PolicyAttachment>
- <!-- policy attachment for whole message encryption -->
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </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://www.osoa.org/xmlns/sca/1.0">
- <policySetReference name="test:AuthenticationPolicies"/>
- <policySetReference name="test:ConfidentialityPolicies"/>
-</policySet>
-
-<policySet name="AuthenticationPolicies"
- provides="test:authentication"
- appliesTo="binding.ws"
- xmlns="http://www.osoa.org/xmlns/sca/1.0"
- 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://www.osoa.org/xmlns/sca/1.0"
- 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://www.osoa.org/xmlns/sca/1.0"
- 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>
- </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/tags/java/sca/2.0-M1/modules/definitions/LICENSE b/tags/java/sca/2.0-M1/modules/definitions/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/definitions/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/definitions/META-INF/MANIFEST.MF
deleted file mode 100644
index a18128b83b..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.definitions.util;uses:="org.apa
- che.tuscany.sca.definitions";version="2.0.0",org.apache.tuscany.sca.def
- initions;uses:="org.apache.tuscany.sca.policy,javax.xml.namespace";ve
- rsion="2.0.0"
-Private-Package: org.apache.tuscany.sca.definitions.impl;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Definitions
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397089625
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Definitions
-Import-Package: javax.xml.namespace,org.apache.tuscany.sca.definitions
- ;version="2.0.0",org.apache.tuscany.sca.definitions.util;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.definitions
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/definitions/NOTICE b/tags/java/sca/2.0-M1/modules/definitions/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/definitions/pom.xml b/tags/java/sca/2.0-M1/modules/definitions/pom.xml
deleted file mode 100644
index 488dbf0d7b..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/pom.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xsd</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefaultDefinitionsFactory.java b/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefaultDefinitionsFactory.java
deleted file mode 100644
index 156fd0af75..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefaultDefinitionsFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.definitions;
-
-import org.apache.tuscany.sca.definitions.impl.DefinitionsImpl;
-
-/**
- * Default Implementation of DefinitionsFactory
- */
-public class DefaultDefinitionsFactory implements DefinitionsFactory {
-
- public Definitions createDefinitions() {
- return new DefinitionsImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java b/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
deleted file mode 100644
index d3373215a2..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
+++ /dev/null
@@ -1,82 +0,0 @@
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.definitions;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-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<IntentAttachPointType> getBindingTypes();
-
-
- /**
- * Returns a list of domain wide Implementation Types
- *
- * @return a list of domain wide Implementation Types
- */
- List<IntentAttachPointType> 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/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java b/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java
deleted file mode 100644
index 59cfa1e205..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java b/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java
deleted file mode 100644
index e3a11d29aa..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderImpl.java b/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderImpl.java
deleted file mode 100644
index 08a01c020a..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderImpl.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.ProfileIntent;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
-
-/**
- * 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, IntentAttachPointType> definedBindingTypes = new HashMap<QName, IntentAttachPointType>();
- for (IntentAttachPointType bindingType : scaDefns.getBindingTypes()) {
- definedBindingTypes.put(bindingType.getName(), bindingType);
- }
-
- Map<QName, IntentAttachPointType> definedImplTypes = new HashMap<QName, IntentAttachPointType>();
- for (IntentAttachPointType implType : scaDefns.getImplementationTypes()) {
- definedImplTypes.put(implType.getName(), 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, IntentAttachPointType> definedBindingTypes,
- Map<QName, Intent> definedIntents) throws DefinitionsBuilderException {
- for (IntentAttachPointType bindingType : scaDefns.getBindingTypes()) {
- buildAlwaysProvidedIntents(bindingType, definedIntents);
- buildMayProvideIntents(bindingType, definedIntents);
- }
-
- }
-
- private void buildImplementationTypes(Definitions scaDefns,
- Map<QName, IntentAttachPointType> definedImplTypes,
- Map<QName, Intent> definedIntents) throws DefinitionsBuilderException {
- for (IntentAttachPointType 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 instanceof ProfileIntent) {
- buildProfileIntent((ProfileIntent)policyIntent, definedIntents);
- }
-
- if (policyIntent instanceof QualifiedIntent) {
- buildQualifiedIntent((QualifiedIntent)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(ProfileIntent 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(QualifiedIntent 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(IntentAttachPointType 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(IntentAttachPointType extensionType,
- Map<QName, Intent> definedIntents) throws DefinitionsBuilderException {
- if (extensionType != null) {
- // resolve all provided intents
- List<Intent> mayProvide = new ArrayList<Intent>();
- for (Intent providedIntent : extensionType.getMayProvideIntents()) {
- 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.getMayProvideIntents().clear();
- extensionType.getMayProvideIntents().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 {
- Map<Intent, List<Object>> mappedPolicies = new Hashtable<Intent, List<Object>>();
- for (Map.Entry<Intent, List<Object>> entry : policySet.getMappedPolicies().entrySet()) {
- Intent mappedIntent = entry.getKey();
- if (mappedIntent.isUnresolved()) {
- Intent resolvedMappedIntent = definedIntents.get(mappedIntent.getName());
-
- if (resolvedMappedIntent != null) {
- mappedPolicies.put(resolvedMappedIntent, entry.getValue());
- } else {
- throw new DefinitionsBuilderException("Mapped Intent - " + mappedIntent
- + " not found for PolicySet "
- + policySet);
-
- }
- } else {
- mappedPolicies.put(mappedIntent, entry.getValue());
- }
- }
-
- policySet.getMappedPolicies().clear();
- policySet.getMappedPolicies().putAll(mappedPolicies);
- }
-
- 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.getMappedPolicies().putAll(referredPolicySet.getMappedPolicies());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsFactory.java b/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsFactory.java
deleted file mode 100644
index 616616ae7a..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.definitions;
-
-/**
- * Factory interface to create SCA definitions model
- *
- */
-public interface DefinitionsFactory {
- /**
- * Create an instance of SCA definitions
- * @return a new instance of SCA definitions
- */
- Definitions createDefinitions();
-}
diff --git a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java b/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
deleted file mode 100644
index fdce0060f9..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.definitions.impl;
-
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-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<IntentAttachPointType> bindingTypes = new CopyOnWriteArrayList<IntentAttachPointType>();
- private List<IntentAttachPointType> implementationTypes = new CopyOnWriteArrayList<IntentAttachPointType>();
- private List<Object> bindings = new CopyOnWriteArrayList<Object>();
-
-
- public List<IntentAttachPointType> getBindingTypes() {
- return bindingTypes;
- }
-
- public List<IntentAttachPointType> 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/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java b/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java
deleted file mode 100644
index cd408125d2..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/definitions/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.DefinitionsFactory b/tags/java/sca/2.0-M1/modules/definitions/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.DefinitionsFactory
deleted file mode 100644
index 521d94f518..0000000000
--- a/tags/java/sca/2.0-M1/modules/definitions/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.DefinitionsFactory
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT 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.tuscany.sca.definitions.DefaultDefinitionsFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/LICENSE b/tags/java/sca/2.0-M1/modules/endpoint/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/endpoint/META-INF/MANIFEST.MF
deleted file mode 100644
index 8b8122ecc1..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,29 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.binding.sca;version="2.0.0",org.
- apache.tuscany.sca.endpoint.impl;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Default Endpoint Implementation
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397237968
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Default Endpoint Implementation
-Import-Package: javax.xml.stream;resolution:=optional,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.builder;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.contribution;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.contribution.processor;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.core.assembly;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.definitions;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.endpointresolver;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.monitor;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.policy;version="2.0.0";resolution:=optional,
- org.oasisopen.sca.annotation;version="2.0.0";resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.endpoint
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/NOTICE b/tags/java/sca/2.0-M1/modules/endpoint/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/pom.xml b/tags/java/sca/2.0-M1/modules/endpoint/pom.xml
deleted file mode 100644
index 9ca27150b9..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/pom.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-endpoint</artifactId>
- <name>Apache Tuscany SCA Endpoint Default Runtime</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-xml</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointResolverFactoryImpl.java b/tags/java/sca/2.0-M1/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointResolverFactoryImpl.java
deleted file mode 100644
index f0646e934e..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointResolverFactoryImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.endpoint.impl;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolver;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory;
-
-/**
- * The factory for creating endpoint Binding providers
- *
- * @version $Rev$ $Date$
- */
-public class EndpointResolverFactoryImpl implements EndpointResolverFactory<Endpoint> {
-
- private ExtensionPointRegistry extensionPoints;
-
- public EndpointResolverFactoryImpl(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
- }
-
- public EndpointResolver createEndpointResolver(Endpoint endpoint, Binding binding) {
-
- return new EndpointResolverImpl(extensionPoints, endpoint);
- }
-
- public Class<Endpoint> getModelType() {
- return Endpoint.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointResolverImpl.java b/tags/java/sca/2.0-M1/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointResolverImpl.java
deleted file mode 100644
index b76c4b82f0..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointResolverImpl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.endpoint.impl;
-
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolver;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolverFactoryExtensionPoint;
-
-
-/**
- * The endpoint resolver allows unresolved endpoints to be plumbed into
- * the runtime start and message send processing as a hook to late resolution
- * of target services
- *
- * @version $Rev$ $Date$
- */
-public class EndpointResolverImpl implements EndpointResolver {
-
- private final static Logger logger = Logger.getLogger(EndpointResolverImpl.class.getName());
-
- private Endpoint endpoint;
- private List<EndpointResolver> endpointResolvers = new ArrayList<EndpointResolver>();
-
- public EndpointResolverImpl(ExtensionPointRegistry extensionPoints,
- Endpoint endpoint) {
- this.endpoint = endpoint;
-
- EndpointResolverFactoryExtensionPoint resolverFactories =
- extensionPoints.getExtensionPoint(EndpointResolverFactoryExtensionPoint.class);
-
- for (Binding binding : endpoint.getCandidateBindings()){
- EndpointResolverFactory resolverFactory = resolverFactories.getEndpointResolverFactory(binding.getClass());
-
- // if the binding in question has a endpoint resolver factory they try and
- // create an endpoint resolver
- if (resolverFactory != null){
- EndpointResolver resolver = resolverFactory.createEndpointResolver(endpoint, binding);
-
- if (resolver != null){
- endpointResolvers.add(resolver);
- }
- }
- }
- }
-
- public void start(){
- // do nothing
- }
-
- public void stop(){
- // do nothing
- }
-
- public void resolve() {
- if (endpoint.isUnresolved()){
- // Resolve the endpoint binding here
-
- // first do any general resolution that's required
-
- // ask the bindings to resolve the endpoint one by one
- for (EndpointResolver resolver : endpointResolvers){
- resolver.resolve();
- if (endpoint.isUnresolved() != true){
- break;
- }
- }
-
- if (endpoint.isUnresolved()){
- // TODO: TUSCANY-2580: if its still unresolved use the first candidate binding
- endpoint.setSourceBinding(endpoint.getCandidateBindings().get(0));
- endpoint.getSourceBinding().setURI(endpoint.getTargetName());
- }
-
- if (endpoint.isUnresolved() != true){
- // If we have to build the endpoint because we are matching
- // intents and policies then we do that now. If the binding
- // is just configured by setting its uri we can just do local binding
- // configuration here
-
- // EndpointBuilderImpl.build(endpoint);
- } else {
- // raise an exception saying the endpoint can't be resolved
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory b/tags/java/sca/2.0-M1/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory
deleted file mode 100644
index 50e0a930d2..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the binding extension
-org.apache.tuscany.sca.endpoint.impl.EndpointResolverFactoryImpl;model=org.apache.tuscany.sca.assembly.Endpoint
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml b/tags/java/sca/2.0-M1/modules/endpoint/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml
deleted file mode 100644
index 8bac9e01c9..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
-
- <sca:bindingType type="sca:binding.sca" mayProvide="" alwaysProvides=""/>
- </sca:definitions> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/AddService.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/AddService.java
deleted file mode 100644
index 188451ebac..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The Add service interface
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 7ca8fb04b5..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/CalculatorService.java
deleted file mode 100644
index 031fa8b912..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-
-/**
- * The Calculator service interface.
- */
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 17fad7de6b..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/DivideService.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/DivideService.java
deleted file mode 100644
index 30d248208b..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index 1323edf55a..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605938..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index 91b803bc9e..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/SubtractService.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/SubtractService.java
deleted file mode 100644
index bf0d1882b6..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 58cc4a3547..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/org/apace/tuscany/sca/binding/sca/EndpointTestCase.java b/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/org/apace/tuscany/sca/binding/sca/EndpointTestCase.java
deleted file mode 100644
index e972670390..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/java/org/apace/tuscany/sca/binding/sca/EndpointTestCase.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR 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;
-
-
-import java.io.File;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.contribution.Contribution;
-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.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.core.ModuleActivator;
-import org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory;
-import org.apache.tuscany.sca.endpoint.impl.EndpointResolverFactoryImpl;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolver;
-import org.apache.tuscany.sca.endpointresolver.EndpointResolverFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * EndpointTestCase
- *
- * @version $Rev$ $Date$
- */
-public class EndpointTestCase {
-
- private static URLArtifactProcessor<Contribution> contributionProcessor;
- private static ModelResolverExtensionPoint modelResolvers;
- private static FactoryExtensionPoint modelFactories;
- private static AssemblyFactory assemblyFactory;
- private static XMLOutputFactory outputFactory;
- private static StAXArtifactProcessor<Object> xmlProcessor;
- private static CompositeBuilder compositeBuilder;
- private static ModelResolver modelResolver;
- private static CompositeActivator compositeActivator;
- private static ExtensionPointRegistry extensionPoints;
- private static Monitor monitor;
-
- @BeforeClass
- public static void init() {
-
- // Create extension point registry
- extensionPoints = new DefaultExtensionPointRegistry();
-
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- monitor = monitorFactory.createMonitor();
-
- modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
-
- // Initialize the Tuscany module activators
- ModuleActivatorExtensionPoint moduleActivators = extensionPoints.getExtensionPoint(ModuleActivatorExtensionPoint.class);
- for (ModuleActivator activator: moduleActivators.getModuleActivators()) {
- activator.start(extensionPoints);
- }
-
- // Get XML input/output factories
-
- XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
-
- // Get contribution workspace and assembly model factories
- assemblyFactory = new RuntimeAssemblyFactory();
- modelFactories.addFactory(assemblyFactory);
-
- // Create XML artifact processors
- StAXArtifactProcessorExtensionPoint xmlProcessorExtensions = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- xmlProcessor = new ExtensibleStAXArtifactProcessor(xmlProcessorExtensions, inputFactory, outputFactory, monitor);
-
- // Create contribution content processor
- URLArtifactProcessorExtensionPoint docProcessorExtensions = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- contributionProcessor = docProcessorExtensions.getProcessor(Contribution.class);
-
- // Get the model resolvers
- modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
- modelResolver = new ExtensibleModelResolver(null, modelResolvers, modelFactories);
-
- // Create a composite builder
- compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
-
- // Runtime Init ===================
-/*
- ContextFactoryExtensionPoint contextFactories = new DefaultContextFactoryExtensionPoint(extensionPoints);
- extensionPoints.addExtensionPoint(contextFactories);
-
- // Create a wire post processor extension point
- RuntimeWireProcessorExtensionPoint wireProcessors =
- extensionPoints.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class);
- RuntimeWireProcessor wireProcessor = new ExtensibleWireProcessor(wireProcessors);
-
- JavaInterfaceFactory javaInterfaceFactory =
- extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class).getFactory(JavaInterfaceFactory.class);
- RequestContextFactory requestContextFactory =
- extensionPoints.getExtensionPoint(ContextFactoryExtensionPoint.class).getFactory(RequestContextFactory.class);
-
- ConversationManager conversationManager = new ConversationManagerImpl();
- extensionPoints.addExtensionPoint(conversationManager);
-
-
- ScopeRegistry scopeRegistry = new ScopeRegistryImpl();
- ScopeContainerFactory[] factories =
- new ScopeContainerFactory[] {new CompositeScopeContainerFactory(), new StatelessScopeContainerFactory(),
- new RequestScopeContainerFactory(),
- new ConversationalScopeContainerFactory(null),
- // new HttpSessionScopeContainer(monitor)
- };
- for (ScopeContainerFactory f : factories) {
- scopeRegistry.register(f);
- }
-
- compositeActivator =new CompositeActivatorImpl(assemblyFactory,
- messageFactory,
- javaInterfaceFactory,
- scaBindingFactory,
- mapper,
- scopeRegistry,
- extensionPoints.getExtensionPoint(WorkScheduler.class),
- wireProcessor,
- requestContextFactory,
- new DefaultProxyFactoryExtensionPoint(messageFactory, mapper),
- extensionPoints.getExtensionPoint(ProviderFactoryExtensionPoint.class),
- extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class),
- conversationManager);
-
-*/
-
-
- }
-
- @Test
- public void testProvider(){
- try {
- URI calculatorURI = URI.create("calcualtor");
- URL calculatorURL = new File("./target/test-classes").toURI().toURL();
- Contribution contribution = contributionProcessor.read(null, calculatorURI, calculatorURL);
-
- contributionProcessor.resolve(contribution, modelResolver);
-
- Composite composite = contribution.getDeployables().get(0);
-
- compositeBuilder.build(composite, null, monitor);
-
- ComponentReference ref = (composite.getComponents().get(0).getReferences().get(0));
-
- Assert.assertEquals(1, ref.getEndpoints().size());
-
- Endpoint endpoint = ref.getEndpoints().get(0);
-
- EndpointResolverFactory<Endpoint> factory = new EndpointResolverFactoryImpl(extensionPoints);
-
- EndpointResolver endpointResolver = factory.createEndpointResolver(endpoint, null);
-
- Assert.assertNotNull(endpointResolver);
-
-
- } catch(Exception ex) {
- ex.printStackTrace();
- System.out.println(ex.toString());
- Assert.fail();
- }
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/endpoint/src/test/resources/Calculator.composite b/tags/java/sca/2.0-M1/modules/endpoint/src/test/resources/Calculator.composite
deleted file mode 100644
index 3b743f6e26..0000000000
--- a/tags/java/sca/2.0-M1/modules/endpoint/src/test/resources/Calculator.composite
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:calc="http://calc"
- targetNamespace="http://calc"
- 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="AddServiceComponentOff">
- <implementation.java class="calculator.AddServiceImpl"/>
- <service name="AddServiceImpl">
- <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> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/extensibility-equinox/LICENSE b/tags/java/sca/2.0-M1/modules/extensibility-equinox/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility-equinox/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/extensibility-equinox/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/extensibility-equinox/META-INF/MANIFEST.MF
deleted file mode 100644
index 9d701161cc..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility-equinox/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.extensibility.equinox;version=
- "2.0.0"
-Bundle-ActivationPolicy: lazy
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Extensibility for Eclipse Equinox
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-DynamicImport-Package: *
-Eclipse-LazyStart: true
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397425625
-Bundle-Activator: org.apache.tuscany.sca.extensibility.equinox.Equinox
- ServiceDiscoveryActivator
-Bundle-ManifestVersion: 2
-Bundle-Description: Apache Tuscany SCA Extensibility for Eclipse Equin
- ox
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Import-Package: org.apache.tuscany.sca.extensibility;version="2.0.0",
- org.eclipse.core.runtime.adaptor;resolution:=optional,
- org.osgi.framework;version="1.4"
-Bundle-SymbolicName: org.apache.tuscany.sca.extensibility.equinox
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/extensibility-equinox/NOTICE b/tags/java/sca/2.0-M1/modules/extensibility-equinox/NOTICE
deleted file mode 100644
index db5ab284d5..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility-equinox/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/extensibility-equinox/pom.xml b/tags/java/sca/2.0-M1/modules/extensibility-equinox/pom.xml
deleted file mode 100644
index ab4533c597..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility-equinox/pom.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-extensibility-equinox</artifactId>
- <name>Apache Tuscany SCA Extensibility for Eclipse Equinox</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- <version>3.3.0-v20070530</version>
- <scope>compile</scope>
- </dependency>
-
- <!--
- Exclude org.eclipse.equinox:app to avoid maven bug/bad equinox version scheme. i.e.:
-
- Couldn't find a version in [1.0.0-v20070606] to match range [1.0.0,2.0.0)
- org.eclipse.equinox:app:jar:null
- -->
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>runtime</artifactId>
- <version>3.3.100-v20070530</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!--
- Now include org.eclipse.equinox:app explicitly
- -->
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- <version>1.0.0-v20070606</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.0</version>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/bundles</outputDirectory>
- <excludeArtifactIds>osgi,junit,easymock,tuscany-extensibility</excludeArtifactIds>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java b/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java
deleted file mode 100644
index 7fba6a003e..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility.equinox;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscoverer;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-
-/**
- * A ServiceDiscoverer that find META-INF/services/... in installed bundles
- *
- * @version $Rev$ $Date$
- */
-public class EquinoxServiceDiscoverer implements ServiceDiscoverer {
- private static final Logger logger = Logger.getLogger(EquinoxServiceDiscoverer.class.getName());
-
- private BundleContext context;
-
- public EquinoxServiceDiscoverer(BundleContext context) {
- this.context = context;
- }
-
- public static class ServiceDeclarationImpl implements ServiceDeclaration {
- private Bundle bundle;
- private URL url;
- private String className;
- private Class<?> javaClass;
- private Map<String, String> attributes;
-
- public ServiceDeclarationImpl(Bundle bundle, URL url, String className, Map<String, String> attributes) {
- super();
- this.bundle = bundle;
- this.url = url;
- this.className = className;
- this.attributes = attributes;
- }
-
- public Map<String, String> getAttributes() {
- return attributes;
- }
-
- public String getClassName() {
- return className;
- }
-
- public Class<?> loadClass() throws ClassNotFoundException {
- if (className == null) {
- return null;
- }
- if (javaClass == null) {
- javaClass = loadClass(className);
- }
- return javaClass;
- }
-
- public Class<?> loadClass(String className) throws ClassNotFoundException {
- return bundle.loadClass(className);
- }
-
- public URL getLocation() {
- return url;
- }
-
- public URL getResource(final String name) {
- return AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- return bundle.getResource(name);
- }
- });
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("Bundle: ").append(EquinoxServiceDiscoverer.toString(bundle));
- sb.append(" Resource: ").append(url);
- sb.append(" Attributes: ").append(attributes);
- return sb.toString();
- }
-
- }
-
- /**
- * Empty static method to trigger the activation of this bundle.
- */
- public static void init() {
- }
-
- private static String toString(Bundle b) {
- StringBuffer sb = new StringBuffer();
- sb.append(b.getBundleId()).append(" ").append(b.getSymbolicName());
- int s = b.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");
- }
- return sb.toString();
-
- }
-
- /**
- * Parse a service declaration in the form class;attr=value,attr=value and
- * return a map of attributes
- *
- * @param declaration
- * @return a map of attributes
- */
- private static Map<String, String> parseServiceDeclaration(String declaration) {
- Map<String, String> attributes = new HashMap<String, String>();
- int index = declaration.indexOf(';');
- if (index != -1) {
- attributes.put("class", declaration.substring(0, index).trim());
- declaration = declaration.substring(index);
- } else {
- int j = declaration.indexOf('=');
- if (j == -1) {
- attributes.put("class", declaration.trim());
- return attributes;
- } else {
- declaration = ";" + declaration;
- }
- }
- StringTokenizer tokens = new StringTokenizer(declaration);
- for (; tokens.hasMoreTokens();) {
- String key = tokens.nextToken("=").substring(1).trim();
- if (key == null)
- break;
- String value = tokens.nextToken(",").substring(1).trim();
- if (value == null)
- break;
- attributes.put(key, value);
- }
- return attributes;
- }
-
- public ServiceDeclaration getFirstServiceDeclaration(String name) throws IOException {
- Set<ServiceDeclaration> declarations = getServiceDeclarations(name);
- if (declarations.isEmpty()) {
- return null;
- } else {
- return declarations.iterator().next();
- }
- }
-
- public Set<ServiceDeclaration> getServiceDeclarations(String serviceName) throws IOException {
- boolean debug = logger.isLoggable(Level.FINE);
- Set<ServiceDeclaration> descriptors = new HashSet<ServiceDeclaration>();
-
- serviceName = "META-INF/services/" + serviceName;
-
- for (Bundle bundle : context.getBundles()) {
- if (bundle.getBundleId() == 0 || bundle.getHeaders().get(Constants.FRAGMENT_HOST) != null) {
- // Skip system bundle as it has access to the application classloader
- // Skip bundle fragments too
- continue;
- }
- Enumeration<URL> urls = null;
- try {
- // Use getResources to find resources on the classpath of the bundle
- // Please note there are cases that getResources will return null even
- // the bundle containing such entries:
- // 1. There is a match on Import-Package or DynamicImport-Package, and another
- // bundle exports the resource package, there is a possiblity that it doesn't
- // find the containing entry
- // 2. The bundle cannot be resolved, then getResources will return null
- urls = bundle.getResources(serviceName);
- if (urls == null) {
- URL entry = bundle.getEntry(serviceName);
- if (entry != null) {
- logger.warning("Unresolved resource " + serviceName + " found in " + toString(bundle));
- try {
- bundle.start();
- } catch (BundleException e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- // urls = Collections.enumeration(Arrays.asList(entry));
- }
- }
- } catch (IOException e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- if (urls == null) {
- continue;
- }
- while (urls.hasMoreElements()) {
- final URL url = urls.nextElement();
-
- if (debug) {
- logger.fine("Reading service provider file: " + url.toExternalForm());
- }
- try {
- // Allow privileged access to open URL stream. Add FilePermission to added to security
- // policy file.
- InputStream is;
- try {
- is = AccessController.doPrivileged(new PrivilegedExceptionAction<InputStream>() {
- public InputStream run() throws IOException {
- return url.openStream();
- }
- });
- } catch (PrivilegedActionException e) {
- throw (IOException)e.getException();
- }
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(is));
- int count = 0;
- while (true) {
- String line = reader.readLine();
- if (line == null)
- break;
- line = line.trim();
- if (!line.startsWith("#") && !"".equals(line)) {
- String reg = line.trim();
- if (debug) {
- logger.fine("Registering service provider: " + reg);
- }
-
- Map<String, String> attributes = parseServiceDeclaration(reg);
- String className = attributes.get("class");
- if (className == null) {
- // Add a unique class name to prevent equals() from returning true
- className = "_class_" + count;
- count++;
- }
- ServiceDeclarationImpl descriptor =
- new ServiceDeclarationImpl(bundle, url, className, attributes);
- descriptors.add(descriptor);
- }
- }
- } finally {
- if (reader != null) {
- try {
- reader.close();
- } catch (IOException e) {
- // Ignore
- }
- }
- }
- } catch (IOException e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- }
- }
- return descriptors;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java b/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
deleted file mode 100644
index d5d7b92022..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility.equinox;
-
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * The Bundle Activator that creates the Equinox-based service discoverer
- *
- * @version $Rev$ $Date$
- */
-public class EquinoxServiceDiscoveryActivator implements BundleActivator {
- private static final Logger logger = Logger.getLogger(EquinoxServiceDiscoveryActivator.class.getName());
-
- public void start(BundleContext context) throws Exception {
- EquinoxServiceDiscoverer discoverer = new EquinoxServiceDiscoverer(context);
- ServiceDiscovery.getInstance().setServiceDiscoverer(discoverer);
- logger.info("Equinox-based service discoverer is now configured.");
- }
-
- public void stop(BundleContext context) throws Exception {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java b/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java
deleted file mode 100644
index 5743f7089a..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility.equinox;
-
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * Test start/stop the Equinox runtime.
- *
- * @version $Rev: $ $Date: $
- */
-public class EquinoxHostTestCase {
- @Test
- public void testStartThenStop() {
- TestEquinoxHost host = new TestEquinoxHost();
- BundleContext context = host.start();
- Assert.assertNotNull(context);
- for (Bundle b : context.getBundles()) {
- System.out.println(toString(b, false));
- }
- host.stop();
- }
-
- @Test
- public void testStartTwice() {
- TestEquinoxHost host = new TestEquinoxHost();
- host.start();
- try {
- host.start();
- Assert.fail();
- } catch (IllegalStateException e) {
- Assert.assertTrue(IllegalStateException.class.isInstance(e.getCause()));
- } finally {
- host.stop();
- }
- }
-
- public static String toString(Bundle b, boolean verbose) {
- StringBuffer sb = new StringBuffer();
- sb.append(b.getBundleId()).append(" ").append(b.getSymbolicName());
- int s = b.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");
- }
-
- sb.append(" ").append(b.getLocation());
- if (verbose) {
- Dictionary<Object, Object> dict = b.getHeaders();
- Enumeration<Object> keys = dict.keys();
- while (keys.hasMoreElements()) {
- Object key = keys.nextElement();
- sb.append(" ").append(key).append("=").append(dict.get(key));
- }
- }
- return sb.toString();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java b/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java
deleted file mode 100644
index deb5b4fb40..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility.equinox;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.JarInputStream;
-import java.util.jar.Manifest;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-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;
-
-/**
- * Test the Equinox service discoverer.
- *
- * @version $Rev$ $Date$
- */
-public class EquinoxServiceDiscovererTestCase {
- private static EquinoxServiceDiscoverer discoverer;
- private static Bundle testBundle;
- private static TestEquinoxHost host;
-
- private static String getState(Bundle b) {
- StringBuffer sb = new StringBuffer();
- int s = b.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 ");
- }
- return sb.toString();
-
- }
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- host = new TestEquinoxHost();
- BundleContext context = host.start();
-
- InputStream is = EquinoxServiceDiscovererTestCase.class.getResourceAsStream("/test-bundle.jar");
- testBundle = context.installBundle("test-bundle", is);
- is.close();
- discoverer = new EquinoxServiceDiscoverer(context);
- File dep = new File("target/bundles");
- List<Bundle> bundles = new ArrayList<Bundle>();
- for (File f : dep.listFiles()) {
- BufferedInputStream bis = new BufferedInputStream(new FileInputStream(f));
- JarInputStream jis = new JarInputStream(bis);
- Manifest manifest = jis.getManifest();
- if (manifest == null || manifest.getMainAttributes().getValue("Bundle-Name") == null) {
- bis.close();
- continue;
- }
- bis.close();
- bis = new BufferedInputStream(new FileInputStream(f));
- Bundle b = context.installBundle(f.getName(), bis);
- System.out.println("Installed "+b.getSymbolicName() + " [" + getState(b) + "]");
- bundles.add(b);
- bis.close();
- }
- for (Bundle b : bundles) {
- b.start();
- System.out.println("Started "+b.getSymbolicName() + " [" + getState(b) + "]");
- // Get the Platform.getExtensionRegistry()
- if ("org.eclipse.core.runtime".equals(b.getSymbolicName())) {
- // The Platform class loaded by the bundle is different that the one
- // on the classpath
- Class<?> cls = b.loadClass("org.eclipse.core.runtime.Platform");
- Method m = cls.getMethod("getExtensionRegistry");
- Object reg = m.invoke(cls);
- System.out.println(reg);
- }
- }
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (testBundle != null) {
- // Uninstall the bundle to clean up the cache
- testBundle.uninstall();
- }
- host.stop();
- }
-
- @Test
- public void testDiscovery() throws IOException {
- Set<ServiceDeclaration> descriptors = discoverer.getServiceDeclarations("test.TestService");
- Assert.assertEquals(1, descriptors.size());
- descriptors = discoverer.getServiceDeclarations("notthere");
- Assert.assertEquals(0, descriptors.size());
- }
-
- @Test
- public void testDiscoveryFirst() throws IOException {
- ServiceDeclaration descriptor = discoverer.getFirstServiceDeclaration("test.TestService");
- Assert.assertNotNull(descriptor);
- descriptor = discoverer.getFirstServiceDeclaration("notthere");
- Assert.assertNull(descriptor);
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java b/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java
deleted file mode 100644
index e000faa447..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility.equinox;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.adaptor.EclipseStarter;
-import org.eclipse.core.runtime.adaptor.LocationManager;
-import org.osgi.framework.BundleContext;
-
-/**
- * A test host that starts/stops Equinox.
- *
- * @version $Rev: $ $Date: $
- */
-public class TestEquinoxHost {
-
- private final static String systemPackages =
- "org.osgi.framework; version=1.3.0," + "org.osgi.service.packageadmin; version=1.2.0, "
- + "org.osgi.service.startlevel; version=1.0.0, "
- + "org.osgi.service.url; version=1.0.0, "
- + "org.osgi.util.tracker; version=1.3.2, "
- + "javax.xml, "
- + "javax.xml.datatype, "
- + "javax.xml.namespace, "
- + "javax.xml.parsers, "
- + "javax.xml.transform, "
- + "javax.xml.transform.dom, "
- + "javax.xml.transform.sax, "
- + "javax.xml.transform.stream, "
- + "javax.xml.validation, "
- + "javax.xml.xpath, "
- // Force the classes to be imported from the system bundle
- + "javax.xml.stream, "
- + "javax.xml.stream.util, "
- + "javax.sql,"
- + "org.w3c.dom, "
- + "org.xml.sax, "
- + "org.xml.sax.ext, "
- + "org.xml.sax.helpers, "
- + "javax.security.auth, "
- + "javax.security.cert, "
- + "javax.security.auth.login, "
- + "javax.security.auth.callback, "
- + "javax.naming, "
- + "javax.naming.spi, "
- + "javax.naming.directory, "
- + "javax.management, "
- + "javax.imageio, "
- + "sun.misc, "
- + "javax.net, "
- + "javax.net.ssl, "
- + "javax.crypto, "
- + "javax.rmi, "
- + "javax.transaction, "
- + "javax.transaction.xa";
-
- public BundleContext start() {
- try {
- Map<Object, Object> props = new HashMap<Object, Object>();
- props.put("org.osgi.framework.system.packages", systemPackages);
- props.put(EclipseStarter.PROP_CLEAN, "true");
- props.put(LocationManager.PROP_INSTANCE_AREA, new File("target/workspace").toURI().toString());
- props.put(LocationManager.PROP_INSTALL_AREA, new File("target/eclipse").toURI().toString());
- EclipseStarter.setInitialProperties(props);
- BundleContext context = EclipseStarter.startup(new String[]{}, null);
- return context;
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- public void stop() {
- try {
- EclipseStarter.shutdown();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/resources/test-bundle.jar b/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/resources/test-bundle.jar
deleted file mode 100644
index afee051f61..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility-equinox/src/test/resources/test-bundle.jar
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/LICENSE b/tags/java/sca/2.0-M1/modules/extensibility/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/extensibility/META-INF/MANIFEST.MF
deleted file mode 100644
index 8beea88eca..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.core;uses:="org.apache.tuscany.
- sca.extensibility";version="2.0.0",org.apache.tuscany.sca.extensibility
- ;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Extensibility
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-DynamicImport-Package: org.apache.tuscany.sca.extensibility.equinox
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397079296
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Extensibility
-Import-Package: org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.extensibility;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.extensibility
-Bundle-DocURL: http://www.apache.org/
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/NOTICE b/tags/java/sca/2.0-M1/modules/extensibility/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/pom.xml b/tags/java/sca/2.0-M1/modules/extensibility/pom.xml
deleted file mode 100644
index 426f016ed1..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/pom.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-extensibility</artifactId>
- <name>Apache Tuscany SCA Extensibility</name>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java
deleted file mode 100644
index 12979723b1..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Modifier;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * Default implementation of a registry to hold all the Tuscany core extension
- * points. As the point of contact for all extension artifacts this registry
- * allows loaded extensions to find all other parts of the system and register
- * themselves appropriately.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultExtensionPointRegistry implements ExtensionPointRegistry {
- private Map<Class<?>, Object> extensionPoints = new HashMap<Class<?>, Object>();
-
- /**
- * Constructs a new registry.
- */
- public DefaultExtensionPointRegistry() {
- }
-
- /**
- * Add an extension point to the registry. This default implementation
- * stores extensions against the interfaces that they implement.
- *
- * @param extensionPoint The instance of the extension point
- *
- * @throws IllegalArgumentException if extensionPoint is null
- */
- public void addExtensionPoint(Object extensionPoint) {
- if (extensionPoint == null) {
- throw new IllegalArgumentException("Cannot register null as an ExtensionPoint");
- }
-
- Set<Class<?>> interfaces = getAllInterfaces(extensionPoint.getClass());
- for (Class<?> i : interfaces) {
- extensionPoints.put(i, extensionPoint);
- }
- }
-
- private Constructor<?> getConstructor(Constructor<?>[] constructors, Class<?>[] paramTypes) {
- for (Constructor<?> c : constructors) {
- Class<?>[] types = c.getParameterTypes();
- if (c.getParameterTypes().length == paramTypes.length) {
- boolean found = true;
- for (int i = 0; i < types.length; i++) {
- if (types[i] != paramTypes[i]) {
- found = false;
- break;
- }
- }
- if (found) {
- return c;
- }
- }
- }
- return null;
- }
-
- /**
- * Get the extension point by the interface that it implements
- *
- * @param extensionPointType The lookup key (extension point interface)
- * @return The instance of the extension point
- *
- * @throws IllegalArgumentException if extensionPointType is null
- */
- public <T> T getExtensionPoint(Class<T> extensionPointType) {
- if (extensionPointType == null) {
- throw new IllegalArgumentException("Cannot lookup ExtensionPoint of type null");
- }
-
- Object extensionPoint = extensionPoints.get(extensionPointType);
- if (extensionPoint == null) {
-
- // Dynamically load an extension point class declared under META-INF/services
- try {
- ServiceDeclaration extensionPointDeclaration = ServiceDiscovery.getInstance().getFirstServiceDeclaration(extensionPointType.getName());
- if (extensionPointDeclaration != null) {
- Class<?> extensionPointClass = extensionPointDeclaration.loadClass();
-
- // Construct the extension point
- Constructor<?>[] constructors = extensionPointClass.getConstructors();
- Constructor<?> constructor = getConstructor(constructors, new Class<?>[] {ExtensionPointRegistry.class});
- if (constructor != null) {
- extensionPoint = constructor.newInstance(this);
- } else {
- constructor = getConstructor(constructors, new Class<?>[] {});
- if (constructor != null) {
- extensionPoint = constructor.newInstance();
- } else {
- throw new IllegalArgumentException(
- "No valid constructor is found for " + extensionPointClass);
- }
- }
-
- // Cache the loaded extension point
- addExtensionPoint(extensionPoint);
- }
- } catch (InvocationTargetException e) {
- throw new IllegalArgumentException(e);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- } catch (ClassNotFoundException e) {
- throw new IllegalArgumentException(e);
- } catch (InstantiationException e) {
- throw new IllegalArgumentException(e);
- } catch (IllegalAccessException e) {
- throw new IllegalArgumentException(e);
- }
- }
- return extensionPointType.cast(extensionPoint);
- }
-
- /**
- * Remove an extension point based on the interface that it implements
- *
- * @param extensionPoint The extension point to remove
- *
- * @throws IllegalArgumentException if extensionPoint is null
- */
- public void removeExtensionPoint(Object extensionPoint) {
- if (extensionPoint == null) {
- throw new IllegalArgumentException("Cannot remove null as an ExtensionPoint");
- }
-
- Set<Class<?>> interfaces = getAllInterfaces(extensionPoint.getClass());
- for (Class<?> i : interfaces) {
- extensionPoints.remove(i);
- }
- }
-
- /**
- * Returns the set of interfaces implemented by the given class and its
- * ancestors or a blank set if none
- */
- private static Set<Class<?>> getAllInterfaces(Class<?> clazz) {
- Set<Class<?>> implemented = new HashSet<Class<?>>();
- getAllInterfaces(clazz, implemented);
- return implemented;
- }
-
- private static void getAllInterfaces(Class<?> clazz, Set<Class<?>> implemented) {
- Class<?>[] interfaces = clazz.getInterfaces();
- for (Class<?> interfaze : interfaces) {
- if (Modifier.isPublic(interfaze.getModifiers())) {
- implemented.add(interfaze);
- }
- }
- Class<?> superClass = clazz.getSuperclass();
- // Object has no superclass so check for null
- if (superClass != null && !superClass.equals(Object.class)) {
- getAllInterfaces(superClass, implemented);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultFactoryExtensionPoint.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultFactoryExtensionPoint.java
deleted file mode 100644
index 1bee91dcea..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultFactoryExtensionPoint.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashMap;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-
-
-/**
- * Default implementation of a model factory extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultFactoryExtensionPoint implements FactoryExtensionPoint {
- private ExtensionPointRegistry extensionPointRegistry;
- private HashMap<Class<?>, Object> factories = new HashMap<Class<?>, Object>();
-
- /**
- * Constructs a new DefaultModelFactoryExtensionPoint.
- */
- public DefaultFactoryExtensionPoint(ExtensionPointRegistry extensionPointRegistry) {
- this.extensionPointRegistry = extensionPointRegistry;
- }
-
- /**
- * Add a model factory extension.
- *
- * @param factory The factory to add
- */
- public void addFactory(Object factory) {
- Class<?>[] interfaces = factory.getClass().getInterfaces();
- if (interfaces.length == 0) {
- Class<?> sc = factory.getClass().getSuperclass();
- if (sc != Object.class) {
- factories.put(sc, factory);
- }
- } else {
- for (int i = 0; i<interfaces.length; i++) {
- factories.put(interfaces[i], factory);
- }
- }
- }
-
- /**
- * Remove a model factory.
- *
- * @param factory The factory to remove
- */
- public void removeFactory(Object factory) {
- Class<?>[] interfaces = factory.getClass().getInterfaces();
- if (interfaces.length == 0) {
- Class<?> sc = factory.getClass().getSuperclass();
- if (sc != Object.class) {
- factories.remove(sc);
- }
- } else {
- for (int i = 0; i<interfaces.length; i++) {
- factories.remove(interfaces[i]);
- }
- }
- }
-
- private ClassLoader setContextClassLoader(final ClassLoader classLoader) {
- return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(classLoader);
- return tccl;
- }
- });
- }
-
- /**
- * Get a factory implementing the given interface.
- * @param factoryInterface The lookup key (factory interface)
- * @return The factory
- */
- public <T> T getFactory(Class<T> factoryInterface) {
- Object factory = factories.get(factoryInterface);
- if (factory == null) {
-
- // Dynamically load a factory class declared under META-INF/services
- try {
- ServiceDeclaration factoryDeclaration =
- ServiceDiscovery.getInstance().getFirstServiceDeclaration(factoryInterface.getName());
- if (factoryDeclaration != null) {
- Class<?> factoryClass = factoryDeclaration.loadClass();
- try {
-
- // Default empty constructor
- Constructor<?> constructor = factoryClass.getConstructor();
- factory = constructor.newInstance();
- } catch (NoSuchMethodException e) {
- try {
-
- // Constructor taking the model factory extension point
- Constructor<?> constructor = factoryClass.getConstructor(FactoryExtensionPoint.class);
- factory = constructor.newInstance(this);
- } catch (NoSuchMethodException e1) {
-
- // Constructor taking the extension point registry
- Constructor<?> constructor = factoryClass.getConstructor(ExtensionPointRegistry.class);
- factory = constructor.newInstance(extensionPointRegistry);
- }
- }
-
- // Cache the loaded factory
- factories.put(factoryInterface, factory);
-
- return factoryInterface.cast(factory);
-
- } else {
-
- // If the input interface is an abstract class
- if (!factoryInterface.isInterface() && Modifier.isAbstract(factoryInterface.getModifiers())) {
- Method newInstanceMethod = factoryInterface.getDeclaredMethod("newInstance");
- ClassLoader tccl = setContextClassLoader(factoryInterface.getClassLoader());
- try {
-
- // Create a new instance
- factory = newInstanceMethod.invoke(null);
-
- // Cache the factory
- factories.put(factoryInterface, factory);
-
- return factoryInterface.cast(factory);
- } catch (Exception e) {
- // Sorry no factory found
- return null;
- } finally {
- setContextClassLoader(tccl);
- }
- } else {
-
- // Sorry no factory found
- return null;
- }
- }
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- } else {
- return factoryInterface.cast(factory);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultModuleActivatorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultModuleActivatorExtensionPoint.java
deleted file mode 100644
index d84f28f11e..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultModuleActivatorExtensionPoint.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * Default implementation of an extension point to hold Tuscany module activators.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultModuleActivatorExtensionPoint implements ModuleActivatorExtensionPoint {
- private List<ModuleActivator> activators = new ArrayList<ModuleActivator>();
- private boolean loadedActivators;
-
- /**
- * Constructs a new extension point.
- */
- public DefaultModuleActivatorExtensionPoint() {
- }
-
- public void addModuleActivator(ModuleActivator activator) {
- activators.add(activator);
- }
-
- public List<ModuleActivator> getModuleActivators() {
- loadModuleActivators();
- return activators;
- }
-
- public void removeModuleActivator(Object activator) {
- activators.remove(activator);
- }
-
- /**
- * Dynamically load module activators declared under META-INF/services
- */
- private void loadModuleActivators() {
- if (loadedActivators)
- return;
-
- // Get the activator service declarations
- Set<ServiceDeclaration> activatorDeclarations;
- try {
- activatorDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(ModuleActivator.class.getName());
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
-
- // Load and instantiate module activators
- for (ServiceDeclaration activatorDeclaration: activatorDeclarations) {
- ModuleActivator activator;
- try {
- Class<ModuleActivator> activatorClass = (Class<ModuleActivator>)activatorDeclaration.loadClass();
- activator = activatorClass.newInstance();
- } catch (ClassNotFoundException e) {
- throw new IllegalArgumentException(e);
- } catch (InstantiationException e) {
- throw new IllegalArgumentException(e);
- } catch (IllegalAccessException e) {
- throw new IllegalArgumentException(e);
- }
- addModuleActivator(activator);
- }
-
- loadedActivators = true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultUtilityExtensionPoint.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultUtilityExtensionPoint.java
deleted file mode 100644
index 9906bef909..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultUtilityExtensionPoint.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Modifier;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * Default implementation of an extension point to hold Tuscany utility utilities.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultUtilityExtensionPoint implements UtilityExtensionPoint {
- private Map<Class<?>, Object> utilities = new HashMap<Class<?>, Object>();
-
- private ExtensionPointRegistry extensionPoints;
-
- /**
- * Constructs a new extension point.
- */
- public DefaultUtilityExtensionPoint(ExtensionPointRegistry extensionPoints) {
- this.extensionPoints = extensionPoints;
- }
-
- /**
- * Add a utility to the extension point. This default implementation
- * stores utilities against the interfaces that they implement.
- *
- * @param utility The instance of the utility
- *
- * @throws IllegalArgumentException if utility is null
- */
- public void addUtility(Object utility) {
- if (utility == null) {
- throw new IllegalArgumentException("Cannot register null as a Service");
- }
-
- Set<Class<?>> interfaces = getAllInterfaces(utility.getClass());
- for (Class<?> i : interfaces) {
- utilities.put(i, utility);
- }
- }
-
- private Constructor<?> getConstructor(Constructor<?>[] constructors, Class<?>[] paramTypes) {
- for (Constructor<?> c : constructors) {
- Class<?>[] types = c.getParameterTypes();
- if (c.getParameterTypes().length == paramTypes.length) {
- boolean found = true;
- for (int i = 0; i < types.length; i++) {
- if (types[i] != paramTypes[i]) {
- found = false;
- break;
- }
- }
- if (found) {
- return c;
- }
- }
- }
- return null;
- }
-
- /**
- * Get the utility by the interface that it implements
- *
- * @param utilityType The lookup key (utility interface)
- * @return The instance of the utility
- *
- * @throws IllegalArgumentException if utilityType is null
- */
- public <T> T getUtility(Class<T> utilityType) {
- if (utilityType == null) {
- throw new IllegalArgumentException("Cannot lookup Service of type null");
- }
-
- Object utility = utilities.get(utilityType);
- if (utility == null) {
-
- // Dynamically load a utility class declared under META-INF/utilities
- try {
- ServiceDeclaration utilityDeclaration =ServiceDiscovery.getInstance().getFirstServiceDeclaration(utilityType.getName());
- if (utilityDeclaration != null) {
- Class<?> utilityClass = utilityDeclaration.loadClass();
-
- // Construct the utility
- Constructor<?>[] constructors = utilityClass.getConstructors();
- Constructor<?> constructor = getConstructor(constructors, new Class<?>[] {ExtensionPointRegistry.class});
- if (constructor != null) {
- utility = constructor.newInstance(extensionPoints);
- } else {
- constructor = getConstructor(constructors, new Class<?>[] {});
- if (constructor != null) {
- utility = constructor.newInstance();
- } else {
- throw new IllegalArgumentException(
- "No valid constructor is found for " + utilityClass);
- }
- }
-
- // Cache the loaded utility
- addUtility(utility);
- }
- } catch (InvocationTargetException e) {
- throw new IllegalArgumentException(e);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- } catch (ClassNotFoundException e) {
- throw new IllegalArgumentException(e);
- } catch (InstantiationException e) {
- throw new IllegalArgumentException(e);
- } catch (IllegalAccessException e) {
- throw new IllegalArgumentException(e);
- }
- }
- return utilityType.cast(utility);
- }
-
- /**
- * Remove a utility based on the interface that it implements
- *
- * @param utility The utility to remove
- *
- * @throws IllegalArgumentException if utility is null
- */
- public void removeUtility(Object utility) {
- if (utility == null) {
- throw new IllegalArgumentException("Cannot remove null as a Service");
- }
-
- Set<Class<?>> interfaces = getAllInterfaces(utility.getClass());
- for (Class<?> i : interfaces) {
- utilities.remove(i);
- }
- }
-
- /**
- * Returns the set of interfaces implemented by the given class and its
- * ancestors or a blank set if none
- */
- private static Set<Class<?>> getAllInterfaces(Class<?> clazz) {
- Set<Class<?>> implemented = new HashSet<Class<?>>();
- getAllInterfaces(clazz, implemented);
- return implemented;
- }
-
- private static void getAllInterfaces(Class<?> clazz, Set<Class<?>> implemented) {
- Class<?>[] interfaces = clazz.getInterfaces();
- for (Class<?> interfaze : interfaces) {
- if (Modifier.isPublic(interfaze.getModifiers())) {
- implemented.add(interfaze);
- }
- }
- Class<?> superClass = clazz.getSuperclass();
- // Object has no superclass so check for null
- if (superClass != null && !superClass.equals(Object.class)) {
- getAllInterfaces(superClass, implemented);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java
deleted file mode 100644
index f2f67b2d52..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core;
-
-
-/**
- * The registry for the Tuscany core extension points. As the point of contact
- * for all extension artifacts this registry allows loaded extensions to find
- * all other parts of the system and register themselves appropriately.
- *
- * @version $Rev$ $Date$
- */
-public interface ExtensionPointRegistry {
-
- /**
- * Add an extension point to the registry
- * @param extensionPoint The instance of the extension point
- *
- * @throws IllegalArgumentException if extensionPoint is null
- */
- void addExtensionPoint(Object extensionPoint);
-
- /**
- * Get the extension point by the interface
- * @param extensionPointType The lookup key (extension point interface)
- * @return The instance of the extension point
- *
- * @throws IllegalArgumentException if extensionPointType is null
- */
- <T> T getExtensionPoint(Class<T> extensionPointType);
-
- /**
- * Remove an extension point
- * @param extensionPoint The extension point to remove
- *
- * @throws IllegalArgumentException if extensionPoint is null
- */
- void removeExtensionPoint(Object extensionPoint);
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/FactoryExtensionPoint.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/FactoryExtensionPoint.java
deleted file mode 100644
index 4d38cb8afe..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/FactoryExtensionPoint.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core;
-
-/**
- * An extension point for model factories. Model factories are provided to
- * abstract the classes that represent artifacts in the assembly model away
- * from their creation mechanism. When the runtime needs to extend the model
- * as it reads in contributed artifacts it looks up the factory for the
- * artifact required in this registry
- *
- * @version $Rev$ $Date$
- */
-public interface FactoryExtensionPoint {
-
- /**
- * Add a model factory extension.
- *
- * @param factory The factory to add
- */
- void addFactory(Object factory);
-
- /**
- * Remove a model factory extension.
- *
- * @param factory The factory to remove
- */
- void removeFactory(Object factory);
-
- /**
- * Get a factory implementing the given interface.
- * @param factoryInterface the lookup key (factory interface)
- * @return The factory
- */
- <T> T getFactory(Class<T> factoryInterface);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java
deleted file mode 100644
index dbfd0dcd90..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core;
-
-
-/**
- * ModuleActivator represents a module that plugs into the Tuscany system. Each
- * module should provide an implementation of this interface and register the
- * ModuleActivator implementation class by defining a file named
- *
- * "META-INF/services/org.apache.tuscany.core.ModuleActivator"
- *
- * The content of the file is the class name of the ModuleActivator implementation.
- * The implementation class must have a no-arg constructor. The same instance
- * will be used to invoke all the methods during different phases of the module
- * activation. Note that the start and stop methods defined by this interface
- * take a reference to the Tuscany SCA runtime ExtensionPointRegistry. This
- * gives the ModuleActivator the opportunity to add extension points to the
- * registry as it is requested to start up and remove them when it is requested
- * to shut down.
- *
- * @version $Rev$ $Date$
- */
-public interface ModuleActivator {
-
- /**
- * This method is invoked when the module is started by the Tuscany system.
- * It can be used by this module to register extensions against extension
- * points.
- *
- * @param registry The extension point registry
- */
- void start(ExtensionPointRegistry registry);
-
- /**
- * This method is invoked when the module is stopped by the Tuscany system.
- * It can be used by this module to unregister extensions against the
- * extension points.
- *
- * @param registry The extension point registry
- */
- void stop(ExtensionPointRegistry registry);
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ModuleActivatorExtensionPoint.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ModuleActivatorExtensionPoint.java
deleted file mode 100644
index ec0f12b8ba..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/ModuleActivatorExtensionPoint.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core;
-
-import java.util.List;
-
-
-/**
- * The extension point for the Tuscany module activator extensions.
- *
- * @version $Rev$ $Date$
- */
-public interface ModuleActivatorExtensionPoint {
-
- /**
- * Add a module activator extension to the extension point
- * @param activator The instance of the module activator
- *
- * @throws IllegalArgumentException if activator is null
- */
- void addModuleActivator(ModuleActivator activator);
-
- /**
- * Returns the module activator extensions.
- * @return The module activator extensions
- */
- List<ModuleActivator> getModuleActivators();
-
- /**
- * Remove a module activator
- * @param activator The module activator to remove
- *
- * @throws IllegalArgumentException if activator is null
- */
- void removeModuleActivator(Object activator);
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/UtilityExtensionPoint.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/UtilityExtensionPoint.java
deleted file mode 100644
index 6b14b95666..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/UtilityExtensionPoint.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core;
-
-
-/**
- * The extension point for the Tuscany core utility extensions.
- *
- * @version $Rev$ $Date$
- */
-public interface UtilityExtensionPoint {
-
- /**
- * Add a utility to the extension point
- * @param utility The instance of the utility
- *
- * @throws IllegalArgumentException if utility is null
- */
- void addUtility(Object utility);
-
- /**
- * Get the utility by the interface
- * @param utilityType The lookup key (utility interface)
- * @return The instance of the utility
- *
- * @throws IllegalArgumentException if utilityType is null
- */
- <T> T getUtility(Class<T> utilityType);
-
- /**
- * Remove a utility
- * @param utility The utility to remove
- *
- * @throws IllegalArgumentException if utility is null
- */
- void removeUtility(Object utility);
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java
deleted file mode 100644
index 918f7beebd..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.ref.WeakReference;
-import java.net.URL;
-import java.net.URLConnection;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A ServiceDiscoverer that find META-INF/services/... using the Context ClassLoader.
- *
- * @version $Rev$ $Date$
- */
-public class ContextClassLoaderServiceDiscoverer implements ServiceDiscoverer {
- private static final Logger logger = Logger.getLogger(ContextClassLoaderServiceDiscoverer.class.getName());
-
- public class ServiceDeclarationImpl implements ServiceDeclaration {
- private URL url;
- private String className;
- private Class<?> javaClass;
- private Map<String, String> attributes;
-
- public ServiceDeclarationImpl(URL url, String className, Map<String, String> attributes) {
- super();
- this.url = url;
- this.className = className;
- this.attributes = attributes;
- }
-
- public Map<String, String> getAttributes() {
- return attributes;
- }
-
- public String getClassName() {
- return className;
- }
-
- public URL getLocation() {
- return url;
- }
-
- public Class<?> loadClass() throws ClassNotFoundException {
- if (className == null) {
- return null;
- }
- if (javaClass == null) {
- javaClass = loadClass(className);
- }
- return javaClass;
- }
-
- public Class<?> loadClass(String className) throws ClassNotFoundException {
- return Class.forName(className, false, classLoaderReference.get());
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("ClassLoader: ").append(classLoaderReference.get());
- sb.append(" Attributes: ").append(attributes);
- return sb.toString();
- }
-
- public URL getResource(final String name) {
- return AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- return classLoaderReference.get().getResource(name);
- }
- });
- }
-
- }
-
- private WeakReference<ClassLoader> classLoaderReference;
-
- public ContextClassLoaderServiceDiscoverer() {
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- this.classLoaderReference = new WeakReference<ClassLoader>(classLoader);
- }
-
- private List<URL> getResources(final String name) throws IOException {
- try {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<List<URL>>() {
- public List<URL> run() throws IOException {
- List<URL> urls = Collections.list(classLoaderReference.get().getResources(name));
- return urls;
- }
- });
- } catch (PrivilegedActionException e) {
- throw (IOException)e.getException();
- }
- }
-
- /**
- * Parse a service declaration in the form class;attr=value,attr=value and
- * return a map of attributes
- *
- * @param declaration
- * @return a map of attributes
- */
- private static Map<String, String> parseServiceDeclaration(String declaration) {
- Map<String, String> attributes = new HashMap<String, String>();
- int index = declaration.indexOf(';');
- if (index != -1) {
- attributes.put("class", declaration.substring(0, index).trim());
- declaration = declaration.substring(index);
- } else {
- int j = declaration.indexOf('=');
- if (j == -1) {
- attributes.put("class", declaration.trim());
- return attributes;
- } else {
- declaration = ";" + declaration;
- }
- }
- StringTokenizer tokens = new StringTokenizer(declaration);
- for (; tokens.hasMoreTokens();) {
- String key = tokens.nextToken("=").substring(1).trim();
- if (key == null)
- break;
- String value = tokens.nextToken(",").substring(1).trim();
- if (value == null)
- break;
- attributes.put(key, value);
- }
- return attributes;
- }
-
- public ServiceDeclaration getFirstServiceDeclaration(String name) throws IOException {
- Set<ServiceDeclaration> declarations = getServiceDeclarations(name);
- if (declarations.isEmpty()) {
- return null;
- } else {
- return declarations.iterator().next();
- }
- }
-
- public Set<ServiceDeclaration> getServiceDeclarations(String serviceName) {
- Set<ServiceDeclaration> descriptors = new HashSet<ServiceDeclaration>();
-
- String name = "META-INF/services/" + serviceName;
- boolean debug = logger.isLoggable(Level.FINE);
- try {
- for (final URL url : getResources(name)) {
- if (debug) {
- logger.fine("Reading service provider file: " + url.toExternalForm());
- }
-
- // Allow privileged access to open URL stream. Add FilePermission to added to security
- // policy file.
- InputStream is;
- try {
- is = AccessController.doPrivileged(new PrivilegedExceptionAction<InputStream>() {
- public InputStream run() throws IOException {
- URLConnection connection = url.openConnection();
- // TUSCANY-2539
- // Don't cache connections by default to stop Tuscany locking contribution jar files
- // done here as this is one of the first places we open a stream and the only way to
- // set the default is to set it on an instance of URLConnection
- connection.setDefaultUseCaches(false);
- connection.setUseCaches(false);
- return url.openStream();
- }
- });
- } catch (PrivilegedActionException e) {
- throw (IOException)e.getException();
- }
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(is));
- int count = 0;
- while (true) {
- String line = reader.readLine();
- if (line == null)
- break;
- line = line.trim();
- if (!line.startsWith("#") && !"".equals(line)) {
- String reg = line.trim();
- if (debug) {
- logger.fine("Registering service provider: " + reg);
- }
-
- Map<String, String> attributes = parseServiceDeclaration(reg);
- String className = attributes.get("class");
- if (className == null) {
- // Add a unique class name to prevent equals() from returning true
- className = "_class_" + count;
- count++;
- }
- ServiceDeclarationImpl descriptor = new ServiceDeclarationImpl(url, className, attributes);
- descriptors.add(descriptor);
- }
- }
- } finally {
- if (reader != null) {
- try {
- reader.close();
- } catch (IOException e) {
- // Ignore
- }
- }
- }
- }
- } catch (IOException e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- return descriptors;
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDeclaration.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDeclaration.java
deleted file mode 100644
index d7ac8b449f..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDeclaration.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility;
-
-import java.net.URL;
-import java.util.Map;
-
-/**
- * Service declaration using J2SE Jar service provider spec Classes specified
- * inside this declaration are loaded using the ClassLoader used to read the
- * configuration file corresponding to this declaration.
- *
- * @version $Rev$ $Date$
- */
-public interface ServiceDeclaration {
- /**
- * Load a java class in the same context as the service definition
- * @param className The class name
- * @return The loaded class
- * @throws ClassNotFoundException
- */
- Class<?> loadClass(String className) throws ClassNotFoundException;
-
- /**
- * Get the java class for the service impl
- * @return The java class
- */
- Class<?> loadClass() throws ClassNotFoundException;
-
- /**
- * Get all attributes (name=value pairs) defined for the given entry
- * @return All attributes keyed by name
- */
- Map<String, String> getAttributes();
-
- URL getLocation();
-
- String getClassName();
-
- URL getResource(String name);
-
- /**
- * The service descriptor might be hashed
- * @param obj Another object
- * @return
- */
- boolean equals(Object obj);
- /**
- * The service descriptor might be hashed
- * @return
- */
- int hashCode();
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscoverer.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscoverer.java
deleted file mode 100644
index 6adf083411..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscoverer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility;
-
-import java.io.IOException;
-import java.util.Set;
-
-/**
- * A SPI that allows different implementations of discovering service declarations
- */
-public interface ServiceDiscoverer {
-
- /**
- * Get all service declarations for this interface
- *
- * @param name
- * @return set of service declarations
- * @throws IOException
- */
- public Set<ServiceDeclaration> getServiceDeclarations(String name) throws IOException;
-
- /**
- * Get first service declaration class for the given interface
- *
- * @param name
- * @return service implementation class
- * @throws IOException
- * @throws ClassNotFoundException
- */
- public ServiceDeclaration getFirstServiceDeclaration(String name) throws IOException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java b/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java
deleted file mode 100644
index 7976ea2f7b..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility;
-
-import java.io.IOException;
-import java.util.Set;
-import java.util.logging.Logger;
-
-/**
- * Service discovery for Tuscany based on J2SE Jar service provider spec.
- * Services are described using configuration files in META-INF/services.
- * Service description specifies a class name followed by optional properties.
- *
- *
- * @version $Rev$ $Date$
- */
-public final class ServiceDiscovery implements ServiceDiscoverer {
- private static final Logger logger = Logger.getLogger(ServiceDiscovery.class.getName());
-
- private final static ServiceDiscovery INSTANCE = new ServiceDiscovery();
-
- private ServiceDiscoverer discoverer;
-
- private ServiceDiscovery() {
- super();
- }
- /**
- * Get an instance of Service discovery, one instance is created per
- * ClassLoader that this class is loaded from
- *
- * @return
- */
- public static ServiceDiscovery getInstance() {
- return INSTANCE;
- }
-
- public ServiceDiscoverer getServiceDiscoverer() {
- if (discoverer != null) {
- return discoverer;
- }
- try {
- //FIXME Remove that upside-down dependency
- Class.forName("org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer");
- if (discoverer != null) {
- return discoverer;
- }
- } catch (Throwable e) {
- }
- discoverer = new ContextClassLoaderServiceDiscoverer();
- return discoverer;
- }
-
- public void setServiceDiscoverer(ServiceDiscoverer sd) {
- if (discoverer != null) {
- throw new IllegalStateException("The ServiceDiscoverer cannot be reset");
- }
- discoverer = sd;
- }
-
- public Set<ServiceDeclaration> getServiceDeclarations(String name) throws IOException {
- Set<ServiceDeclaration> services = getServiceDiscoverer().getServiceDeclarations(name);
- return services;
- }
-
- public ServiceDeclaration getFirstServiceDeclaration(final String name) throws IOException {
- ServiceDeclaration service = getServiceDiscoverer().getFirstServiceDeclaration(name);
- return service;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.FactoryExtensionPoint b/tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.FactoryExtensionPoint
deleted file mode 100644
index 3c135aa267..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.FactoryExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint b/tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint
deleted file mode 100644
index 42bad63132..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.core.DefaultModuleActivatorExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.UtilityExtensionPoint b/tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.UtilityExtensionPoint
deleted file mode 100644
index d769bad283..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.UtilityExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.core.DefaultUtilityExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscovererTestCase.java b/tags/java/sca/2.0-M1/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscovererTestCase.java
deleted file mode 100644
index 288c759a18..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscovererTestCase.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility;
-
-import java.io.IOException;
-import java.util.Set;
-
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test Case for ClasspathServiceDiscover
- */
-public class ContextClassLoaderServiceDiscovererTestCase {
- private static ContextClassLoaderServiceDiscoverer discover;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- discover = new ContextClassLoaderServiceDiscoverer();
- }
-
- @Test
- public void testDiscovery() {
- Set<ServiceDeclaration> discriptors =
- discover.getServiceDeclarations("org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint");
- Assert.assertEquals(1, discriptors.size());
- discriptors =
- discover.getServiceDeclarations("notthere");
- Assert.assertEquals(0, discriptors.size());
- }
-
- @Test
- public void testDiscoveryFirst() throws IOException {
- ServiceDeclaration descriptor =
- discover.getFirstServiceDeclaration("org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint");
- Assert.assertNotNull(descriptor);
- descriptor = discover.getFirstServiceDeclaration("notthere");
- Assert.assertNull(descriptor);
- }
-
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/DefaultExtensionPointRegistryTestCase.java b/tags/java/sca/2.0-M1/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/DefaultExtensionPointRegistryTestCase.java
deleted file mode 100644
index 9758cba3b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/DefaultExtensionPointRegistryTestCase.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility;
-
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.junit.Before;
-import org.junit.Test;
-
-public class DefaultExtensionPointRegistryTestCase {
- private ExtensionPointRegistry registry;
-
- @Before
- public void setUp() throws Exception {
- registry = new DefaultExtensionPointRegistry();
- }
-
- @Test
- public void testRegistry() {
- MyExtensionPoint service = new MyExtensionPointImpl();
- registry.addExtensionPoint(service);
- assertSame(service, registry.getExtensionPoint(MyExtensionPoint.class));
- registry.removeExtensionPoint(service);
- assertNull(registry.getExtensionPoint(MyExtensionPoint.class));
- }
-
- public static interface MyExtensionPoint {
- void doSomething();
- }
-
- private static class MyExtensionPointImpl implements MyExtensionPoint {
-
- public void doSomething() {
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-http/LICENSE b/tags/java/sca/2.0-M1/modules/host-http/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/host-http/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/host-http/META-INF/MANIFEST.MF
deleted file mode 100644
index 1c4e6bf2cc..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.host.http;uses:="javax.servlet,
- javax.servlet.http";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA HTTP Servlet Host Extension Point
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397255593
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA HTTP Servlet Host Extension Poi
- nt
-Import-Package: javax.servlet,javax.servlet.http,org.apache.tuscany.sc
- a.host.http;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.host.http
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/host-http/NOTICE b/tags/java/sca/2.0-M1/modules/host-http/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/host-http/pom.xml b/tags/java/sca/2.0-M1/modules/host-http/pom.xml
deleted file mode 100644
index 4df5d3135c..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-host-http</artifactId>
- <name>Apache Tuscany SCA HTTP Servlet Host Extension Point</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultResourceServlet.java b/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultResourceServlet.java
deleted file mode 100644
index 3de0b9f5a7..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultResourceServlet.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.http;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-import java.net.URLDecoder;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * A minimal implementation of a Servlet that serves documents in a document root
- * directory.
- *
- * A Servlet host implementation is not required to use this implementation and can map
- * the URI and document root to a more complete and more efficient implementation of
- * a resource Servlet, for example the Tomcat or Jetty default Servlets.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultResourceServlet extends HttpServlet implements Servlet {
- private static final long serialVersionUID = 2865466417329430610L;
-
- private String documentRoot;
-
- /**
- * Constructs a new ResourceServlet
- * @param documentRoot the document root
- */
- public DefaultResourceServlet(String documentRoot) {
- this.documentRoot = documentRoot;
- }
-
- /**
- * Returns the document root.
- * @return the document root
- */
- public String getDocumentRoot() {
- return documentRoot;
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // Determine the resource path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.startsWith("/")) {
- path = path.substring(1);
- }
- URL url = new URL(documentRoot + '/' + path);
-
- // Write the resource
- InputStream is = url.openStream();
- OutputStream os = response.getOutputStream();
- byte[] buffer = new byte[2048];
- for (;;) {
- int n = is.read(buffer);
- if (n <= 0)
- break;
- os.write(buffer, 0, n);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java b/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java
deleted file mode 100644
index 5e6de0b29b..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.http;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Default implementation of a Servlet host extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultServletHostExtensionPoint implements ServletHostExtensionPoint {
-
- private List<ServletHost> servletHosts = new ArrayList<ServletHost>();
-
- public void addServletHost(ServletHost servletHost) {
- servletHosts.add(servletHost);
- }
-
- public void removeServletHost(ServletHost servletHost) {
- servletHosts.remove(servletHost);
- }
-
- public List<ServletHost> getServletHosts() {
- return servletHosts;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java b/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java
deleted file mode 100644
index 4be5de4100..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.http;
-
-import java.net.URL;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-
-/**
- * Default implementation of an extensible Servlet host.
- *
- * @version $Rev$ $Date$
- */
-public class ExtensibleServletHost implements ServletHost {
-
- private ServletHostExtensionPoint servletHosts;
-
- public ExtensibleServletHost(ServletHostExtensionPoint servletHosts) {
- this.servletHosts = servletHosts;
- }
-
- public void setDefaultPort(int port) {
- if (servletHosts.getServletHosts().isEmpty()) {
- throw new ServletMappingException("No servlet host available");
- }
-
- for (ServletHost servletHost: servletHosts.getServletHosts()) {
- servletHost.setDefaultPort(port);
- }
- }
-
- private ServletHost getDefaultServletHost() {
- return servletHosts.getServletHosts().get(0);
- }
-
- public int getDefaultPort() {
- if (servletHosts.getServletHosts().isEmpty()) {
- throw new ServletMappingException("No servlet host available");
- }
-
- return getDefaultServletHost().getDefaultPort();
- }
-
- public void addServletMapping(String uri, Servlet servlet) throws ServletMappingException {
- if (servletHosts.getServletHosts().isEmpty()) {
- throw new ServletMappingException("No servlet host available");
- }
-
- // TODO implement selection of the correct Servlet host based on the mapping
- // For now just select the first one
- getDefaultServletHost().addServletMapping(uri, servlet);
- }
-
- public Servlet getServletMapping(String uri) throws ServletMappingException {
- if (servletHosts.getServletHosts().isEmpty()) {
- throw new ServletMappingException("No servlet host available");
- }
-
- // TODO implement selection of the correct Servlet host based on the mapping
- // For now just select the first one
- return getDefaultServletHost().getServletMapping(uri);
- }
-
- public Servlet removeServletMapping(String uri) throws ServletMappingException {
- if (servletHosts.getServletHosts().isEmpty()) {
- throw new ServletMappingException("No servlet host available");
- }
-
- // TODO implement selection of the correct Servlet host based on the mapping
- // For now just select the first one
- return getDefaultServletHost().removeServletMapping(uri);
- }
-
- public RequestDispatcher getRequestDispatcher(String uri) throws ServletMappingException {
- if (servletHosts.getServletHosts().isEmpty()) {
- throw new ServletMappingException("No servlet host available");
- }
-
- // TODO implement selection of the correct Servlet host based on the mapping
- // For now just select the first one
- return getDefaultServletHost().getRequestDispatcher(uri);
- }
-
- public String getContextPath() {
- if (servletHosts.getServletHosts().isEmpty()) {
- throw new ServletMappingException("No servlet host available");
- }
-
- // TODO implement selection of the correct Servlet host based on the mapping
- // For now just select the first one
- return getDefaultServletHost().getContextPath();
- }
-
- public URL getURLMapping(String uri) {
- if (servletHosts.getServletHosts().isEmpty()) {
- throw new ServletMappingException("No servlet host available");
- }
-
- return getDefaultServletHost().getURLMapping(uri);
- }
-
- public void setContextPath(String path) {
- getDefaultServletHost().setContextPath(path);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java b/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java
deleted file mode 100644
index e5dbd59a07..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.host.http;
-
-import java.net.URL;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-
-/**
- * Interface implemented by host environments that allow Servlets to be
- * registered.
- * <p/>
- * This interface allows a system service to register a Servlet
- * to handle inbound requests.
- *
- * @version $Rev$ $Date$
- */
-public interface ServletHost {
-
- /**
- * Sets the default port for the server.
- *
- * @param port the default port
- */
- void setDefaultPort(int port);
-
- /**
- * Returns the default port for the server.
- *
- * @return the default port
- */
- int getDefaultPort();
-
- /**
- * Add a mapping for an instance of a Servlet. This requests that the
- * Servlet container direct all requests to the designated mapping to the
- * supplied Servlet instance.
- *
- * @param uri the URI-mapping for the Servlet
- * @param servlet the Servlet that should be invoked
- * @throws ServletMappingException
- */
- void addServletMapping(String uri, Servlet servlet) throws ServletMappingException;
-
- /**
- * Remove a Servlet mapping. This directs the Servlet container not to direct
- * any more requests to a previously registered Servlet.
- *
- * @param uri the URI-mapping for the Servlet
- * @return the Servlet that was registered to the mapping, null if nothing
- * was registered to the mapping
- * @throws ServletMappingException
- */
- Servlet removeServletMapping(String uri) throws ServletMappingException;
-
- /**
- * Returns the Servlet mapped to the given URI.
- *
- * @param uri the URI-mapping for the Servlet
- * @return the Servlet registered with the mapping
- * @throws ServletMappingException
- */
- Servlet getServletMapping(String uri) throws ServletMappingException;
-
- /**
- * Returns a Servlet request dispatcher for the Servlet mapped to the specified URI.
- *
- * @param uri the URI mapped to a Servlet
- * @return a RequestDispatcher that can be used to dispatch requests to
- * that Servlet
- * @throws ServletMappingException
- */
- RequestDispatcher getRequestDispatcher(String uri) throws ServletMappingException;
-
- /**
- * Returns the portion of the request URI that indicates the context of the request
- *
- * @return a String specifying the portion of the request URI that indicates the context of the request
- */
- String getContextPath();
-
- /**
- * Sets the portion of the request URI that indicates the context of the request
- *
- * @param path the context path
- */
- void setContextPath(String path);
-
- /**
- * Returns the complete URL mapped to the specified URI.
- * @return the URL mapped to the specified URI
- */
- URL getURLMapping(String uri);
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostExtensionPoint.java b/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostExtensionPoint.java
deleted file mode 100644
index fbd085ba2b..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostExtensionPoint.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.host.http;
-
-import java.util.List;
-
-/**
- * An extension point for Servlet hosts.
- *
- * @version $Rev$ $Date$
- */
-public interface ServletHostExtensionPoint {
-
- /**
- * Adds a Servlet host extension.
- *
- * @param servletHost
- */
- void addServletHost(ServletHost servletHost);
-
- /**
- * Removes a Servlet host extension.
- *
- * @param servletHost
- */
- void removeServletHost(ServletHost servletHost);
-
- /**
- * Returns a list of Servlet host extensions.
- *
- * @return
- */
- List<ServletHost> getServletHosts();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletMappingException.java b/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletMappingException.java
deleted file mode 100644
index ae66c44c3e..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletMappingException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.host.http;
-
-/**
- * Indicates an exception while registering a Servlet mapping.
- *
- * @version $Rev$ $Date$
- */
-public class ServletMappingException extends RuntimeException {
- private static final long serialVersionUID = 1L;
-
- public ServletMappingException() {
- super();
- }
-
- public ServletMappingException(String message) {
- super(message);
- }
-
- public ServletMappingException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ServletMappingException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.ServletHostExtensionPoint b/tags/java/sca/2.0-M1/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.ServletHostExtensionPoint
deleted file mode 100644
index 44f4550b40..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.http.ServletHostExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.host.http.DefaultServletHostExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/LICENSE b/tags/java/sca/2.0-M1/modules/host-jetty/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/host-jetty/META-INF/MANIFEST.MF
deleted file mode 100644
index deac071675..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,30 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.http.jetty;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Jetty Servlet Host Extension
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397258562
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Jetty Servlet Host Extension
-Import-Package: javax.net.ssl;resolution:=optional,
- javax.servlet,
- javax.servlet.http;resolution:=optional,
-
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.host.http;version="2.0.0",
- org.apache.tuscany.sca.work;version="2.0.0",
- org.mortbay.component;version="6.1.7",
- org.mortbay.jetty;version="6.1.7",
- org.mortbay.jetty.handler;version="6.1.7",
- org.mortbay.jetty.nio;version="6.1.7",
- org.mortbay.jetty.security;version="6.1.7",
- org.mortbay.jetty.servlet;version="6.1.7",
- org.mortbay.log;version="6.1.7",
- org.mortbay.resource;version="6.1.7",
- org.mortbay.thread;version="6.1.7"
-Bundle-SymbolicName: org.apache.tuscany.sca.host.jetty
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/NOTICE b/tags/java/sca/2.0-M1/modules/host-jetty/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/pom.xml b/tags/java/sca/2.0-M1/modules/host-jetty/pom.xml
deleted file mode 100644
index 41f453e301..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/pom.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-host-jetty</artifactId>
- <name>Apache Tuscany SCA Jetty Servlet Host Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>6.1.7</version>
- <exclusions>
- <exclusion>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>servlet-api-2.5</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>6.1.7</version>
- <exclusions>
- <exclusion>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>servlet-api-2.5</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyDefaultServlet.java b/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyDefaultServlet.java
deleted file mode 100644
index 4f5bfb3c62..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyDefaultServlet.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.http.jetty;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.mortbay.jetty.servlet.DefaultServlet;
-import org.mortbay.resource.Resource;
-import org.mortbay.resource.URLResource;
-
-/**
- * Customizes the Jetty default Servlet.
- *
- * @version $Rev$ $Date$
- */
-public class JettyDefaultServlet extends DefaultServlet {
- private static final long serialVersionUID = 7000218247190209353L;
-
- private String documentRoot;
- private String servletPath;
-
- public JettyDefaultServlet(String servletPath, String documentRoot) {
- this.servletPath = servletPath + '/';
- this.documentRoot = documentRoot;
- }
-
- @Override
- public Resource getResource(String pathInContext) {
- if (pathInContext.startsWith(servletPath)) {
- if (pathInContext.length() > servletPath.length()) {
- pathInContext = pathInContext.substring(servletPath.length());
- } else {
- pathInContext = "";
- }
- } else {
- if ((pathInContext + "/").equals(servletPath)) {
- pathInContext = "";
- }
- }
-
- try {
- URL url = new URL(documentRoot + "/" + pathInContext);
- return new URLResource(url, url.openConnection()) {
- private static final long serialVersionUID = 8560952113883507717L;
-
- @Override
- public File getFile() throws IOException {
- return null;
- }
-
- };
- } catch (MalformedURLException e) {
- return null;
- } catch (IOException e) {
- return null;
- }
- }
-
- @Override
- public String getInitParameter(String name) {
- if ("resourceBase".equals(name)) {
- return documentRoot;
- } else if ("redirectWelcome".equals(name)) {
- return "true";
- } else {
- return super.getInitParameter(name);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyLogger.java b/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyLogger.java
deleted file mode 100644
index 1ecf1bca1b..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyLogger.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.http.jetty;
-
-import org.mortbay.log.Logger;
-
-/**
- * Replaces Jetty's logging mechanism
- *
- * @version $Rev$ $Date$
- */
-public class JettyLogger implements Logger {
-
- private boolean debugEnabled;
-
- public boolean isDebugEnabled() {
- return debugEnabled;
- }
-
- public void setDebugEnabled(boolean debugEnabled) {
- this.debugEnabled = debugEnabled;
- }
-
- public void info(String msg, Object arg0, Object arg1) {
- if (debugEnabled) {
- System.err.println(":INFO: " + format(msg, arg0, arg1));
- }
- }
-
- public void debug(String msg, Throwable th) {
- if (debugEnabled) {
- System.err.println(":DEBUG: " + msg);
- th.printStackTrace();
- }
- }
-
- public void debug(String msg, Object arg0, Object arg1) {
- if (debugEnabled) {
- System.err.println(":DEBUG: " + format(msg, arg0, arg1));
- }
- }
-
- public void warn(String msg, Object arg0, Object arg1) {
- if (debugEnabled) {
- System.err.println(":WARN: " + format(msg, arg0, arg1));
- }
- }
-
- public void warn(String msg, Throwable th) {
- if (debugEnabled) {
- System.err.println(":WARN: " + msg);
- th.printStackTrace();
- }
- }
-
- public Logger getLogger(String name) {
- return this;
- }
-
- private String format(String msg, Object arg0, Object arg1) {
- int i0 = msg.indexOf("{}");
- int i1 = i0 < 0 ? -1 : msg.indexOf("{}", i0 + 2);
- if (arg1 != null && i1 >= 0) {
- msg = msg.substring(0, i1) + arg1 + msg.substring(i1 + 2);
- }
- if (arg0 != null && i0 >= 0) {
- msg = msg.substring(0, i0) + arg0 + msg.substring(i0 + 2);
- }
- return msg;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java b/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java
deleted file mode 100644
index 31c8397f8b..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.http.jetty;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.work.WorkScheduler;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JettyRuntimeModuleActivator implements ModuleActivator {
- private static final Logger logger = Logger.getLogger(JettyRuntimeModuleActivator.class.getName());
-
- private JettyServer server;
-
- public void start(ExtensionPointRegistry extensionPointRegistry) {
-
- // Register a Jetty Servlet host
- ServletHostExtensionPoint servletHosts =
- extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class);
-
- if (servletHosts.getServletHosts().size() < 1) {
- UtilityExtensionPoint utilities = extensionPointRegistry.getExtensionPoint(UtilityExtensionPoint.class);
- final WorkScheduler workScheduler = utilities.getUtility(WorkScheduler.class);
- // Allow privileged access to start MBeans. Requires MBeanPermission in security policy.
- try {
- server = AccessController.doPrivileged(new PrivilegedAction<JettyServer>() {
- public JettyServer run() {
- return new JettyServer(workScheduler);
- }
- });
- servletHosts.addServletHost(server);
- } catch (Exception e) {
- logger.log(Level.WARNING, "Exception creating JettyServer", e);
- }
- }
- }
-
- public void stop(ExtensionPointRegistry registry) {
- // Allow privileged access to stop MBeans. Requires MBeanPermission in security policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- if (server != null) {
- server.stop();
- }
- return null;
- }
- });
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java b/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java
deleted file mode 100644
index dfb34f11a5..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.http.jetty;
-
-import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.security.AccessController;
-import java.security.KeyStore;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-import java.util.logging.Logger;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-
-import org.apache.tuscany.sca.host.http.DefaultResourceServlet;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletMappingException;
-import org.apache.tuscany.sca.work.WorkScheduler;
-import org.mortbay.jetty.Connector;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.handler.ContextHandler;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.security.SslSocketConnector;
-import org.mortbay.jetty.servlet.DefaultServlet;
-import org.mortbay.jetty.servlet.ServletHandler;
-import org.mortbay.jetty.servlet.ServletHolder;
-import org.mortbay.jetty.servlet.ServletMapping;
-import org.mortbay.jetty.servlet.SessionHandler;
-import org.mortbay.thread.ThreadPool;
-
-/**
- * Implements an HTTP transport service using Jetty.
- *
- * @version $Rev$ $Date$
- */
-public class JettyServer implements ServletHost {
- private static final Logger logger = Logger.getLogger(JettyServer.class.getName());
-
- private final Object joinLock = new Object();
- private String trustStore;
- private String truststorePassword;
- private String keyStore;
- private String keyStorePassword;
-
- private String keyStoreType;
- private String trustStoreType;
-
-
- private boolean sendServerVersion;
- private WorkScheduler workScheduler;
- private int defaultPort = 8080;
-
- /**
- * Represents a port and the server that serves it.
- */
- private class Port {
- private Server server;
- private ServletHandler servletHandler;
-
- private Port(Server server, ServletHandler servletHandler) {
- this.server = server;
- this.servletHandler = servletHandler;
- }
-
- public Server getServer() {
- return server;
- }
-
- public ServletHandler getServletHandler() {
- return servletHandler;
- }
- }
-
- private Map<Integer, Port> ports = new HashMap<Integer, Port>();
-
- private String contextPath = "/";
-
- static {
- // Hack to replace the static Jetty logger
- System.setProperty("org.mortbay.log.class", JettyLogger.class.getName());
- }
-
- public JettyServer(WorkScheduler workScheduler) {
- this.workScheduler = workScheduler;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- trustStore = System.getProperty("javax.net.ssl.trustStore");
- truststorePassword = System.getProperty("javax.net.ssl.trustStorePassword");
- keyStore = System.getProperty("javax.net.ssl.keyStore");
- keyStorePassword = System.getProperty("javax.net.ssl.keyStorePassword");
-
- keyStoreType = System.getProperty("javax.net.ssl.keyStoreType", KeyStore.getDefaultType());
- trustStoreType = System.getProperty("javax.net.ssl.trustStoreType", KeyStore.getDefaultType());
- return null;
- }
- });
- }
-
- public void setDefaultPort(int port) {
- defaultPort = port;
- }
-
- public int getDefaultPort() {
- return defaultPort;
- }
-
- public void setSendServerVersion(boolean sendServerVersion) {
- this.sendServerVersion = sendServerVersion;
- }
-
- /**
- * Stop all the started servers.
- */
- public void stop() {
- synchronized (joinLock) {
- joinLock.notifyAll();
- }
- try {
- Set<Entry<Integer, Port>> entries = new HashSet<Entry<Integer, Port>>(ports.entrySet());
- for (Entry<Integer, Port> entry: entries) {
- Port port = entry.getValue();
- port.getServer().stop();
- ports.remove(entry.getKey());
- }
- } catch (Exception e) {
- throw new ServletMappingException(e);
- }
- }
-
- private void configureSSL(SslSocketConnector connector) {
- connector.setProtocol("TLS");
- connector.setKeystore(keyStore);
- connector.setKeyPassword(keyStorePassword);
- connector.setKeystoreType(keyStoreType);
-
- connector.setTruststore(trustStore);
- connector.setTrustPassword(truststorePassword);
- connector.setTruststoreType(trustStoreType);
-
- connector.setPassword(keyStorePassword);
- if (trustStore != null) {
- connector.setNeedClientAuth(true);
- }
-
- }
-
- public void addServletMapping(String suri, Servlet servlet) throws ServletMappingException {
- URI uri = URI.create(suri);
-
- // Get the URI scheme and port
- String scheme = uri.getScheme();
- if (scheme == null) {
- scheme = "http";
- }
- int portNumber = uri.getPort();
- if (portNumber == -1) {
- portNumber = defaultPort;
- }
-
- // Get the port object associated with the given port number
- Port port = ports.get(portNumber);
- if (port == null) {
-
- // Create and start a new server
- try {
- Server server = new Server();
- server.setThreadPool(new WorkSchedulerThreadPool());
- if ("https".equals(scheme)) {
-// Connector httpConnector = new SelectChannelConnector();
-// httpConnector.setPort(portNumber);
- SslSocketConnector sslConnector = new SslSocketConnector();
- sslConnector.setPort(portNumber);
- configureSSL(sslConnector);
- server.setConnectors(new Connector[] {sslConnector});
- } else {
- SelectChannelConnector selectConnector = new SelectChannelConnector();
- selectConnector.setPort(portNumber);
- server.setConnectors(new Connector[] {selectConnector});
- }
-
- ContextHandler contextHandler = new ContextHandler();
- //contextHandler.setContextPath(contextPath);
- contextHandler.setContextPath("/");
- server.setHandler(contextHandler);
-
- SessionHandler sessionHandler = new SessionHandler();
- ServletHandler servletHandler = new ServletHandler();
- sessionHandler.addHandler(servletHandler);
-
- contextHandler.setHandler(sessionHandler);
-
- server.setStopAtShutdown(true);
- server.setSendServerVersion(sendServerVersion);
- server.start();
-
- // Keep track of the new server and Servlet handler
- port = new Port(server, servletHandler);
- ports.put(portNumber, port);
-
- } catch (Exception e) {
- throw new ServletMappingException(e);
- }
- }
-
- // Register the Servlet mapping
- ServletHandler servletHandler = port.getServletHandler();
- ServletHolder holder;
- if (servlet instanceof DefaultResourceServlet) {
-
- // Optimize the handling of resource requests, use the Jetty default Servlet
- // instead of our default resource Servlet
- String servletPath = uri.getPath();
- if (servletPath.endsWith("*")) {
- servletPath = servletPath.substring(0, servletPath.length()-1);
- }
- if (servletPath.endsWith("/")) {
- servletPath = servletPath.substring(0, servletPath.length()-1);
- }
- if (!servletPath.startsWith("/")) {
- servletPath = '/' + servletPath;
- }
-
- DefaultResourceServlet resourceServlet = (DefaultResourceServlet)servlet;
- DefaultServlet defaultServlet = new JettyDefaultServlet(servletPath, resourceServlet.getDocumentRoot());
- holder = new ServletHolder(defaultServlet);
-
- } else {
- holder = new ServletHolder(servlet);
- }
- servletHandler.addServlet(holder);
-
- ServletMapping mapping = new ServletMapping();
- mapping.setServletName(holder.getName());
- String path = uri.getPath();
-
- if (!path.startsWith("/")) {
- path = '/' + path;
- }
-
- if (!path.startsWith(contextPath)) {
- path = contextPath + path;
- }
-
- mapping.setPathSpec(path);
- servletHandler.addServletMapping(mapping);
-
- // Compute the complete URL
- String host;
- try {
- host = InetAddress.getLocalHost().getHostName();
- } catch (UnknownHostException e) {
- host = "localhost";
- }
- URL addedURL;
- try {
- addedURL = new URL(scheme, host, portNumber, path);
- } catch (MalformedURLException e) {
- throw new ServletMappingException(e);
- }
- logger.info("Added Servlet mapping: " + addedURL);
- }
-
- public URL getURLMapping(String suri) throws ServletMappingException {
- URI uri = URI.create(suri);
-
- // Get the URI scheme and port
- String scheme = uri.getScheme();
- if (scheme == null) {
- scheme = "http";
- }
- int portNumber = uri.getPort();
- if (portNumber == -1) {
- portNumber = defaultPort;
- }
-
- // Get the host
- String host;
- try {
- host = InetAddress.getLocalHost().getHostName();
- } catch (UnknownHostException e) {
- host = "localhost";
- }
-
- // Construct the URL
- String path = uri.getPath();
-
-
- if (!path.startsWith("/")) {
- path = '/' + path;
- }
-
- if (!path.startsWith(contextPath)) {
- path = contextPath + path;
- }
-
-
- URL url;
- try {
- url = new URL(scheme, host, portNumber, path);
- } catch (MalformedURLException e) {
- throw new ServletMappingException(e);
- }
- return url;
- }
-
- public Servlet getServletMapping(String suri) throws ServletMappingException {
-
- if (suri == null){
- return null;
- }
-
- URI uri = URI.create(suri);
-
- // Get the URI port
- int portNumber = uri.getPort();
- if (portNumber == -1) {
- portNumber = defaultPort;
- }
-
- // Get the port object associated with the given port number
- Port port = ports.get(portNumber);
- if (port == null) {
- return null;
- }
-
- // Remove the Servlet mapping for the given Servlet
- ServletHandler servletHandler = port.getServletHandler();
- Servlet servlet = null;
- List<ServletMapping> mappings =
- new ArrayList<ServletMapping>(Arrays.asList(servletHandler.getServletMappings()));
- String path = uri.getPath();
-
- if (!path.startsWith("/")) {
- path = '/' + path;
- }
-
- if (!path.startsWith(contextPath)) {
- path = contextPath + path;
- }
-
- for (ServletMapping mapping : mappings) {
- if (Arrays.asList(mapping.getPathSpecs()).contains(path)) {
- try {
- servlet = servletHandler.getServlet(mapping.getServletName()).getServlet();
- } catch (ServletException e) {
- throw new IllegalStateException(e);
- }
- break;
- }
- }
- return servlet;
- }
-
- public Servlet removeServletMapping(String suri) {
- URI uri = URI.create(suri);
-
- // Get the URI port
- int portNumber = uri.getPort();
- if (portNumber == -1) {
- portNumber = defaultPort;
- }
-
- // Get the port object associated with the given port number
- Port port = ports.get(portNumber);
- if (port == null) {
- throw new IllegalStateException("No servlet registered at this URI: " + suri);
- }
-
- // Remove the Servlet mapping for the given Servlet
- ServletHandler servletHandler = port.getServletHandler();
- Servlet removedServlet = null;
- List<ServletMapping> mappings =
- new ArrayList<ServletMapping>(Arrays.asList(servletHandler.getServletMappings()));
- String path = uri.getPath();
-
- if (!path.startsWith("/")) {
- path = '/' + path;
- }
-
- if (!path.startsWith(contextPath)) {
- path = contextPath + path;
- }
-
- for (ServletMapping mapping : mappings) {
- if (Arrays.asList(mapping.getPathSpecs()).contains(path)) {
- try {
- removedServlet = servletHandler.getServlet(mapping.getServletName()).getServlet();
- } catch (ServletException e) {
- throw new IllegalStateException(e);
- }
- mappings.remove(mapping);
- logger.info("Removed Servlet mapping: " + path);
- break;
- }
- }
- if (removedServlet != null) {
- servletHandler.setServletMappings(mappings.toArray(new ServletMapping[mappings.size()]));
-
- // Stop the port if there are no servlet mappings on it anymore
- if (mappings.size() == 0) {
- try {
- port.getServer().stop();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- ports.remove(portNumber);
- }
-
- } else {
- logger.warning("Trying to Remove servlet mapping: " + path + " where mapping is not registered");
- }
-
- return removedServlet;
- }
-
- public RequestDispatcher getRequestDispatcher(String suri) throws ServletMappingException {
- //FIXME implement this later
- return null;
- }
-
- public String getContextPath() {
- return contextPath;
- }
-
- public void setContextPath(String path) {
- this.contextPath = path;
- }
-
- /**
- * A wrapper to enable use of a WorkScheduler with Jetty
- */
- private class WorkSchedulerThreadPool implements ThreadPool {
-
- public boolean dispatch(Runnable work) {
- workScheduler.scheduleWork(work);
- return true;
- }
-
- public void join() throws InterruptedException {
- synchronized (joinLock) {
- joinLock.wait();
- }
- }
-
- public int getThreads() {
- throw new UnsupportedOperationException();
- }
-
- public int getIdleThreads() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isLowOnThreads() {
- return false;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/tags/java/sca/2.0-M1/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index e826f5a496..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# Implementation class for the ModuleActivator
-org.apache.tuscany.sca.http.jetty.JettyRuntimeModuleActivator
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java b/tags/java/sca/2.0-M1/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java
deleted file mode 100644
index 020dd4af0e..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.http.jetty;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.ConnectException;
-import java.net.Socket;
-import java.net.URL;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLSession;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.http.DefaultResourceServlet;
-import org.apache.tuscany.sca.work.NotificationListener;
-import org.apache.tuscany.sca.work.WorkScheduler;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JettyServerTestCase extends TestCase {
-
- private static final String REQUEST1_HEADER =
- "GET / HTTP/1.0\n" + "Host: localhost\n"
- + "Content-Type: text/xml\n"
- + "Connection: close\n"
- + "Content-Length: ";
- private static final String REQUEST1_CONTENT = "";
- private static final String REQUEST1 =
- REQUEST1_HEADER + REQUEST1_CONTENT.getBytes().length + "\n\n" + REQUEST1_CONTENT;
-
- private static final String REQUEST2_HEADER =
- "GET /webcontent/test.html HTTP/1.0\n" + "Host: localhost\n"
- + "Content-Type: text/xml\n"
- + "Connection: close\n"
- + "Content-Length: ";
- private static final String REQUEST2_CONTENT = "";
- private static final String REQUEST2 =
- REQUEST2_HEADER + REQUEST2_CONTENT.getBytes().length + "\n\n" + REQUEST2_CONTENT;
-
- private static final int HTTP_PORT = 8085;
-
- private WorkScheduler workScheduler = new WorkScheduler() {
-
- public <T extends Runnable> void scheduleWork(T work) {
- Thread thread = new Thread(work);
- thread.start();
- }
-
- public <T extends Runnable> void scheduleWork(T work, NotificationListener<T> listener) {
- scheduleWork(work);
- }
-
- public void destroy() {
- }
- };
-
- /**
- * Verifies requests are properly routed according to the Servlet mapping
- */
- public void testRegisterServletMapping() throws Exception {
- JettyServer service = new JettyServer(workScheduler);
- TestServlet servlet = new TestServlet();
- service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/", servlet);
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
- read(client);
- service.stop();
- assertTrue(servlet.invoked);
- }
-
- public void testRegisterServletMappingSSL() throws Exception {
- System.setProperty("javax.net.ssl.keyStore", "target/test-classes/tuscany.keyStore");
- System.setProperty("javax.net.ssl.keyStorePassword", "apache");
- System.setProperty("jetty.ssl.password", "apache");
- JettyServer service = new JettyServer(workScheduler);
- TestServlet servlet = new TestServlet();
- try {
- service.addServletMapping("https://127.0.0.1:" + HTTP_PORT + "/foo", servlet);
- } finally {
- System.clearProperty("javax.net.ssl.keyStore");
- System.clearProperty("javax.net.ssl.keyStorePassword");
- System.clearProperty("jetty.ssl.password");
- }
- System.setProperty("javax.net.ssl.trustStore", "target/test-classes/tuscany.keyStore");
- System.setProperty("javax.net.ssl.trustStorePassword", "apache");
- URL url = new URL("https://127.0.0.1:8085/foo");
- HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
- conn.setHostnameVerifier(new HostnameVerifier() {
- public boolean verify(String hostname, SSLSession session) {
- return true;
- }}
- );
-
- conn.connect();
- read(conn.getInputStream());
-
- service.stop();
- assertTrue(servlet.invoked);
-
- }
-
- /**
- * Verifies that Servlets can be registered with multiple ports
- */
- public void testRegisterMultiplePorts() throws Exception {
- JettyServer service = new JettyServer(workScheduler);
- TestServlet servlet = new TestServlet();
- service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/", servlet);
- TestServlet servlet2 = new TestServlet();
- service.addServletMapping("http://127.0.0.1:" + (HTTP_PORT + 1) + "/", servlet2);
- {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
- read(client);
- }
- {
- Socket client = new Socket("127.0.0.1", HTTP_PORT + 1);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
- read(client);
- }
-
- service.stop();
- assertTrue(servlet.invoked);
- assertTrue(servlet2.invoked);
- }
-
- public void testUnregisterMapping() throws Exception {
- JettyServer service = new JettyServer(workScheduler);
- TestServlet servlet = new TestServlet();
- String uri = "http://127.0.0.1:" + HTTP_PORT + "/foo";
- service.addServletMapping(uri, servlet);
- service.removeServletMapping(uri);
- try {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
- read(client);
- fail("Server still bound to port");
- } catch (ConnectException e) {
- }
- service.stop();
- assertFalse(servlet.invoked);
- }
-
- public void testRequestSession() throws Exception {
- JettyServer service = new JettyServer(workScheduler);
- TestServlet servlet = new TestServlet();
- service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/", servlet);
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
- read(client);
- service.stop();
- assertTrue(servlet.invoked);
- assertNotNull(servlet.sessionId);
- }
-
- public void testRestart() throws Exception {
- JettyServer service = new JettyServer(workScheduler);
- service.stop();
- service.stop();
- }
-
- public void testNoMappings() throws Exception {
- JettyServer service = new JettyServer(workScheduler);
- Exception ex = null;
- try {
- new Socket("127.0.0.1", HTTP_PORT);
- } catch (ConnectException e) {
- ex = e;
- }
- assertNotNull(ex);
- service.stop();
- }
-
- public void testResourceServlet() throws Exception {
- JettyServer service = new JettyServer(workScheduler);
-
- String documentRoot = getClass().getClassLoader().getResource("content/test.html").toString();
- documentRoot = documentRoot.substring(0, documentRoot.lastIndexOf('/'));
- DefaultResourceServlet resourceServlet = new DefaultResourceServlet(documentRoot);
- TestResourceServlet servlet = new TestResourceServlet(resourceServlet);
- service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/webcontent/*", servlet);
-
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST2.getBytes());
- os.flush();
-
- String document = read(client);
- assertTrue(document.indexOf("<body><p>hello</body>") != -1);
-
- service.stop();
- }
-
- public void testDefaultServlet() throws Exception {
- JettyServer service = new JettyServer(workScheduler);
-
- String documentRoot = getClass().getClassLoader().getResource("content/test.html").toString();
- documentRoot = documentRoot.substring(0, documentRoot.lastIndexOf('/'));
- DefaultResourceServlet resourceServlet = new DefaultResourceServlet(documentRoot);
- service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/webcontent/*", resourceServlet);
-
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST2.getBytes());
- os.flush();
-
- String document = read(client);
- assertTrue(document.indexOf("<body><p>hello</body>") != -1);
-
- service.stop();
- }
-
- private static String read(Socket socket) throws IOException {
- InputStream is = socket.getInputStream();
- return read(is);
- }
-
- private static String read(InputStream is) throws IOException {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(is));
- StringBuffer sb = new StringBuffer();
- String str;
- while ((str = reader.readLine()) != null) {
- sb.append(str);
- }
- return sb.toString();
- } finally {
- if (reader != null) {
- reader.close();
- }
- }
- }
-
- private class TestServlet extends HttpServlet {
- private static final long serialVersionUID = 1L;
- boolean invoked;
- String sessionId;
-
- @Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
- invoked = true;
- sessionId = req.getSession().getId();
- OutputStream writer = resp.getOutputStream();
- try {
- writer.write("result".getBytes());
- } finally {
- writer.close();
- }
- }
-
- }
-
- private class TestResourceServlet extends HttpServlet {
- private static final long serialVersionUID = 1L;
- private HttpServlet delegate;
-
- public TestResourceServlet(HttpServlet delegate) {
- this.delegate = delegate;
- }
-
- @Override
- public void init() throws ServletException {
- super.init();
- delegate.init();
- }
-
- @Override
- public void init(ServletConfig config) throws ServletException {
- super.init();
- delegate.init(config);
- }
-
- @Override
- protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
- delegate.service(req, resp);
- }
-
- @Override
- public void destroy() {
- super.destroy();
- delegate.destroy();
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/src/test/resources/content/test.html b/tags/java/sca/2.0-M1/modules/host-jetty/src/test/resources/content/test.html
deleted file mode 100644
index f4b79d7f01..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/src/test/resources/content/test.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<body><p>hello</body>
-</html> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/host-jetty/src/test/resources/tuscany.keyStore b/tags/java/sca/2.0-M1/modules/host-jetty/src/test/resources/tuscany.keyStore
deleted file mode 100644
index 7ea23f7ff4..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-jetty/src/test/resources/tuscany.keyStore
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/LICENSE b/tags/java/sca/2.0-M1/modules/host-rmi/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/host-rmi/META-INF/MANIFEST.MF
deleted file mode 100644
index 805cc806c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.host.rmi;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA RMI Host Extension Point
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397321468
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA RMI Host Extension Point
-Import-Package: org.apache.tuscany.sca.host.rmi;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.host.rmi
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/NOTICE b/tags/java/sca/2.0-M1/modules/host-rmi/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/pom.xml b/tags/java/sca/2.0-M1/modules/host-rmi/pom.xml
deleted file mode 100644
index 9c172ba131..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/pom.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHost.java b/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHost.java
deleted file mode 100644
index fe15bb59fe..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHost.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.net.URI;
-import java.rmi.AlreadyBoundException;
-import java.rmi.NotBoundException;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Default implementation of a RMI host.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultRMIHost implements RMIHost {
-
- // Map of RMI registries started and running
- private Map<String, Registry> rmiRegistries;
-
- public DefaultRMIHost() {
- rmiRegistries = new ConcurrentHashMap<String, Registry>();
- /*
- * if (System.getSecurityManager() == null) { System.setSecurityManager(new RMISecurityManager()); }
- */
- }
-
- public void registerService(String uri, Remote serviceObject) throws RMIHostException, RMIHostRuntimeException {
- RMIURI rmiURI = new RMIURI(uri);
-
- Registry registry;
- try {
- registry = rmiRegistries.get(Integer.toString(rmiURI.port));
- if (registry == null) {
- try {
- registry = LocateRegistry.getRegistry(rmiURI.port);
- registry.lookup(rmiURI.serviceName);
- } catch (RemoteException e) {
- registry = LocateRegistry.createRegistry(rmiURI.port);
- } catch (NotBoundException e) {
- // Ignore
- }
- rmiRegistries.put(Integer.toString(rmiURI.port), registry);
- }
- registry.bind(rmiURI.serviceName, serviceObject);
- } catch (AlreadyBoundException e) {
- throw new RMIHostException(e);
- } catch (RemoteException e) {
- RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
- rmiExec.setStackTrace(e.getStackTrace());
- throw rmiExec;
- }
-
- }
-
- public void unregisterService(String uri) throws RMIHostException, RMIHostRuntimeException {
- RMIURI rmiURI = new RMIURI(uri);
-
- try {
- Registry registry = rmiRegistries.get(Integer.toString(rmiURI.port));
- if (registry == null) {
- registry = LocateRegistry.getRegistry(rmiURI.port);
- rmiRegistries.put(Integer.toString(rmiURI.port), registry);
- }
- registry.unbind(rmiURI.serviceName);
- } catch (RemoteException e) {
- RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
- rmiExec.setStackTrace(e.getStackTrace());
- throw rmiExec;
- } catch (NotBoundException e) {
- throw new RMIHostException(e.getMessage());
- }
- }
-
- public Remote findService(String uri) throws RMIHostException, RMIHostRuntimeException {
- RMIURI rmiURI = new RMIURI(uri);
-
- Remote remoteService = null;
- try {
- // Requires permission java.net.SocketPermission "host:port", "connect,accept,resolve"
- // in security policy.
- Registry registry = LocateRegistry.getRegistry(rmiURI.host, rmiURI.port);
-
- if (registry != null) {
- remoteService = registry.lookup(rmiURI.serviceName);
- }
- } catch (RemoteException e) {
- RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
- rmiExec.setStackTrace(e.getStackTrace());
- throw rmiExec;
- } catch (NotBoundException e) {
- throw new RMIHostException(e.getMessage());
- }
- return remoteService;
- }
-
- /**
- * A representation of an RMI URI.
- *
- * rmi://[host][:port][/[object]]
- * rmi:[/][object]
- */
- private static class RMIURI {
- private String host;
- private int port;
- private String serviceName;
-
- private RMIURI(String uriStr) {
- URI uri = URI.create(uriStr);
- host = uri.getHost();
- if (host == null) {
- host = "localhost";
- }
- port = uri.getPort();
- if (port <= 0) {
- port = RMI_DEFAULT_PORT;
- }
- String path = uri.getPath();
- if (path != null && path.charAt(0) == '/') {
- path = path.substring(1);
- }
- serviceName = path;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHostExtensionPoint.java b/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHostExtensionPoint.java
deleted file mode 100644
index 3ac086a2ee..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/DefaultRMIHostExtensionPoint.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.rmi;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Default implementation of an RMI host extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultRMIHostExtensionPoint implements RMIHostExtensionPoint {
-
- private List<RMIHost> rmiHosts = new ArrayList<RMIHost>();
-
- public DefaultRMIHostExtensionPoint() {
- addRMIHost(new DefaultRMIHost());
- }
-
- public void addRMIHost(RMIHost rmiHost) {
- rmiHosts.add(rmiHost);
- }
-
- public void removeRMIHost(RMIHost rmiHost) {
- rmiHosts.remove(rmiHost);
- }
-
- public List<RMIHost> getRMIHosts() {
- return rmiHosts;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java b/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java
deleted file mode 100644
index 29b4e195c7..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/ExtensibleRMIHost.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.rmi;
-
-import java.rmi.Remote;
-
-
-/**
- * Default implementation of an extensible RMI host.
- *
- * @version $Rev$ $Date$
- */
-public class ExtensibleRMIHost implements RMIHost {
-
- private RMIHostExtensionPoint rmiHosts;
-
- public ExtensibleRMIHost(RMIHostExtensionPoint rmiHosts) {
- this.rmiHosts = rmiHosts;
- }
-
- public void registerService(String uri, Remote serviceObject) throws RMIHostException, RMIHostRuntimeException {
- if (rmiHosts.getRMIHosts().isEmpty()) {
- throw new RMIHostException("No RMI host available");
- }
- rmiHosts.getRMIHosts().get(0).registerService(uri, serviceObject);
- }
-
- public void unregisterService(String uri) throws RMIHostException, RMIHostRuntimeException {
- if (rmiHosts.getRMIHosts().isEmpty()) {
- throw new RMIHostException("No RMI host available");
- }
- rmiHosts.getRMIHosts().get(0).unregisterService(uri);
- }
-
- public Remote findService(String uri) throws RMIHostException, RMIHostRuntimeException {
- if (rmiHosts.getRMIHosts().isEmpty()) {
- throw new RMIHostException("No RMI host available");
- }
- return rmiHosts.getRMIHosts().get(0).findService(uri);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHost.java b/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHost.java
deleted file mode 100644
index b95b91f003..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHost.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.host.rmi;
-
-import java.rmi.Remote;
-
-/**
- * RMI Service hosting interface to be implemented by host environments that allows SCA Components
- * to register RMI Services to handle inbound service requests over RMI to SCA Components
- *
- * @version $Rev$ $Date$
- */
-public interface RMIHost {
- int RMI_DEFAULT_PORT = 1099;
-
- /**
- * Register an RMI service with the given name and port
- *
- * @param uri the URI against which the server is to be registered
- * @param serviceObject the server object to be registered
- * @throws RMIHostException
- * @throws RMIHostRuntimeException
- */
- void registerService(String uri, Remote serviceObject) throws RMIHostException, RMIHostRuntimeException;
-
- /**
- * Unregister a service registered under the given service name and port number
- *
- * @param uri the URI of the server
- * @throws RMIHostException
- * @throws RMIHostRuntimeException
- */
- void unregisterService(String uri) throws RMIHostException, RMIHostRuntimeException;
-
- /**
- * find a remote service hosted on the given host, port and service name
- *
- * @param uri the URI of the service
- * @return the RMI server object
- * @throws RMIHostException
- * @throws RMIHostRuntimeException
- */
- Remote findService(String uri) throws RMIHostException, RMIHostRuntimeException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java b/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java
deleted file mode 100644
index 959eb72f6e..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostExtensionPoint.java b/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostExtensionPoint.java
deleted file mode 100644
index 40d6013940..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostExtensionPoint.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.host.rmi;
-
-import java.util.List;
-
-/**
- * An extension point for RMI hosts.
- *
- * @version $Rev$ $Date$
- */
-public interface RMIHostExtensionPoint {
-
- /**
- * Adds a Servlet host extension.
- *
- * @param rmiHost
- */
- void addRMIHost(RMIHost rmiHost);
-
- /**
- * Removes a Servlet host extension.
- *
- * @param rmiHost
- */
- void removeRMIHost(RMIHost rmiHost);
-
- /**
- * Returns a list of Servlet host extensions.
- *
- * @return
- */
- List<RMIHost> getRMIHosts();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java b/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java
deleted file mode 100644
index 998287f998..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/host-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint b/tags/java/sca/2.0-M1/modules/host-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint
deleted file mode 100644
index 014c5391b8..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.host.rmi.DefaultRMIHostExtensionPoint
diff --git a/tags/java/sca/2.0-M1/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java b/tags/java/sca/2.0-M1/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java
deleted file mode 100644
index 88f3e89489..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/host-webapp/LICENSE b/tags/java/sca/2.0-M1/modules/host-webapp/LICENSE
deleted file mode 100644
index 0085d7e5ee..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/LICENSE
+++ /dev/null
@@ -1,241 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-===============================================================================
-
-Apache Tuscany SCA for Java Subcomponents
-=========================================:
-
-The Tuscany SCA for Java release includes a number of subcomponents with
-separate copyright notices and license terms. Your use of the source
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses.
-
-===============================================================================
-The module host-webapp includes files under the following license:
-
-Permission to copy, display and distribute the Service Component Architecture Specification and/or
-portions thereof, without modification, in any medium without fee or royalty is hereby granted, provided
-that you include the following on ALL copies of the Service Component Architecture Specification, or
-portions thereof, that you make:
-
-1. A link or URL to the Service Component Architecture Specification at this location:
-· http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
-
-2. The full text of the copyright notice as shown in the Service Component Architecture Specification.
-
-BEA, Cape Clear, IBM, Interface21, IONA, Oracle, Primeton, Progress Software, Red Hat, Rogue Wave,
-SAP, Siemens, Software AG., Sun, Sybase, TIBCO (collectively, the "Authors") agree to grant you a
-royalty-free license, under reasonable, non-discriminatory terms and conditions to patents that they deem
-necessary to implement the Service Component Architecture Specification.
-THE Service Component Architecture SPECIFICATION IS PROVIDED "AS IS," AND THE
-AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
-REGARDING THIS SPECIFICATION AND THE IMPLEMENTATION OF ITS CONTENTS,
-INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE, NON-INFRINGEMENT OR TITLE.
-THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL
-OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR
-DISTRIBUTION OF THE Service Components Architecture SPECIFICATION.
-The name and trademarks of the Authors may NOT be used in any manner, including advertising or
-publicity pertaining to the Service Component Architecture Specification or its contents without specific,
-
diff --git a/tags/java/sca/2.0-M1/modules/host-webapp/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/host-webapp/META-INF/MANIFEST.MF
deleted file mode 100644
index f5164a6db9..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,39 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.host.webapp;version="2.0.0";
- uses:="javax.naming,
- org.apache.tuscany.sca.host.embedded.impl,
- org.apache.tuscany.sca.host.embedded,
- org.apache.tuscany.sca.core,
- javax.servlet,
- org.apache.tuscany.sca.host.http,
- javax.servlet.http",
- org.apache.tuscany.sca.host.webapp.jsp;version="2.0.0";
- uses:="javax.servlet,
- org.apache.tuscany.sca.host.embedded,
- javax.servlet.jsp.tagext,
- org.apache.tuscany.sca.host.webapp,
- org.oasisopen.sca,
- javax.servlet.jsp"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Webapp Host
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1222833658000
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Webapp Host
-Import-Package: javax.naming,
- javax.servlet,
- javax.servlet.http,
- javax.servlet.jsp,
- javax.servlet.jsp.tagext,
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.host.http;version="2.0.0",
- org.apache.tuscany.sca.host.webapp;version="2.0.0",
- org.apache.tuscany.sca.host.webapp.jsp;version="2.0.0",
- org.apache.tuscany.sca.node;version="2.0.0",
- org.oasisopen.sca;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.host.webapp
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/host-webapp/NOTICE b/tags/java/sca/2.0-M1/modules/host-webapp/NOTICE
deleted file mode 100644
index d989435591..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/NOTICE
+++ /dev/null
@@ -1,12 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software under the Service Component Architecture specification license
-(see the LICENSE file contained in this distribution) with the following copyright
-
-(c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA
-Technologies, Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens
-AG., Software AG., Sun Microsystems, Inc., Sybase Inc., TIBCO Software Inc., 2005, 2008. All rights reserved.
diff --git a/tags/java/sca/2.0-M1/modules/host-webapp/pom.xml b/tags/java/sca/2.0-M1/modules/host-webapp/pom.xml
deleted file mode 100644
index f6fe4ea16f..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-host-webapp</artifactId>
- <name>Apache Tuscany SCA Webapp Host</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace-impl</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <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>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java b/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java
deleted file mode 100644
index cb4369fc01..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/TuscanyServletFilter.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.webapp;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterConfig;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.tuscany.sca.host.http.ServletHost;
-
-/**
- * A Servlet filter that forwards service requests to the Servlets registered with
- * the Tuscany ServletHost.
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyServletFilter implements Filter {
- private static final long serialVersionUID = 1L;
- //private static final Logger logger = Logger.getLogger(WebAppServletHost.class.getName());
-
- private static Map<ClassLoader, ServletHost> servletHosts =
- Collections.synchronizedMap(new WeakHashMap<ClassLoader, ServletHost>());
-
- // [REVIEW] Assume the filter class is per webapp
- private static WebAppServletHost servletHost;
-
- // Test if the servletHost == null to know if the filter is called (webapp)
- static ServletHost getServletHost() {
- return servletHosts.get(Thread.currentThread().getContextClassLoader());
- }
-
- public void init(final FilterConfig config) throws ServletException {
- // TODO: must be a better way to get this than using a static
- servletHost = new WebAppServletHost();
- servletHosts.put(Thread.currentThread().getContextClassLoader(), servletHost);
-
- // Initialize the Servlet host
- servletHost.init(new ServletConfig() {
- public String getInitParameter(String name) {
- return config.getInitParameter(name);
- }
-
- public Enumeration getInitParameterNames() {
- return config.getInitParameterNames();
- }
-
- public ServletContext getServletContext() {
- return config.getServletContext();
- }
-
- public String getServletName() {
- return config.getFilterName();
- }
- });
- }
-
- public void destroy() {
- if (servletHost != null) {
- servletHost.destroy();
- servletHost = null;
- servletHosts.remove(Thread.currentThread().getContextClassLoader());
- }
- }
-
- public void doFilter(ServletRequest request, ServletResponse response, javax.servlet.FilterChain chain)
- throws IOException, ServletException {
-
- // Get the Servlet path
- HttpServletRequest httpRequest = (HttpServletRequest)request;
- String path = httpRequest.getPathInfo();
- if (path == null) {
- path = httpRequest.getServletPath();
- }
- if (path == null) {
- path = "/";
- }
-
- // Get a request dispatcher for the Servlet mapped to that path
- RequestDispatcher dispatcher = servletHost.getRequestDispatcher(path);
- if (dispatcher != null) {
-
- // Let the dispatcher forward the request to the Servlet
- dispatcher.forward(request, response);
-
- } else {
-
- // Proceed down the filter chain
- chain.doFilter(request, response);
-
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppModuleActivator.java b/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppModuleActivator.java
deleted file mode 100644
index 1b39b32d75..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppModuleActivator.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.webapp;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-
-/**
- * Activates the webapp host by registering the webapp ServletHost impl
- *
- * @version $Rev$ $Date$
- */
-public class WebAppModuleActivator implements ModuleActivator {
-
- public void start(ExtensionPointRegistry extensionPointRegistry) {
-
- ServletHostExtensionPoint servletHosts =
- extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class);
-
- List<ServletHost> hosts = servletHosts.getServletHosts();
- ServletHost host = null;
- try {
- host = TuscanyServletFilter.getServletHost();
- } catch (NoClassDefFoundError e) {
- // ignore
- }
- if (host != null) {
- hosts.clear();
- hosts.add(host);
- }
- }
-
- public void stop(ExtensionPointRegistry registry) {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppRequestDispatcher.java b/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppRequestDispatcher.java
deleted file mode 100644
index f14dfac58b..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppRequestDispatcher.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.webapp;
-
-import java.io.IOException;
-import java.util.StringTokenizer;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-
-/**
- * A Servlet request dispatcher that can be used to delegate requests to a
- * Servlet registered with the Webapp Servlet host.
- *
- * @version $Rev$ $Date$
- */
-class WebAppRequestDispatcher implements RequestDispatcher {
- private String servletPath;
- private Servlet servlet;
-
- public WebAppRequestDispatcher(String mapping, Servlet servlet) {
- if (mapping.endsWith("*")) {
- mapping = mapping.substring(0, mapping.length()-1);
- }
- if (mapping.endsWith("/")) {
- mapping = mapping.substring(0, mapping.length()-1);
- }
- this.servletPath = mapping;
- this.servlet = servlet;
- }
-
- /**
- * Returns a request wrapper which will return the correct Servlet path
- * and path info.
- *
- * @param request
- * @return
- */
- private HttpServletRequest createRequestWrapper(ServletRequest request) {
- HttpServletRequest requestWrapper = new HttpServletRequestWrapper((HttpServletRequest)request) {
-
- @Override
- public String getServletPath() {
- return servletPath;
- }
-
- @Override
- public String getPathInfo() {
- String path = super.getServletPath();
- if (path.length() == 0) {
- path = super.getPathInfo();
- }
-
- // TODO: another context path hack, revisit when context path is sorted out
- path = fiddlePath(path, servletPath);
-
- return path;
- }
- };
- return requestWrapper;
- }
-
- /**
- * Remove any path suffix thats part of the Servlet context path
- */
- protected String fiddlePath(String path, String servletPath) {
- StringTokenizer st = new StringTokenizer(path, "/");
- if (st.countTokens() == 1) {
- return path;
- }
- String root = "";
- while (st.hasMoreTokens()){
- String s = st.nextToken();
- if (servletPath.endsWith((root + "/" + s))) {
- root += "/" + s;
- } else {
- break;
- }
- }
- String fiddlePath = path.substring(root.length());
- return fiddlePath;
- }
-
- public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException {
- servlet.service(createRequestWrapper(request), response);
- }
-
- public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException {
- servlet.service(createRequestWrapper(request), response);
- }
-}
-
diff --git a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java b/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
deleted file mode 100644
index 118403fd67..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.lang.reflect.Method;
-import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletMappingException;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * ServletHost implementation for use in a webapp environment.
- *
- * FIXME: using a static singleton seems a big hack but how should it be shared?
- * Need some way for TuscanyServlet to pull it out.
- *
- * @version $Rev$ $Date$
- */
-public class WebAppServletHost implements ServletHost {
- private static final Logger logger = Logger.getLogger(WebAppServletHost.class.getName());
-
- public static final String SCA_NODE_ATTRIBUTE = Node.class.getName();
-
- private static final WebAppServletHost instance = new WebAppServletHost();
-
- private Map<String, Servlet> servlets;
- private Node node;
- private String contextPath = "/";
- private int defaultPortNumber = 8080;
- private String contributionRoot;
-
- private ServletContext servletContext;
-
- WebAppServletHost() {
- servlets = new HashMap<String, Servlet>();
- }
-
- public void setDefaultPort(int port) {
- defaultPortNumber = port;
- }
-
- public int getDefaultPort() {
- return defaultPortNumber;
- }
-
- public void addServletMapping(String suri, Servlet servlet) throws ServletMappingException {
- URI pathURI = URI.create(suri);
-
- // Make sure that the path starts with a /
- suri = pathURI.getPath();
- if (!suri.startsWith("/")) {
- suri = '/' + suri;
- }
-
- if (!suri.startsWith(contextPath)) {
- suri = contextPath + suri;
- }
-
- // In a webapp just use the given path and ignore the host and port
- // as they are fixed by the Web container
- servlets.put(suri, servlet);
-
- logger.info("Added Servlet mapping: " + suri);
- }
-
- public Servlet removeServletMapping(String suri) throws ServletMappingException {
- URI pathURI = URI.create(suri);
-
- // Make sure that the path starts with a /
- suri = pathURI.getPath();
- if (!suri.startsWith("/")) {
- suri = '/' + suri;
- }
-
- if (!suri.startsWith(contextPath)) {
- suri = contextPath + suri;
- }
-
- // In a webapp just use the given path and ignore the host and port
- // as they are fixed by the Web container
- return servlets.remove(suri);
- }
-
- public Servlet getServletMapping(String suri) throws ServletMappingException {
- if (!suri.startsWith("/")) {
- suri = '/' + suri;
- }
-
- if (!suri.startsWith(contextPath)) {
- suri = contextPath + suri;
- }
-
- // Get the Servlet mapped to the given path
- Servlet servlet = servlets.get(suri);
- return servlet;
- }
-
- public URL getURLMapping(String suri) throws ServletMappingException {
- URI uri = URI.create(suri);
-
- // Get the URI scheme and port
- String scheme = uri.getScheme();
- if (scheme == null) {
- scheme = "http";
- }
- int portNumber = uri.getPort();
- if (portNumber == -1) {
- portNumber = defaultPortNumber;
- }
-
- // Get the host
- String host;
- try {
- host = InetAddress.getLocalHost().getHostName();
- } catch (UnknownHostException e) {
- host = "localhost";
- }
-
- // Construct the URL
- String path = uri.getPath();
- if (!path.startsWith("/")) {
- path = '/' + path;
- }
-
- if (contextPath != null && !path.startsWith(contextPath)) {
- path = contextPath + path;
- }
-
- URL url;
- try {
- url = new URL(scheme, host, portNumber, path);
- } catch (MalformedURLException e) {
- throw new ServletMappingException(e);
- }
- return url;
- }
-
- public RequestDispatcher getRequestDispatcher(String suri) throws ServletMappingException {
-
- // Make sure that the path starts with a /
- if (!suri.startsWith("/")) {
- suri = '/' + suri;
- }
-
- suri = contextPath + suri;
-
- // Get the Servlet mapped to the given path
- Servlet servlet = servlets.get(suri);
- if (servlet != null) {
- return new WebAppRequestDispatcher(suri, servlet);
- }
-
- for (Map.Entry<String, Servlet> entry : servlets.entrySet()) {
- String servletPath = entry.getKey();
- if (servletPath.endsWith("*")) {
- servletPath = servletPath.substring(0, servletPath.length() - 1);
- if (suri.startsWith(servletPath)) {
- // entry key is contextPath/servletPath, WebAppRequestDispatcher only wants servletPath
- return new WebAppRequestDispatcher(entry.getKey().substring(contextPath.length()), entry.getValue());
- } else {
- if ((suri + "/").startsWith(servletPath)) {
- return new WebAppRequestDispatcher(entry.getKey().substring(contextPath.length()), entry.getValue());
- }
- }
- }
- }
-
- // No Servlet found
- return null;
- }
-
- public static WebAppServletHost getInstance() {
- return instance;
- }
-
- public void init(ServletConfig config) throws ServletException {
-
- servletContext = config.getServletContext();
- if (servletContext.getAttribute(SCA_NODE_ATTRIBUTE) == null) {
- initContextPath(config);
- contributionRoot = getContributionRoot(servletContext);
- NodeFactory factory = NodeFactory.newInstance();
- node = factory.createNode("WEB-INF/web.composite", new Contribution(contributionRoot, contributionRoot));
- node.start();
- servletContext.setAttribute(SCA_NODE_ATTRIBUTE, node);
- }
-
- // Initialize the registered Servlets
- for (Servlet servlet : servlets.values()) {
- servlet.init(config);
- }
-
- }
-
- protected String getContributionRoot(ServletContext servletContext) {
- String contributionRoot = null;
- try {
-
- InitialContext ic = new InitialContext();
- URL repoURL = (URL)ic.lookup("java:comp/env/url/contributions");
-
- contributionRoot = repoURL.toString();
-
- } catch (NamingException e) {
-
- // ignore exception and use default location
-
- try {
-
- String root = servletContext.getInitParameter("contributionRoot");
- if (root == null || root.length() < 1) {
- root = "/";
- }
- URL rootURL = servletContext.getResource(root);
- if (rootURL.getProtocol().equals("jndi")) {
- //this is Tomcat case, we should use getRealPath
- File warRootFile = new File(servletContext.getRealPath(root));
- contributionRoot = warRootFile.toURI().toString();
- } else {
- //this is Jetty case
- contributionRoot = rootURL.toString();
- }
-
- } catch (MalformedURLException mf) {
- //ignore, pass null
- }
- }
-
- return contributionRoot;
- }
-
- /**
- * Initializes the contextPath
- * The 2.5 Servlet API has a getter for this, for pre 2.5 Servlet
- * containers use an init parameter.
- */
- @SuppressWarnings("unchecked")
- public void initContextPath(ServletConfig config) {
-
- if (Collections.list(config.getInitParameterNames()).contains("contextPath")) {
- contextPath = config.getInitParameter("contextPath");
- } else {
- // The getContextPath() is introduced since Servlet 2.5
- ServletContext context = config.getServletContext();
- try {
- // Try to get the method anyway since some ServletContext impl has this method even before 2.5
- Method m = context.getClass().getMethod("getContextPath", new Class[] {});
- contextPath = (String)m.invoke(context, new Object[] {});
- } catch (Exception e) {
- logger.warning("Servlet level is: " + context.getMajorVersion() + "." + context.getMinorVersion());
- throw new IllegalStateException("'contextPath' init parameter must be set for pre-2.5 servlet container");
- }
- }
-
- logger.info("ContextPath: " + contextPath);
- }
-
- void destroy() {
-
- // Destroy the registered Servlets
- for (Servlet servlet : servlets.values()) {
- servlet.destroy();
- }
-
- // Close the SCA domain
- if (node != null) {
- node.stop();
- }
- }
-
- public String getContextPath() {
- return contextPath;
- }
-
- public void setContextPath(String path) {
- // if (!contextPath.equals(path)) {
- // throw new IllegalArgumentException("invalid context path for webapp, existing context path: " + contextPath + " new contextPath: " + path);
- // }
- }
-
- /**
- * TODO: How context paths work is still up in the air so for now
- * this hacks in a path that gets some samples working
- * can't use setContextPath as NodeImpl calls that later
- */
- public void setContextPath2(String path) {
- if (path != null && path.length() > 0) {
- this.contextPath = path;
- }
- }
-
- public String getContributionRoot() {
- return contributionRoot;
- }
-
- public void setAttribute(String name, Object value) {
- servletContext.setAttribute(name, value);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTEI.java b/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTEI.java
deleted file mode 100644
index 6e1b187a48..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTEI.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.webapp.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/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTag.java b/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTag.java
deleted file mode 100644
index 555ad16cd8..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/jsp/ReferenceTag.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.webapp.jsp;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.PageContext;
-import javax.servlet.jsp.tagext.TagSupport;
-
-import org.apache.tuscany.sca.host.webapp.WebAppServletHost;
-import org.apache.tuscany.sca.node.Node;
-import org.oasisopen.sca.ComponentContext;
-
-/**
- * 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 {
-
- try {
- WebAppServletHost.getInstance().init(pageContext.getServletConfig());
- } catch (ServletException e) {
- throw new JspException("Exception initializing Tuscany webapp: " + e, e);
- }
-
- ServletContext servletContext = pageContext.getServletContext();
- ComponentContext componentContext = (ComponentContext)servletContext.getAttribute("org.oasisopen.sca.ComponentContext");
- Node scaDomain = null;
- if (componentContext == null) {
- scaDomain = (Node)servletContext.getAttribute(WebAppServletHost.SCA_NODE_ATTRIBUTE);
- if (scaDomain == null) {
- throw new JspException("SCADomain is null. Check Tuscany configuration in web.xml");
- }
- }
-
- Class<?> typeClass;
- try {
- typeClass = Class.forName(type, true, Thread.currentThread().getContextClassLoader());
- } catch (ClassNotFoundException e) {
- throw new JspException("Reference '" + name + "' type class not found: " + type);
- }
-
- Object o;
- try {
- if (componentContext != null) {
- o = componentContext.getService(typeClass, name);
- } else {
- o = scaDomain.getService(typeClass, name);
- }
- } catch (Exception e) {
- throw new JspException("Exception getting service for reference'" + name + "': " + e, e);
- }
- if (o == null) {
- throw new JspException("Reference '" + name + "' not found");
- }
-
- pageContext.setAttribute(name, o, 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/tags/java/sca/2.0-M1/modules/host-webapp/src/main/resources/META-INF/sca.tld b/tags/java/sca/2.0-M1/modules/host-webapp/src/main/resources/META-INF/sca.tld
deleted file mode 100644
index 91ee6cb922..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/resources/META-INF/sca.tld
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version = '1.0' encoding = 'ISO-8859-1'?>
-<!--
-(c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA
-Technologies, Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens
-AG., Software AG., Sun Microsystems, Inc., Sybase Inc., TIBCO Software Inc., 2005, 2008. All rights reserved.
-
-see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- -->
-
-<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd">
-
-<taglib version="2.1">
-
- <tlib-version>1.0</tlib-version>
- <short-name>SCA-JSP</short-name>
- <uri>http://www.osoa.org/sca/sca_jsp.tld</uri>
- <description>A tag library for integrating sca components with jsp</description>
-
- <tag>
-
- <name>reference</name>
-
- <tag-class>org.apache.tuscany.sca.host.webapp.jsp.ReferenceTag</tag-class>
- <tei-class>org.apache.tuscany.sca.host.webapp.jsp.ReferenceTEI</tei-class>
-
- <attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- </attribute>
-
- <attribute>
- <name>type</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.String</type>
- </attribute>
-
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <type>java.lang.Integer</type>
- </attribute>
-
- <body-content>empty</body-content>
-
- </tag>
-
-</taglib>
diff --git a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/tags/java/sca/2.0-M1/modules/host-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index d99fdf257e..0000000000
--- a/tags/java/sca/2.0-M1/modules/host-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# Implementation class for the ModuleActivator
-org.apache.tuscany.sca.host.webapp.WebAppModuleActivator
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/LICENSE b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/META-INF/MANIFEST.MF
deleted file mode 100644
index eb643084fb..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,61 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.implementation.java.context;use
- s:="org.apache.tuscany.sca.core.context,org.apache.tuscany.sca.core.f
- actory,org.apache.tuscany.sca.implementation.java,org.apache.tuscany.
- sca.core.scope,org.apache.tuscany.sca.implementation.java.injection";
- version="2.0.0",org.apache.tuscany.sca.implementation.java.injection;us
- es:="org.apache.tuscany.sca.databinding,org.apache.tuscany.sca.databi
- nding.xml,org.apache.tuscany.sca.runtime,org.apache.tuscany.sca.inter
- facedef.util,org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.c
- ontext,org.apache.tuscany.sca.databinding.impl,org.apache.tuscany.sca
- .core.context,org.apache.tuscany.sca.implementation.java.introspect,o
- rg.apache.tuscany.sca.implementation.java,org.apache.tuscany.sca.inte
- rfacedef,org.w3c.dom,javax.xml.namespace,org.apache.tuscany.sca.invoc
- ation,org.apache.tuscany.sca.core.factory,org.apache.tuscany.sca.inte
- rfacedef.impl,org.oasisopen.sca,org.apache.tuscany.sca.core.invocation";ve
- rsion="2.0.0"
-Private-Package: org.apache.tuscany.sca.implementation.java.invocation
- ;version="2.0.0",org.apache.tuscany.sca.implementation.java.module;vers
- ion="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Java Implementation Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397187218
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Java Implementation Model
-Import-Package: javax.xml.namespace,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.context;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.core.context;version="2.0.0",
- org.apache.tuscany.sca.core.factory;version="2.0.0",
- org.apache.tuscany.sca.core.invocation;version="2.0.0",
- org.apache.tuscany.sca.core.scope;version="2.0.0",
- org.apache.tuscany.sca.databinding;version="2.0.0",
- org.apache.tuscany.sca.databinding.impl;version="2.0.0",
- org.apache.tuscany.sca.databinding.xml;version="2.0.0",
- org.apache.tuscany.sca.implementation.java;version="2.0.0",
- org.apache.tuscany.sca.implementation.java.context;version="2.0.0",
- org.apache.tuscany.sca.implementation.java.injection;version="2.0.0",
- org.apache.tuscany.sca.implementation.java.introspect;version="2.0.0",
- org.apache.tuscany.sca.implementation.java.invocation;resolution:=optional,
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.policy.util;version="2.0.0",
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.oasisopen.sca;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0",
- org.w3c.dom
-Bundle-SymbolicName: org.apache.tuscany.sca.implementation.java.runtim
- e
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/NOTICE b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/pom.xml b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/pom.xml
deleted file mode 100644
index 59cab81c7e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <name>Apache Tuscany SCA Implementation Java Runtime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/InstanceFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/InstanceFactory.java
deleted file mode 100644
index e2d99852d8..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/InstanceFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.context;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-
-/**
- * Interface for a factory that returns an injected component instance.
- * This is used by a Component implementation to create new instances of
- * application implementation objects as determined by the component scope's
- * lifecycle.
- * <p/>
- * The implementation of this interface may be supplied by the user,
- * may be generated during deployment, or may be dynamic.
- *
- * @version $Rev$ $Date$
- * @param <T> Type of the instance generated by the factory.
- */
-public interface InstanceFactory<T> {
- /**
- * Creates a new instance of the component.
- * All injected values must be set but any @Init methods must not have been invoked.
- *
- * @return A wrapper for the created component instance.
- */
- InstanceWrapper<T> newInstance();
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/InstanceFactoryProvider.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/InstanceFactoryProvider.java
deleted file mode 100644
index df21e013f1..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/InstanceFactoryProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.context;
-
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface InstanceFactoryProvider<T> {
- /**
- * Return the implementation class.
- *
- * @return the implementation class.
- */
- Class<T> getImplementationClass();
-
- /**
- * Sets an object factory for an injection site
- *
- * @param element the injection site name
- * @param objectFactory the object factory
- */
- void setObjectFactory(JavaElementImpl element, ObjectFactory<?> objectFactory);
-
- /**
- * Create an instance factory that can be used to create component instances.
- *
- * @return a new instance factory
- */
- InstanceFactory<T> createFactory();
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceFactory.java
deleted file mode 100644
index 73b7990a79..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceFactory.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.context;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.implementation.java.injection.Injector;
-import org.apache.tuscany.sca.implementation.java.invocation.EventInvoker;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ReflectiveInstanceFactory<T> implements InstanceFactory<T> {
- private final Constructor<T> ctr;
- private final ObjectFactory<?>[] ctrArgs;
- private final Injector<T>[] injectors;
- private final EventInvoker<T> initInvoker;
- private final EventInvoker<T> destroyInvoker;
-
- public ReflectiveInstanceFactory(Constructor<T> ctr,
- ObjectFactory<?>[] ctrArgs,
- Injector<T>[] injectors,
- EventInvoker<T> initInvoker,
- EventInvoker<T> destroyInvoker) {
- this.ctr = ctr;
- this.ctrArgs = ctrArgs;
- this.injectors = injectors;
- this.initInvoker = initInvoker;
- this.destroyInvoker = destroyInvoker;
- }
-
- public InstanceWrapper<T> newInstance() {
- T instance;
- try {
- if (ctrArgs != null) {
- Object[] args = new Object[ctrArgs.length];
- for (int i = 0; i < args.length; i++) {
- args[i] = ctrArgs[i].getInstance();
- }
- instance = ctr.newInstance(args);
- } else {
- instance = ctr.newInstance();
- }
- } catch (InstantiationException e) {
- String name = ctr.getDeclaringClass().getName();
- throw new AssertionError("Class is not instantiable [" + name + "]");
- } catch (IllegalAccessException e) {
- String name = ctr.getName();
- throw new AssertionError("Constructor is not accessible [" + name + "]");
- } catch (
- InvocationTargetException e) {
- String name = ctr.getName();
- throw new ObjectCreationException("Exception thrown by constructor: " + name, e);
- }
-
- if (injectors != null) {
- for (Injector<T> injector : injectors) {
- //FIXME Injectors should never be null
- if (injector != null)
- injector.inject(instance);
- }
- }
-
- return new ReflectiveInstanceWrapper<T>(instance, initInvoker, destroyInvoker);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapper.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapper.java
deleted file mode 100644
index aeaf60e957..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapper.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.context;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.scope.TargetDestructionException;
-import org.apache.tuscany.sca.core.scope.TargetInitializationException;
-import org.apache.tuscany.sca.implementation.java.invocation.EventInvoker;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ReflectiveInstanceWrapper<T> implements InstanceWrapper<T> {
- private final EventInvoker<T> initInvoker;
- private final EventInvoker<T> destroyInvoker;
- private final T instance;
-
- public ReflectiveInstanceWrapper(T instance, EventInvoker<T> initInvoker, EventInvoker<T> destroyInvoker) {
- this.instance = instance;
- this.initInvoker = initInvoker;
- this.destroyInvoker = destroyInvoker;
- }
-
- public T getInstance() {
- return instance;
- }
-
- public void start() throws TargetInitializationException {
- if (initInvoker != null) {
- initInvoker.invokeEvent(instance);
- }
- }
-
- public void stop() throws TargetDestructionException {
- if (destroyInvoker != null) {
- destroyInvoker.invokeEvent(instance);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ArrayMultiplicityObjectFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ArrayMultiplicityObjectFactory.java
deleted file mode 100644
index 2513c63e38..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ArrayMultiplicityObjectFactory.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import java.lang.reflect.Array;
-import java.util.List;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-
-/**
- * Resolves targets configured in a multiplicity by delegating to object factories and returning an <code>Array</code>
- * containing object instances
- *
- * @version $Rev$ $Date$
- */
-public class ArrayMultiplicityObjectFactory implements ObjectFactory<Object> {
-
- private ObjectFactory[] factories;
-
- private Class interfaceType;
-
- public ArrayMultiplicityObjectFactory(Class interfaceType, List<ObjectFactory<?>> factories) {
- assert interfaceType != null : "Interface type was null";
- assert factories != null : "Object factories were null";
- this.interfaceType = interfaceType;
- this.factories = factories.toArray(new ObjectFactory[factories.size()]);
- }
-
- public Object getInstance() throws ObjectCreationException {
- Object array = Array.newInstance(interfaceType, factories.length);
- for (int i = 0; i < factories.length; i++) {
- Array.set(array, i, factories[i].getInstance());
- }
- return array;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ContextInjector.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ContextInjector.java
deleted file mode 100644
index d8eef18c74..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ContextInjector.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-
-/**
- * Implementations inject a pre-configured context type (interface) on an instance.
- *
- * @version $Rev$ $Date$
- */
-public interface ContextInjector<S, T> extends Injector<T> {
-
- void setContext(S context) throws ObjectCreationException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java
deleted file mode 100644
index ffce7ce467..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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() {
- return ThreadMessageContext.getMessageContext().getFrom().getReferenceParameters().getConversationID();
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjector.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjector.java
deleted file mode 100644
index dd454be7c5..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjector.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-
-/**
- * Injects a value created by an {@link org.apache.tuscany.sca.core.factory.ObjectFactory} on a given field
- *
- * @version $Rev$ $Date$
- */
-public class FieldInjector<T> implements Injector<T> {
-
- private final Field field;
-
- private final ObjectFactory<?> objectFactory;
-
- /**
- * Create an injector and have it use the given <code>ObjectFactory</code> to inject a value on the instance using
- * the reflected <code>Field</code>
- */
- public FieldInjector(Field pField, ObjectFactory<?> objectFactory) {
- field = pField;
- // Allow privileged access to set accessibility. Requires ReflectPermission
- // in security policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- field.setAccessible(true); // ignore Java accessibility
- return null;
- }
- });
-
- this.objectFactory = objectFactory;
- }
-
- /**
- * Inject a new value on the given instance
- */
- public void inject(T instance) throws ObjectCreationException {
- try {
- field.set(instance, objectFactory.getInstance());
- } catch (IllegalAccessException e) {
- throw new ObjectCreationException("Field is not accessible [" + field + "]", e);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InjectionRuntimeException.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InjectionRuntimeException.java
deleted file mode 100644
index fbc2ace341..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InjectionRuntimeException.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-
-/**
- * Root unchecked exception for the injection package
- *
- * @version $Rev$ $Date$
- */
-public abstract class InjectionRuntimeException extends RuntimeException {
- private static final long serialVersionUID = -2264137603099898773L;
-
- public InjectionRuntimeException() {
- super();
- }
-
- public InjectionRuntimeException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public InjectionRuntimeException(String message) {
- super(message);
- }
-
- public InjectionRuntimeException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/Injector.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/Injector.java
deleted file mode 100644
index 4d062859b9..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/Injector.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-
-/**
- * Implementations inject a pre-configured value on an instance
- *
- * @version $Rev$ $Date$
- */
-public interface Injector<T> {
-
- /**
- * Inject a value on the given instance
- */
- void inject(T instance) throws ObjectCreationException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InvalidAccessorException.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InvalidAccessorException.java
deleted file mode 100644
index 5aeebcca36..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InvalidAccessorException.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-/**
- * @version $Rev$ $Date$
- */
-public class InvalidAccessorException extends InjectionRuntimeException {
- private static final long serialVersionUID = 9196299279363310978L;
-
- public InvalidAccessorException() {
- super();
- }
-
- public InvalidAccessorException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public InvalidAccessorException(String message) {
- super(message);
- }
-
- public InvalidAccessorException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
deleted file mode 100644
index 3618fa3477..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 boolean isSimpleType;
-
- public JavaPropertyValueObjectFactory(ExtensionPointRegistry registry) {
- this.mediator = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(Mediator.class);
- }
- public JavaPropertyValueObjectFactory(Mediator mediator) {
- this.mediator = mediator;
- }
-
- public ObjectFactory createValueFactory(Property property, Object propertyValue, JavaElementImpl javaElement) {
- isSimpleType = isSimpleType(property);
- Document doc = (Document)propertyValue;
- Class<?> javaType = JavaIntrospectionHelper.getBaseType(javaElement.getType(), javaElement.getGenericType());
- Element rootElement = doc.getDocumentElement();
- if (property.isMany()) {
- if (isSimpleType) {
- String value = "";
- if (rootElement.getChildNodes().getLength() > 0) {
- value = rootElement.getChildNodes().item(0).getTextContent();
- }
- List<String> values = getSimplePropertyValues(value, javaType);
- if ( javaElement.getType().isArray() ) {
- return new ArrayObjectFactoryImpl(property, values, isSimpleType, javaType);
- } else {
- return new ListObjectFactoryImpl(property, values, isSimpleType, javaType);
- }
- } else {
- if ( javaElement.getType().isArray() ) {
- return new ArrayObjectFactoryImpl(property, getComplexPropertyValues(doc), isSimpleType, javaType);
- } else {
- return new ListObjectFactoryImpl(property, getComplexPropertyValues(doc), isSimpleType, javaType);
- }
- }
- } else {
- if (isSimpleType) {
- String value = "";
- if (rootElement.getChildNodes().getLength() > 0) {
- value = rootElement.getChildNodes().item(0).getTextContent();
- }
- return new ObjectFactoryImpl(property, value, isSimpleType, javaType);
- } else {
- List<Node> nodes = getComplexPropertyValues(doc);
- Object value = null;
- if (!nodes.isEmpty()) {
- value = nodes.get(0);
- }
- return new ObjectFactoryImpl(property, value, isSimpleType, javaType);
- }
-
- }
- }
-
- public ObjectFactory createValueFactory(Property property, Object propertyValue, Class<?> javaType) {
- isSimpleType = isSimpleType(property);
- Document doc = (Document)propertyValue;
- Element rootElement = doc.getDocumentElement();
- if (property.isMany()) {
- if (isSimpleType) {
- String value = "";
- if (rootElement.getChildNodes().getLength() > 0) {
- value = rootElement.getChildNodes().item(0).getTextContent();
- }
- List<String> values = getSimplePropertyValues(value, javaType);
- return new ListObjectFactoryImpl(property, values, isSimpleType, javaType);
- } else {
- return new ListObjectFactoryImpl(property, getComplexPropertyValues(doc), isSimpleType, javaType);
- }
- } else {
- if (isSimpleType) {
- String value = "";
- if (rootElement.getChildNodes().getLength() > 0) {
- value = rootElement.getChildNodes().item(0).getTextContent();
- }
- return new ObjectFactoryImpl(property, value, isSimpleType, javaType);
- } else {
- List<Node> nodes = getComplexPropertyValues(doc);
- Object value = null;
- if (!nodes.isEmpty()) {
- value = nodes.get(0);
- }
- return new ObjectFactoryImpl(property, value, isSimpleType, 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;
- boolean isSimpleType;
-
- public ObjectFactoryImplBase(Property property, Object propertyValue, boolean isSimpleType, Class<?> javaType) {
- this.isSimpleType = isSimpleType;
- 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 (SimpleTypeMapperImpl.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, boolean isSimpleType, Class<?> javaType) {
- super(property, propertyValue, isSimpleType, 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, boolean isSimpleType, Class<?> javaType) {
- super(property, propertyValues, isSimpleType, 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, boolean isSimpleType, Class<?> javaType) {
- super(property, propertyValues, isSimpleType, 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 static boolean isSimpleType(Property property) {
- if (property.getXSDType() != null) {
- return SimpleTypeMapperImpl.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> getComplexPropertyValues(Document document) {
- 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/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ListMultiplicityObjectFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ListMultiplicityObjectFactory.java
deleted file mode 100644
index 2906897e96..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ListMultiplicityObjectFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-
-/**
- * Resolves targets configured in a multiplicity by delegating to object factories and returning an <code>List</code>
- * containing object instances
- *
- * @version $Rev$ $Date$
- */
-public class ListMultiplicityObjectFactory implements ObjectFactory<List<?>> {
-
- private ObjectFactory[] factories;
-
- public ListMultiplicityObjectFactory(List<ObjectFactory<?>> factories) {
- assert factories != null : "Object factories were null";
- this.factories = factories.toArray(new ObjectFactory[factories.size()]);
- }
-
- public List<?> getInstance() throws ObjectCreationException {
- List<Object> list = new ArrayList<Object>();
- for (ObjectFactory factory : factories) {
- list.add(factory.getInstance());
- }
- return list;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjector.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjector.java
deleted file mode 100644
index baf9eb9cc1..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjector.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-
-/**
- * Injects a value created by an {@link org.apache.tuscany.sca.core.factory.ObjectFactory} using a given method
- *
- * @version $Rev$ $Date$
- */
-public class MethodInjector<T> implements Injector<T> {
- private final Method method;
- private final ObjectFactory<?> objectFactory;
-
- public MethodInjector(Method aMethod, ObjectFactory<?> objectFactory) {
- assert aMethod != null;
- assert objectFactory != null;
- this.method = aMethod;
- // Allow privileged access to set accessibility. Requires ReflectPermission in security
- // policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- method.setAccessible(true);
- return null;
- }
- });
- this.objectFactory = objectFactory;
- }
-
- public void inject(T instance) throws ObjectCreationException {
- try {
- method.invoke(instance, objectFactory.getInstance());
- } catch (IllegalAccessException e) {
- throw new ObjectCreationException("Method is not accessible [" + method + "]", e);
- } catch (IllegalArgumentException e) {
- throw new ObjectCreationException("Exception thrown by setter: " + method.getName(), e);
- } catch (InvocationTargetException e) {
- throw new ObjectCreationException("Exception thrown by setter: " + method.getName(), e);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/RequestContextObjectFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/RequestContextObjectFactory.java
deleted file mode 100644
index 43fb5d6170..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/RequestContextObjectFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import org.apache.tuscany.sca.context.RequestContextFactory;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.oasisopen.sca.RequestContext;
-
-/**
- * Creates instances of RequestContext for injection on component implementation instances
- *
- * @version $Rev$ $Date$
- */
-public class RequestContextObjectFactory implements ObjectFactory<RequestContext> {
- private RequestContextFactory factory;
- private RuntimeComponent component;
-
- public RequestContextObjectFactory(RequestContextFactory factory, RuntimeComponent component) {
- this.factory = factory;
- this.component = component;
- }
-
- public RequestContext getInstance() throws ObjectCreationException {
- return factory.createRequestContext(component);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceHost.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceHost.java
deleted file mode 100644
index 70c368a0e6..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceHost.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-/**
- * Interface implemented by host environments that allow for resolution of component implementation resources, e.g.
- * items bound in a JNDI tree.
- *
- * @version $Rev$ $Date$
- */
-public interface ResourceHost {
-
- /**
- * Resolve a resource matching the given type
- *
- * @param type the type of the resources
- * @throws ResourceResolutionException if an error is encountered during resolution
- */
- <T> T resolveResource(Class<T> type) throws ResourceResolutionException;
-
- /**
- * Resolve a resource matching the given type and name
- *
- * @param type the type of the resources
- * @param mappedName the mapped name of the resource
- * @throws ResourceResolutionException if an error is encountered during resolution
- */
- <T> T resolveResource(Class<T> type, String mappedName) throws ResourceResolutionException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceNotFoundException.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceNotFoundException.java
deleted file mode 100644
index d5c1c7b69e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceNotFoundException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-
-/**
- * Denotes an exception thrown when a runtime resource is not found
- *
- * @version $Rev$ $Date$
- */
-public class ResourceNotFoundException extends ObjectCreationException {
- private static final long serialVersionUID = 1L;
-
- public ResourceNotFoundException() {
- super();
- }
-
- public ResourceNotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ResourceNotFoundException(String message) {
- super(message);
- }
-
- public ResourceNotFoundException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceObjectFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceObjectFactory.java
deleted file mode 100644
index 8f55eb18bc..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceObjectFactory.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-
-/**
- * Resolves a runtime resource to be injected on a field or method of a Java component type marked with {@link
- * javax.annotation.Resource}. If the mapped name of the resource is an absolute URI such as
- * <code>sca://localhost</code> or <code>jndi://localhost</code> the host container namespace is searched; otherwise the
- * URI is assumed to be relative and the parent composite is searched. If a mapped name is not provided, i.e. resolution
- * is by type, the parent composite is first searched followed by the host namespace.
- *
- * @version $Rev$ $Date$
- */
-public class ResourceObjectFactory<T> implements ObjectFactory<T> {
-
- private Class<T> type;
- private String mappedName;
- private ResourceHost host;
- private boolean optional;
-
- /**
- * Instantiates a factory that resolves resources by type
- *
- * @param type the type of the resource to inject
- * @param optional true if an error should be thrown if the resource is not found
- * @param host the runtime resource provider
- */
- public ResourceObjectFactory(Class<T> type, boolean optional, ResourceHost host) {
- this(type, null, optional, host);
- }
-
- /**
- * Instantiates a factory that resolves resources by mapped name
- *
- * @param type the type of the resource to inject
- * @param mappedName the resource name
- * @param optional true if an error should be thrown if the resource is not found
- * @param host the runtime resource provider
- */
- public ResourceObjectFactory(Class<T> type, String mappedName, boolean optional, ResourceHost host) {
- this.type = type;
- this.host = host;
- this.mappedName = mappedName;
- this.optional = optional;
- }
-
- public T getInstance() throws ObjectCreationException {
- try {
- T resource;
- if (mappedName == null) {
- resource = host.resolveResource(type);
- if (!optional && resource == null) {
- throw new ResourceNotFoundException("Resource not found: " + type.getName());
- }
- } else {
- resource = host.resolveResource(type, mappedName);
- if (!optional && resource == null) {
- throw new ResourceNotFoundException("Resource not found: " + mappedName);
- }
- }
- return resource;
- } catch (ResourceResolutionException e) {
- throw new ObjectCreationException(e);
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceResolutionException.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceResolutionException.java
deleted file mode 100644
index f94b24762a..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceResolutionException.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-
-/**
- * @version $Rev$ $Date$
- */
-public class ResourceResolutionException extends Exception {
- private static final long serialVersionUID = 13421352711315479L;
-
- public ResourceResolutionException() {
- super();
- }
-
- public ResourceResolutionException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ResourceResolutionException(String message) {
- super(message);
- }
-
- public ResourceResolutionException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/EventInvocationException.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/EventInvocationException.java
deleted file mode 100644
index 25c09231c5..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/EventInvocationException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-import org.apache.tuscany.sca.implementation.java.injection.InjectionRuntimeException;
-
-/**
- * Denotes an error when invoking an event on an object
- *
- * @version $Rev$ $Date$
- */
-public class EventInvocationException extends InjectionRuntimeException {
- private static final long serialVersionUID = 1480018831708211581L;
-
- public EventInvocationException() {
- super();
- }
-
- public EventInvocationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public EventInvocationException(String message) {
- super(message);
- }
-
- public EventInvocationException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/EventInvoker.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/EventInvoker.java
deleted file mode 100644
index e6ebb5abc3..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/EventInvoker.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-/**
- * Performs an invocation on an instance
- *
- * @version $Rev$ $Date$
- */
-public interface EventInvoker<T> {
-
- /**
- * Performs the invocation on a given instance
- *
- * @throws EventInvocationException
- */
- void invokeEvent(T instance) throws EventInvocationException;
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/InvalidConversationSequenceException.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/InvalidConversationSequenceException.java
deleted file mode 100644
index 1c330ea913..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/InvalidConversationSequenceException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-
-/**
- * Denotes an unknown operation sequence in a conversation
- *
- * @version $Rev$ $Date$
- */
-public class InvalidConversationSequenceException extends Exception {
- private static final long serialVersionUID = -5744028391493899147L;
-
- public InvalidConversationSequenceException() {
- super();
- }
-
- public InvalidConversationSequenceException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public InvalidConversationSequenceException(String message) {
- super(message);
- }
-
- public InvalidConversationSequenceException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaCallbackRuntimeWireProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaCallbackRuntimeWireProcessor.java
deleted file mode 100644
index ef4e67d79a..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaCallbackRuntimeWireProcessor.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.core.invocation.CallbackInterfaceInterceptor;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.apache.tuscany.sca.runtime.RuntimeWireProcessor;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaCallbackRuntimeWireProcessor implements RuntimeWireProcessor {
- private static final Logger logger = Logger.getLogger(JavaCallbackRuntimeWireProcessor.class.getName());
- private InterfaceContractMapper interfaceContractMapper;
- private JavaInterfaceFactory javaInterfaceFactory;
-
- /**
- * @param interfaceContractMapper
- * @param javaInterfaceFactory
- */
- public JavaCallbackRuntimeWireProcessor(InterfaceContractMapper interfaceContractMapper,
- JavaInterfaceFactory javaInterfaceFactory) {
- super();
- this.interfaceContractMapper = interfaceContractMapper;
- this.javaInterfaceFactory = javaInterfaceFactory;
- }
-
- public void process(RuntimeWire wire) {
- addCallbackInterfaceInterceptors(wire);
- }
-
- private void addCallbackInterfaceInterceptors(RuntimeWire wire) {
- Contract contract = wire.getSource().getContract();
- if (!(contract instanceof RuntimeComponentReference)) {
- return;
- }
- RuntimeComponent component = wire.getSource().getComponent();
- Implementation implementation = component.getImplementation();
- if (!(implementation instanceof JavaImplementation)) {
- return;
- }
- JavaImplementation javaImpl = (JavaImplementation)implementation;
- EndpointReference callbackEndpoint = wire.getSource().getCallbackEndpoint();
- if (callbackEndpoint != null) {
- Interface iface = callbackEndpoint.getContract().getInterfaceContract().getInterface();
- if (!supportsCallbackInterface(iface, javaImpl)) {
- // callback to this impl is not possible, so ensure a callback object is set
- for (InvocationChain chain : wire.getInvocationChains()) {
- chain.addInterceptor(Phase.REFERENCE, new CallbackInterfaceInterceptor());
- }
- }
- }
- }
-
- private boolean supportsCallbackInterface(Interface iface, JavaImplementation impl) {
- if (iface instanceof JavaInterface) {
- Class<?> ifaceClass = ((JavaInterface)iface).getJavaClass();
- if (ifaceClass.isAssignableFrom(impl.getJavaClass())) {
- return true;
- }
- }
- try {
- Interface implType = javaInterfaceFactory.createJavaInterface(impl.getJavaClass());
- // Ignore the remotable/conversational testing
- implType.setRemotable(iface.isRemotable());
- implType.setConversational(iface.isConversational());
- return interfaceContractMapper.isCompatible(iface, implType);
- } catch (InvalidInterfaceException e) {
- logger.log(Level.WARNING, e.getMessage(), e);
- return false;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextFactory.java
deleted file mode 100644
index f2a0d576db..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.oasisopen.sca.ComponentContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaComponentContextFactory implements ObjectFactory<ComponentContext> {
- private final JavaComponentContextProvider component;
-
-
- public JavaComponentContextFactory(JavaComponentContextProvider component) {
- this.component = component;
- }
-
-
- public ComponentContext getInstance() throws ObjectCreationException {
- return component.getComponent().getComponentContext();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
deleted file mode 100644
index 0044c0f196..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.lang.annotation.ElementType;
-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.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.context.ComponentContextFactory;
-import org.apache.tuscany.sca.context.RequestContextFactory;
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.core.invocation.CallableReferenceObjectFactory;
-import org.apache.tuscany.sca.core.invocation.CallbackReferenceObjectFactory;
-import org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.invocation.WireObjectFactory;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.TargetResolutionException;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaResourceImpl;
-import org.apache.tuscany.sca.implementation.java.injection.ConversationIDObjectFactory;
-import org.apache.tuscany.sca.implementation.java.injection.InvalidAccessorException;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-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.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.annotation.ConversationID;
-
-/**
- * The runtime instantiation of Java component implementations
- *
- * @version $Rev$ $Date$
- */
-public class JavaComponentContextProvider {
- private JavaPropertyValueObjectFactory propertyValueFactory;
- private RuntimeComponent component;
- private JavaInstanceFactoryProvider<?> instanceFactoryProvider;
- private ProxyFactory proxyFactory;
-
- public JavaComponentContextProvider(RuntimeComponent component,
- JavaInstanceFactoryProvider configuration,
- DataBindingExtensionPoint dataBindingExtensionPoint,
- JavaPropertyValueObjectFactory propertyValueObjectFactory,
- ComponentContextFactory componentContextFactory,
- RequestContextFactory requestContextFactory) {
- super();
- this.instanceFactoryProvider = configuration;
- this.proxyFactory = configuration.getProxyFactory();
- // if (componentContextFactory != null) {
- // this.componentContext = componentContextFactory.createComponentContext(component, requestContextFactory);
- // } else {
- // this.componentContext = new ComponentContextImpl(this, requestContextFactory, this.proxyService);
- // }
- this.component = component;
- this.propertyValueFactory = propertyValueObjectFactory;
- }
-
- InstanceWrapper<?> createInstanceWrapper() throws ObjectCreationException {
- return instanceFactoryProvider.createFactory().newInstance();
- }
-
- void configureProperties(List<ComponentProperty> definedProperties) {
- for (ComponentProperty p : definedProperties) {
- configureProperty(p);
- }
- }
-
- private void configureProperty(ComponentProperty configuredProperty) {
- JavaElementImpl element =
- instanceFactoryProvider.getImplementation().getPropertyMembers().get(configuredProperty.getName());
-
- if (element != null && configuredProperty.getValue() != null) {
- if (!(element.getAnchor() instanceof Constructor)) {
- if(element.getElementType() == ElementType.FIELD) {
- // Field field = (Field)element.getAnchor();
- instanceFactoryProvider.getInjectionSites().add(element);
- /*
- if(Modifier.isPublic(field.getModifiers())) {
- instanceFactoryProvider.getInjectionSites().add(element);
- } else if(field.getAnnotation(org.oasisopen.sca.annotation.Property.class) != null) {
- instanceFactoryProvider.getInjectionSites().add(element);
- }
- */
- } else {
- instanceFactoryProvider.getInjectionSites().add(element);
- }
- }
-
- //Class propertyJavaType = JavaIntrospectionHelper.getBaseType(element.getType(), element.getGenericType());
- ObjectFactory<?> propertyObjectFactory =
- createPropertyValueFactory(configuredProperty, configuredProperty.getValue(), element);
- instanceFactoryProvider.setObjectFactory(element, propertyObjectFactory);
-
- JavaConstructorImpl<?> constructor = instanceFactoryProvider.getImplementation().getConstructor();
- for(JavaElementImpl p: constructor.getParameters()){
- if(element.getName().equals(p.getName())) {
- instanceFactoryProvider.setObjectFactory(p, propertyObjectFactory);
- }
- }
- }
- }
-
- void start() {
- if (!instanceFactoryProvider.getImplementation().getCallbackMembers().isEmpty()) {
- Map<String, List<RuntimeWire>> callbackWires = new HashMap<String, List<RuntimeWire>>();
- for (ComponentService service : component.getServices()) {
-
- RuntimeComponentReference callbackReference = (RuntimeComponentReference)service.getCallbackReference();
- if (callbackReference != null) {
- List<RuntimeWire> wires = callbackReference.getRuntimeWires();
- if (!wires.isEmpty()) {
- callbackWires.put(wires.get(0).getSource().getInterfaceContract().getInterface().toString(),
- wires);
- }
- }
- }
-
- for (Map.Entry<String, Collection<JavaElementImpl>> entry : instanceFactoryProvider.getImplementation()
- .getCallbackMembers().entrySet()) {
- List<RuntimeWire> wires = callbackWires.get(entry.getKey());
- if (wires == null) {
- // this can happen when there are no client wires to a
- // component that has a callback
- continue;
- }
- for(JavaElementImpl element : entry.getValue()) {
- Class<?> businessInterface = element.getType();
- ObjectFactory<?> factory = null;
- if (CallableReference.class.isAssignableFrom(element.getType())) {
- businessInterface =
- JavaIntrospectionHelper.getBusinessInterface(element.getType(), element.getGenericType());
- factory =
- new CallbackReferenceObjectFactory(businessInterface, proxyFactory, wires);
- } else {
- factory = new CallbackWireObjectFactory(businessInterface, proxyFactory, wires);
- }
- if (!(element.getAnchor() instanceof Constructor)) {
- instanceFactoryProvider.getInjectionSites().add(element);
- }
- instanceFactoryProvider.setObjectFactory(element, factory);
- }
- }
- }
- for (Reference ref : instanceFactoryProvider.getImplementation().getReferences()) {
- JavaElementImpl element =
- instanceFactoryProvider.getImplementation().getReferenceMembers().get(ref.getName());
- if (element != null) {
- if (!(element.getAnchor() instanceof Constructor)) {
- if(element.getElementType() == ElementType.FIELD) {
- Field field = (Field)element.getAnchor();
- if(Modifier.isPublic(field.getModifiers())) {
- instanceFactoryProvider.getInjectionSites().add(element);
- } else if(field.getAnnotation(org.oasisopen.sca.annotation.Reference.class) != null) {
- instanceFactoryProvider.getInjectionSites().add(element);
- }
- } else {
- instanceFactoryProvider.getInjectionSites().add(element);
- }
- }
- ComponentReference componentReference = null;
- List<RuntimeWire> wireList = null;
- for (ComponentReference reference : component.getReferences()) {
- if (reference.getName().equals(ref.getName())) {
- wireList = ((RuntimeComponentReference)reference).getRuntimeWires();
- componentReference = reference;
- break;
- }
- }
- if (ref.getMultiplicity() == Multiplicity.ONE_N || ref.getMultiplicity() == Multiplicity.ZERO_N) {
- List<ObjectFactory<?>> factories = new ArrayList<ObjectFactory<?>>();
- Class<?> baseType =
- JavaIntrospectionHelper.getBaseType(element.getType(), element.getGenericType());
- for (int i = 0; i < wireList.size(); i++) {
- ObjectFactory<?> factory = null;
- if (CallableReference.class.isAssignableFrom(baseType)) {
- Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
- // Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
- Class<?> businessInterface =
- JavaIntrospectionHelper.getBusinessInterface(baseType, callableRefType);
- factory =
- new CallableReferenceObjectFactory(businessInterface, component,
- (RuntimeComponentReference)wireList.get(i)
- .getSource().getContract(), wireList.get(i)
- .getSource().getBinding());
- } else {
- factory = createObjectFactory(baseType, wireList.get(i));
- }
- factories.add(factory);
- }
- instanceFactoryProvider.setObjectFactories(element, factories);
- JavaConstructorImpl<?> constructor = instanceFactoryProvider.getImplementation().getConstructor();
- for(JavaElementImpl p: constructor.getParameters()){
- if(element.getName().equals(p.getName())) {
- instanceFactoryProvider.setObjectFactories(p, factories);
- }
- }
- } else {
- if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
- throw new IllegalStateException("Required reference is missing: " + ref.getName());
- }
- if (wireList != null && !wireList.isEmpty()) {
- ObjectFactory<?> factory = null;
- if (CallableReference.class.isAssignableFrom(element.getType())) {
- Class<?> businessInterface =
- JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
- .getGenericType());
- factory =
- new CallableReferenceObjectFactory(businessInterface, component,
- (RuntimeComponentReference)componentReference, null);
- } else {
- factory = createObjectFactory(element.getType(), wireList.get(0));
- }
- instanceFactoryProvider.setObjectFactory(element, factory);
- JavaConstructorImpl<?> constructor = instanceFactoryProvider.getImplementation().getConstructor();
- for(JavaElementImpl p: constructor.getParameters()){
- if(element.getName().equals(p.getName())) {
- instanceFactoryProvider.setObjectFactory(p, factory);
- }
- }
- }
- }
- }
- }
-
- //setUpPolicyHandlers();
- }
-
- void addResourceFactory(String name, ObjectFactory<?> factory) {
- JavaResourceImpl resource = instanceFactoryProvider.getImplementation().getResources().get(name);
-
- if (resource != null && !(resource.getElement().getAnchor() instanceof Constructor)) {
- instanceFactoryProvider.getInjectionSites().add(resource.getElement());
- }
-
- instanceFactoryProvider.setObjectFactory(resource.getElement(), factory);
- }
-
- void addConversationIDFactories(List<Member> names) {
- ObjectFactory<String> factory = new ConversationIDObjectFactory();
- for (Member name : names) {
- if (name instanceof Field) {
- JavaElementImpl element = new JavaElementImpl((Field)name);
- element.setClassifer(ConversationID.class);
- instanceFactoryProvider.setObjectFactory(element, factory);
- } else if (name instanceof Method) {
- JavaElementImpl element = new JavaElementImpl((Method)name, 0);
- element.setName(JavaIntrospectionHelper.toPropertyName(name.getName()));
- element.setClassifer(ConversationID.class);
- instanceFactoryProvider.setObjectFactory(element, factory);
- } else {
- throw new InvalidAccessorException("Member must be a field or method: " + name.getName());
- }
- }
- }
-
- Object createInstance() throws ObjectCreationException {
- return createInstanceWrapper().getInstance();
- }
-
- JavaInstanceFactoryProvider<?> getInstanceFactoryProvider() {
- return instanceFactoryProvider;
- }
-
- void stop() {
- //cleanUpPolicyHandlers();
- }
-
- Invoker createInvoker(Operation operation) throws NoSuchMethodException {
- Class<?> implClass = instanceFactoryProvider.getImplementationClass();
-
- Method method = JavaInterfaceUtil.findMethod(implClass, operation);
- return new JavaImplementationInvoker(operation, method, component);
- }
-
- private static class OptimizedObjectFactory<T> implements ObjectFactory<T> {
- private ScopeContainer scopeContainer;
-
- public OptimizedObjectFactory(ScopeContainer scopeContainer) {
- super();
- this.scopeContainer = scopeContainer;
- }
-
- public T getInstance() throws ObjectCreationException {
- try {
- return (T)scopeContainer.getWrapper(null).getInstance();
- } catch (TargetResolutionException e) {
- throw new ObjectCreationException(e);
- }
- }
-
- }
-
- private <B> ObjectFactory<B> createObjectFactory(Class<B> interfaze, RuntimeWire wire) {
- // FIXME: [rfeng] Disable the optimization for new as it needs more discussions
- /*
- boolean conversational = wire.getSource().getInterfaceContract().getInterface().isConversational();
- Binding binding = wire.getSource().getBinding();
- // Check if it's wireable binding for optimization
- if (!conversational && binding instanceof OptimizableBinding) {
- OptimizableBinding optimizableBinding = (OptimizableBinding)binding;
- Component component = optimizableBinding.getTargetComponent();
- if (component != null) {
- Implementation implementation = component.getImplementation();
- // Check if the target component is java component
- if (implementation instanceof JavaImplementation) {
- JavaImplementation javaImplementation = (JavaImplementation)implementation;
- if (interfaze.isAssignableFrom(javaImplementation.getJavaClass())) {
- ScopedRuntimeComponent scopedComponent = (ScopedRuntimeComponent)component;
- ScopeContainer scopeContainer = scopedComponent.getScopeContainer();
- Scope scope = scopeContainer.getScope();
- if (scope == Scope.COMPOSITE || scope == Scope.STATELESS || scope == Scope.SYSTEM) {
- boolean optimizable = true;
- for (InvocationChain chain : wire.getInvocationChains()) {
- if (chain.getHeadInvoker() != chain.getTailInvoker()) {
- optimizable = false;
- break;
- }
- }
- if (optimizable) {
- return new OptimizedObjectFactory<B>(scopeContainer);
- }
- }
- }
- }
- }
- }
- */
- return new WireObjectFactory<B>(interfaze, wire, proxyFactory);
- }
-
- private ObjectFactory<?> createPropertyValueFactory(ComponentProperty property,
- Object propertyValue,
- JavaElementImpl javaElement) {
- return propertyValueFactory.createValueFactory(property, propertyValue, javaElement);
- }
-
- /**
- * @return the component
- */
- RuntimeComponent getComponent() {
- return component;
- }
-
- /*private void setUpPolicyHandlers() {
- for (PolicyHandler policyHandler : policyHandlers.values()) {
- policyHandler.setUp(component.getImplementation());
- }
- }
-
- private void cleanUpPolicyHandlers() {
- for (PolicyHandler policyHandler : policyHandlers.values() ) {
- policyHandler.cleanUp(this);
- }
- }*/
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentNameFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentNameFactory.java
deleted file mode 100644
index 4a5ad98e5b..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentNameFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaComponentNameFactory implements ObjectFactory<String> {
- private final JavaComponentContextProvider componentContextProvider;
-
-
- public JavaComponentNameFactory(JavaComponentContextProvider component) {
- this.componentContextProvider = component;
- }
-
-
- public String getInstance() throws ObjectCreationException {
- String uri = componentContextProvider.getComponent().getURI();
- return uri.substring(uri.lastIndexOf('/')+1);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
deleted file mode 100644
index 60e093d0dc..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopeContainer;
-import org.apache.tuscany.sca.core.scope.ScopedRuntimeComponent;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.interfacedef.ConversationSequence;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.EndpointReference;
-import org.apache.tuscany.sca.runtime.ReferenceParameters;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Responsible for synchronously dispatching an invocation to a Java component
- * implementation instance
- *
- * @version $Rev$ $Date$
- */
-public class JavaImplementationInvoker implements Invoker, DataExchangeSemantics {
- protected Operation operation;
- protected Method method;
- protected boolean allowsPBR;
-
- @SuppressWarnings("unchecked")
- protected final ScopeContainer scopeContainer;
-
- public JavaImplementationInvoker(Operation operation, Method method, RuntimeComponent component) {
- assert method != null : "Operation method cannot be null";
- this.method = method;
- this.operation = operation;
- this.scopeContainer = ((ScopedRuntimeComponent)component).getScopeContainer();
- this.allowsPBR = ((JavaImplementation)component.getImplementation()).isAllowsPassByReference(method);
- }
-
- public JavaImplementationInvoker(Operation operation, RuntimeComponent component) {
- // used if the method can't be computed statically in advance
- this.operation = operation;
- this.scopeContainer = ((ScopedRuntimeComponent)component).getScopeContainer();
- }
-
- @SuppressWarnings("unchecked")
- public Message invoke(Message msg) {
- Operation op = msg.getOperation();
- if (op == null) {
- op = this.operation;
- }
- ConversationSequence sequence = op.getConversationSequence();
- Object payload = msg.getBody();
-
- Object contextId = null;
-
- EndpointReference from = msg.getFrom();
- ReferenceParameters parameters = null;
- if (from != null) {
- parameters = from.getReferenceParameters();
- }
- // check what sort of context is required
- if (scopeContainer != null) {
- Scope scope = scopeContainer.getScope();
- if (scope == Scope.REQUEST) {
- contextId = Thread.currentThread();
- } else if (scope == Scope.CONVERSATION && parameters != null) {
- contextId = parameters.getConversationID();
- }
- }
-
- try {
- // The following call might create a new conversation, as a result, the msg.getConversationID() might
- // return a new value
- InstanceWrapper wrapper = scopeContainer.getWrapper(contextId);
-
- // detects whether the scope container has created a conversation Id. This will
- // happen in the case that the component has conversational scope but only the
- // callback interface is conversational. Or in the callback case if the service interface
- // is conversational and the callback interface isn't. If we are in this situation we need
- // to get the contextId of this component and remove it after we have invoked the method on
- // it. It is possible that the component instance will not go away when it is removed below
- // because a callback conversation will still be holding a reference to it
- boolean removeTemporaryConversationalComponentAfterCall = false;
- if (parameters != null && (contextId == null) && (parameters.getConversationID() != null)) {
- contextId = parameters.getConversationID();
- removeTemporaryConversationalComponentAfterCall = true;
- }
-
- Object instance = wrapper.getInstance();
-
- // If the method couldn't be computed statically, or the instance being
- // invoked is a user-specified callback object that doesn't implement
- // the service interface from which the reflective method was obtained,
- // compute the method object dynamically for this invocation.
- Method imethod = method;
- if (imethod == null || !imethod.getDeclaringClass().isInstance(instance)) {
- try {
- imethod = JavaInterfaceUtil.findMethod(instance.getClass(), operation);
- } catch (NoSuchMethodException e) {
- throw new IllegalArgumentException("Callback object does not provide method " + e.getMessage());
- }
- }
-
- Object ret;
- if (payload != null && !payload.getClass().isArray()) {
- ret = imethod.invoke(instance, payload);
- } else {
- ret = imethod.invoke(instance, (Object[])payload);
- }
-
- scopeContainer.returnWrapper(wrapper, contextId);
-
- if ((sequence == ConversationSequence.CONVERSATION_END) || (removeTemporaryConversationalComponentAfterCall)) {
- // if end conversation, or we have the special case where a conversational
- // object was created to service the stateless half of a stateful component
- scopeContainer.remove(contextId);
- parameters.setConversationID(null);
- }
- msg.setBody(ret);
- } catch (InvocationTargetException e) {
- Throwable cause = e.getTargetException();
- boolean isChecked = false;
- for (DataType<?> d : operation.getFaultTypes()) {
- if (d.getPhysical().isInstance(cause)) {
- isChecked = true;
- msg.setFaultBody(cause);
- break;
- }
- }
-
-
- if (sequence != ConversationSequence.CONVERSATION_NONE ){
- try {
-// // If the exception is not a business exception then end the conversation
-// boolean businessException = false;
-//
-// for (DataType dataType : operation.getFaultTypes()){
-// if ((dataType.getPhysical() == e.getCause().getClass()) &&
-// (contextId != null) ){
-// businessException = true;
-// break;
-// }
-// }
-
- if (!isChecked && contextId != null) {
- scopeContainer.remove(contextId);
- parameters.setConversationID(null);
- }
- } catch (Exception ex){
- // TODO - sure what the best course of action is here. We have
- // a system exception in the middle of a business exception
- }
- }
- if (!isChecked) {
- if (cause instanceof RuntimeException) {
- throw (RuntimeException)cause;
- }
- if (cause instanceof Error) {
- throw (Error)cause;
- } else {
- throw new ServiceRuntimeException(cause.getMessage(), cause);
- }
- }
-
- } catch (Exception e) {
- msg.setFaultBody(e);
- }
- return msg;
- }
-
- public boolean allowsPassByReference() {
- return allowsPBR;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java
deleted file mode 100644
index e5deab4b9e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.lang.reflect.Method;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.context.ComponentContextFactory;
-import org.apache.tuscany.sca.context.RequestContextFactory;
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.scope.Scope;
-import org.apache.tuscany.sca.core.scope.ScopedImplementationProvider;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaResourceImpl;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.java.injection.RequestContextObjectFactory;
-import org.apache.tuscany.sca.implementation.java.injection.ResourceHost;
-import org.apache.tuscany.sca.implementation.java.injection.ResourceObjectFactory;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaImplementationProvider implements ScopedImplementationProvider {
- private JavaImplementation implementation;
- private JavaComponentContextProvider componentContextProvider;
- private RequestContextFactory requestContextFactory;
-
- public JavaImplementationProvider(RuntimeComponent component,
- JavaImplementation implementation,
- ProxyFactory proxyService,
- DataBindingExtensionPoint dataBindingRegistry,
- JavaPropertyValueObjectFactory propertyValueObjectFactory,
- ComponentContextFactory componentContextFactory,
- RequestContextFactory requestContextFactory,
- List<PolicyHandlerTuple> policyHandlerClassNames) {
- super();
- this.implementation = implementation;
- this.requestContextFactory = requestContextFactory;
- this.implementation.setPolicyHandlerClassNames(policyHandlerClassNames);
-
- try {
- JavaInstanceFactoryProvider configuration = new JavaInstanceFactoryProvider(implementation);
- configuration.setProxyFactory(proxyService);
- componentContextProvider =
- new JavaComponentContextProvider(component,
- configuration,
- dataBindingRegistry,
- propertyValueObjectFactory,
- componentContextFactory,
- requestContextFactory);
-
- Scope scope = getScope();
-
- if (scope == Scope.SYSTEM || scope == Scope.COMPOSITE) {
- // Nothing
- } else {
- // Check for conversational contract if conversational scope
- if (scope == Scope.CONVERSATION) {
- boolean hasConversationalContract = false;
- for (Service serviceDef : implementation.getServices()) {
- if (serviceDef.getInterfaceContract().getInterface().isConversational()) {
- hasConversationalContract = true;
- break;
- }
- }
- if (!hasConversationalContract) {
- String name = implementation.getJavaClass().getName();
- throw new NoConversationalContractException(name);
- }
- }
- }
-
- if (implementation.getConversationIDMembers().size() > 0) {
- componentContextProvider.addConversationIDFactories(implementation.getConversationIDMembers());
- }
-
- componentContextProvider.configureProperties(component.getProperties());
- handleResources(implementation, proxyService);
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
-
- }
-
- private void handleResources(JavaImplementation componentType, ProxyFactory proxyService) {
- for (JavaResourceImpl resource : componentType.getResources().values()) {
- String name = resource.getName();
-
- ObjectFactory<?> objectFactory =
- (ObjectFactory<?>)componentContextProvider.getInstanceFactoryProvider().getFactories().get(resource.getElement());
- if (objectFactory == null) {
- Class<?> type = resource.getElement().getType();
- if (ComponentContext.class.equals(type)) {
- objectFactory = new JavaComponentContextFactory(componentContextProvider);
- } else if (RequestContext.class.equals(type)) {
- objectFactory = new RequestContextObjectFactory(requestContextFactory, componentContextProvider.getComponent());
- } else if (String.class.equals(type)) {
- objectFactory = new JavaComponentNameFactory(componentContextProvider);
- } else {
- boolean optional = resource.isOptional();
- String mappedName = resource.getMappedName();
- objectFactory = createResourceObjectFactory(type, mappedName, optional, null);
- }
- }
- componentContextProvider.addResourceFactory(name, objectFactory);
- }
- }
-
- private <T> ResourceObjectFactory<T> createResourceObjectFactory(Class<T> type,
- String mappedName,
- boolean optional,
- ResourceHost host) {
- return new ResourceObjectFactory<T>(type, mappedName, optional, host);
- }
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- try {
- return componentContextProvider.createInvoker(operation);
- } catch (NoSuchMethodException e) {
- // It's possible that the instance being invoked is a user-specified
- // callback object that isn't an instance of the component implementation
- // class. As an attempt to deal with this, look up a method object from
- // the service interface. This isn't foolproof, as it's possible that
- // the service interface isn't a Java interface, or that the callback
- // object has the right method signature without implementing the
- // callback interface. There is code in JavaImplementationInvoker
- // to deal with these possibilities.
- Interface iface = service.getInterfaceContract().getInterface();
- if (iface instanceof JavaInterface) {
- try {
- Method method = JavaInterfaceUtil.findMethod(((JavaInterface)iface).getJavaClass(), operation);
- return new JavaImplementationInvoker(operation, method, componentContextProvider.getComponent());
- } catch (NoSuchMethodException e1) {
- throw new IllegalArgumentException(e1);
- }
- } else {
- return new JavaImplementationInvoker(operation, componentContextProvider.getComponent());
- }
- }
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public Scope getScope() {
- return new Scope(implementation.getJavaScope().getScope());
- }
-
- public void start() {
- componentContextProvider.start();
- }
-
- public void stop() {
- componentContextProvider.stop();
- }
-
- public InstanceWrapper<?> createInstanceWrapper() {
- return componentContextProvider.createInstanceWrapper();
- }
-
- public boolean isEagerInit() {
- return implementation.isEagerInit();
- }
-
- public long getMaxAge() {
- return implementation.getMaxAge();
- }
-
- public long getMaxIdleTime() {
- return implementation.getMaxIdleTime();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProviderFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProviderFactory.java
deleted file mode 100644
index 9b78439012..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProviderFactory.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.context.ComponentContextFactory;
-import org.apache.tuscany.sca.context.RequestContextFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaImplementationProviderFactory implements ImplementationProviderFactory<JavaImplementation> {
- private JavaPropertyValueObjectFactory propertyValueObjectFactory;
- private DataBindingExtensionPoint dataBindingRegistry;
- private ProxyFactory proxyService;
- private ComponentContextFactory componentContextFactory;
- private RequestContextFactory requestContextFactory;
- private List<PolicyHandlerTuple> policyHandlerClassNames = null;
-
- public JavaImplementationProviderFactory(ProxyFactory proxyService,
- DataBindingExtensionPoint dataBindingRegistry,
- JavaPropertyValueObjectFactory propertyValueObjectFactory,
- ComponentContextFactory componentContextFactory,
- RequestContextFactory requestContextFactory,
- List<PolicyHandlerTuple> policyHandlerClassNames) {
- super();
- this.proxyService = proxyService;
- this.dataBindingRegistry = dataBindingRegistry;
- this.propertyValueObjectFactory = propertyValueObjectFactory;
- this.componentContextFactory = componentContextFactory;
- this.requestContextFactory = requestContextFactory;
- this.policyHandlerClassNames = policyHandlerClassNames;
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component,
- JavaImplementation implementation) {
- return new JavaImplementationProvider(component,
- implementation,
- proxyService,
- dataBindingRegistry,
- propertyValueObjectFactory,
- componentContextFactory,
- requestContextFactory,
- policyHandlerClassNames);
- }
-
- public Class<JavaImplementation> getModelType() {
- return JavaImplementation.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaInstanceFactoryProvider.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaInstanceFactoryProvider.java
deleted file mode 100644
index 7fcfaad615..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaInstanceFactoryProvider.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-import java.lang.annotation.ElementType;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-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.context.InstanceFactory;
-import org.apache.tuscany.sca.implementation.java.context.InstanceFactoryProvider;
-import org.apache.tuscany.sca.implementation.java.context.ReflectiveInstanceFactory;
-import org.apache.tuscany.sca.implementation.java.injection.ArrayMultiplicityObjectFactory;
-import org.apache.tuscany.sca.implementation.java.injection.FieldInjector;
-import org.apache.tuscany.sca.implementation.java.injection.Injector;
-import org.apache.tuscany.sca.implementation.java.injection.InvalidAccessorException;
-import org.apache.tuscany.sca.implementation.java.injection.ListMultiplicityObjectFactory;
-import org.apache.tuscany.sca.implementation.java.injection.MethodInjector;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-
-/**
- * Encapsulates configuration for a Java-based atomic component
- *
- * @version $Rev$ $Date$
- */
-public class JavaInstanceFactoryProvider<T> implements InstanceFactoryProvider<T> {
- private JavaImplementation definition;
- private ProxyFactory proxyService;
-
- private final List<JavaElementImpl> injectionSites;
- private final EventInvoker<T> initInvoker;
- private final EventInvoker<T> destroyInvoker;
- private final Map<JavaElementImpl, Object> factories = new HashMap<JavaElementImpl, Object>();
-
- public JavaInstanceFactoryProvider(JavaImplementation definition) {
- this.definition = definition;
- this.initInvoker = definition.getInitMethod() == null ? null : new MethodEventInvoker<T>(definition
- .getInitMethod());
- this.destroyInvoker = definition.getDestroyMethod() == null ? null : new MethodEventInvoker<T>(definition
- .getDestroyMethod());
- injectionSites = new ArrayList<JavaElementImpl>();
- }
-
- ProxyFactory getProxyFactory() {
- return proxyService;
- }
-
- void setProxyFactory(ProxyFactory proxyService) {
- this.proxyService = proxyService;
- }
-
- /**
- * @return the definition
- */
- JavaImplementation getImplementation() {
- return definition;
- }
-
- @SuppressWarnings("unchecked")
- public InstanceFactory<T> createFactory() {
- ObjectFactory<?>[] initArgs = getConstructorArgs();
- Injector<T>[] injectors = getInjectors();
- return new ReflectiveInstanceFactory<T>((Constructor<T>)definition.getConstructor().getConstructor(),
- initArgs, injectors, initInvoker, destroyInvoker);
- }
-
- private ObjectFactory<?>[] getConstructorArgs() {
- JavaConstructorImpl<?> constructor = definition.getConstructor();
- ObjectFactory<?>[] initArgs = new ObjectFactory<?>[constructor.getParameters().length];
- for (int i = 0; i < initArgs.length; i++) {
- ObjectFactory<?> factory = (ObjectFactory<?>)factories.get(constructor.getParameters()[i]);
- assert factory != null;
- initArgs[i] = factory;
- }
- return initArgs;
- }
-
- @SuppressWarnings("unchecked")
- private Injector<T>[] getInjectors() {
- // work around JDK1.5 issue with allocating generic arrays
- Injector<T>[] injectors = new Injector[injectionSites.size()];
-
- int i = 0;
- for (JavaElementImpl element : injectionSites) {
- Object obj = factories.get(element);
- if (obj != null) {
- if (obj instanceof ObjectFactory) {
- ObjectFactory<?> factory = (ObjectFactory<?>)obj;
- Member member = (Member)element.getAnchor();
- if (element.getElementType() == ElementType.FIELD) {
- injectors[i++] = new FieldInjector<T>((Field)member, factory);
- } else if (element.getElementType() == ElementType.PARAMETER && member instanceof Method) {
- injectors[i++] = new MethodInjector<T>((Method)member, factory);
- } else if (member instanceof Constructor) {
- // Ignore
- } else {
- throw new AssertionError(String.valueOf(element));
- }
- } else {
- injectors[i++] = createMultiplicityInjector(element, (List<ObjectFactory<?>>)obj);
- }
- }
- }
- return injectors;
- }
-
- private Injector<T> createMultiplicityInjector(JavaElementImpl element, List<ObjectFactory<?>> factories) {
- Class<?> interfaceType = JavaIntrospectionHelper.getBaseType(element.getType(), element.getGenericType());
-
- if (element.getAnchor() instanceof Field) {
- Field field = (Field)element.getAnchor();
- if (field.getType().isArray()) {
- return new FieldInjector<T>(field, new ArrayMultiplicityObjectFactory(interfaceType, factories));
- } else {
- return new FieldInjector<T>(field, new ListMultiplicityObjectFactory(factories));
- }
- } else if (element.getAnchor() instanceof Method) {
- Method method = (Method)element.getAnchor();
- if (method.getParameterTypes()[0].isArray()) {
- return new MethodInjector<T>(method, new ArrayMultiplicityObjectFactory(interfaceType, factories));
- } else {
- return new MethodInjector<T>(method, new ListMultiplicityObjectFactory(factories));
- }
- } else {
- throw new InvalidAccessorException("Member must be a field or method: " + element.getName());
- }
- }
-
- @SuppressWarnings("unchecked")
- public Class<T> getImplementationClass() {
- return (Class<T>)definition.getJavaClass();
- }
-
- public void setObjectFactory(JavaElementImpl element, ObjectFactory<?> objectFactory) {
- factories.put(element, objectFactory);
- }
-
- public void setObjectFactories(JavaElementImpl element, List<ObjectFactory<?>> objectFactory) {
- factories.put(element, objectFactory);
- }
-
- /**
- * @return the injectionSites
- */
- List<JavaElementImpl> getInjectionSites() {
- return injectionSites;
- }
-
- /**
- * @return the factories
- */
- Map<JavaElementImpl, Object> getFactories() {
- return factories;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/MethodEventInvoker.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/MethodEventInvoker.java
deleted file mode 100644
index 515a7c8a43..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/MethodEventInvoker.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-
-/**
- * Performs an wire on a method of a given instance
- *
- * @version $Rev$ $Date$
- */
-public class MethodEventInvoker<T> implements EventInvoker<T> {
- private final Method method;
-
- /**
- * Instantiates an invoker for the given method
- */
- public MethodEventInvoker(Method method) {
- assert method != null;
- this.method = method;
- }
-
- public void invokeEvent(T instance) throws EventInvocationException {
- try {
- method.invoke(instance, (Object[]) null);
- } catch (IllegalArgumentException e) {
- String name = method.getName();
- throw new EventInvocationException("Exception thrown by event method [" + name + "]", e.getCause());
- } catch (IllegalAccessException e) {
- String name = method.getName();
- throw new EventInvocationException("Method is not accessible [" + name + "]");
- } catch (InvocationTargetException e) {
- String name = method.getName();
- throw new EventInvocationException("Exception thrown by event method [" + name + "]", e.getCause());
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/NoConversationalContractException.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/NoConversationalContractException.java
deleted file mode 100644
index 5dc6bc790d..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/NoConversationalContractException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/PolicyHandlingInterceptor.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/PolicyHandlingInterceptor.java
deleted file mode 100644
index 8c85b46c65..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/PolicyHandlingInterceptor.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-
-/**
- * An interceptor to invoke policy handlers before and after the invocation of operations on
- * an implementation.
- *
- * @version $Rev$ $Date$
- */
-public class PolicyHandlingInterceptor implements Interceptor {
- private Invoker next;
- private List<PolicyHandler> policyHandlers = null;
- private Operation targetOperation = null;
-
- public PolicyHandlingInterceptor(Operation targetOperation, List<PolicyHandler> policyHandlers) {
- this.policyHandlers = policyHandlers;
- this.targetOperation = targetOperation;
- }
-
- public Message invoke(Message msg) {
- try {
- applyPreInvocationPolicies(targetOperation, msg);
- msg = next.invoke(msg);
- } finally {
- applyPostInvocationPolices(targetOperation, msg);
- }
- return msg;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-
- public Invoker getNext() {
- return next;
- }
-
- private void applyPreInvocationPolicies(Object... context) {
- for (PolicyHandler policyHandler : policyHandlers) {
- policyHandler.beforeInvoke(context);
- }
- }
-
- private void applyPostInvocationPolices(Object... context) {
- for ( int count = policyHandlers.size() - 1 ; count >= 0 ; --count) {
- policyHandlers.get(count).afterInvoke(context);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/module/JavaRuntimeModuleActivator.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/module/JavaRuntimeModuleActivator.java
deleted file mode 100644
index 1ea3546adb..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/module/JavaRuntimeModuleActivator.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.java.module;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.context.ComponentContextFactory;
-import org.apache.tuscany.sca.context.ContextFactoryExtensionPoint;
-import org.apache.tuscany.sca.context.RequestContextFactory;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.core.invocation.CglibProxyFactory;
-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.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.impl.MediatorImpl;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.java.invocation.JavaCallbackRuntimeWireProcessor;
-import org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationProviderFactory;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerDefinitionsLoader;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
-import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaRuntimeModuleActivator implements ModuleActivator {
-
- private static final Logger logger = Logger.getLogger(JavaRuntimeModuleActivator.class.getName());
-
- public JavaRuntimeModuleActivator() {
- }
-
- public void start(ExtensionPointRegistry registry) {
-
- FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
- MessageFactory messageFactory = factories.getFactory(MessageFactory.class);
-
- UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper interfaceContractMapper = utilities.getUtility(InterfaceContractMapper.class);
-
- ProxyFactoryExtensionPoint proxyFactories = registry.getExtensionPoint(ProxyFactoryExtensionPoint.class);
- try {
- proxyFactories.setClassProxyFactory(new CglibProxyFactory(messageFactory, interfaceContractMapper));
- } catch (NoClassDefFoundError e) {
- logger.warning("Class proxys not supported due to NoClassDefFoundError:" + e.getMessage());
- }
-
- JavaInterfaceFactory javaFactory = factories.getFactory(JavaInterfaceFactory.class);
-
- DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class);
- TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class);
- MediatorImpl mediator = new MediatorImpl(dataBindings, transformers);
- utilities.addUtility(mediator);
- JavaPropertyValueObjectFactory factory = new JavaPropertyValueObjectFactory(mediator);
- factories.addFactory(factory);
-
- ContextFactoryExtensionPoint contextFactories = registry.getExtensionPoint(ContextFactoryExtensionPoint.class);
- ComponentContextFactory componentContextFactory = contextFactories.getFactory(ComponentContextFactory.class);
- RequestContextFactory requestContextFactory = contextFactories.getFactory(RequestContextFactory.class);
-
- List<PolicyHandlerTuple> policyHandlerClassNames = null;
- policyHandlerClassNames = PolicyHandlerDefinitionsLoader.loadPolicyHandlerClassnames();
-
- ProxyFactory proxyFactory = new ExtensibleProxyFactory(proxyFactories);
-
- JavaImplementationProviderFactory javaImplementationProviderFactory =
- new JavaImplementationProviderFactory(proxyFactory, dataBindings, factory, componentContextFactory,
- requestContextFactory, policyHandlerClassNames);
-
- ProviderFactoryExtensionPoint providerFactories =
- registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
- providerFactories.addProviderFactory(javaImplementationProviderFactory);
-
- RuntimeWireProcessorExtensionPoint wireProcessorExtensionPoint =
- registry.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class);
- if (wireProcessorExtensionPoint != null) {
- wireProcessorExtensionPoint.addWireProcessor(new JavaCallbackRuntimeWireProcessor(interfaceContractMapper,
- javaFactory));
- //wireProcessorExtensionPoint.addWireProcessor(new JavaPolicyHandlingRuntimeWireProcessor());
- }
- }
-
- public void stop(ExtensionPointRegistry registry) {
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index 0871ddf4be..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# Implementation class for the ModuleActivator
-org.apache.tuscany.sca.implementation.java.module.JavaRuntimeModuleActivator
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/MultiplicityTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/MultiplicityTestCase.java
deleted file mode 100644
index 629ba8b321..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/MultiplicityTestCase.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.context;
-
-import org.junit.Test;
-
-
-
-/**
- * Tests wires that are configured with a multiplicity
- *
- * @version $Rev$ $Date$
- */
-public class MultiplicityTestCase {
-
- @Test
- public void testMultiplicity() throws Exception {
- // TODO implement
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapperTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapperTestCase.java.fixme
deleted file mode 100644
index 628a308c86..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapperTestCase.java.fixme
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.context;
-
-import static org.easymock.EasyMock.createMock;
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.core.scope.TargetDestructionException;
-import org.apache.tuscany.sca.core.scope.TargetInitializationException;
-import org.apache.tuscany.sca.implementation.java.invocation.EventInvoker;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ReflectiveInstanceWrapperTestCase extends TestCase {
- private ReflectiveInstanceWrapper<Object> wrapper;
- private Object instance;
- private EventInvoker<Object> initInvoker;
- private EventInvoker<Object> destroyInvoker;
-
- public void testWithNoCallbacks() {
- wrapper = new ReflectiveInstanceWrapper<Object>(instance, null, null);
- try {
- wrapper.start();
- } catch (TargetInitializationException e) {
- fail();
- }
- try {
- wrapper.stop();
- } catch (TargetDestructionException e) {
- fail();
- }
- }
-
- public void testWithStartCallback() {
- initInvoker.invokeEvent(instance);
- EasyMock.replay(initInvoker);
- wrapper = new ReflectiveInstanceWrapper<Object>(instance, initInvoker, null);
- try {
- wrapper.start();
- } catch (TargetInitializationException e) {
- fail();
- }
- EasyMock.verify(initInvoker);
- }
-
- public void testWithStopCallback() {
- destroyInvoker.invokeEvent(instance);
- EasyMock.replay(destroyInvoker);
- wrapper = new ReflectiveInstanceWrapper<Object>(instance, null, destroyInvoker);
- try {
- wrapper.stop();
- } catch (TargetDestructionException e) {
- fail();
- }
- EasyMock.verify(destroyInvoker);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected void setUp() throws Exception {
- super.setUp();
- instance = new Object();
- initInvoker = createMock(EventInvoker.class);
- destroyInvoker = createMock(EventInvoker.class);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/CallbackWireObjectFactoryTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/CallbackWireObjectFactoryTestCase.java.fixme
deleted file mode 100644
index 29dcfa8169..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/CallbackWireObjectFactoryTestCase.java.fixme
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import static org.easymock.EasyMock.createMock;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CallbackWireObjectFactoryTestCase extends TestCase {
-
- @SuppressWarnings({"unchecked"})
- public void testCreateInstance() throws Exception {
- ProxyFactory service = createMock(ProxyFactory.class);
- Foo foo = new Foo() {
- };
- EasyMock.expect(service.createCallbackProxy(EasyMock.eq(Foo.class), EasyMock.isA(List.class))).andReturn(foo);
- EasyMock.replay(service);
- List<RuntimeWire> wires = new ArrayList<RuntimeWire>();
- CallbackWireObjectFactory factory = new CallbackWireObjectFactory(Foo.class, service, wires);
- assertEquals(foo, factory.getInstance());
- EasyMock.verify(service);
- }
-
- private interface Foo {
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjectorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjectorTestCase.java
deleted file mode 100644
index 098789f495..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjectorTestCase.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import static org.junit.Assert.assertEquals;
-
-import java.lang.reflect.Field;
-
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class FieldInjectorTestCase {
-
- protected Field protectedField;
-
- @Test
- public void testIllegalAccess() throws Exception {
- FieldInjector<Foo> injector = new FieldInjector<Foo>(protectedField, new SingletonObjectFactory<String>("foo"));
- Foo foo = new Foo();
- injector.inject(foo);
- assertEquals("foo", foo.hidden);
- }
-
-
- @Before
- public void setUp() throws Exception {
- protectedField = Foo.class.getDeclaredField("hidden");
- }
-
- private class Foo {
- private String hidden;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactoryTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactoryTestCase.java.fixme
deleted file mode 100644
index 366f21d9f0..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactoryTestCase.java.fixme
+++ /dev/null
@@ -1,449 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.easymock.EasyMock;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This test case will test the JavaPropertyValueObjectFactory.
- *
- * @version $Rev$ $Date$
- */
-public class JavaPropertyValueObjectFactoryTestCase {
-
- /**
- * The factory we should use for testing.
- */
- private static JavaPropertyValueObjectFactory factory;
-
- /**
- * The assembly factory used to create Properties.
- */
- private static AssemblyFactory assemblyFactory;
-
- /**
- * Test Setup.
- */
- @BeforeClass
- public static void setup() {
- // Create the factory
- Mediator mediator = EasyMock.createNiceMock(Mediator.class);
- DataBindingExtensionPoint dpep = new DefaultDataBindingExtensionPoint();
- EasyMock.expect(mediator.getDataBindings()).andReturn(dpep).anyTimes();
- EasyMock.replay(mediator);
- factory = new JavaPropertyValueObjectFactory(mediator);
-
- // Create the AssemblyFactory we should use
- assemblyFactory = new DefaultAssemblyFactory();
- }
-
- /**
- * A test that will attempt to inject positive, negative and zero into an
- * int property.
- */
- @Test
- public void testIntegerInjectionValid() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "intField";
- params.xsdType = SimpleTypeMapperImpl.XSD_INT;
- params.expectedType = Integer.TYPE;
-
- for (int i = -5; i <= 5; i++) {
- params.propertyValue = Integer.toString(i);
- params.expectedValueFromFactory = i;
- doInjection(params);
- }
- }
-
- /**
- * A test that will attempt to inject positive, negative and zero into an
- * int property using a JavaElement.
- */
- @Test
- public void testIntegerInjectionValidWithJavaElement() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "intField";
- params.xsdType = SimpleTypeMapperImpl.XSD_INT;
- params.expectedJavaElement = new JavaElementImpl(int.class);
-
- for (int i = -5; i <= 5; i++) {
- params.propertyValue = Integer.toString(i);
- params.expectedValueFromFactory = i;
- doInjection(params);
- }
- }
-
- /**
- * A test that will attempt to inject multiple int values into an
- * int property.
- */
- @Test
- public void testIntegerArrayInjectionValid() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "intField";
- params.xsdType = SimpleTypeMapperImpl.XSD_INT;
- params.isMany = true;
- params.expectedType = int.class;
- params.propertyValue = "1 2 3 4 5";
- params.expectedValueFromFactory = Arrays.asList(1, 2, 3, 4, 5);
- doInjection(params);
- }
-
- /**
- * A test that will attempt to inject multiple int values into an
- * int property using a JavaElement.
- */
- @Test
- public void testIntegerArrayInjectionValidWithJavaElement() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "intField";
- params.xsdType = SimpleTypeMapperImpl.XSD_INT;
- params.isMany = true;
- params.expectedJavaElement = new JavaElementImpl(int[].class);
- params.propertyValue = "1 2 3 4 5";
- int[] expected = { 1, 2, 3, 4, 5 };
- params.expectedValueFromFactory = expected;
- doInjection(params);
- }
-
- /**
- * A test that will attempt to inject a non-number into an
- * int property.
- */
- @Test
- public void testIntegerInjectionBadNumberInvalid() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "intField";
- params.xsdType = SimpleTypeMapperImpl.XSD_INT;
- params.expectedType = Integer.TYPE;
- params.propertyValue = "a";
- params.exceptionExpected = true;
- doInjection(params);
- }
-
- /**
- * A test that will attempt to inject a non-number into an
- * int property using a JavaElement.
- */
- @Test
- public void testIntegerInjectionBadNumberInvalidWithJavaElement() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "intField";
- params.xsdType = SimpleTypeMapperImpl.XSD_INT;
- params.expectedJavaElement = new JavaElementImpl(Integer.TYPE);
- params.propertyValue = "a";
- params.exceptionExpected = true;
- doInjection(params);
- }
-
- /**
- * A test that will attempt to inject multiple int values into an
- * int property where one of the property values is not a number.
- * The injection should throw ObjectCreationException
- */
- @Test
- public void testIntegerArrayInjectionBadNumberInvalid() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "intField";
- params.xsdType = SimpleTypeMapperImpl.XSD_INT;
- params.isMany = true;
- params.expectedType = int.class;
- params.propertyValue = "1 2 aa 4 5";
- params.exceptionExpected = true;
- doInjection(params);
- }
-
- /**
- * A test that will attempt to inject multiple int values into an
- * int property using a JavaElement where one of the property
- * values is not a number.
- * The injection should throw ObjectCreationException
- */
- @Test
- public void testIntegerArrayInjectionBadNumberInvalidWithJavaElement() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "intField";
- params.xsdType = SimpleTypeMapperImpl.XSD_INT;
- params.isMany = true;
- params.expectedJavaElement = new JavaElementImpl(int[].class);
- params.propertyValue = "1 2 aa 4 5";
- params.exceptionExpected = true;
- doInjection(params);
- }
-
- /**
- * A test that will attempt to inject an empty string into an int property.
- * The injection should throw ObjectCreationException
- */
- @Test
- public void testIntegerInjectionEmptyStringInvalid() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "intField";
- params.xsdType = SimpleTypeMapperImpl.XSD_INT;
- params.expectedType = Integer.TYPE;
- params.propertyValue = "";
- params.exceptionExpected = true;
- doInjection(params);
- }
-
- /**
- * A test that will attempt to inject an empty string into an int property
- * using a JavaElement.
- * The injection should throw ObjectCreationException
- */
- @Test
- public void testIntegerInjectionEmptyStringInvalidWithJavaElement() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "intField";
- params.xsdType = SimpleTypeMapperImpl.XSD_INT;
- params.expectedJavaElement = new JavaElementImpl(Integer.TYPE);
- params.propertyValue = "";
- params.exceptionExpected = true;
- doInjection(params);
- }
-
- /**
- * A test that will attempt to inject a String into a String
- * property.
- */
- @Test
- public void testStringInjectionValid() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "StringField";
- params.xsdType = SimpleTypeMapperImpl.XSD_STRING;
- params.expectedType = String.class;
-
- params.propertyValue = "Some Test String";
- params.expectedValueFromFactory = "Some Test String";
- doInjection(params);
- }
-
- /**
- * A test that will attempt to inject a String into a String
- * property using a JavaElement.
- */
- @Test
- public void testStringInjectionValidWithJavaElement() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "StringField";
- params.xsdType = SimpleTypeMapperImpl.XSD_STRING;
- params.expectedJavaElement = new JavaElementImpl(String.class);
-
- params.propertyValue = "Some Test String";
- params.expectedValueFromFactory = "Some Test String";
- doInjection(params);
- }
-
- /**
- * This class defines all the parameters for the Property Injection test.
- */
- private class InjectionTestParams {
- // Input parameters for the test
- public boolean isMany = false;
- public String propertyName;
- public String propertyValue;
- public QName xsdType;
-
- // Expected result for test
- public Object expectedValueFromFactory;
- public Class<?> expectedType;
- public JavaElementImpl expectedJavaElement;
- public boolean exceptionExpected = false;
- }
-
- /**
- * A test that will attempt to inject multiple String values into an
- * String property.
- */
- @Test
- public void testStringArrayInjectionValid() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "StringField";
- params.xsdType = SimpleTypeMapperImpl.XSD_STRING;
- params.isMany = true;
- params.expectedType = String.class;
- params.propertyValue = "\"String1\" \"String2\" \"String3\" \"String4\" \"String5\"";
- params.expectedValueFromFactory = Arrays.asList(
- "String1", "String2", "String3", "String4", "String5");
- doInjection(params);
- }
-
- /**
- * A test that will attempt to inject multiple String values into an
- * String property using a JavaElement.
- */
- @Test
- public void testStringArrayInjectionValidWithJavaElement() {
- InjectionTestParams params = new InjectionTestParams();
- params.propertyName = "StringField";
- params.xsdType = SimpleTypeMapperImpl.XSD_STRING;
- params.isMany = true;
- params.expectedJavaElement = new JavaElementImpl(String.class);
- params.propertyValue = "\"String1\" \"String2\" \"String3\" \"String4\" \"String5\"";
- params.expectedValueFromFactory = Arrays.asList(
- "String1", "String2", "String3", "String4", "String5");
- doInjection(params);
- }
-
- /**
- * Utility method for testing creating properties with the
- * JavaPropertyValueObjectFactory.
- *
- * @param testParams The parameters for the test
- */
- private void doInjection(final InjectionTestParams testParams) {
- // Create the property
- Property prop = assemblyFactory.createProperty();
- prop.setMany(testParams.isMany);
- prop.setName(testParams.propertyName);
- prop.setXSDType(testParams.xsdType);
-
- // Mock up the XML that will contain the Property details
- Document doc = EasyMock.createNiceMock(Document.class);
- Element rootElement = EasyMock.createMock(Element.class);
- EasyMock.expect(doc.getDocumentElement()).andReturn(rootElement);
- NodeList nodeList = EasyMock.createMock(NodeList.class);
- EasyMock.expect(rootElement.getChildNodes()).andReturn(nodeList).anyTimes();
- EasyMock.expect(nodeList.getLength()).andReturn(1);
- Node node = EasyMock.createMock(Node.class);
- EasyMock.expect(nodeList.item(0)).andReturn(node);
- EasyMock.expect(node.getTextContent()).andReturn(testParams.propertyValue);
- EasyMock.replay(doc, rootElement, nodeList, node);
-
- // Create a factory either using the Class or JavaElementImpl constructor
- ObjectFactory<?> objectFactory;
- if (testParams.expectedJavaElement != null) {
- objectFactory = factory.createValueFactory(prop, doc, testParams.expectedJavaElement);
- } else {
- objectFactory = factory.createValueFactory(prop, doc, testParams.expectedType);
- }
- Assert.assertNotNull(objectFactory);
-
- // Lets test the factory
- try {
- // Create a new instance with the factory
- Object value = objectFactory.getInstance();
-
- // Did we expect an exception to be thrown?
- if (testParams.exceptionExpected) {
- Assert.fail("Test should have thrown ObjectCreationException");
- }
-
- // Make sure the result is of the correct type
- if (testParams.expectedValueFromFactory instanceof Collection<?>) {
- // Make sure the Collections contain the same type
- Assert.assertTrue(value instanceof Collection<?>);
- Iterator<?> iter1 = ((Collection<?>) testParams.expectedValueFromFactory).iterator();
- Iterator<?> iter2 = ((Collection<?>) value).iterator();
- Assert.assertEquals(iter1.next().getClass(), iter2.next().getClass());
- } else {
- Assert.assertEquals(testParams.expectedValueFromFactory.getClass(), value.getClass());
- }
-
- // Validate the result
- Assert.assertNotNull(value);
- if (testParams.expectedValueFromFactory.getClass().isArray()) {
- Assert.assertTrue(compareArrays(testParams.expectedValueFromFactory, value));
- } else {
- Assert.assertEquals(testParams.expectedValueFromFactory, value);
- }
- } catch (ObjectCreationException ex) {
- // Is this an expected exception?
- if (testParams.exceptionExpected) {
- // Make sure the exception error message contains the property name
- Assert.assertTrue(ex.toString().indexOf(testParams.propertyName) != -1);
-
- // Make sure the exception error message contains the property value
- if (testParams.propertyValue != null) {
- if (testParams.isMany) {
- // FIXME: No simple way to do this for multi-value properties
- } else {
- Assert.assertTrue(ex.toString().indexOf(testParams.propertyValue) != -1);
- }
- }
- } else {
- // Test failure. We were not expecting an exception
- ex.printStackTrace();
- Assert.fail("Unexpected exception " + ex);
- }
- }
- }
-
- /**
- * Compares two Objects that are actually arrays to make sure that they are
- * equal.
- *
- * @param array1 The first array
- * @param array2 The second array
- * @return True if they are equal. False if they are not
- */
- private boolean compareArrays(final Object array1, final Object array2) {
- // Check for primitive array types
- if (array1 instanceof boolean[]) {
- return Arrays.equals((boolean[]) array1, (boolean[]) array2);
- }
- if (array1 instanceof byte[]) {
- return Arrays.equals((byte[]) array1, (byte[]) array2);
- }
- if (array1 instanceof char[]) {
- return Arrays.equals((char[]) array1, (char[]) array2);
- }
- if (array1 instanceof double[]) {
- return Arrays.equals((double[]) array1, (double[]) array2);
- }
- if (array1 instanceof float[]) {
- return Arrays.equals((float[]) array1, (float[]) array2);
- }
- if (array1 instanceof int[]) {
- return Arrays.equals((int[]) array1, (int[]) array2);
- }
- if (array1 instanceof long[]) {
- return Arrays.equals((long[]) array1, (long[]) array2);
- }
- if (array1 instanceof short[]) {
- return Arrays.equals((short[]) array1, (short[]) array2);
- }
-
- // Not a primitive so must be an Object[]
- return Arrays.equals((Object[]) array1, (Object[]) array2);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/MethodEventInvokerTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/MethodEventInvokerTestCase.java
deleted file mode 100644
index e9cbce4390..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/MethodEventInvokerTestCase.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.implementation.java.invocation.EventInvocationException;
-import org.apache.tuscany.sca.implementation.java.invocation.MethodEventInvoker;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class MethodEventInvokerTestCase {
- private Method privateMethod;
- private Method exceptionMethod;
-
- @Test
- public void testIllegalAccess() throws Exception {
- MethodEventInvoker<MethodEventInvokerTestCase.Foo> injector = new MethodEventInvoker<Foo>(privateMethod);
- try {
- injector.invokeEvent(new Foo());
- fail();
- } catch (EventInvocationException e) {
- // expected
- }
- }
-
- @Test
- public void testException() throws Exception {
- MethodEventInvoker<MethodEventInvokerTestCase.Foo> injector = new MethodEventInvoker<Foo>(exceptionMethod);
- try {
- injector.invokeEvent(new Foo());
- fail();
- } catch (RuntimeException e) {
- // expected
- }
- }
-
- @Before
- public void setUp() throws Exception {
- privateMethod = MethodEventInvokerTestCase.Foo.class.getDeclaredMethod("hidden");
- exceptionMethod = MethodEventInvokerTestCase.Foo.class.getDeclaredMethod("exception");
-
- }
-
- public class Foo {
-
- public void foo() {
- }
-
- private void hidden() {
- }
-
- public void exception() {
- throw new RuntimeException();
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjectorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjectorTestCase.java
deleted file mode 100644
index 19184d5204..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjectorTestCase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class MethodInjectorTestCase {
- private Method fooMethod;
- private Method privateMethod;
- private Method exceptionMethod;
-
- @Test
- public void testIllegalArgument() throws Exception {
- ObjectFactory<Object> factory = new SingletonObjectFactory<Object>(new Object());
- MethodInjector<Foo> injector = new MethodInjector<Foo>(fooMethod, factory);
- try {
- injector.inject(new Foo());
- fail();
- } catch (ObjectCreationException e) {
- // expected
- }
- }
-
- @Test
- public void testException() throws Exception {
- ObjectFactory<Object> factory = new SingletonObjectFactory<Object>("foo");
- MethodInjector<Foo> injector = new MethodInjector<Foo>(exceptionMethod, factory);
- try {
- injector.inject(new Foo());
- fail();
- } catch (RuntimeException e) {
- // expected
- }
- }
-
- @Before
- public void setUp() throws Exception {
- fooMethod = Foo.class.getMethod("foo", String.class);
- privateMethod = Foo.class.getDeclaredMethod("hidden", String.class);
- exceptionMethod = Foo.class.getDeclaredMethod("exception", String.class);
-
- }
-
- private class Foo {
-
- public void foo(String bar) {
- }
-
- private void hidden(String bar) {
- }
-
- public void exception(String bar) {
- throw new RuntimeException();
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/ResourceObjectFactoryTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/ResourceObjectFactoryTestCase.java.fixme
deleted file mode 100644
index ed7a0e7d03..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/ResourceObjectFactoryTestCase.java.fixme
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import junit.framework.TestCase;
-
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ResourceObjectFactoryTestCase extends TestCase {
-
- public void testResolveFromHostByType() throws Exception {
- ResourceHost host = EasyMock.createMock(ResourceHost.class);
- EasyMock.expect(host.resolveResource(EasyMock.eq(String.class))).andReturn("foo");
- EasyMock.replay(host);
- ResourceObjectFactory<String> factory = new ResourceObjectFactory<String>(String.class, false, host);
- assertEquals("foo", factory.getInstance());
- EasyMock.verify(host);
- }
-
- public void testResolveFromHostByName() throws Exception {
- ResourceHost host = EasyMock.createMock(ResourceHost.class);
- EasyMock.expect(host.resolveResource(EasyMock.eq(String.class),
- EasyMock.eq("sca://localhost/bar"))).andReturn("foo");
- EasyMock.replay(host);
- ResourceObjectFactory<String> factory =
- new ResourceObjectFactory<String>(String.class, "sca://localhost/bar", false, host);
- assertEquals("foo", factory.getInstance());
- EasyMock.verify(host);
- }
-
-
- public void testResolveFromParentThenResolveFromHostNotFound() throws Exception {
- ResourceHost host = EasyMock.createMock(ResourceHost.class);
- EasyMock.expect(host.resolveResource(EasyMock.eq(String.class))).andReturn(null);
- EasyMock.replay(host);
- ResourceObjectFactory<String> factory = new ResourceObjectFactory<String>(String.class, true, host);
- assertNull(factory.getInstance());
- EasyMock.verify(host);
- }
-
- public void testResolveByTypeNotFound() throws Exception {
-// ResourceHost host = EasyMock.createMock(ResourceHost.class);
-// EasyMock.expect(host.resolveResource(EasyMock.eq(String.class))).andReturn(null);
-// EasyMock.replay(host);
-//
-// RuntimeWire wire = EasyMock.createMock(RuntimeWire.class);
-// EasyMock.expect(wire.getTargetInstance()).andReturn(null);
-// EasyMock.replay(wire);
-//
-// ResourceObjectFactory<String> factory = new ResourceObjectFactory<String>(String.class, false, host);
-// try {
-// factory.getInstance();
-// fail();
-// } catch (ResourceNotFoundException e) {
-// //expected
-// }
-// EasyMock.verify(host);
- }
-
- public void testResolveByTypeNotFoundOptional() throws Exception {
- ResourceHost host = EasyMock.createMock(ResourceHost.class);
- EasyMock.expect(host.resolveResource(EasyMock.eq(String.class))).andReturn(null);
- EasyMock.replay(host);
- ResourceObjectFactory<String> factory = new ResourceObjectFactory<String>(String.class, true, host);
- assertNull(factory.getInstance());
- EasyMock.verify(host);
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/SingletonObjectFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/SingletonObjectFactory.java
deleted file mode 100644
index c1650c3a83..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/SingletonObjectFactory.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-
-/**
- * Implementation of ObjectFactory that returns a single instance, typically an immutable type.
- *
- * @version $Rev$ $Date$
- */
-public class SingletonObjectFactory<T> implements ObjectFactory<T> {
- private final T instance;
-
- public SingletonObjectFactory(T instance) {
- this.instance = instance;
- }
-
- public T getInstance() {
- return instance;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/SingletonObjectFactoryTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/SingletonObjectFactoryTestCase.java
deleted file mode 100644
index 0bb222bad4..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/SingletonObjectFactoryTestCase.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SingletonObjectFactoryTestCase {
-
- @Test
- public void testSingleton() throws Exception {
- Object o = new Object();
- SingletonObjectFactory<Object> factory = new SingletonObjectFactory<Object>(o);
- assertEquals(o, factory.getInstance());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/TestObjectFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/TestObjectFactory.java
deleted file mode 100644
index de371e09bb..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/TestObjectFactory.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-
-/**
- * Creates new instances of a Java class
- *
- * @version $Rev$ $Date$
- * @see org.apache.tuscany.sca.implementation.java.injection.Injector
- */
-public class TestObjectFactory<T> implements ObjectFactory<T> {
-
- private final Constructor<T> ctr;
- private ObjectFactory[] initializerFactories;
-
- /**
- * Creates the object factory
- *
- * @param ctr the constructor to use when instantiating a new object
- */
- public TestObjectFactory(Constructor<T> ctr) {
- assert ctr != null;
- this.ctr = ctr;
- initializerFactories = new ObjectFactory[ctr.getParameterTypes().length];
- }
-
- /**
- * Creates the object factory
- *
- * @param ctr the constructor to use when instantiating a new object
- * @param factories an ordered list of <code>ObjectFactory</code>s to use for returning constructor parameters
- */
- public TestObjectFactory(Constructor<T> ctr, List<ObjectFactory> factories) {
- assert ctr != null;
- int params = ctr.getParameterTypes().length;
- assert params == factories.size();
- this.ctr = ctr;
- initializerFactories = new ObjectFactory[params];
- int i = 0;
- for (ObjectFactory factory : factories) {
- initializerFactories[i] = factory;
- i++;
- }
- }
-
- /**
- * Returns the ordered array of <code>ObjectFactory</code>s use in creating constructor parameters
- */
- public ObjectFactory[] getInitializerFactories() {
- return initializerFactories;
- }
-
- /**
- * Sets an <code>ObjectFactory</code>s to use in creating constructor parameter
- *
- * @param pos the constructor parameter position
- * @param factory the object factory
- */
- public void setInitializerFactory(int pos, ObjectFactory factory) {
- assert pos < initializerFactories.length;
- initializerFactories[pos] = factory;
- }
-
- /**
- * Creates a new instance of an object
- */
- public T getInstance() throws ObjectCreationException {
- int size = initializerFactories.length;
- Object[] initargs = new Object[size];
- // create the constructor arg array
- for (int i = 0; i < size; i++) {
- ObjectFactory<?> objectFactory = initializerFactories[i];
- if (objectFactory == null) {
- // this can happen if a reference is optional
- initargs[i] = null;
- } else {
- initargs[i] = objectFactory.getInstance();
- }
- }
- try {
- ctr.setAccessible(true);
- return ctr.newInstance(initargs);
- } catch (IllegalArgumentException e) {
- String name = ctr.getName();
- throw new ObjectCreationException("Exception thrown by constructor: " + name, e);
- } catch (InstantiationException e) {
- String name = ctr.getDeclaringClass().getName();
- throw new AssertionError("Class is not instantiable [" + name + "]");
- } catch (IllegalAccessException e) {
- String name = ctr.getName();
- throw new AssertionError("Constructor is not accessible [" + name + "]");
- } catch (InvocationTargetException e) {
- String name = ctr.getName();
- throw new ObjectCreationException("Exception thrown by constructor: " + name, e);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/TestObjectFactoryTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/TestObjectFactoryTestCase.java
deleted file mode 100644
index ea9d15b3f6..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/TestObjectFactoryTestCase.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TestObjectFactoryTestCase {
-
- private Constructor<Foo> ctor;
-
- @Test
- public void testConstructorInjection() throws Exception {
- List<ObjectFactory> initializers = new ArrayList<ObjectFactory>();
- initializers.add(new SingletonObjectFactory<String>("foo"));
- TestObjectFactory<Foo> factory = new TestObjectFactory<Foo>(ctor, initializers);
- Foo foo = factory.getInstance();
- assertEquals("foo", foo.foo);
- }
-
- /**
- * Verifies null parameters can be passed to a constructor. This is valid when a reference is optional during
- * constructor injection
- */
- @Test
- public void testConstructorInjectionOptionalParam() throws Exception {
- List<ObjectFactory> initializers = new ArrayList<ObjectFactory>();
- initializers.add(null);
- TestObjectFactory<Foo> factory = new TestObjectFactory<Foo>(ctor, initializers);
- Foo foo = factory.getInstance();
- assertNull(foo.foo);
- }
-
- @Test
- public void testConstructorInitializerInjection() throws Exception {
- TestObjectFactory<Foo> factory = new TestObjectFactory<Foo>(ctor);
- factory.setInitializerFactory(0, new SingletonObjectFactory<String>("foo"));
- Foo foo = factory.getInstance();
- assertEquals("foo", foo.foo);
- }
-
- @Before
- public void setUp() throws Exception {
- ctor = Foo.class.getConstructor(String.class);
- }
-
- private static class Foo {
-
- private String foo;
-
- public Foo(String foo) {
- this.foo = foo;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean1.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean1.java
deleted file mode 100644
index e993cdd382..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean1.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.util;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Bean1 extends SuperBean {
-
- public static final int ALL_BEAN1_FIELDS = 6 + ALL_SUPER_FIELDS;
- public static final int ALL_BEAN1_PUBLIC_PROTECTED_FIELDS = 5 + ALL_SUPER_PUBLIC_PROTECTED_FIELDS;
- public static final int ALL_BEAN1_METHODS = 4 + ALL_SUPER_METHODS - 1;
- public String field3;
- protected String field2;
- private String field1;
-
- public void setMethod1(String param) {
- }
-
- public void setMethod1(int param) {
- }
-
- @Override
- public void override(String param) throws Exception {
- }
-
-
- public void noOverride(String param) throws Exception {
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean2.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean2.java
deleted file mode 100644
index f5128f6a6c..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean2.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.util;
-
-import java.util.List;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Bean2 {
-
- private List methodList;
- private List fieldList;
-
- public List getMethodList() {
- return methodList;
- }
-
- public void setMethodList(List list) {
- methodList = list;
- }
-
- public List getfieldList() {
- return fieldList;
- }
-
- public void setfieldList(List list) {
- throw new RuntimeException("setter inadvertantly called");
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Entry.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Entry.java
deleted file mode 100644
index a5e12d181c..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Entry.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.util;
-
-/**
- * Implementations are used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public interface Entry {
-
- String getString();
-
- void setString(String val);
-}
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java
deleted file mode 100644
index 9624865dcc..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.util;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-import org.junit.Test;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaIntrospectionHelperTestCase {
-
- private List testNoGenericsList;
- private List<String> testList;
- private Map<String, Bean1> testMap;
- private Entry[] testArray;
- private String[] testStringArray;
-
- @Test
- public void testBean1AllPublicProtectedFields() throws Exception {
- Set<Field> beanFields = JavaIntrospectionHelper.getAllPublicAndProtectedFields(Bean1.class, true);
- assertEquals(4, beanFields.size()); //Bean1.ALL_BEAN1_PUBLIC_PROTECTED_FIELDS
- }
-
- @Test
- public void testGetSuperAllMethods() throws Exception {
- Set<Method> superBeanMethods = JavaIntrospectionHelper.getAllUniquePublicProtectedMethods(SuperBean.class, true);
- assertEquals(SuperBean.ALL_SUPER_METHODS, superBeanMethods.size());
- }
-
- @Test
- public void testGetBean1AllMethods() throws Exception {
- Set<Method> beanMethods = JavaIntrospectionHelper.getAllUniquePublicProtectedMethods(Bean1.class, true);
- assertEquals(Bean1.ALL_BEAN1_METHODS, beanMethods.size());
- }
-
- @Test
- public void testOverrideMethod() throws Exception {
- Set<Method> beanFields = JavaIntrospectionHelper.getAllUniquePublicProtectedMethods(Bean1.class, true);
- boolean invoked = false;
- for (Method method : beanFields) {
- if (method.getName().equals("override")) {
- method.invoke(new Bean1(), "foo");
- invoked = true;
- }
- }
- if (!invoked) {
- throw new Exception("Override never invoked");
- }
- }
-
- @Test
- public void testNoOverrideMethod() throws Exception {
- Set<Method> beanFields = JavaIntrospectionHelper.getAllUniquePublicProtectedMethods(Bean1.class, true);
- boolean found = false;
- for (Method method : beanFields) {
- if (method.getName().equals("noOverride") && method.getParameterTypes().length == 0) {
- found = true;
- }
- }
- if (!found) {
- throw new Exception("No override not found");
- }
- }
-
- @Test
- public void testDefaultConstructor() throws Exception {
- Constructor<Bean2> ctr = JavaIntrospectionHelper.getDefaultConstructor(Bean2.class);
- assertEquals(ctr, Bean2.class.getConstructor());
- assertTrue(Bean2.class == ctr.newInstance((Object[]) null).getClass());
- }
-
-
- @Test
- public void testGetAllInterfaces() {
- Set<Class<?>> interfaces = JavaIntrospectionHelper.getAllInterfaces(Z.class);
- assertEquals(2, interfaces.size());
- assertTrue(interfaces.contains(W.class));
- assertTrue(interfaces.contains(W2.class));
- }
-
-
- @Test
- public void testGetAllInterfacesObject() {
- Set<Class<?>> interfaces = JavaIntrospectionHelper.getAllInterfaces(Object.class);
- assertEquals(0, interfaces.size());
- }
-
- @Test
- public void testGetAllInterfacesNoInterfaces() {
- Set<Class<?>> interfaces = JavaIntrospectionHelper.getAllInterfaces(NoInterface.class);
- assertEquals(0, interfaces.size());
- }
-
- /**
- * Tests generics introspection capabilities
- */
- @Test
- public void testGenerics() throws Exception {
-
- List classes = JavaIntrospectionHelper.getGenerics(getClass().getDeclaredField("testList").getGenericType());
- assertEquals(1, classes.size());
- assertEquals(String.class, classes.get(0));
-
- classes =
- JavaIntrospectionHelper.getGenerics(getClass().getDeclaredField("testNoGenericsList").getGenericType());
- assertEquals(0, classes.size());
-
- classes = JavaIntrospectionHelper.getGenerics(getClass().getDeclaredField("testMap").getGenericType());
- assertEquals(2, classes.size());
- assertEquals(String.class, classes.get(0));
- assertEquals(Bean1.class, classes.get(1));
-
- classes = JavaIntrospectionHelper
- .getGenerics(getClass().getDeclaredMethod("fooMethod", Map.class).getGenericParameterTypes()[0]);
- assertEquals(2, classes.size());
- assertEquals(String.class, classes.get(0));
- assertEquals(Bean1.class, classes.get(1));
-
- classes = JavaIntrospectionHelper
- .getGenerics(getClass().getDeclaredMethod("fooMethod", List.class).getGenericParameterTypes()[0]);
- assertEquals(1, classes.size());
- assertEquals(String.class, classes.get(0));
-
- }
-
- private void fooMethod(List<String> foo) {
-
- }
-
- private void fooMethod(Map<String, Bean1> foo) {
-
- }
-
- public void setTestArray(Entry[] array) {
- }
-
- private interface W {
-
- }
-
- private interface W2 {
-
- }
-
- private class X implements W {
-
- }
-
- private class Y extends X implements W, W2 {
-
- }
-
- private class Z extends Y {
-
- }
-
- private class NoInterface {
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/SuperBean.java b/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/SuperBean.java
deleted file mode 100644
index 408cedb8be..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/SuperBean.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.util;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SuperBean {
-
- public static final int ALL_SUPER_FIELDS = 6;
- public static final int ALL_SUPER_PUBLIC_PROTECTED_FIELDS = 5;
- public static final int ALL_SUPER_METHODS = 4;
- public String superField2;
-
- protected String superField3;
-
- private String superField1;
-
- public void setSuperMethod1(String param) {
- }
-
- public void setSuperMethod1(int param) {
- }
-
- public void override(String param) throws Exception {
- throw new Exception("Override not handled");
- }
-
- public void noOverride() throws Exception {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/LICENSE b/tags/java/sca/2.0-M1/modules/implementation-java-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/implementation-java-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index 47985bffbe..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,29 +0,0 @@
-Manifest-Version: 1.0
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Java Implementation XML Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397170750
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Java Implementation XML Model
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.builder;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.assembly.xml;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.implementation.java;version="2.0.0",
- org.apache.tuscany.sca.implementation.java.introspect;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0";resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.implementation.java.xml
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/NOTICE b/tags/java/sca/2.0-M1/modules/implementation-java-xml/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/pom.xml b/tags/java/sca/2.0-M1/modules/implementation-java-xml/pom.xml
deleted file mode 100644
index ba3ff8d65e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/pom.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-java-xml</artifactId>
- <name>Apache Tuscany SCA Implementation Java XML Model</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions-xml</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationConstants.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationConstants.java
deleted file mode 100644
index eae7b64267..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationConstants.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.xml;
-
-import javax.xml.namespace.QName;
-
-/**
- * Constants for the Java Implementation.
- *
- * @version $Rev$ $Date$
- */
-public interface JavaImplementationConstants {
- String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- String IMPLEMENTATION_JAVA = "implementation.java";
- QName IMPLEMENTATION_JAVA_QNAME = new QName(SCA10_NS, "implementation.java");
- String CLASS = "class";
- String OPERATION = "operation";
- QName OPERATION_QNAME = new QName(SCA10_NS, OPERATION);
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java
deleted file mode 100644
index 143bb094a3..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-import static org.apache.tuscany.sca.implementation.java.xml.JavaImplementationConstants.CLASS;
-import static org.apache.tuscany.sca.implementation.java.xml.JavaImplementationConstants.IMPLEMENTATION_JAVA;
-import static org.apache.tuscany.sca.implementation.java.xml.JavaImplementationConstants.IMPLEMENTATION_JAVA_QNAME;
-import static org.apache.tuscany.sca.implementation.java.xml.JavaImplementationConstants.OPERATION_QNAME;
-import static org.apache.tuscany.sca.implementation.java.xml.JavaImplementationConstants.SCA10_NS;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.HashMap;
-import java.util.Map;
-
-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.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-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.xml.ConfiguredOperationProcessor;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-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.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-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.IntentAttachPointTypeFactory;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaImplementationProcessor implements StAXArtifactProcessor<JavaImplementation> {
-
- private JavaImplementationFactory javaFactory;
- private AssemblyFactory assemblyFactory;
- private PolicyFactory policyFactory;
- private PolicyAttachPointProcessor policyProcessor;
- private IntentAttachPointTypeFactory intentAttachPointTypeFactory;
- private ConfiguredOperationProcessor configuredOperationProcessor;
- private Monitor monitor;
-
- public JavaImplementationProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.javaFactory = modelFactories.getFactory(JavaImplementationFactory.class);
- this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
- this.intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- this.monitor = monitor;
- this.configuredOperationProcessor = new ConfiguredOperationProcessor(modelFactories, this.monitor);
- }
-
- /**
- * 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-javaxml-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(), "impl-javaxml-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- public JavaImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Read an <implementation.java>
- JavaImplementation javaImplementation = javaFactory.createJavaImplementation();
-
- /*if ( javaImplementation instanceof PolicySetAttachPoint ) {
- IntentAttachPointType implType = intentAttachPointTypeFactory.createImplementationType();
- implType.setName(getArtifactType());
- implType.setUnresolved(true);
- ((PolicySetAttachPoint)javaImplementation).setType(implType);
- }*/
-
- javaImplementation.setUnresolved(true);
- javaImplementation.setName(reader.getAttributeValue(null, CLASS));
-
- // Read policies
- policyProcessor.readPolicies(javaImplementation, reader);
-
- // read operation elements if exists or skip unto end element
- int event;
- ConfiguredOperation confOp = null;
- while (reader.hasNext()) {
- event = reader.next();
- switch ( event ) {
- case START_ELEMENT : {
- if ( OPERATION_QNAME.equals(reader.getName()) ) {
- confOp = configuredOperationProcessor.read(reader);
- if ( confOp != null ) {
- ((OperationsConfigurator)javaImplementation).getConfiguredOperations().add(confOp);
- }
- }
- }
- break;
- }
-
- if (event == END_ELEMENT && IMPLEMENTATION_JAVA_QNAME.equals(reader.getName())) {
- break;
- }
- }
- return javaImplementation;
- }
-
- public void write(JavaImplementation javaImplementation, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
-
- // Write an <implementation.java>
- policyProcessor.writePolicyPrefixes(javaImplementation, writer);
- writer.writeStartElement(SCA10_NS, IMPLEMENTATION_JAVA);
- policyProcessor.writePolicyAttributes(javaImplementation, writer);
-
- if (javaImplementation.getName() != null) {
- writer.writeAttribute(CLASS, javaImplementation.getName());
- }
-
- writer.writeEndElement();
- }
-
- public void resolve(JavaImplementation javaImplementation, ModelResolver resolver)
- throws ContributionResolveException {
-
- ClassReference classReference = new ClassReference(javaImplementation.getName());
- classReference = resolver.resolveModel(ClassReference.class, classReference);
- Class<?> javaClass = classReference.getJavaClass();
- if (javaClass == null) {
- error("ClassNotFoundException", resolver, javaImplementation.getName());
- //throw new ContributionResolveException(new ClassNotFoundException(javaImplementation.getName()));
- return;
- }
-
- javaImplementation.setJavaClass(javaClass);
-
- try {
- javaFactory.createJavaImplementation(javaImplementation, javaImplementation.getJavaClass());
- } catch (IntrospectionException e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", javaFactory, ce);
- //throw ce;
- return;
- }
-
- javaImplementation.setUnresolved(false);
- mergeComponentType(resolver, javaImplementation);
-
- // FIXME the introspector should always create at least one service
- if (javaImplementation.getServices().isEmpty()) {
- javaImplementation.getServices().add(assemblyFactory.createService());
- }
- }
-
- private JavaElementImpl getMemeber(JavaImplementation impl, String name, Class<?> type) {
- String setter = JavaIntrospectionHelper.toSetter(name);
- try {
- Method method = impl.getJavaClass().getDeclaredMethod(setter, type);
- int mod = method.getModifiers();
- if ((Modifier.isPublic(mod) || Modifier.isProtected(mod)) && (!Modifier.isStatic(mod))) {
- return new JavaElementImpl(method, 0);
- }
- } catch (NoSuchMethodException e) {
- Field field;
- try {
- field = impl.getJavaClass().getDeclaredField(name);
- int mod = field.getModifiers();
- if ((Modifier.isPublic(mod) || Modifier.isProtected(mod)) && (!Modifier.isStatic(mod))) {
- return new JavaElementImpl(field);
- }
- } catch (NoSuchFieldException e1) {
- // Ignore
- }
- }
- return null;
- }
-
- /**
- * Merge the componentType from introspection and external file
- * @param resolver
- * @param impl
- */
- private void mergeComponentType(ModelResolver resolver, JavaImplementation impl) {
- // FIXME: Need to clarify how to merge
- ComponentType componentType = getComponentType(resolver, impl);
- if (componentType != null && !componentType.isUnresolved()) {
- Map<String, Reference> refMap = new HashMap<String, Reference>();
- for (Reference ref : impl.getReferences()) {
- refMap.put(ref.getName(), ref);
- }
- for (Reference reference : componentType.getReferences()) {
- refMap.put(reference.getName(), reference);
- }
- impl.getReferences().clear();
- impl.getReferences().addAll(refMap.values());
-
- // Try to match references by type
- Map<String, JavaElementImpl> refMembers = impl.getReferenceMembers();
- for (Reference ref : impl.getReferences()) {
- if (ref.getInterfaceContract() != null) {
- Interface i = ref.getInterfaceContract().getInterface();
- if (i instanceof JavaInterface) {
- Class<?> type = ((JavaInterface)i).getJavaClass();
- if (!refMembers.containsKey(ref.getName())) {
- JavaElementImpl e = getMemeber(impl, ref.getName(), type);
- if (e != null) {
- refMembers.put(ref.getName(), e);
- }
- }
- }
- }
- }
-
- Map<String, Service> serviceMap = new HashMap<String, Service>();
- for (Service svc : impl.getServices()) {
- serviceMap.put(svc.getName(), svc);
- }
- for (Service service : componentType.getServices()) {
- serviceMap.put(service.getName(), service);
- }
- impl.getServices().clear();
- impl.getServices().addAll(serviceMap.values());
-
- Map<String, Property> propMap = new HashMap<String, Property>();
- for (Property prop : impl.getProperties()) {
- propMap.put(prop.getName(), prop);
- }
- for (Property property : componentType.getProperties()) {
- propMap.put(property.getName(), property);
- }
- impl.getProperties().clear();
- impl.getProperties().addAll(propMap.values());
-
- if (componentType.getConstrainingType() != null) {
- impl.setConstrainingType(componentType.getConstrainingType());
- }
- }
- }
-
- private ComponentType getComponentType(ModelResolver resolver, JavaImplementation impl) {
- String className = impl.getJavaClass().getName();
- String componentTypeURI = className.replace('.', '/') + ".componentType";
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setUnresolved(true);
- componentType.setURI(componentTypeURI);
- componentType = resolver.resolveModel(ComponentType.class, componentType);
- if (!componentType.isUnresolved()) {
- return componentType;
- }
- return null;
- }
-
- public QName getArtifactType() {
- return IMPLEMENTATION_JAVA_QNAME;
- }
-
- public Class<JavaImplementation> getModelType() {
- return JavaImplementation.class;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index ff43eebcfc..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#implementation.java,model=org.apache.tuscany.sca.implementation.java.JavaImplementation
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties
deleted file mode 100644
index 210b715da8..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-ClassNotFoundException = Class Not Found Exception: {0}
-ContributionResolveException = Contribution Resolve Exception occured due to:
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/AddService.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/AddService.java
deleted file mode 100644
index 9c22177684..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/AddService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * Interface for the Add Service.
- *
- * @version $Rev$ $Date$
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 64298b6275..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * An implementation of the Add service.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-@EagerInit
-public class AddServiceImpl implements AddService {
-
- public double add(double n1, double n2) {
- return n1 + n2;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/CalculatorService.java
deleted file mode 100644
index e0cf23dc17..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The Calculator service interface.
- *
- * @version $Rev$ $Date$
- */
-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/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 9f64dc8bca..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * An implementation of the Calculator service.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-public class CalculatorServiceImpl implements CalculatorService {
-
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- @Reference
- public void setAddService(AddService addService) {
- this.addService = addService;
- }
-
- @Reference
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- @Reference
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- @Reference
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- public double add(double n1, double n2) {
- return addService.add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return subtractService.subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return multiplyService.multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return divideService.divide(n1, n2);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/DivideService.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/DivideService.java
deleted file mode 100644
index 9599c86292..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/DivideService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * Interface for the Divide Service.
- *
- * @version $Rev$ $Date$
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index f5b8ff5be0..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * An implementation of the Divide service.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-public class DivideServiceImpl implements DivideService {
-
- public double divide(double n1, double n2) {
- return n1 / n2;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/MultiplyService.java
deleted file mode 100644
index 7a3d06c15e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * Interface for the Multiply Service.
- *
- * @version $Rev$ $Date$
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index d146d23153..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * An implementation of the Multiply service.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-public class MultiplyServiceImpl implements MultiplyService {
-
- public double multiply(double n1, double n2) {
- return n1 * n2;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/SubtractService.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/SubtractService.java
deleted file mode 100644
index 21af91f392..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * Interface for the Subtract Service.
- *
- * @version $Rev$ $Date$
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index ffe09c3dde..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * An implementation of the subtract service.
- *
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-public class SubtractServiceImpl implements SubtractService {
-
- public double subtract(double n1, double n2) {
- return n1 - n2;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java
deleted file mode 100644
index d0d5caaa3a..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-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.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Test reading Java implementations.
- *
- * @version $Rev$ $Date$
- */
-public class ReadTestCase {
-
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static URLArtifactProcessor<Definitions> policyDefinitionsProcessor;
- private static CompositeBuilder compositeBuilder;
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry 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");
-
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- policyDefinitionsProcessor = documentProcessors.getProcessor(Definitions.class);
- }
-
- @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);
-
- }
-
- @Ignore("To be fixed")
- @Test
- public void testPolicyIntents() throws Exception {
- ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
-
- URL url = getClass().getResource("definitions.xml");
- URI uri = URI.create("definitions.xml");
- Definitions scaDefns = policyDefinitionsProcessor.read(null, uri, url);
-
- InputStream is = getClass().getResourceAsStream("Calculator.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
-
- staxProcessor.resolve(scaDefns, resolver);
- staxProcessor.resolve(composite, resolver);
-
- compositeBuilder.build(composite, null, null);
-
- //intents are computed and aggregate intents from ancestor elements
- assertEquals(((PolicySetAttachPoint)composite.getComponents().get(0)).getRequiredIntents().size(), 3);
- assertEquals(((PolicySetAttachPoint)composite.getComponents().get(5)).getRequiredIntents().size(), 3);
-
- //assertEquals(((OperationsConfigurator)composite.getComponents().get(0)).getConfiguredOperations().isEmpty(), true);
- //assertEquals(((OperationsConfigurator)composite.getComponents().get(5)).getConfiguredOperations().isEmpty(), false);
-
-
- //test for proper aggregation of policy intents on implementation elements
- for ( Intent intent : ((PolicySetAttachPoint)composite.getComponents().get(0).getImplementation()).getRequiredIntents() ) {
- String intentName = intent.getName().getLocalPart();
- if ( !(intentName.equals("tuscanyIntent_1") || intentName.equals("tuscanyIntent_2") ||
- intentName.equals("tuscanyIntent_3")) ) {
- fail();
- }
- }
-
- for ( Intent intent : ((PolicySetAttachPoint)composite.getComponents().get(5)).getRequiredIntents() ) {
- String intentName = intent.getName().getLocalPart();
- if ( !(intentName.equals("tuscanyIntent_1") || intentName.equals("tuscanyIntent_4") ||
- intentName.equals("tuscanyIntent_5")) ) {
- fail();
- }
- }
-
- //test for proper aggregation of policy intents and policysets on operations of implementation
- OperationsConfigurator opConf = (OperationsConfigurator)composite.getComponents().get(5);
- assertEquals(opConf.getConfiguredOperations().get(0).getRequiredIntents().size(), 4);
- for ( Intent intent : opConf.getConfiguredOperations().get(0).getRequiredIntents()) {
- String intentName = intent.getName().getLocalPart();
- if ( !(intentName.equals("tuscanyIntent_1") || intentName.equals("tuscanyIntent_4") ||
- intentName.equals("tuscanyIntent_5") || intentName.equals("tuscanyIntent_6") ) ) {
- fail();
- }
- }
-
- opConf = (OperationsConfigurator)composite.getComponents().get(6);
- assertEquals(opConf.getConfiguredOperations().get(0).getRequiredIntents().size(), 3);
- for ( Intent intent : opConf.getConfiguredOperations().get(0).getRequiredIntents()) {
- String intentName = intent.getName().getLocalPart();
- if ( !(intentName.equals("tuscanyIntent_1") || intentName.equals("tuscanyIntent_4") ||
- intentName.equals("tuscanyIntent_6.qualified2") ) ) {
- fail();
- }
- }
- }
-
- @Test
- @Ignore("Broken for now in 2.0 bringup")
- public void testPolicySets() throws Exception {
- ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
-
- URL url = getClass().getResource("definitions_with_policysets.xml");
- URI uri = URI.create("definitions_with_policysets.xml");
- Definitions policyDefinitions = policyDefinitionsProcessor.read(null, uri, url);
-
- InputStream is = getClass().getResourceAsStream("Calculator.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
-
- for ( Component component : composite.getComponents() ) {
- for ( PolicySet policySet : policyDefinitions.getPolicySets() ) {
- component.getApplicablePolicySets().add(policySet);
- }
- }
-
- staxProcessor.resolve(policyDefinitions, resolver);
- staxProcessor.resolve(composite, resolver);
-
- compositeBuilder.build(composite, null, null);
-
- //test for determination of policysets for implementation
- assertEquals(((PolicySetAttachPoint)composite.getComponents().get(0)).getPolicySets().size(), 1);
- for ( PolicySet policySet : ((PolicySetAttachPoint)composite.getComponents().get(0).getImplementation()).getPolicySets() ) {
- String policySetName = policySet.getName().getLocalPart();
- if ( !(policySetName.equals("tuscanyPolicySet_1")) ) {
- fail();
- }
- }
-
- assertEquals(((PolicySetAttachPoint)composite.getComponents().get(5)).getPolicySets().size(), 2);
- for ( PolicySet policySet : ((PolicySetAttachPoint)composite.getComponents().get(5).getImplementation()).getPolicySets() ) {
- String policySetName = policySet.getName().getLocalPart();
- if ( !(policySetName.equals("tuscanyPolicySet_1") || policySetName.equals("tuscanyPolicySet_2")) ) {
- fail();
- }
- }
-
- //test for computation of policysets on operations of implementation
- OperationsConfigurator opConf = (OperationsConfigurator)composite.getComponents().get(5);
- assertEquals(opConf.getConfiguredOperations().get(0).getPolicySets().size(), 3);
- for ( PolicySet policySet : opConf.getConfiguredOperations().get(0).getPolicySets() ) {
- String policySetName = policySet.getName().getLocalPart();
- if ( !(policySetName.equals("tuscanyPolicySet_1") || policySetName.equals("tuscanyPolicySet_2")
- || policySetName.equals("tuscanyPolicySet_3")) ) {
- fail();
- }
- }
-
- opConf = (OperationsConfigurator)composite.getComponents().get(6);
- assertEquals(opConf.getConfiguredOperations().get(0).getPolicySets().size(), 4);
- for ( PolicySet policySet : opConf.getConfiguredOperations().get(0).getPolicySets() ) {
- String policySetName = policySet.getName().getLocalPart();
- if ( !(policySetName.equals("tuscanyPolicySet_1") || policySetName.equals("tuscanyPolicySet_2")
- || policySetName.equals("tuscanyPolicySet_3")
- || policySetName.equals("tuscanyPolicySet_4")) ) {
- fail();
- }
- }
- //new PrintUtil(System.out).print(composite);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/TestModelResolver.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/TestModelResolver.java
deleted file mode 100644
index 085b21a652..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/TestModelResolver.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.java.xml;
-
-import java.lang.ref.WeakReference;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-
-/**
- * A default implementation of an artifact resolver, based on a map.
- *
- * @version $Rev$ $Date$
- */
-public class TestModelResolver implements ModelResolver {
- private static final long serialVersionUID = -7826976465762296634L;
-
- private Map<Object, Object> map = new HashMap<Object, Object>();
-
- private WeakReference<ClassLoader> classLoader;
-
- public TestModelResolver(ClassLoader classLoader) {
- this.classLoader = new WeakReference<ClassLoader>(classLoader);
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- Object resolved = map.get(unresolved);
- if (resolved != null) {
-
- // Return the resolved object
- return modelClass.cast(resolved);
-
- } else if (unresolved instanceof ClassReference) {
-
- // Load a class on demand
- ClassReference classReference = (ClassReference)unresolved;
- Class<?> clazz;
- try {
- clazz = Class.forName(classReference.getClassName(), true, classLoader.get());
- } catch (ClassNotFoundException e) {
-
- // Return the unresolved object
- return unresolved;
- }
-
- // Store a new ClassReference wrapping the loaded class
- resolved = new ClassReference(clazz);
- map.put(resolved, resolved);
-
- // Return the resolved ClassReference
- return modelClass.cast(resolved);
-
- } else {
-
- // Return the unresolved object
- return unresolved;
- }
- }
-
- public void addModel(Object resolved) {
- map.put(resolved, resolved);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(resolved);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/WriteTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/WriteTestCase.java
deleted file mode 100644
index 7d863c99de..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/WriteTestCase.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.java.xml;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-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.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test writing Java implementations.
- *
- * @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();
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- }
-
- @Test
- public void testReadWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("Calculator.composite");
- Composite composite = (Composite)staxProcessor.read(inputFactory.createXMLStreamReader(is));
- Assert.assertNotNull(composite);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/Calculator.composite b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/Calculator.composite
deleted file mode 100644
index a58fa0c072..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/Calculator.composite
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:calc="http://sample.calculator"
- requires="cns:tuscanyIntent_1"
- targetNamespace="http://sample.calculator"
- xmlns:cns="http://test"
- name="Calculator">
-
- <service name="CalculatorService" promote="CalculatorServiceComponent">
- <interface.java interface="calculator.CalculatorService"/>
- </service>
-
- <component name="CalculatorServiceComponent" requires="cns:tuscanyIntent_2">
- <implementation.java class="calculator.CalculatorServiceImpl" requires="cns:tuscanyIntent_3" />
- <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" requires="cns:tuscanyIntent_4">
- <implementation.java class="calculator.CalculatorServiceImpl" requires="cns:tuscanyIntent_5">
- <operation name="add" requires="cns:tuscanyIntent_6"/>
- </implementation.java>
- </component>
-
- <component name="YetAnotherCalculatorServiceComponent" requires="cns:tuscanyIntent_4">
- <implementation.java class="calculator.CalculatorServiceImpl" requires="cns:tuscanyIntent_6.qualified1">
- <operation name="add" requires="cns:tuscanyIntent_6.qualified2" policySets="cns:tuscanyPolicySet_4"/>
- </implementation.java>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions.xml b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions.xml
deleted file mode 100644
index cddc134c2c..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
-<!-- 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/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions_with_policysets.xml b/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions_with_policysets.xml
deleted file mode 100644
index 9147133d5d..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions_with_policysets.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
-<!-- 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>
-
- <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>
-
- <!-- 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:definitions> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/LICENSE b/tags/java/sca/2.0-M1/modules/implementation-java/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/implementation-java/META-INF/MANIFEST.MF
deleted file mode 100644
index ab3b8e9864..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,38 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.implementation.java.introspect;
- uses:="org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.impleme
- ntation.java,org.oasisopen.sca";version="2.0.0",org.apache.tuscany.sca.imple
- mentation.java;uses:="org.apache.tuscany.sca.assembly,org.apache.tusc
- any.sca.implementation.java.introspect,org.apache.tuscany.sca.core,or
- g.apache.tuscany.sca.policy,org.apache.tuscany.sca.interfacedef.java"
- ;version="2.0.0"
-Private-Package: org.apache.tuscany.sca.implementation.java.impl;versi
- on="2.0.0",org.apache.tuscany.sca.implementation.java.introspect.impl;v
- ersion="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Java Implementation Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397153500
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Java Implementation Model
-Import-Package: javax.jws,
- javax.xml.namespace,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.impl;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.implementation.java;version="2.0.0",
- org.apache.tuscany.sca.implementation.java.introspect;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.impl;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.policy.util;version="2.0.0",
- org.oasisopen.sca;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.implementation.java
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/NOTICE b/tags/java/sca/2.0-M1/modules/implementation-java/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/pom.xml b/tags/java/sca/2.0-M1/modules/implementation-java/pom.xml
deleted file mode 100644
index 8df5b6dca4..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-java</artifactId>
- <name>Apache Tuscany SCA Implementation Java Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>javax.jws</groupId>
- <artifactId>jsr181-api</artifactId>
- <version>1.0-MR1</version>
- </dependency>
- </dependencies>
-
- <repositories>
- <repository>
- <id>java.net</id>
- <name>java.net Maven 1.x Repository</name>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
- </repositories>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/BaseJavaImplementation.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/BaseJavaImplementation.java
deleted file mode 100644
index c8b7c072ac..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/BaseJavaImplementation.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java;
-
-import org.apache.tuscany.sca.assembly.Extensible;
-import org.apache.tuscany.sca.assembly.Implementation;
-
-/**
- * Represents a Java implementation.
- *
- * @version $Rev$ $Date$
- */
-public interface BaseJavaImplementation extends Implementation, Extensible {
-
- /**
- * Returns the name of the Java implementation class.
- *
- * @return the name of the Java implementation class
- */
- String getName();
-
- /**
- * Sets the name of the Java implementation class.
- *
- * @param className the name of the Java implementation class
- */
- void setName(String className);
-
- /**
- * Returns the Java implementation class.
- *
- * @return the Java implementation class
- */
- Class<?> getJavaClass();
-
- /**
- * Sets the Java implementation class.
- *
- * @param javaClass the Java implementation class
- */
- void setJavaClass(Class<?> javaClass);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/DefaultJavaImplementationFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/DefaultJavaImplementationFactory.java
deleted file mode 100644
index e44ebd7c91..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/DefaultJavaImplementationFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java;
-
-/**
- * A factory for the Java model.
- *
- * @version $Rev$ $Date$
- */
-import org.apache.tuscany.sca.implementation.java.impl.JavaImplementationFactoryImpl;
-
-public class DefaultJavaImplementationFactory extends JavaImplementationFactoryImpl implements JavaImplementationFactory {
-
- public DefaultJavaImplementationFactory() {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/IntrospectionException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/IntrospectionException.java
deleted file mode 100644
index 2198a632c0..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/IntrospectionException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java;
-
-import java.lang.reflect.Member;
-
-/**
- * Denotes a problem processing annotations on a POJO implementation
- *
- * @version $Rev$ $Date$
- */
-public class IntrospectionException extends Exception {
- private static final long serialVersionUID = -361025119035104470L;
- private Member member;
-
- public IntrospectionException() {
- }
-
- public IntrospectionException(String message) {
- super(message);
- }
-
- public IntrospectionException(String message, Member member) {
- super(message);
- this.member = member;
- }
-
- public IntrospectionException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public IntrospectionException(Throwable cause) {
- super(cause);
- }
-
- public Member getMember() {
- return member;
- }
-
- public void setMember(Member member) {
- this.member = member;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaConstructorImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaConstructorImpl.java
deleted file mode 100644
index df76d3ea4e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaConstructorImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java;
-
-import java.lang.reflect.Constructor;
-
-
-/**
- * Hold injection information for the constructor used to instantiate a
- * component implementation instance
- *
- * @version $Rev$ $Date$
- */
-public class JavaConstructorImpl<T> {
- private Constructor<T> constructor;
- private JavaParameterImpl[] parameters;
-
- public JavaConstructorImpl(Constructor<T> constructor) {
- this.constructor = constructor;
- int size = constructor.getParameterTypes().length;
- parameters = new JavaParameterImpl[size];
- for (int i = 0; i < size; i++) {
- parameters[i] = new JavaParameterImpl(constructor, i);
- }
- }
-
- /**
- * @return the constructor
- */
- public Constructor<T> getConstructor() {
- return constructor;
- }
-
- /**
- * @return the parameters
- */
- public JavaParameterImpl[] getParameters() {
- return parameters;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaElementImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaElementImpl.java
deleted file mode 100644
index e748a5f6fa..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaElementImpl.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.java;
-
-import java.lang.annotation.Annotation;
-import java.lang.annotation.ElementType;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-
-/**
- * This class represents a java element such as a Package, Class, Constructor,
- * Field, Method or Parameter.
- *
- * @version $Rev$ $Date$
- */
-public class JavaElementImpl {
- private AnnotatedElement anchor;
- private ElementType elementType;
- private Class<?> type;
- private Type genericType;
- private int index = -1;
- private String name;
- private Class<? extends Annotation> classifer;
-
- public JavaElementImpl(Class<?> cls) {
- this.anchor = cls;
- this.elementType = ElementType.TYPE;
- this.type = cls;
- this.genericType = cls;
- this.name = cls.getName();
- }
-
- public JavaElementImpl(Field field) {
- this.anchor = field;
- this.elementType = ElementType.FIELD;
- this.type = field.getType();
- this.genericType = field.getGenericType();
- this.name = field.getName();
- }
-
- public JavaElementImpl(Constructor<?> constructor, int index) {
- this.anchor = constructor;
- this.elementType = ElementType.PARAMETER;
- this.type = constructor.getParameterTypes()[index];
- this.genericType = constructor.getGenericParameterTypes()[index];
- this.index = index;
- this.name = "";
- }
-
- public JavaElementImpl(Method method, int index) {
- this.anchor = method;
- this.elementType = ElementType.PARAMETER;
- this.type = method.getParameterTypes()[index];
- this.genericType = method.getGenericParameterTypes()[index];
- this.index = index;
- this.name = "";
- }
-
- /**
- * For testing purpose
- *
- * @param name
- * @param type
- * @param classifer TODO
- * @param elementType
- */
- public JavaElementImpl(String name, Class<?> type, Class<? extends Annotation> classifer) {
- super();
- this.type = type;
- this.name = name;
- this.classifer = classifer;
- }
-
- /**
- * @return the anchor
- */
- public AnnotatedElement getAnchor() {
- return anchor;
- }
-
- /**
- * @return the elementType
- */
- public ElementType getElementType() {
- return elementType;
- }
-
- /**
- * @return the genericType
- */
- public Type getGenericType() {
- return genericType;
- }
-
- /**
- * @return the index
- */
- public int getIndex() {
- return index;
- }
-
- /**
- * @return the type
- */
- public Class<?> getType() {
- return type;
- }
-
- /**
- * @return the annotations
- */
- public Annotation[] getAnnotations() {
- if (elementType == ElementType.PARAMETER) {
- if (anchor instanceof Method) {
- // We only care about the method-level annotations
- return ((Method)anchor).getAnnotations();
- }
- if (anchor instanceof Constructor) {
- return ((Constructor<?>)anchor).getParameterAnnotations()[index];
- }
- }
- return anchor.getAnnotations();
- }
-
- public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
- for (Annotation a : getAnnotations()) {
- if (a.annotationType() == annotationType) {
- return annotationType.cast(a);
- }
- }
- return null;
- }
-
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @return the classifier
- */
- public Class<? extends Annotation> getClassifer() {
- return classifer;
- }
-
- /**
- * @param classifer the classifier to set
- */
- public void setClassifer(Class<? extends Annotation> classifer) {
- this.classifer = classifer;
- }
-
-
- @Override
- public String toString() {
- return anchor.toString() + (elementType == ElementType.PARAMETER ? "[" + index + "]" : "");
- }
-
- @Override
- public int hashCode() {
- final int PRIME = 31;
- int result = 1;
- result = PRIME * result + ((anchor == null) ? 0 : anchor.hashCode());
- result = PRIME * result + index;
- 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 JavaElementImpl other = (JavaElementImpl)obj;
- if (anchor == null) {
- if (other.anchor != null) {
- return false;
- }
- } else if (!anchor.equals(other.anchor)) {
- return false;
- }
- if (index != other.index) {
- return false;
- }
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementation.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementation.java
deleted file mode 100644
index cfb8aed338..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementation.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.java;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-
-/**
- * Represents a Java implementation.
- *
- * @version $Rev$ $Date$
- */
-public interface JavaImplementation extends BaseJavaImplementation {
-
- /**
- * Returns the constructor used to instantiate implementation instances.
- *
- * @return the constructor used to instantiate implementation instances
- */
- JavaConstructorImpl<?> getConstructor();
-
- /**
- * Sets the constructor used to instantiate implementation instances
- *
- * @param definition the constructor used to instantiate implementation instances
- */
- void setConstructor(JavaConstructorImpl<?> definition);
-
- /**
- * Returns the component initializer method.
- *
- * @return the component initializer method
- */
- Method getInitMethod();
-
- /**
- * Sets the component initializer method.
- *
- * @param initMethod the component initializer method
- */
- void setInitMethod(Method initMethod);
-
- /**
- * Returns the component destructor method.
- *
- * @return the component destructor method
- */
- Method getDestroyMethod();
-
- /**
- * Sets the component destructor method.
- *
- * @param destroyMethod the component destructor method
- */
- void setDestroyMethod(Method destroyMethod);
-
- /**
- * Returns the resources injected into this implementation.
- *
- * @return
- */
- Map<String, JavaResourceImpl> getResources();
-
- /**
- * Returns the Java member used to inject a conversation ID.
- *
- * @return
- */
- List<Member> getConversationIDMembers();
-
- /**
- * Sets the Java member used to inject a conversation ID.
- *
- * @param conversationIDMember
- */
- void addConversationIDMember(Member conversationIDMember);
-
- /**
- * Returns true if AllowsPassReference is set.
- *
- * @return true if AllowsPassByReference is set
- */
- boolean isAllowsPassByReference();
-
- /**
- * @param allowsPassByReference the allowsPassByReference to set
- */
- void setAllowsPassByReference(boolean allowsPassByReference);
-
- /**
- * @return the allowsPassByReferenceMethods
- */
- List<Method> getAllowsPassByReferenceMethods();
-
- /**
- * @param method
- * @return
- */
- boolean isAllowsPassByReference(Method method);
-
- /**
- * @return the constructors
- */
- Map<Constructor, JavaConstructorImpl> getConstructors();
-
- /**
- * @return the eagerInit
- */
- boolean isEagerInit();
-
- /**
- * @param eagerInit the eagerInit to set
- */
- void setEagerInit(boolean eagerInit);
-
- /**
- * @return the callbacks
- */
- Map<String, Collection<JavaElementImpl>> getCallbackMembers();
-
- /**
- * @return the properties
- */
- Map<String, JavaElementImpl> getPropertyMembers();
-
- /**
- * @return the references
- */
- Map<String, JavaElementImpl> getReferenceMembers();
-
- /**
- * @return the scope
- */
- JavaScopeImpl getJavaScope();
-
- /**
- * @param scope the scope to set
- */
- void setJavaScope(JavaScopeImpl scope);
-
- /**
- * @return the maxAge
- */
- long getMaxAge();
-
- /**
- * @param maxAge the maxAge to set
- */
- void setMaxAge(long maxAge);
-
- /**
- * @return the maxIdleTime
- */
- long getMaxIdleTime();
-
- /**
- * @param maxIdleTime the maxIdleTime to set
- */
- void setMaxIdleTime(long maxIdleTime);
-
- /**
- * @return the map of a policy handler class names
- */
- List<PolicyHandlerTuple> getPolicyHandlerClassNames();
-
- /**
- * @param policyHandlerClassNames Map of policyhandler class names
- */
- void setPolicyHandlerClassNames(List<PolicyHandlerTuple> policyHandlerClassNames);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementationActivator.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementationActivator.java
deleted file mode 100644
index 39484b8840..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementationActivator.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.java;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ModuleActivator;
-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.AllowsPassByReferenceProcessor;
-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.ConversationIDProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ConversationProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.DestroyProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.EagerInitProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.HeuristicPojoProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.InitProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.PolicyProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.PropertyProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ReferenceProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ResourceProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ScopeProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * A module activator for the Java implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class JavaImplementationActivator implements ModuleActivator {
-
- public void start(ExtensionPointRegistry registry) {
- FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- PolicyFactory policyFactory = modelFactories.getFactory(PolicyFactory.class);
-
- BaseJavaClassVisitor[] extensions =
- new BaseJavaClassVisitor[] {new ConstructorProcessor(assemblyFactory),
- new AllowsPassByReferenceProcessor(assemblyFactory),
- new ComponentNameProcessor(assemblyFactory),
- new ContextProcessor(assemblyFactory),
- new ConversationIDProcessor(assemblyFactory),
- new ConversationProcessor(assemblyFactory),
- new DestroyProcessor(assemblyFactory), new EagerInitProcessor(assemblyFactory),
- new InitProcessor(assemblyFactory), new PropertyProcessor(assemblyFactory),
- new ReferenceProcessor(assemblyFactory, javaFactory),
- new ResourceProcessor(assemblyFactory), new ScopeProcessor(assemblyFactory),
- new ServiceProcessor(assemblyFactory, javaFactory),
- new HeuristicPojoProcessor(assemblyFactory, javaFactory),
- new PolicyProcessor(assemblyFactory, policyFactory)};
-
- JavaImplementationFactory javaImplementationFactory = modelFactories.getFactory(JavaImplementationFactory.class);
- for (JavaClassVisitor extension : extensions) {
- javaImplementationFactory.addClassVisitor(extension);
- }
-
- }
-
- public void stop(ExtensionPointRegistry registry) {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementationFactory.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementationFactory.java
deleted file mode 100644
index 8228c80372..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementationFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor;
-
-
-/**
- * Factory for the Java model
- *
- * @version $Rev$ $Date$
- */
-public interface JavaImplementationFactory {
-
- /**
- * Creates a new Java implementation model.
- *
- * @return
- */
- JavaImplementation createJavaImplementation();
-
- /**
- * Creates a new Java implementation model from an implementation class.
- *
- * @param implementationClass The implementation class to introspect.
- * @return
- */
- JavaImplementation createJavaImplementation(Class<?> implementationClass) throws IntrospectionException;
-
- /**
- * Creates the contents of a Java implementation model from an implementation class.
- *
- * @param implementationClass The implementation class to introspect.
- * @return
- */
- void createJavaImplementation(JavaImplementation javaImplementation, Class<?> implementationClass) throws IntrospectionException;
-
- /**
- * Registers the given visitor.
- *
- * @param visitor
- */
- void addClassVisitor(JavaClassVisitor visitor);
-
- /**
- * Deregisters the given visitor.
- */
- void removeClassVisitor(JavaClassVisitor visitor);
-
- /**
- * Returns the list of visitors.
- *
- * @return
- */
- List<JavaClassVisitor> getClassVisitors();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaParameterImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaParameterImpl.java
deleted file mode 100644
index 80911a9552..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaParameterImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.java;
-
-import java.lang.reflect.Constructor;
-
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaParameterImpl extends JavaElementImpl {
- /**
- * @param constructor
- * @param index
- */
- public JavaParameterImpl(Constructor<?> constructor, int index) {
- super(constructor, index);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaResourceImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaResourceImpl.java
deleted file mode 100644
index 19a9f38549..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaResourceImpl.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java;
-
-
-
-/**
- * A resource dependency declared by a Java component implementation
- *
- * @version $Rev$ $Date$
- */
-public class JavaResourceImpl {
- private JavaElementImpl element;
- private String mappedName;
- private boolean optional;
-
- public JavaResourceImpl(JavaElementImpl element) {
- this.element = element;
- }
-
- /**
- * The name of the resource
- *
- * @return the name of the resource
- */
- public String getName() {
- return element.getName();
- }
-
- /**
- * Returns the URI of the resource
- *
- * @return the URI of the resource
- */
- public String getMappedName() {
- return mappedName;
- }
-
- /**
- * Sets the resource URI
- */
- public void setMappedName(String mappedName) {
- this.mappedName = mappedName;
- }
-
- /**
- * If true, the resource is optional
- *
- * @return true if the resource is optional
- */
- public boolean isOptional() {
- return optional;
- }
-
- /**
- * Sets whether the resource is optional
- */
- public void setOptional(boolean optional) {
- this.optional = optional;
- }
-
- /**
- * @return the element
- */
- public JavaElementImpl getElement() {
- return element;
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaScopeImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaScopeImpl.java
deleted file mode 100644
index b3ee8e8b2b..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaScopeImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java;
-
-/**
- * The default implementation scopes supported by assemblies.
- *
- * @version $Rev$ $Date$
- */
-public class JavaScopeImpl {
- public static final JavaScopeImpl STATELESS = new JavaScopeImpl("STATELESS");
- public static final JavaScopeImpl REQUEST = new JavaScopeImpl("REQUEST");
- public static final JavaScopeImpl SESSION = new JavaScopeImpl("SESSION");
- public static final JavaScopeImpl CONVERSATION = new JavaScopeImpl("CONVERSATION");
- public static final JavaScopeImpl COMPOSITE = new JavaScopeImpl("COMPOSITE");
- public static final JavaScopeImpl SYSTEM = new JavaScopeImpl("SYSTEM");
- public static final JavaScopeImpl UNDEFINED = new JavaScopeImpl("UNDEFINED");
-
- private String scope;
-
- public JavaScopeImpl(String scope) {
- this.scope = scope.toUpperCase().intern();
- }
-
- public String getScope() {
- return scope;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- final JavaScopeImpl scope1 = (JavaScopeImpl) o;
- return !(scope != null ? scope != scope1.scope.intern() : scope1.scope != null);
- }
-
- @Override
- public int hashCode() {
- return scope != null ? scope.hashCode() : 0;
- }
-
- @Override
- public String toString() {
- return scope;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/BaseJavaImplementationImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/BaseJavaImplementationImpl.java
deleted file mode 100644
index 97773879fa..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/BaseJavaImplementationImpl.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.impl;
-
-import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
-import org.apache.tuscany.sca.implementation.java.BaseJavaImplementation;
-
-/**
- * Represents a Java implementation.
- *
- * @version $Rev$ $Date$
- */
-abstract class BaseJavaImplementationImpl extends ImplementationImpl implements BaseJavaImplementation {
-
- private String className;
- private Class<?> javaClass;
-
- protected BaseJavaImplementationImpl() {
- }
-
- public String getName() {
- if (isUnresolved()) {
- return className;
- } else if (javaClass != null) {
- return javaClass.getName();
- } else {
- return null;
- }
- }
-
- public void setName(String className) {
- if (!isUnresolved()) {
- throw new IllegalStateException();
- }
- this.className = className;
- }
-
- public Class<?> getJavaClass() {
- return javaClass;
- }
-
- public void setJavaClass(Class<?> javaClass) {
- this.javaClass = javaClass;
- if (this.className == null) {
- this.className = javaClass.getName();
- }
- }
-
- @Override
- public String toString() {
- return getName();
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(getName()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof BaseJavaImplementation) {
- if (getName() != null) {
- return getName().equals(((BaseJavaImplementation)obj).getName());
- } else {
- return ((BaseJavaImplementation)obj).getName() == null;
- }
- } else {
- return false;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaClassIntrospectorImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaClassIntrospectorImpl.java
deleted file mode 100644
index 6cb5e3730b..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaClassIntrospectorImpl.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.impl;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-
-/**
- * An extensible Java class introspector implementation.
- *
- * @version $Rev$ $Date$
- */
-public class JavaClassIntrospectorImpl {
-
- private List<JavaClassVisitor> visitors;
-
- public JavaClassIntrospectorImpl(List<JavaClassVisitor> visitors) {
- this.visitors = visitors;
- }
-
- /**
- * JSR-250 PFD recommends the following guidelines for how annotations
- * interact with inheritance in order to keep the resulting complexity in
- * control:
- * <ol>
- * <li>Class-level annotations only affect the class they annotate and
- * their members, that is, its methods and fields. They never affect a
- * member declared by a superclass, even if it is not hidden or overridden
- * by the class in question.
- * <li>In addition to affecting the annotated class, class-level
- * annotations may act as a shorthand for member-level annotations. If a
- * member carries a specific member-level annotation, any annotations of the
- * same type implied by a class-level annotation are ignored. In other
- * words, explicit member-level annotations have priority over member-level
- * annotations implied by a class-level annotation.
- * <li>The interfaces implemented by a class never contribute annotations
- * to the class itself or any of its members.
- * <li>Members inherited from a superclass and which are not hidden or
- * overridden maintain the annotations they had in the class that declared
- * them, including member-level annotations implied by class-level ones.
- * <li>Member-level annotations on a hidden or overridden member are always
- * ignored.
- * </ol>
- */
- public void introspectClass(JavaImplementation type, Class<?> clazz)
- throws IntrospectionException {
- for (JavaClassVisitor extension : visitors) {
- extension.visitClass(clazz, type);
- }
-
- for (Constructor<?> constructor : clazz.getConstructors()) {
- for (JavaClassVisitor extension : visitors) {
- extension.visitConstructor(constructor, type);
- // Assuming the visitClass or visitConstructor will populate the
- // type.getConstructors
- JavaConstructorImpl<?> definition = type.getConstructors().get(constructor);
- if (definition != null) {
- for (JavaParameterImpl p : definition.getParameters()) {
- extension.visitConstructorParameter(p, type);
- }
- }
- }
- }
-
- Set<Field> fields = JavaIntrospectionHelper.getAllPublicAndProtectedFields(clazz, true);
- for (Field field : fields) {
- for (JavaClassVisitor extension : visitors) {
- extension.visitField(field, type);
- }
- }
-
- // Check if any private fields have illegal annotations that should be raised as errors
- Set<Field> privateFields = JavaIntrospectionHelper.getPrivateFields(clazz);
- for (Field field : privateFields) {
- for (JavaClassVisitor processor : visitors) {
- processor.visitField(field, type);
- }
- }
-
- Set<Method> methods = JavaIntrospectionHelper.getAllUniquePublicProtectedMethods(clazz, true);
- for (Method method : methods) {
- for (JavaClassVisitor processor : visitors) {
- processor.visitMethod(method, type);
- }
- }
-
- // Check if any private methods have illegal annotations that should be raised as errors
- Set<Method> privateMethods = JavaIntrospectionHelper.getPrivateMethods(clazz);
- for (Method method : privateMethods) {
- for (JavaClassVisitor processor : visitors) {
- processor.visitMethod(method, type);
- }
- }
-
- Class<?> superClass = clazz.getSuperclass();
- if (superClass != null) {
- visitSuperClass(superClass, type);
- }
-
- for (JavaClassVisitor extension : visitors) {
- extension.visitEnd(clazz, type);
- }
- }
-
- private void visitSuperClass(Class<?> clazz, JavaImplementation type) throws IntrospectionException {
- if (!Object.class.equals(clazz)) {
- for (JavaClassVisitor extension : visitors) {
- extension.visitSuperClass(clazz, type);
- }
- clazz = clazz.getSuperclass();
- if (clazz != null) {
- visitSuperClass(clazz, type);
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaImplementationFactoryImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaImplementationFactoryImpl.java
deleted file mode 100644
index 0cc78498e6..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaImplementationFactoryImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.JavaClassVisitor;
-
-/**
- * A factory for the Java model.
- *
- * @version $Rev$ $Date$
- */
-public abstract class JavaImplementationFactoryImpl implements JavaImplementationFactory {
-
- private List<JavaClassVisitor> visitors = new ArrayList<JavaClassVisitor>();
- private JavaClassIntrospectorImpl introspector;
-
- public JavaImplementationFactoryImpl() {
- introspector = new JavaClassIntrospectorImpl(visitors);
- }
-
- public JavaImplementation createJavaImplementation() {
- JavaImplementation javaImplementation = new JavaImplementationImpl();
- return javaImplementation;
- }
-
- public JavaImplementation createJavaImplementation(Class<?> implementationClass) throws IntrospectionException {
- JavaImplementation javaImplementation = createJavaImplementation();
- introspector.introspectClass(javaImplementation, implementationClass);
- return javaImplementation;
- }
-
- public void createJavaImplementation(JavaImplementation javaImplementation, Class<?> implementationClass) throws IntrospectionException {
- introspector.introspectClass(javaImplementation, implementationClass);
- }
-
- public void addClassVisitor(JavaClassVisitor visitor) {
- visitors.add(visitor);
- }
-
- public void removeClassVisitor(JavaClassVisitor visitor) {
- visitors.remove(visitor);
- }
-
- public List<JavaClassVisitor> getClassVisitors() {
- return visitors;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaImplementationImpl.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaImplementationImpl.java
deleted file mode 100644
index a0b8b1dba0..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaImplementationImpl.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.impl;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-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.JavaResourceImpl;
-import org.apache.tuscany.sca.implementation.java.JavaScopeImpl;
-import org.apache.tuscany.sca.policy.util.PolicyHandlerTuple;
-
-/**
- * A component type specialization for POJO implementations
- *
- * @version $Rev$ $Date$
- */
-public class JavaImplementationImpl extends BaseJavaImplementationImpl implements JavaImplementation {
- private JavaConstructorImpl<?> constructorDefinition;
- private Map<Constructor, JavaConstructorImpl> constructors = new HashMap<Constructor, JavaConstructorImpl>();
- private Method initMethod;
- private Method destroyMethod;
- private final Map<String, JavaResourceImpl> resources = new HashMap<String, JavaResourceImpl>();
- private final Map<String, JavaElementImpl> propertyMembers = new HashMap<String, JavaElementImpl>();
- private final Map<String, JavaElementImpl> referenceMembers = new HashMap<String, JavaElementImpl>();
- private final Map<String, Collection<JavaElementImpl>> callbackMembers = new HashMap<String, Collection<JavaElementImpl>>();
- private List<Member> conversationIDMember = new ArrayList<Member>();
- private boolean eagerInit;
- private boolean allowsPassByReference;
- private List<Method> allowsPassByReferenceMethods = new ArrayList<Method>();
- private long maxAge = -1;
- private long maxIdleTime = -1;
- private JavaScopeImpl scope = JavaScopeImpl.STATELESS;
- private List<PolicyHandlerTuple> policyHandlerClassNames = null;
-
- protected JavaImplementationImpl() {
- super();
- }
-
- public JavaConstructorImpl<?> getConstructor() {
- return constructorDefinition;
- }
-
- public void setConstructor(JavaConstructorImpl<?> definition) {
- this.constructorDefinition = definition;
- }
-
- public Method getInitMethod() {
- return initMethod;
- }
-
- public void setInitMethod(Method initMethod) {
- this.initMethod = initMethod;
- }
-
- public Method getDestroyMethod() {
- return destroyMethod;
- }
-
- public void setDestroyMethod(Method destroyMethod) {
- this.destroyMethod = destroyMethod;
- }
-
- public Map<String, JavaResourceImpl> getResources() {
- return resources;
- }
-
- public List<Member> getConversationIDMembers() {
- return this.conversationIDMember;
- }
-
- public void addConversationIDMember(Member conversationIDMember) {
- this.conversationIDMember.add(conversationIDMember);
- }
-
- public boolean isAllowsPassByReference() {
- return allowsPassByReference;
- }
-
- public void setAllowsPassByReference(boolean allowsPassByReference) {
- this.allowsPassByReference = allowsPassByReference;
- }
-
- public List<Method> getAllowsPassByReferenceMethods() {
- return allowsPassByReferenceMethods;
- }
-
- public boolean isAllowsPassByReference(Method method) {
- return allowsPassByReference || allowsPassByReferenceMethods.contains(method);
- }
-
- public Map<Constructor, JavaConstructorImpl> getConstructors() {
- return constructors;
- }
-
- public boolean isEagerInit() {
- return eagerInit;
- }
-
- public void setEagerInit(boolean eagerInit) {
- this.eagerInit = eagerInit;
- }
-
- public Map<String, Collection<JavaElementImpl>> getCallbackMembers() {
- return callbackMembers;
- }
-
- public Map<String, JavaElementImpl> getPropertyMembers() {
- return propertyMembers;
- }
-
- public Map<String, JavaElementImpl> getReferenceMembers() {
- return referenceMembers;
- }
-
- public JavaScopeImpl getJavaScope() {
- return scope;
- }
-
- public void setJavaScope(JavaScopeImpl scope) {
- this.scope = scope;
- }
-
- public long getMaxAge() {
- return maxAge;
- }
-
- public void setMaxAge(long maxAge) {
- this.maxAge = maxAge;
- }
-
- public long getMaxIdleTime() {
- return maxIdleTime;
- }
-
- public void setMaxIdleTime(long maxIdleTime) {
- this.maxIdleTime = maxIdleTime;
- }
-
- public List<PolicyHandlerTuple> getPolicyHandlerClassNames() {
- return policyHandlerClassNames;
- }
-
- public void setPolicyHandlerClassNames(List<PolicyHandlerTuple> policyHandlerClassNames) {
- this.policyHandlerClassNames = policyHandlerClassNames;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/BaseJavaClassVisitor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/BaseJavaClassVisitor.java
deleted file mode 100644
index 39b20d41eb..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/BaseJavaClassVisitor.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
-
-/**
- * A convenience class for annotation processors which alleviates the need to
- * implement unused callbacks
- *
- * @version $Rev$ $Date$
- */
-public abstract class BaseJavaClassVisitor implements JavaClassVisitor {
- protected AssemblyFactory assemblyFactory;
-
- protected BaseJavaClassVisitor(AssemblyFactory factory) {
- this.assemblyFactory = factory;
- }
-
- public <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- }
-
- public <T> void visitSuperClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- }
-
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- }
-
- public <T> void visitConstructor(Constructor<T> constructor, JavaImplementation type) throws IntrospectionException {
- }
-
- public void visitField(Field field, JavaImplementation type) throws IntrospectionException {
- }
-
- public <T> void visitEnd(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- }
-
- public void visitConstructorParameter(JavaParameterImpl parameter, JavaImplementation type) throws IntrospectionException {
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaClassVisitor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaClassVisitor.java
deleted file mode 100644
index 4b0f5bea55..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaClassVisitor.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
-
-/**
- * Implementations process class-level metadata, typically parsing annotations
- * and updating the corresponding <code>ComponentType</code>. A processor
- * may, for example, create a Property which is responsible for injecting a
- * complex type on a component implementation instance when it is instantiated.
- * <p/> Processors will receive callbacks as the implementation class is walked
- * while evaluating an assembly. It is the responsibility of the parser to
- * determine whether to perform an action during the callback.
- *
- * @version $Rev$ $Date$
- */
-public interface JavaClassVisitor {
-
- /**
- * A callback received when the component implementation class is first
- * loaded
- *
- * @param clazz the component implementation class
- * @param type the incomplete component type associated with the
- * implementation class
- * @throws IntrospectionException if an error is encountered while processing
- * metadata
- */
- <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException;
-
- /**
- * A callback received as the component implementation class hierarchy is
- * evaluated
- *
- * @param clazz the superclass in the component implmentation's class
- * hierarchy
- * @param type the incomplete component type associated with the
- * implementation class
- * @throws IntrospectionException if an error is encountered while processing
- * metadata
- */
- <T> void visitSuperClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException;
-
- /**
- * A callback received as the component implementation's public and
- * protected methods are evaluated
- *
- * @param method the current public or protected method being evaluated
- * @param type the incomplete component type associated with the
- * implementation class
- * @throws IntrospectionException if an error is encountered while processing
- * metadata
- */
- void visitMethod(Method method, JavaImplementation type) throws IntrospectionException;
-
- /**
- * A callback received as the component implementation's constructor used
- * for instantiation by the runtime is evaluated. If an implementation
- * contains more than one constructor, the constructor passed to the
- * callback will be chosen according to the algorithm described in the SCA
- * Java Client and Implementation Model Specification.
- *
- * @param constructor the constructor used for instantiating component
- * implementation instances
- * @param type the incomplete component type associated with the
- * implementation class
- * @throws IntrospectionException if an error is encountered while processing
- * metadata
- */
- <T> void visitConstructor(Constructor<T> constructor, JavaImplementation type) throws IntrospectionException;
-
- /**
- * @param parameter
- * @param type
- * @throws IntrospectionException
- */
- void visitConstructorParameter(JavaParameterImpl parameter, JavaImplementation type) throws IntrospectionException;
-
- /**
- * A callback received as the component implementation's public and
- * protected fields are evaluated
- *
- * @param field the current public or protected field being evaluated
- * @param type the incomplete component type associated with the
- * implementation class
- * @throws IntrospectionException if an error is encountered while processing
- * metadata
- */
- void visitField(Field field, JavaImplementation type) throws IntrospectionException;
-
- /**
- * The final callback received when all other callbacks during evaluation of
- * the component implementation have been issued
- *
- * @param clazz the component implementation class
- * @param type the incomplete component type associated with the
- * implementation class
- * @throws IntrospectionException if an error is encountered while processing
- * metadata
- */
- <T> void visitEnd(Class<T> clazz, JavaImplementation type) throws IntrospectionException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java
deleted file mode 100644
index 31a92f35bc..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java
+++ /dev/null
@@ -1,577 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect;
-
-import java.beans.Introspector;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.lang.reflect.WildcardType;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.oasisopen.sca.CallableReference;
-
-/**
- * Implements various reflection-related operations
- *
- * @version $Rev$ $Date$
- */
-public final class JavaIntrospectionHelper {
- private static final Logger logger = Logger.getLogger(JavaIntrospectionHelper.class.getName());
- private static final Class[] EMPTY_CLASS_ARRY = new Class[0];
-
- /**
- * Hide the constructor
- */
- private JavaIntrospectionHelper() {
- }
-
- /**
- * Returns a collection of public, and protected fields declared by a class
- * or one of its supertypes
- */
- public static Set<Field> getAllPublicAndProtectedFields(Class clazz, boolean validating) {
- return getAllPublicAndProtectedFields(clazz, new HashSet<Field>(), validating);
- }
-
- private static void checkInvalidAnnotations(AnnotatedElement element) {
- for (Annotation a : element.getAnnotations()) {
- if (a.annotationType().getName().startsWith("org.oasisopen.sca.annotation.")) {
- logger.warning("Invalid annotation " + a + " is found on " + element);
- }
- }
- }
-
- /**
- * Recursively evaluates the type hierarchy to return all fields that are
- * public or protected
- */
- private static Set<Field> getAllPublicAndProtectedFields(Class clazz, Set<Field> fields, boolean validating) {
- if (clazz == null || clazz.isArray() || Object.class.equals(clazz)) {
- return fields;
- }
- fields = getAllPublicAndProtectedFields(clazz.getSuperclass(), fields, validating);
- Field[] declaredFields = clazz.getDeclaredFields();
- for (final Field field : declaredFields) {
- int modifiers = field.getModifiers();
- if ((Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)) && !Modifier.isStatic(modifiers)) {
- // Allow privileged access to set accessibility. Requires ReflectPermission
- // in security policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- field.setAccessible(true); // ignore Java accessibility
- return null;
- }
- });
- fields.add(field);
- } else {
- if (validating) {
- checkInvalidAnnotations(field);
- }
- }
- }
- return fields;
- }
-
- /**
- * Returns a collection of public and protected methods declared by a class
- * or one of its supertypes. Note that overridden methods will not be
- * returned in the collection (i.e. only the method override will be). <p/>
- * This method can potentially be expensive as reflection information is not
- * cached. It is assumed that this method will be used during a
- * configuration phase.
- */
- public static Set<Method> getAllUniquePublicProtectedMethods(Class clazz, boolean validating) {
- return getAllUniqueMethods(clazz, new HashSet<Method>(), validating);
- }
-
- /**
- * Recursively evaluates the type hierarchy to return all unique methods
- */
- private static Set<Method> getAllUniqueMethods(Class pClass, Set<Method> methods, boolean validating) {
- if (pClass == null || pClass.isArray() || Object.class.equals(pClass)) {
- return methods;
- }
- // we first evaluate methods of the subclass and then move to the parent
- Method[] declaredMethods = pClass.getDeclaredMethods();
- for (final Method declaredMethod : declaredMethods) {
- int modifiers = declaredMethod.getModifiers();
- if ((!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) || Modifier.isStatic(modifiers)) {
- if (validating) {
- checkInvalidAnnotations(declaredMethod);
- }
- continue;
- }
- if (methods.size() == 0) {
- methods.add(declaredMethod);
- } else {
- List<Method> temp = new ArrayList<Method>();
- boolean matched = false;
- for (Method method : methods) {
- // only add if not already in the set from a superclass (i.e.
- // the method is not overridden)
- if (exactMethodMatch(declaredMethod, method)) {
- matched = true;
- break;
- }
- }
- if (!matched) {
- // Allow privileged access to set accessibility. Requires ReflectPermission
- // in security policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- declaredMethod.setAccessible(true);
- return null;
- }
- });
- temp.add(declaredMethod);
- }
- methods.addAll(temp);
- temp.clear();
- }
- }
- // evaluate class hierarchy - this is done last to track inherited
- // methods
- methods = getAllUniqueMethods(pClass.getSuperclass(), methods, validating);
- return methods;
- }
-
- /**
- * Finds the closest matching field with the given name, that is, a field of
- * the exact specified type or, alternately, of a supertype.
- *
- * @param name the name of the field
- * @param type the field type
- * @param fields the collection of fields to search
- * @return the matching field or null if not found
- */
- public static Field findClosestMatchingField(String name, Class type, Set<Field> fields) {
- Field candidate = null;
- for (Field field : fields) {
- if (field.getName().equals(name)) {
- if (field.getType().equals(type)) {
- return field; // exact match
- } else if (field.getType().isAssignableFrom(type) || (field.getType().isPrimitive() && primitiveAssignable(field
- .getType(),
- type))) {
- // We could have the situation where a field parameter is a
- // primitive and the demarshalled value is
- // an object counterpart (e.g. Integer and int)
- // @spec issue
- // either an interface or super class, so keep a reference
- // until
- // we know there are no closer types
- candidate = field;
- }
- }
- }
- if (candidate != null) {
- return candidate;
- } else {
- return null;
- }
- }
-
- /**
- * Finds the closest matching method with the given name, that is, a method
- * taking the exact parameter types or, alternately, parameter supertypes.
- *
- * @param name the name of the method
- * @param types the method parameter types
- * @param methods the collection of methods to search
- * @return the matching method or null if not found
- */
- public static Method findClosestMatchingMethod(String name, Class[] types, Set<Method> methods) {
- if (types == null) {
- types = EMPTY_CLASS_ARRY;
- }
- Method candidate = null;
- for (Method method : methods) {
- if (method.getName().equals(name) && method.getParameterTypes().length == types.length) {
- Class<?>[] params = method.getParameterTypes();
- boolean disqualify = false;
- boolean exactMatch = true;
- for (int i = 0; i < params.length; i++) {
- if (!params[i].equals(types[i]) && !params[i].isAssignableFrom(types[i])) {
- // no match
- disqualify = true;
- exactMatch = false;
- break;
- } else if (!params[i].equals(types[i]) && params[i].isAssignableFrom(types[i])) {
- // not exact match
- exactMatch = false;
- }
- }
- if (disqualify) {
- continue;
- } else if (exactMatch) {
- return method;
- } else {
- candidate = method;
- }
- }
- }
- if (candidate != null) {
- return candidate;
- } else {
- return null;
- }
- }
-
- /**
- * Determines if two methods "match" - that is, they have the same method
- * names and exact parameter types (one is not a supertype of the other)
- */
- public static boolean exactMethodMatch(Method method1, Method method2) {
- if (!method1.getName().equals(method2.getName())) {
- return false;
- }
- Class<?>[] types1 = method1.getParameterTypes();
- Class<?>[] types2 = method2.getParameterTypes();
- if (types1.length != types2.length) {
- return false;
- }
- boolean matched = true;
- for (int i = 0; i < types1.length; i++) {
- if (types1[i] != types2[i]) {
- matched = false;
- break;
- }
- }
- return matched;
- }
-
- public static <T> Constructor<T> getDefaultConstructor(Class<T> clazz) throws NoSuchMethodException {
- return clazz.getConstructor((Class[])null);
- }
-
- /**
- * Returns the simple name of a class - i.e. the class name devoid of its
- * package qualifier
- *
- * @param implClass the implementation class
- */
- public static String getBaseName(Class<?> implClass) {
- return implClass.getSimpleName();
- }
-
- public static boolean isImmutable(Class<?> clazz) {
- return String.class == clazz || clazz.isPrimitive()
- || Number.class.isAssignableFrom(clazz)
- || Boolean.class.isAssignableFrom(clazz)
- || Character.class.isAssignableFrom(clazz)
- || Byte.class.isAssignableFrom(clazz);
- }
-
- /**
- * Takes a property name and converts it to a getter method name according
- * to JavaBean conventions. For example, property
- * <code>foo<code> is returned as <code>getFoo</code>
- */
- public static String toGetter(String name) {
- return "get" + name.toUpperCase().substring(0, 1) + name.substring(1);
- }
-
- /**
- * Takes a setter or getter method name and converts it to a property name
- * according to JavaBean conventions. For example, <code>setFoo(var)</code>
- * is returned as property <code>foo<code>
- */
- public static String toPropertyName(String name) {
- if (!name.startsWith("set")) {
- return name;
- }
- return Introspector.decapitalize(name.substring(3));
- }
-
- public static Class<?> getErasure(Type type) {
- if (type instanceof Class) {
- return (Class<?>)type;
- } else if (type instanceof GenericArrayType) {
- // FIXME: How to deal with the []?
- GenericArrayType arrayType = (GenericArrayType)type;
- return getErasure(arrayType.getGenericComponentType());
- } else if (type instanceof ParameterizedType) {
- ParameterizedType pType = (ParameterizedType)type;
- return getErasure(pType.getRawType());
- } else if (type instanceof WildcardType) {
- WildcardType wType = (WildcardType)type;
- Type[] types = wType.getUpperBounds();
- return getErasure(types[0]);
- } else if (type instanceof TypeVariable) {
- TypeVariable var = (TypeVariable)type;
- Type[] types = var.getBounds();
- return getErasure(types[0]);
- }
- return null;
- }
-
- public static Class<?> getBaseType(Class<?> cls, Type genericType) {
- if (cls.isArray()) {
- return cls.getComponentType();
- } else if (Collection.class.isAssignableFrom(cls)) {
- if (genericType instanceof ParameterizedType) {
- // Collection<BaseType>
- ParameterizedType parameterizedType = (ParameterizedType)genericType;
- Type baseType = parameterizedType.getActualTypeArguments()[0];
- if (baseType instanceof GenericArrayType) {
- // Base is array
- return cls;
- } else {
- return getErasure(baseType);
- }
- } else {
- return cls;
- }
- } else {
- return cls;
- }
- }
-
- public static Type getParameterType(Type type) {
- if (type instanceof ParameterizedType) {
- // Collection<BaseType>
- ParameterizedType parameterizedType = (ParameterizedType)type;
- Type baseType = parameterizedType.getActualTypeArguments()[0];
- return baseType;
- } else {
- return Object.class;
- }
- }
-
- public static Class<?> getBusinessInterface(Class<?> cls, Type callableReferenceType) {
- if (CallableReference.class.isAssignableFrom(cls) && callableReferenceType instanceof ParameterizedType) {
- // Collection<BaseType>
- ParameterizedType parameterizedType = (ParameterizedType)callableReferenceType;
- Type baseType = parameterizedType.getActualTypeArguments()[0];
- if (baseType instanceof GenericArrayType) {
- // Base is array
- return cls;
- } else {
- return getErasure(baseType);
- }
- }
- return Object.class;
- }
-
- /**
- * Takes a property name and converts it to a setter method name according
- * to JavaBean conventions. For example, the property
- * <code>foo<code> is returned as <code>setFoo(var)</code>
- */
- public static String toSetter(String name) {
- return "set" + name.toUpperCase().substring(0, 1) + name.substring(1);
- }
-
- /**
- * Compares a two types, assuming one is a primitive, to determine if the
- * other is its object counterpart
- */
- private static boolean primitiveAssignable(Class<?> memberType, Class<?> param) {
- if (memberType == Integer.class) {
- return param == Integer.TYPE;
- } else if (memberType == Double.class) {
- return param == Double.TYPE;
- } else if (memberType == Float.class) {
- return param == Float.TYPE;
- } else if (memberType == Short.class) {
- return param == Short.TYPE;
- } else if (memberType == Character.class) {
- return param == Character.TYPE;
- } else if (memberType == Boolean.class) {
- return param == Boolean.TYPE;
- } else if (memberType == Byte.class) {
- return param == Byte.TYPE;
- } else if (param == Integer.class) {
- return memberType == Integer.TYPE;
- } else if (param == Double.class) {
- return memberType == Double.TYPE;
- } else if (param == Float.class) {
- return memberType == Float.TYPE;
- } else if (param == Short.class) {
- return memberType == Short.TYPE;
- } else if (param == Character.class) {
- return memberType == Character.TYPE;
- } else if (param == Boolean.class) {
- return memberType == Boolean.TYPE;
- } else if (param == Byte.class) {
- return memberType == Byte.TYPE;
- } else {
- return false;
- }
- }
-
- /**
- * Returns the generic types represented in the given type. Usage as
- * follows: <code>
- * JavaIntrospectionHelper.getGenerics(field.getGenericType());
- * <p/>
- * JavaIntrospectionHelper.getGenerics(m.getGenericParameterTypes()[0];); </code>
- *
- * @return the generic types in order of declaration or an empty array if
- * the type is not genericized
- */
- public static List<? extends Type> getGenerics(Type genericType) {
- List<Type> classes = new ArrayList<Type>();
- if (genericType instanceof ParameterizedType) {
- ParameterizedType ptype = (ParameterizedType)genericType;
- // get the type arguments
- Type[] targs = ptype.getActualTypeArguments();
- for (Type targ : targs) {
- classes.add(targ);
- }
- }
- return classes;
- }
-
- /**
- * Returns the generic type specified by the class at the given position as
- * in: <p/> <code> public class Foo<Bar,Baz>{ //.. }
- * <p/>
- * JavaIntrospectionHelper.introspectGeneric(Foo.class,1); <code>
- * <p/>
- * will return Baz.
- */
- public static Class introspectGeneric(Class<?> clazz, int pos) {
- assert clazz != null : "No class specified";
- Type type = clazz.getGenericSuperclass();
- if (type instanceof ParameterizedType) {
- Type[] args = ((ParameterizedType)type).getActualTypeArguments();
- if (args.length <= pos) {
- throw new IllegalArgumentException("Invalid index value for generic class " + clazz.getName());
- }
- return (Class)((ParameterizedType)type).getActualTypeArguments()[pos];
- } else {
- Type[] interfaces = clazz.getGenericInterfaces();
- for (Type itype : interfaces) {
- if (!(itype instanceof ParameterizedType)) {
- continue;
- }
- ParameterizedType interfaceType = (ParameterizedType)itype;
- return (Class)interfaceType.getActualTypeArguments()[0];
- }
- }
- return null;
- }
-
- /**
- * Returns the set of interfaces implemented by the given class and its
- * ancestors or a blank set if none
- */
- public static Set<Class<?>> getAllInterfaces(Class<?> clazz) {
- Set<Class<?>> implemented = new HashSet<Class<?>>();
- getAllInterfaces(clazz, implemented);
- return implemented;
- }
-
- private static void getAllInterfaces(Class<?> clazz, Set<Class<?>> implemented) {
- Class<?>[] interfaces = clazz.getInterfaces();
- for (Class<?> interfaze : interfaces) {
- implemented.add(interfaze);
- }
- Class<?> superClass = clazz.getSuperclass();
- // Object has no superclass so check for null
- if (superClass != null && !superClass.equals(Object.class)) {
- getAllInterfaces(superClass, implemented);
- }
- }
-
- public static boolean isSetter(Method method) {
- return (void.class == method.getReturnType() && method.getParameterTypes().length == 1 && method.getName()
- .startsWith("set"));
- }
-
- public static boolean isGetter(Method method) {
- return (void.class != method.getReturnType() && method.getParameterTypes().length == 0 && method.getName()
- .startsWith("get"));
- }
-
- private final static Map<Class<?>, String> signatures = new HashMap<Class<?>, String>();
- static {
- signatures.put(boolean.class, "Z");
- signatures.put(byte.class, "B");
- signatures.put(char.class, "C");
- signatures.put(short.class, "S");
- signatures.put(int.class, "I");
- signatures.put(long.class, "J");
- signatures.put(float.class, "F");
- signatures.put(double.class, "D");
- };
-
- public static String getSignature(Class<?> cls) {
- if (cls.isPrimitive()) {
- return signatures.get(cls);
- }
- if (cls.isArray()) {
- return "[" + getSignature(cls.getComponentType());
- }
- return "L" + cls.getName().replace('.', '/') + ";";
- }
-
- public static Class<?> getArrayType(Class<?> componentType, int dims) throws ClassNotFoundException {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < dims; i++) {
- buf.append('[');
- }
- buf.append(getSignature(componentType));
- return Class.forName(buf.toString(), false, componentType.getClassLoader());
- }
-
- public static Set<Method> getPrivateMethods(Class<?> clazz) {
- Set<Method> methods = new HashSet<Method>();
- Method[] declaredMethods = clazz.getDeclaredMethods();
- for (final Method declaredMethod : declaredMethods) {
- int modifiers = declaredMethod.getModifiers();
- if(Modifier.isPrivate(modifiers)) {
- methods.add(declaredMethod);
- }
- }
-
- return methods;
- }
-
- public static Set<Field> getPrivateFields(Class<?> clazz) {
- Set<Field> fields = new HashSet<Field>();
- Field[] declaredFields = clazz.getDeclaredFields();
- for (final Field declaredField : declaredFields) {
- int modifiers = declaredField.getModifiers();
- if(Modifier.isPrivate(modifiers)) {
- fields.add(declaredField);
- }
- }
-
- return fields;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessor.java
deleted file mode 100644
index e7f2638255..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessor.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import java.lang.annotation.Annotation;
-import java.lang.annotation.ElementType;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-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.interfacedef.util.JavaXMLMapper;
-
-/**
- * Base class for ImplementationProcessors that handle annotations that add
- * Properties.
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractPropertyProcessor<A extends Annotation> extends BaseJavaClassVisitor {
- private final Class<A> annotationClass;
-
- protected AbstractPropertyProcessor(AssemblyFactory assemblyFactory, Class<A> annotationClass) {
- super(assemblyFactory);
- this.annotationClass = annotationClass;
- }
-
- private static boolean removeProperty(JavaElementImpl prop, JavaImplementation type) {
- if(prop==null) {
- return false;
- }
- List<Property> props = type.getProperties();
- for(int i=0;i<props.size();i++) {
- if(props.get(i).getName().equals(prop.getName())) {
- props.remove(i);
- return true;
- }
- }
- return false;
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- A annotation = method.getAnnotation(annotationClass);
- if (annotation == null) {
- return;
- }
-
- if (!JavaIntrospectionHelper.isSetter(method)) {
- throw new IllegalPropertyException("Annotated method is not a setter: " + method, method);
- }
-
- String name = getName(annotation);
- if (name == null || "".equals(name)) {
- name = method.getName();
- if (name.startsWith("set")) {
- name = JavaIntrospectionHelper.toPropertyName(method.getName());
- }
- }
-
- Map<String, JavaElementImpl> properties = type.getPropertyMembers();
- JavaElementImpl prop = properties.get(name);
- // Setter override field
- if (prop != null && prop.getElementType() != ElementType.FIELD) {
- throw new DuplicatePropertyException(name);
- }
-
- removeProperty(prop, type);
-
- JavaElementImpl element = new JavaElementImpl(method, 0);
- Property property = createProperty(name, element);
-
- // add databinding available as annotations, as extensions
-
- initProperty(property, annotation);
- type.getProperties().add(property);
- properties.put(name, element);
- }
-
- @Override
- public void visitField(Field field, JavaImplementation type) throws IntrospectionException {
-
- A annotation = field.getAnnotation(annotationClass);
- if (annotation == null) {
- return;
- }
-
- String name = getName(annotation);
- if (name == null) {
- name = "";
- }
- if ("".equals(name) || name.equals(field.getType().getName())) {
- name = field.getName();
- }
-
- Map<String, JavaElementImpl> properties = type.getPropertyMembers();
- JavaElementImpl prop = properties.get(name);
- // Setter override field
- if (prop != null && prop.getElementType() == ElementType.FIELD) {
- throw new DuplicatePropertyException(name);
- }
-
- if (prop == null) {
- JavaElementImpl element = new JavaElementImpl(field);
- Property property = createProperty(name, element);
- initProperty(property, annotation);
- type.getProperties().add(property);
- properties.put(name, element);
- }
- }
-
- @Override
- public void visitConstructorParameter(JavaParameterImpl parameter, JavaImplementation type)
- throws IntrospectionException {
-
- Map<String, JavaElementImpl> properties = type.getPropertyMembers();
- A annotation = parameter.getAnnotation(annotationClass);
- if (annotation != null) {
- String name = getName(annotation);
- if (name == null) {
- name = parameter.getType().getName();
- }
- if (!"".equals(name) && !"".equals(parameter.getName()) && !name.equals(parameter.getName())) {
- throw new InvalidConstructorException("Mismatched property name: " + parameter);
- }
- if ("".equals(name) && "".equals(parameter.getName())) {
- throw new InvalidPropertyException("Missing property name: " + parameter);
- }
- if ("".equals(name)) {
- name = parameter.getName();
- }
-
- JavaElementImpl prop = properties.get(name);
- // Setter override field
- if (prop != null && prop.getElementType() != ElementType.FIELD) {
- throw new DuplicatePropertyException(name);
- }
- removeProperty(prop, type);
-
- parameter.setName(name);
- parameter.setClassifer(annotationClass);
- Property property = createProperty(name, parameter);
- initProperty(property, annotation);
- type.getProperties().add(property);
- properties.put(name, parameter);
- }
- }
-
- protected abstract String getName(A annotation);
-
- protected abstract void initProperty(Property property, A annotation) throws IntrospectionException;
-
- protected Property createProperty(String name, JavaElementImpl element) throws IntrospectionException {
-
- Property property = assemblyFactory.createProperty();
- property.setName(name);
- Class<?> baseType = JavaIntrospectionHelper.getBaseType(element.getType(), element.getGenericType());
- property.setXSDType(JavaXMLMapper.getXMLType(baseType));
-
- Class<?> javaType = element.getType();
- if (javaType.isArray() || Collection.class.isAssignableFrom(javaType)) {
- property.setMany(true);
- }
- return property;
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AllowsPassByReferenceProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AllowsPassByReferenceProcessor.java
deleted file mode 100644
index b08a1f6182..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AllowsPassByReferenceProcessor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.oasisopen.sca.annotation.AllowsPassByReference;
-
-/**
- * Processes {@link AllowsPassByReference} on an implementation
- *
- * @version $Rev$ $Date$
- */
-public class AllowsPassByReferenceProcessor extends BaseJavaClassVisitor {
-
- public AllowsPassByReferenceProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- type.setAllowsPassByReference(clazz.isAnnotationPresent(AllowsPassByReference.class));
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- boolean pbr = method.isAnnotationPresent(AllowsPassByReference.class);
- if (pbr) {
- type.getAllowsPassByReferenceMethods().add(method);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AmbiguousConstructorException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AmbiguousConstructorException.java
deleted file mode 100644
index c6e6b6e4d6..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AmbiguousConstructorException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Member;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Thrown when constructor parameters cannot be unambiguously resolved to a property or reference
- *
- * @version $Rev$ $Date$
- */
-public class AmbiguousConstructorException extends IntrospectionException {
- private static final long serialVersionUID = 3662860753837091880L;
-
- public AmbiguousConstructorException(String message) {
- super(message);
- }
-
- public AmbiguousConstructorException(String message, Member member) {
- super(message, member);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ComponentNameProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ComponentNameProcessor.java
deleted file mode 100644
index fd6dbcc1ed..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ComponentNameProcessor.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaResourceImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-import org.oasisopen.sca.annotation.ComponentName;
-
-/**
- * Processes {@link @ComponentName} annotations on a component implementation and adds
- * a {@link JavaMappedProperty} to the component type which will be used to
- * inject the appropriate component name.
- *
- * @version $Rev$ $Date$
- */
-public class ComponentNameProcessor extends BaseJavaClassVisitor {
-
- public ComponentNameProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- if (method.getAnnotation(ComponentName.class) == null) {
- return;
- }
- if (method.getParameterTypes().length != 1) {
- throw new IllegalContextException("ComponentName setter must have one parameter", method);
- }
- Class<?> paramType = method.getParameterTypes()[0];
- String name = JavaIntrospectionHelper.toPropertyName(method.getName());
- if (String.class.equals(paramType)) {
- JavaElementImpl element = new JavaElementImpl(method, 0);
- element.setName(name);
- element.setClassifer(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
- JavaResourceImpl resource = new JavaResourceImpl(element);
- type.getResources().put(resource.getName(), resource);
- } else {
- throw new IllegalContextException(paramType.getName());
- }
- }
-
- @Override
- public void visitField(Field field, JavaImplementation type) throws IntrospectionException {
- if (field.getAnnotation(ComponentName.class) == null) {
- return;
- }
- Class<?> paramType = field.getType();
- if (String.class.equals(paramType)) {
- JavaElementImpl element = new JavaElementImpl(field);
- element.setClassifer(Resource.class);
- JavaResourceImpl resource = new JavaResourceImpl(element);
- type.getResources().put(resource.getName(), resource);
- } else {
- throw new IllegalContextException(paramType.getName());
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessor.java
deleted file mode 100644
index b49dbb5fe7..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessor.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Constructor;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
-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;
-
-/**
- * Handles processing of a constructor decorated with
- * {@link org.oasisopen.sca.annotation.Constructor}
- *
- * @version $Rev$ $Date$
- */
-@SuppressWarnings("unchecked")
-public class ConstructorProcessor extends BaseJavaClassVisitor {
-
- public ConstructorProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- Constructor[] ctors = clazz.getConstructors();
- boolean found = false;
- for (Constructor constructor : ctors) {
- JavaConstructorImpl<?> definition = new JavaConstructorImpl(constructor);
- type.getConstructors().put(constructor, definition);
- if (constructor.getAnnotation(org.oasisopen.sca.annotation.Constructor.class) != null) {
- if (found) {
- throw new DuplicateConstructorException("Multiple constructors marked with @Constructor", constructor);
- }
- found = true;
- type.setConstructor(definition);
- }
- }
- }
-
- @Override
- public <T> void visitConstructor(Constructor<T> constructor, JavaImplementation type)
- throws IntrospectionException {
- org.oasisopen.sca.annotation.Constructor annotation = constructor
- .getAnnotation(org.oasisopen.sca.annotation.Constructor.class);
- if (annotation == null) {
- return;
- }
- JavaConstructorImpl<?> definition = type.getConstructor();
- if (definition == null) {
- definition = new JavaConstructorImpl(constructor);
- type.setConstructor(definition);
- }
- JavaParameterImpl[] parameters = definition.getParameters();
- String[] value = annotation.value();
- boolean isDefault = value.length == 0 || (value.length == 1 && "".equals(value[0]));
- if (!isDefault && value.length != parameters.length) {
- throw new InvalidConstructorException("Invalid Number of names in @Constructor");
- }
- for (int i = 0; i < parameters.length; i++) {
- parameters[i].setName(i < value.length ? value[i] : "");
- }
- type.setConstructor(definition);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ContextProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ContextProcessor.java
deleted file mode 100644
index 0694def99a..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ContextProcessor.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaResourceImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.annotation.Context;
-
-/**
- * Processes {@link @Context} annotations on a component implementation and adds
- * a {@link JavaMappedProperty} to the component type which will be used to
- * inject the appropriate context
- *
- * @version $Rev$ $Date$
- */
-public class ContextProcessor extends BaseJavaClassVisitor {
-
- public ContextProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- if (method.getAnnotation(Context.class) == null) {
- return;
- }
- if (method.getParameterTypes().length != 1) {
- throw new IllegalContextException("Context setter must have one parameter", method);
- }
- Class<?> paramType = method.getParameterTypes()[0];
- String name = JavaIntrospectionHelper.toPropertyName(method.getName());
- if (ComponentContext.class.equals(paramType) || RequestContext.class.equals(paramType)) {
- JavaElementImpl element = new JavaElementImpl(method, 0);
- element.setName(name);
- element.setClassifer(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
- JavaResourceImpl resource = new JavaResourceImpl(element);
- type.getResources().put(resource.getName(), resource);
- } else {
- throw new UnknownContextTypeException(paramType.getName());
- }
- }
-
- @Override
- public void visitField(Field field, JavaImplementation type) throws IntrospectionException {
- if (field.getAnnotation(Context.class) == null) {
- return;
- }
- Class<?> paramType = field.getType();
- if (ComponentContext.class.equals(paramType) || RequestContext.class.equals(paramType)) {
- JavaElementImpl element = new JavaElementImpl(field);
- element.setClassifer(Resource.class);
- JavaResourceImpl resource = new JavaResourceImpl(element);
- type.getResources().put(resource.getName(), resource);
- } else {
- throw new UnknownContextTypeException(paramType.getName());
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationIDProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationIDProcessor.java
deleted file mode 100644
index ef94104cbd..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationIDProcessor.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaResourceImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-import org.oasisopen.sca.annotation.ConversationID;
-
-/**
- * Processes {@link @ConversationID} annotations on a component implementation and adds
- * a {@link JavaMappedProperty} to the component type which will be used to
- * inject the appropriate conversationId
- *
- * @version $Rev$ $Date$
- */
-public class ConversationIDProcessor extends BaseJavaClassVisitor {
-
- public ConversationIDProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- if (method.getAnnotation(ConversationID.class) == null) {
- return;
- }
- if (method.getParameterTypes().length != 1) {
- throw new IllegalContextException("ConversationID setter must have one parameter", method);
- }
- String name = JavaIntrospectionHelper.toPropertyName(method.getName());
- JavaElementImpl element = new JavaElementImpl(method, 0);
- element.setName(name);
- element.setClassifer(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
- JavaResourceImpl resource = new JavaResourceImpl(element);
- type.getResources().put(resource.getName(), resource);
- }
-
- @Override
- public void visitField(Field field, JavaImplementation type) throws IntrospectionException {
- if (field.getAnnotation(ConversationID.class) == null) {
- return;
- }
- JavaElementImpl element = new JavaElementImpl(field);
- element.setClassifer(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
- JavaResourceImpl resource = new JavaResourceImpl(element);
- type.getResources().put(resource.getName(), resource);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationProcessor.java
deleted file mode 100644
index 2fb657159b..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationProcessor.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConversationProcessor extends BaseJavaClassVisitor {
- private static final String SECONDS = " SECONDS";
- private static final String MINUTES = " MINUTES";
- private static final String HOURS = " HOURS";
- private static final String DAYS = " DAYS";
- private static final String YEARS = " YEARS";
-
- public ConversationProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
-
- ConversationAttributes conversation = clazz.getAnnotation(ConversationAttributes.class);
- if (conversation == null) {
- return;
- }
- Scope scope = clazz.getAnnotation(Scope.class);
- if (scope == null) {
- // implicitly assume conversation
- type.setJavaScope(org.apache.tuscany.sca.implementation.java.JavaScopeImpl.CONVERSATION);
- } else if (conversation != null) {
- long maxAge;
- long maxIdleTime;
- String maxAgeVal = conversation.maxAge();
- String maxIdleTimeVal = conversation.maxIdleTime();
- try {
- if (maxAgeVal.length() > 0) {
- maxAge = convertTimeMillis(maxAgeVal);
- type.setMaxAge(maxAge);
- }
- } catch (NumberFormatException e) {
- throw new InvalidConversationalImplementationException("Invalid maximum age", e);
- }
- try {
- if (maxIdleTimeVal.length() > 0) {
- maxIdleTime = convertTimeMillis(maxIdleTimeVal);
- type.setMaxIdleTime(maxIdleTime);
- }
- } catch (NumberFormatException e) {
- throw new InvalidConversationalImplementationException("Invalid maximum idle time", e);
- }
- }
-
- }
-
- @Override
- public void visitMethod(Method method,
- JavaImplementation type) throws IntrospectionException {
- ConversationID conversationID = method.getAnnotation(ConversationID.class);
- if (conversationID == null) {
- return;
- }
- type.addConversationIDMember(method);
- }
-
- @Override
- public void visitField(Field field,
- JavaImplementation type) throws IntrospectionException {
- ConversationID conversationID = field.getAnnotation(ConversationID.class);
- if (conversationID == null) {
- return;
- }
- type.addConversationIDMember(field);
- }
-
- static long convertTimeMillis(String expr) throws NumberFormatException {
- expr = expr.trim().toUpperCase();
- int i = expr.lastIndexOf(SECONDS);
- if (i >= 0) {
- String units = expr.substring(0, i);
- return Long.parseLong(units) * 1000;
- }
- i = expr.lastIndexOf(MINUTES);
- if (i >= 0) {
- String units = expr.substring(0, i);
- return Long.parseLong(units) * 60000;
- }
-
- i = expr.lastIndexOf(HOURS);
- if (i >= 0) {
- String units = expr.substring(0, i);
- return Long.parseLong(units) * 3600000;
- }
- i = expr.lastIndexOf(DAYS);
- if (i >= 0) {
- String units = expr.substring(0, i);
- return Long.parseLong(units) * 86400000;
- }
- i = expr.lastIndexOf(YEARS);
- if (i >= 0) {
- String units = expr.substring(0, i);
- return Long.parseLong(units) * 31556926000L;
- }
- return Long.parseLong(expr) * 1000; // assume seconds if no suffix
- // specified
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessor.java
deleted file mode 100644
index 68cfc4c189..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessor.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.oasisopen.sca.annotation.Destroy;
-
-/**
- * Processes the {@link @Destroy} annotation on a component implementation and
- * updates the component type with the decorated destructor method
- *
- * @version $Rev$ $Date$
- */
-public class DestroyProcessor extends BaseJavaClassVisitor {
-
- public DestroyProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- Destroy annotation = method.getAnnotation(Destroy.class);
- if (annotation == null) {
- return;
- }
- if (method.getParameterTypes().length != 0) {
- throw new IllegalDestructorException("Destructor must not have argments", method);
- }
- if(!method.getReturnType().equals(void.class)) {
- throw new IllegalDestructorException("Destructor must return void.", method);
- }
- if (type.getDestroyMethod() != null) {
- throw new DuplicateDestructorException("More than one destructor found on implementation");
- }
- if (!Modifier.isPublic(method.getModifiers())) {
- throw new IllegalDestructorException("Destructor must be a public method. Invalid annotation @Destroy found on "+method);
- }
- type.setDestroyMethod(method);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateConstructorException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateConstructorException.java
deleted file mode 100644
index d6494e3845..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateConstructorException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Member;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Thrown when more than one component implementation constructor is annotated with {@link
- * org.oasisopen.sca.annotation.Constructor}
- *
- * @version $Rev$ $Date$
- */
-public class DuplicateConstructorException extends IntrospectionException {
- private static final long serialVersionUID = -5926763756570552986L;
-
- public DuplicateConstructorException(String message) {
- super(message);
- }
-
- public DuplicateConstructorException(String message, Member member) {
- super(message, member);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateDestructorException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateDestructorException.java
deleted file mode 100644
index 8bfae89162..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateDestructorException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Thrown when an implementation is annotated multiple times with {@link org.oasisopen.sca.annotation.Destroy}
- *
- * @version $Rev$ $Date$
- */
-public class DuplicateDestructorException extends IntrospectionException {
- private static final long serialVersionUID = -7474912510114895203L;
-
- public DuplicateDestructorException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateInitException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateInitException.java
deleted file mode 100644
index 38f6478531..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateInitException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Thrown when an implementation is annotated multiple times with {@link @org.oasisopen.sca.annotation.Init}
- *
- * @version $Rev$ $Date$
- */
-public class DuplicateInitException extends IntrospectionException {
- private static final long serialVersionUID = -6282935288115512057L;
-
- public DuplicateInitException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicatePropertyException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicatePropertyException.java
deleted file mode 100644
index b9e1923e73..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicatePropertyException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Thrown when an implementation has more than one property injection site with the same name
- *
- * @version $Rev$ $Date$
- */
-public class DuplicatePropertyException extends IntrospectionException {
- private static final long serialVersionUID = 5536415875694904037L;
-
- public DuplicatePropertyException(String message) {
- super(message);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateReferenceException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateReferenceException.java
deleted file mode 100644
index 300ad6817e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateReferenceException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Thrown when an implementation has more than one reference injection site with the same name
- *
- * @version $Rev$ $Date$
- */
-public class DuplicateReferenceException extends IntrospectionException {
- private static final long serialVersionUID = 907910648213477158L;
-
- public DuplicateReferenceException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateResourceException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateResourceException.java
deleted file mode 100644
index 2d177b3f76..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateResourceException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Thrown when an implementation has more than one resource injection site with the same name
- *
- * @version $Rev$ $Date$
- */
-public class DuplicateResourceException extends IntrospectionException {
-
- private static final long serialVersionUID = 1619276459330463299L;
-
- public DuplicateResourceException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessor.java
deleted file mode 100644
index ca02c96834..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.oasisopen.sca.annotation.EagerInit;
-
-/**
- * Handles processing of {@link org.oasisopen.sca.annotation.EagerInit}
- *
- * @version $Rev$ $Date$
- */
-public class EagerInitProcessor extends BaseJavaClassVisitor {
-
- public EagerInitProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public <T> void visitClass(Class<T> clazz,
- JavaImplementation type) throws IntrospectionException {
- super.visitClass(clazz, type);
- EagerInit annotation = clazz.getAnnotation(EagerInit.class);
- if (annotation == null) {
- Class<?> superClass = clazz.getSuperclass();
- while (!Object.class.equals(superClass)) {
- annotation = superClass.getAnnotation(EagerInit.class);
- if (annotation != null) {
- break;
- }
- superClass = superClass.getSuperclass();
- }
- if (annotation == null) {
- return;
- }
- }
- type.setEagerInit(true);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
deleted file mode 100644
index 551909e9bc..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
+++ /dev/null
@@ -1,658 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-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.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.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 HeuristicPojoProcessor extends BaseJavaClassVisitor {
- private JavaInterfaceFactory javaFactory;
-
- public HeuristicPojoProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory) {
- super(assemblyFactory);
- this.javaFactory = javaFactory;
- }
-
- @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 <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));
- }
- }
- }
- }
-
- /**
- * 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();
- 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 {
- // FIXME multiple constructors, none yet done
- Constructor<T> selected = null;
- int sites = type.getPropertyMembers().size() + type.getReferenceMembers().size();
- for (Constructor<T> ctor : constructors) {
- if (ctor.getParameterTypes().length == 0) {
- selected = ctor;
- }
- if (ctor.getParameterTypes().length == sites) {
- // TODO finish
- // selected = constructor;
- // select constructor
- // break;
- }
- }
- if (selected == null) {
- throw new NoConstructorException();
- }
- constructor = selected;
- definition = type.getConstructors().get(selected);
- type.setConstructor(definition);
- // return;
- }
- definition = type.getConstructors().get(constructor);
- type.setConstructor(definition);
- }
- JavaParameterImpl[] parameters = definition.getParameters();
- if (parameters.length == 0) {
- return;
- }
- Map<String, JavaElementImpl> props = type.getPropertyMembers();
- Map<String, JavaElementImpl> refs = type.getReferenceMembers();
- 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);
- }
- }
-
-
-
- /**
- * 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;
- }
-
- /**
- * 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 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;
- }
-
- private 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;
- }
-
- private 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);
- }
- }
-
-
- /**
- * Utility methods
- */
-
-
- /**
- * Verify if the method is a public setter
- * @param method
- * @return
- */
- private static boolean isPublicSetter(Method method) {
- return method.getParameterTypes().length == 1 && Modifier.isPublic(method.getModifiers())
- && method.getName().startsWith("set")
- && method.getReturnType() == void.class;
- }
-
- /**
- * Verify if the method is a protected setter
- * @param method
- * @return
- */
- private static boolean isProtectedSetter(Method method) {
- return method.getParameterTypes().length == 1 && Modifier.isProtected(method.getModifiers())
- && method.getName().startsWith("set")
- && method.getReturnType() == void.class;
- }
-
- /**
- * @param collection
- * @return
- */
- private static boolean areUnique(Class<?>[] collection) {
- Set<Class<?>> set = new HashSet<Class<?>>(Arrays.asList(collection));
- return set.size() == collection.length;
- }
-
- /**
- * 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 static 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
- * @param operation
- * @param services
- * @return
- */
- private static 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 static 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;
- }
-
- /**
- * Verify if there is any SCA annotation on the parameter
- * @param parameter
- * @return
- */
- private static 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;
- }
-
- /**
- * Verify if the parameters are unique
- * @param parameters
- * @return
- */
- private static 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;
- }
-
- /**
- * Verify if the annotations are SCA annotation
- * @param annots
- * @return
- */
- private static 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/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalCallbackReferenceException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalCallbackReferenceException.java
deleted file mode 100644
index badd41fbb9..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalCallbackReferenceException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Member;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an illegal use of {@link org.oasisopen.sca.annotation.Callback} on a reference
- *
- * @version $Rev$ $Date$
- */
-public class IllegalCallbackReferenceException extends IntrospectionException {
- private static final long serialVersionUID = -8932525723147700591L;
-
- public IllegalCallbackReferenceException(String message) {
- super(message);
- }
-
- public IllegalCallbackReferenceException(String message, Member member) {
- super(message, member);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalContextException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalContextException.java
deleted file mode 100644
index fa1e67a336..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalContextException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Member;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an illegal signature for a method decorated with {@link org.oasisopen.sca.annotation.Context}
- *
- * @version $Rev$ $Date$
- */
-public class IllegalContextException extends IntrospectionException {
- private static final long serialVersionUID = -6946383136750117008L;
-
- public IllegalContextException(String message) {
- super(message);
- }
-
- public IllegalContextException(String message, Member member) {
- super(message, member);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalDestructorException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalDestructorException.java
deleted file mode 100644
index 0c4c3d5646..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalDestructorException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Member;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an illegal signature for a method decorated with {@link org.oasisopen.sca.annotation.Destroy}
- *
- * @version $Rev$ $Date$
- */
-public class IllegalDestructorException extends IntrospectionException {
- private static final long serialVersionUID = 365719353107446326L;
-
- public IllegalDestructorException(String message) {
- super(message);
- }
-
- public IllegalDestructorException(String message, Member member) {
- super(message, member);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalInitException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalInitException.java
deleted file mode 100644
index 2956b60b65..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalInitException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Member;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an illegal signature for a method decorated with {@link @org.oasisopen.sca.annotation.Init}
- *
- * @version $Rev$ $Date$
- */
-public class IllegalInitException extends IntrospectionException {
- private static final long serialVersionUID = -3690763271986854701L;
-
- public IllegalInitException(String message) {
- super(message);
- }
-
- public IllegalInitException(String message, Member member) {
- super(message, member);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalPropertyException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalPropertyException.java
deleted file mode 100644
index 54f7dfad1e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalPropertyException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Member;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an illegal property definition in a component type
- *
- * @version $Rev$ $Date$
- */
-public class IllegalPropertyException extends IntrospectionException {
- private static final long serialVersionUID = -2836849110706758494L;
-
- public IllegalPropertyException(String message) {
- super(message);
- }
-
- public IllegalPropertyException(String message, Member member) {
- super(message, member);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalReferenceException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalReferenceException.java
deleted file mode 100644
index 25196c56e5..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalReferenceException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Member;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an illegal reference definition in a component type
- *
- * @version $Rev$ $Date$
- */
-public class IllegalReferenceException extends IntrospectionException {
- private static final long serialVersionUID = 4612984122225271395L;
-
- public IllegalReferenceException(String message) {
- super(message);
- }
-
- public IllegalReferenceException(String message, Member member) {
- super(message, member);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalResourceException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalResourceException.java
deleted file mode 100644
index ccfbaf0043..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalResourceException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Member;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an illegal resource definition in a component type
- *
- * @version $Rev$ $Date$
- */
-public class IllegalResourceException extends IntrospectionException {
- private static final long serialVersionUID = -1100936539412435579L;
-
- public IllegalResourceException(String message) {
- super(message);
- }
-
- public IllegalResourceException(String message, Member member) {
- super(message, member);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalServiceDefinitionException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalServiceDefinitionException.java
deleted file mode 100644
index e0f90779a1..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalServiceDefinitionException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an illegal use of the {@link @org.oasisopen.sca.annotation.Service} annotation
- *
- * @version $Rev$ $Date$
- */
-public class IllegalServiceDefinitionException extends IntrospectionException {
- private static final long serialVersionUID = -7151534258405092548L;
-
- public IllegalServiceDefinitionException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessor.java
deleted file mode 100644
index 8d12f14729..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessor.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.oasisopen.sca.annotation.Init;
-
-/**
- * Processes the {@link @Init} annotation on a component implementation and
- * updates the component type with the decorated initializer method
- *
- * @version $Rev$ $Date$
- */
-public class InitProcessor extends BaseJavaClassVisitor {
-
- public InitProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- Init annotation = method.getAnnotation(Init.class);
- if (annotation == null) {
- return;
- }
- if (method.getParameterTypes().length != 0) {
- throw new IllegalInitException("Initializer must not have argments", method);
- }
- if(!method.getReturnType().equals(void.class)) {
- throw new IllegalInitException("Initializer must return void.", method);
- }
- if (type.getInitMethod() != null) {
- throw new DuplicateInitException("More than one initializer found on implementaton");
- }
- if (!Modifier.isPublic(method.getModifiers())) {
- throw new IllegalInitException("Initializer must be a public method. Invalid annotation @Init found on "+method);
- }
- type.setInitMethod(method);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidConstructorException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidConstructorException.java
deleted file mode 100644
index c75dfdaf46..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidConstructorException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an invalid constructor definition, e.g. when the number of injection names specified in {@link
- * org.oasisopen.sca.annotation.Constructor} do not match the number of actual constructor parameters
- *
- * @version $Rev$ $Date$
- */
-public class InvalidConstructorException extends IntrospectionException {
- private static final long serialVersionUID = 1411492435210741512L;
-
- public InvalidConstructorException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidConversationalImplementationException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidConversationalImplementationException.java
deleted file mode 100644
index 079495e4db..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidConversationalImplementationException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Raised when an implementation specifies improper conversational metadata
- *
- * @version $Rev$ $Date$
- */
-public class InvalidConversationalImplementationException extends IntrospectionException {
- private static final long serialVersionUID = -5487291552769408149L;
-
- public InvalidConversationalImplementationException(String message) {
- super(message);
- }
-
- public InvalidConversationalImplementationException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidPropertyException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidPropertyException.java
deleted file mode 100644
index 429b88aa1f..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidPropertyException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an invalid usage of {@link org.oasisopen.sca.annotation.Property}
- *
- * @version $Rev$ $Date$
- */
-public class InvalidPropertyException extends IntrospectionException {
- private static final long serialVersionUID = -2682862652069727948L;
-
- public InvalidPropertyException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidReferenceException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidReferenceException.java
deleted file mode 100644
index fbf3fc9ed3..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidReferenceException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an invalid usage of {@link org.oasisopen.sca.annotation.Reference}
- *
- * @version $Rev$ $Date$
- */
-public class InvalidReferenceException extends IntrospectionException {
- private static final long serialVersionUID = -3285246635989254165L;
-
- public InvalidReferenceException(String message) {
- super(message);
- }
-
- public InvalidReferenceException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public InvalidReferenceException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidResourceException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidResourceException.java
deleted file mode 100644
index debb5cbacc..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidResourceException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Member;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Denotes an invalid usage of {@link @org.apache.tuscany.api.annotation.Resource}
- *
- * @version $Rev$ $Date$
- */
-public class InvalidResourceException extends IntrospectionException {
- private static final long serialVersionUID = 511728001735534934L;
-
- public InvalidResourceException(String message) {
- super(message);
- }
-
- public InvalidResourceException(String message, Member member) {
- super(message, member);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidServiceTypeException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidServiceTypeException.java
deleted file mode 100644
index 230c8c6fdd..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidServiceTypeException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Thrown when a service type specified by an {@link org.oasisopen.sca.annotation.Service} annotation is invalid, e.g. it is
- * not an interface
- *
- * @version $Rev$ $Date$
- */
-public class InvalidServiceTypeException extends IntrospectionException {
- private static final long serialVersionUID = -1076466639416644386L;
- private Class<?> serviceType;
-
- public InvalidServiceTypeException(String message) {
- super(message);
- }
-
- public InvalidServiceTypeException(String message, Class<?> clazz) {
- super(message);
- this.serviceType = clazz;
- }
-
- /**
- * @return the serviceType
- */
- public Class<?> getServiceType() {
- return serviceType;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/NoConstructorException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/NoConstructorException.java
deleted file mode 100644
index 453cfa35fe..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/NoConstructorException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Thrown when a suitable constructor for a component implementation cannot be found
- *
- * @version $Rev$ $Date$
- */
-public class NoConstructorException extends IntrospectionException {
- private static final long serialVersionUID = 3086706387280694424L;
-
- public NoConstructorException() {
- }
-
- public NoConstructorException(String message) {
- super(message);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessor.java
deleted file mode 100644
index a85a66e8c7..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessor.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Callback;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.oasisopen.sca.annotation.PolicySets;
-import org.oasisopen.sca.annotation.Requires;
-
-/**
- * Processes an {@link org.oasisopen.sca.annotation.Requires} annotation
- *
- * @version $Rev$ $Date$
- */
-public class PolicyProcessor extends BaseJavaClassVisitor {
-
- private PolicyFactory policyFactory;
-
- public PolicyProcessor(AssemblyFactory assemblyFactory, PolicyFactory policyFactory) {
- super(assemblyFactory);
- this.policyFactory = policyFactory;
- }
-
-
- @Override
- public void visitField(Field field, JavaImplementation type) throws IntrospectionException {
- org.oasisopen.sca.annotation.Reference annotation =
- field.getAnnotation( org.oasisopen.sca.annotation.Reference.class);
- if (annotation == null) {
- return;
- }
- String name = annotation.name();
- if ("".equals(name)) {
- name = field.getName();
- }
-
- Reference reference = null;
- if ( (reference = getReferenceByName(name, type)) != null ) {
- readIntents(field.getAnnotation(Requires.class), reference.getRequiredIntents());
- readPolicySets(field.getAnnotation(PolicySets.class), reference.getPolicySets());
- }
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- Reference reference = null;
- if ( (reference = getReference(method, type)) != null ) {
- readIntents(method.getAnnotation(Requires.class), reference.getRequiredIntents());
- readPolicySets(method.getAnnotation(PolicySets.class), reference.getPolicySets());
- } else {
- if ( type instanceof OperationsConfigurator ) {
- //Read the intents specified on the given implementation method
- if ( (method.getAnnotation(Requires.class) != null ||
- method.getAnnotation(PolicySets.class) != null ) &&
- (type instanceof PolicySetAttachPoint )) {
- ConfiguredOperation confOp = assemblyFactory.createConfiguredOperation();
- confOp.setName(method.getName());
- ((OperationsConfigurator)type).getConfiguredOperations().add(confOp);
-
-
- readIntents(method.getAnnotation(Requires.class), confOp.getRequiredIntents());
- readPolicySets(method.getAnnotation(PolicySets.class), confOp.getPolicySets());
- }
- }
- }
- }
-
- @Override
- public <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
-
- // Read intents on the Java implementation class
- if ( type instanceof PolicySetAttachPoint ) {
- readIntentsAndPolicySets(clazz,
- ((PolicySetAttachPoint)type).getRequiredIntents(),
- ((PolicySetAttachPoint)type).getPolicySets());
- }
-
- // Process annotations on the service interfaces
- //TODO This will have to move to a JavaInterface introspector later
- for (Service service: type.getServices()) {
- InterfaceContract interfaceContract = service.getInterfaceContract();
- if (interfaceContract instanceof JavaInterfaceContract) {
- JavaInterfaceContract javaInterfaceContract = (JavaInterfaceContract)interfaceContract;
-
- // Read intents on the service interface
- if (javaInterfaceContract.getInterface() != null) {
- JavaInterface javaInterface = (JavaInterface)javaInterfaceContract.getInterface();
- if (javaInterface.getJavaClass() != null) {
- readIntentsAndPolicySets(javaInterface.getJavaClass(),
- service.getRequiredIntents(),
- service.getPolicySets());
-
- // Read intents on the service interface methods
- Method[] methods = javaInterface.getJavaClass().getMethods();
- ConfiguredOperation confOp = null;
- for (Method method: methods) {
- if ( method.getAnnotation(Requires.class) != null ||
- method.getAnnotation(PolicySets.class) != null ) {
- confOp = assemblyFactory.createConfiguredOperation();
- confOp.setName(method.getName());
- confOp.setContractName(service.getName());
-
- service.getConfiguredOperations().add(confOp);
- readIntents(method.getAnnotation(Requires.class), confOp.getRequiredIntents());
- readPolicySets(method.getAnnotation(PolicySets.class), confOp.getPolicySets());
- }
- }
- }
-
- }
-
- // Read intents on the callback interface
- if (javaInterfaceContract.getCallbackInterface() != null) {
- JavaInterface javaCallbackInterface = (JavaInterface)javaInterfaceContract.getCallbackInterface();
- if (javaCallbackInterface.getJavaClass() != null) {
- Callback callback = service.getCallback();
- if (callback == null) {
- callback = assemblyFactory.createCallback();
- service.setCallback(callback);
- }
- readIntentsAndPolicySets(javaCallbackInterface.getJavaClass(),
- callback.getRequiredIntents(),
- callback.getPolicySets());
-
- // Read intents on the callback interface methods
- Method[] methods = javaCallbackInterface.getJavaClass().getMethods();
- ConfiguredOperation confOp = null;
- for (Method method: methods) {
- confOp = assemblyFactory.createConfiguredOperation();
- confOp.setName(method.getName());
- callback.getConfiguredOperations().add(confOp);
- readIntents(method.getAnnotation(Requires.class), confOp.getRequiredIntents());
- readPolicySets(method.getAnnotation(PolicySets.class), confOp.getPolicySets());
- }
- }
- }
- }
- }
- }
-
- /**
- * Read policy intents on the given interface or class
- * @param clazz
- * @param requiredIntents
- */
- private void readIntentsAndPolicySets(Class<?> clazz,
- List<Intent> requiredIntents,
- List<PolicySet> policySets) {
- Requires intentAnnotation = clazz.getAnnotation(Requires.class);
- if (intentAnnotation != null) {
- String[] intentNames = intentAnnotation.value();
- if (intentNames.length != 0) {
- for (String intentName : intentNames) {
-
- // Add each intent to the list
- Intent intent = policyFactory.createIntent();
- intent.setName(getQName(intentName));
- requiredIntents.add(intent);
- }
- }
- }
-
- PolicySets policySetAnnotation = clazz.getAnnotation(PolicySets.class);
- if (policySetAnnotation != null) {
- String[] policySetNames = policySetAnnotation.value();
- if (policySetNames.length != 0) {
- for (String policySetName : policySetNames) {
-
- // Add each intent to the list
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(getQName(policySetName));
- policySets.add(policySet);
- }
- }
- }
- }
-
- /**
- * Read intent annotations on the given interface or class
- * @param intentAnnotation
- * @param requiredIntents
- */
- private void readIntents(Requires intentAnnotation, List<Intent> requiredIntents) {
- //Requires intentAnnotation = method.getAnnotation(Requires.class);
- if (intentAnnotation != null) {
- String[] intentNames = intentAnnotation.value();
- if (intentNames.length != 0) {
- //Operation operation = assemblyFactory.createOperation();
- //operation.setName(method.getName());
- //operation.setUnresolved(true);
- for (String intentName : intentNames) {
-
- // Add each intent to the list, associated with the
- // operation corresponding to the annotated method
- Intent intent = policyFactory.createIntent();
- intent.setName(getQName(intentName));
- //intent.getOperations().add(operation);
- requiredIntents.add(intent);
- }
- }
- }
- }
-
-
- /**
- * Read policy set annotations on a given interface or class
- * @param policySetAnnotation
- * @param policySets
- */
- private void readPolicySets(PolicySets policySetAnnotation, List<PolicySet> policySets) {
- if (policySetAnnotation != null) {
- String[] policySetNames = policySetAnnotation.value();
- if (policySetNames.length != 0) {
- //Operation operation = assemblyFactory.createOperation();
- //operation.setName(method.getName());
- //operation.setUnresolved(true);
- for (String policySetName : policySetNames) {
- // Add each intent to the list, associated with the
- // operation corresponding to the annotated method
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(getQName(policySetName));
- //intent.getOperations().add(operation);
- policySets.add(policySet);
- }
- }
- }
- }
-
- /**
- * Utility methods
- */
-
- /**
- *
- * @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 {
- qname = new QName("", intentName);
- }
- } else {
- qname = new QName("", intentName);
- }
- return qname;
- }
-
-
- /**
- *
- * @param name
- * @param type
- * @return
- */
- private static Reference getReferenceByName(String name, JavaImplementation type) {
- for ( Reference reference : type.getReferences() ) {
- if ( reference.getName().equals(name) ) {
- return reference;
- }
- }
- return null;
- }
-
-
- /**
- *
- * @param method
- * @param type
- * @return
- */
- private static Reference getReference(Method method, JavaImplementation type) {
- //since the ReferenceProcessor is called ahead of the PolicyProcessor the type should have
- //picked up the reference setter method
- org.oasisopen.sca.annotation.Reference annotation =
- method.getAnnotation(org.oasisopen.sca.annotation.Reference.class);
- if (annotation != null) {
- if (JavaIntrospectionHelper.isSetter(method)) {
- String name = annotation.name();
- if ("".equals(name)) {
- name = JavaIntrospectionHelper.toPropertyName(method.getName());
- }
- return getReferenceByName(name, type);
- }
- }
- return null;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessor.java
deleted file mode 100644
index a755146997..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.oasisopen.sca.annotation.Property;
-
-/**
- * Processes an {@link @Property} annotation, updating the component type with
- * corresponding {@link JavaMappedProperty}
- *
- * @version $Rev$ $Date$
- */
-public class PropertyProcessor extends AbstractPropertyProcessor<Property> {
-
- public PropertyProcessor(AssemblyFactory assemblyFactory) {
- super(assemblyFactory, Property.class);
- }
-
- @Override
- protected String getName(Property annotation) {
- return annotation.name();
- }
-
- @Override
- protected void initProperty(org.apache.tuscany.sca.assembly.Property property, Property annotation) {
- property.setMustSupply(annotation.required());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java
deleted file mode 100644
index 49c589c5a1..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getBaseType;
-
-import java.lang.annotation.ElementType;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-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.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.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * Processes an {@link @Reference} annotation, updating the component type with
- * corresponding {@link
- * org.apache.tuscany.spi.implementation.java.JavaMappedReference}
- *
- * @version $Rev$ $Date$
- */
-public class ReferenceProcessor extends BaseJavaClassVisitor {
- private JavaInterfaceFactory javaFactory;
-
- public ReferenceProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory) {
- super(assemblyFactory);
- this.javaFactory = javaFactory;
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- Reference annotation = method.getAnnotation(Reference.class);
- if (annotation == null) {
- return; // Not a reference annotation.
- }
- if (!JavaIntrospectionHelper.isSetter(method)) {
- throw new IllegalReferenceException("Annotated method is not a setter: " + method, method);
- }
- String name = annotation.name();
- if ("".equals(name)) {
- name = JavaIntrospectionHelper.toPropertyName(method.getName());
- }
- JavaElementImpl ref = type.getReferenceMembers().get(name);
- // Setter override field
- if (ref != null && ref.getElementType() != ElementType.FIELD) {
- throw new DuplicateReferenceException(name);
- }
- removeReference(ref, type);
-
- JavaElementImpl element = new JavaElementImpl(method, 0);
- org.apache.tuscany.sca.assembly.Reference reference = createReference(element, name);
- type.getReferences().add(reference);
- type.getReferenceMembers().put(name, element);
- }
-
-
- @Override
- public void visitField(Field field, JavaImplementation type) throws IntrospectionException {
- Reference annotation = field.getAnnotation(Reference.class);
- if (annotation == null) {
- return;
- }
- String name = annotation.name();
- if ("".equals(name)) {
- name = field.getName();
- }
- JavaElementImpl ref = type.getReferenceMembers().get(name);
- if (ref != null && ref.getElementType() == ElementType.FIELD) {
- throw new DuplicateReferenceException(name);
- }
-
- // Setter method override field
- if (ref == null) {
- JavaElementImpl element = new JavaElementImpl(field);
- org.apache.tuscany.sca.assembly.Reference reference = createReference(element, name);
- type.getReferences().add(reference);
- type.getReferenceMembers().put(name, element);
- }
- }
-
- @Override
- public void visitConstructorParameter(JavaParameterImpl parameter, JavaImplementation type)
- throws IntrospectionException {
- Reference refAnnotation = parameter.getAnnotation(Reference.class);
- if (refAnnotation == null) {
- return;
- }
- String paramName = parameter.getName();
- String name = getReferenceName(paramName, parameter.getIndex(), refAnnotation.name());
- JavaElementImpl ref = type.getReferenceMembers().get(name);
-
- // Setter override field
- if (ref != null && ref.getElementType() != ElementType.FIELD) {
- throw new DuplicateReferenceException(name);
- }
-
- removeReference(ref, type);
- org.apache.tuscany.sca.assembly.Reference reference = createReference(parameter, name);
- type.getReferences().add(reference);
- type.getReferenceMembers().put(name, parameter);
- parameter.setClassifer(Reference.class);
- parameter.setName(name);
- }
-
- /**
- * Create a SCA reference for a java Element
- * @param element
- * @param name
- * @return
- * @throws IntrospectionException
- */
- private org.apache.tuscany.sca.assembly.Reference createReference(JavaElementImpl element, String name)
- throws IntrospectionException {
- org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference();
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- reference.setInterfaceContract(interfaceContract);
-
- // reference.setMember((Member)element.getAnchor());
- boolean required = true;
- Reference ref = element.getAnnotation(Reference.class);
- if (ref != null) {
- required = ref.required();
- }
- // reference.setRequired(required);
- reference.setName(name);
- Class<?> rawType = element.getType();
- if (rawType.isArray() || Collection.class.isAssignableFrom(rawType)) {
- if (required) {
- reference.setMultiplicity(Multiplicity.ONE_N);
- } else {
- reference.setMultiplicity(Multiplicity.ZERO_N);
- }
- } else {
- if (required) {
- reference.setMultiplicity(Multiplicity.ONE_ONE);
- } else {
- reference.setMultiplicity(Multiplicity.ZERO_ONE);
- }
- }
- Type genericType = element.getGenericType();
- Class<?> baseType = getBaseType(rawType, genericType);
- if (CallableReference.class.isAssignableFrom(baseType)) {
- if (Collection.class.isAssignableFrom(rawType)) {
- genericType = JavaIntrospectionHelper.getParameterType(genericType);
- }
- baseType = JavaIntrospectionHelper.getBusinessInterface(baseType, genericType);
- }
- try {
- JavaInterface callInterface = javaFactory.createJavaInterface(baseType);
- reference.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
- reference.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
- } catch (InvalidInterfaceException e) {
- throw new IntrospectionException(e);
- }
- return reference;
- }
-
-
- /**
- * Utility methods
- */
-
- /**
- *
- * @param paramName
- * @param pos
- * @param name
- * @return
- * @throws InvalidConstructorException
- */
- private static String getReferenceName(String paramName, int pos, String name) throws InvalidConstructorException {
- if ("".equals(name)) {
- name = paramName;
- }
- if ("".equals(name)) {
- return "_ref" + pos;
- }
- if (!"".equals(paramName) && !name.equals(paramName)) {
- throw new InvalidConstructorException("Mismatching names specified for reference parameter " + pos);
- } else {
- return name;
- }
- }
-
- /**
- *
- * @param ref
- * @param type
- * @return
- */
- private static boolean removeReference(JavaElementImpl ref, JavaImplementation type) {
- if (ref == null) {
- return false;
- }
- List<org.apache.tuscany.sca.assembly.Reference> refs = type.getReferences();
- for (int i = 0; i < refs.size(); i++) {
- if (refs.get(i).getName().equals(ref.getName())) {
- refs.remove(i);
- return true;
- }
- }
- return false;
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/Resource.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/Resource.java
deleted file mode 100644
index 3d43e39ce8..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/Resource.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a resource should be provided to an implementation by the runtime.
- *
- * @version $Rev$ $Date$
- */
-@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Resource {
-
- /**
- * Denotes the name of the resource declared by the implementation.
- */
- String name() default "";
-
- /**
- * Denotes if the resource is optional
- */
- boolean optional() default false;
-
- /**
- * Denotes the default name of the resource provided by the runtime environment.
- */
- String mappedName() default "";
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ResourceProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ResourceProcessor.java
deleted file mode 100644
index 49320579d0..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ResourceProcessor.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-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.JavaResourceImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-
-/**
- * Processes an {@link @Resource} annotation, updating the component type with
- * corresponding {@link org.apache.tuscany.spi.implementation.java.JavaResourceImpl}
- *
- * @version $Rev$ $Date$
- */
-public class ResourceProcessor extends BaseJavaClassVisitor {
-
- public ResourceProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
- org.apache.tuscany.sca.implementation.java.introspect.impl.Resource annotation = method
- .getAnnotation(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
- if (annotation == null) {
- return;
- }
- if (method.getParameterTypes().length != 1) {
- throw new IllegalResourceException("Resource setter must have one parameter", method);
- }
- String name = annotation.name();
- if (name.length() < 1) {
- name = JavaIntrospectionHelper.toPropertyName(method.getName());
- }
- if (type.getResources().get(name) != null) {
- throw new DuplicateResourceException(name);
- }
-
- String mappedName = annotation.mappedName();
- JavaResourceImpl resource = createResource(name, new JavaElementImpl(method, 0));
- resource.setOptional(annotation.optional());
- if (mappedName.length() > 0) {
- resource.setMappedName(mappedName);
- }
- type.getResources().put(resource.getName(), resource);
- }
-
- @Override
- public void visitField(Field field, JavaImplementation type) throws IntrospectionException {
-
- org.apache.tuscany.sca.implementation.java.introspect.impl.Resource annotation = field
- .getAnnotation(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
- if (annotation == null) {
- return;
- }
- String name = annotation.name();
- if (name.length() < 1) {
- name = field.getName();
- }
- if (type.getResources().get(name) != null) {
- throw new DuplicateResourceException(name);
- }
-
- String mappedName = annotation.mappedName();
-
- JavaResourceImpl resource = createResource(name, new JavaElementImpl(field));
- resource.setOptional(annotation.optional());
- if (mappedName.length() > 0) {
- resource.setMappedName(mappedName);
- }
- type.getResources().put(resource.getName(), resource);
- }
-
- @Override
- public void visitConstructorParameter(JavaParameterImpl parameter, JavaImplementation type)
- throws IntrospectionException {
- org.apache.tuscany.sca.implementation.java.introspect.impl.Resource resourceAnnotation = parameter
- .getAnnotation(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
- if (resourceAnnotation != null) {
- String name = resourceAnnotation.name();
- if ("".equals(name)) {
- name = parameter.getName();
- }
- if ("".equals(name)) {
- throw new InvalidResourceException("Missing resource name", (Member)parameter.getAnchor());
- }
-
- if (!"".equals(parameter.getName()) && !name.equals(parameter.getName())) {
- throw new InvalidConstructorException("Mismatched resource name: " + parameter);
- }
-
- if (type.getResources().get(name) != null) {
- throw new DuplicateResourceException(name);
- }
-
- String mappedName = resourceAnnotation.mappedName();
-
- JavaResourceImpl resource = createResource(name, parameter);
- resource.setOptional(resourceAnnotation.optional());
- if (mappedName.length() > 0) {
- resource.setMappedName(mappedName);
- }
- type.getResources().put(resource.getName(), resource);
- }
- }
-
-
- /**
- * Utility methods
- */
-
- /**
- *
- * @param name
- * @param element
- * @return
- */
- private static JavaResourceImpl createResource(String name, JavaElementImpl element) {
- element.setClassifer(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
- element.setName(name);
- return new JavaResourceImpl(element);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessor.java
deleted file mode 100644
index 4bfdb9af9e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessor.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaScopeImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-
-/**
- * Processes the {@link JavaScopeImpl} annotation and updates the component type with the corresponding implmentation scope
- *
- * @version $Rev$ $Date$
- */
-public class ScopeProcessor extends BaseJavaClassVisitor {
-
- public ScopeProcessor(AssemblyFactory factory) {
- super(factory);
- }
-
- @Override
- public <T> void visitClass(Class<T> clazz,
- JavaImplementation type)
- throws IntrospectionException {
- org.oasisopen.sca.annotation.Scope annotation = clazz.getAnnotation(org.oasisopen.sca.annotation.Scope.class);
- if (annotation == null) {
- type.setJavaScope(JavaScopeImpl.STATELESS);
- return;
- }
- String name = annotation.value();
- JavaScopeImpl scope;
- if ("COMPOSITE".equals(name)) {
- scope = JavaScopeImpl.COMPOSITE;
- } else if ("SESSION".equals(name)) {
- scope = JavaScopeImpl.SESSION;
- } else if ("CONVERSATION".equals(name)) {
- scope = JavaScopeImpl.CONVERSATION;
- } else if ("REQUEST".equals(name)) {
- scope = JavaScopeImpl.REQUEST;
- } else {
- scope = new JavaScopeImpl(name);
- }
- type.setJavaScope(scope);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
deleted file mode 100644
index 68f90a5be5..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllInterfaces;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import javax.jws.WebService;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-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.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Processes an {@link org.oasisopen.sca.annotation.Service} annotation and updates
- * the component type with corresponding {@link Service}s. Also processes
- * related {@link org.oasisopen.sca.annotation.Callback} annotations.
- *
- * @version $Rev$ $Date$
- */
-public class ServiceProcessor extends BaseJavaClassVisitor {
- private static final Logger logger = Logger.getLogger(ServiceProcessor.class.getName());
- private JavaInterfaceFactory javaFactory;
-
- public ServiceProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory) {
- super(assemblyFactory);
- this.javaFactory = javaFactory;
- }
-
- @Override
- public <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- org.oasisopen.sca.annotation.Service annotation = clazz.getAnnotation(org.oasisopen.sca.annotation.Service.class);
- if (annotation == null) {
- // scan interfaces for remotable
- Set<Class<?>> interfaces = getAllInterfaces(clazz);
- for (Class<?> interfaze : interfaces) {
- if (interfaze.isAnnotationPresent(Remotable.class)
- || interfaze.isAnnotationPresent(WebService.class)
- || interfaze.isAnnotationPresent(Callback.class)
- ) {
- Service service;
- try {
- service = createService(interfaze);
- } catch (InvalidInterfaceException e) {
- throw new IntrospectionException(e);
- }
- type.getServices().add(service);
- }
- }
- return;
- }
- Class<?>[] interfaces = annotation.interfaces();
- if (interfaces.length == 0) {
- Class<?> interfaze = annotation.value();
- if (Void.class.equals(interfaze)) {
- //throw new IllegalServiceDefinitionException("No interfaces specified");
- logger.warning("Ignoring @Service annotation. No interfaces specified. class = "+clazz.getName());
- } else {
- interfaces = new Class<?>[1];
- interfaces[0] = interfaze;
- }
- }
- for (Class<?> interfaze : interfaces) {
- try {
- Service service = createService(interfaze);
- type.getServices().add(service);
- } catch (InvalidInterfaceException e) {
- throw new IntrospectionException(e);
- }
- }
- }
-
- @Override
- public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
-
- Callback annotation = method.getAnnotation(Callback.class);
- if (annotation == null) {
- return;
- }
- if(Modifier.isPrivate(method.getModifiers())) {
- throw new IllegalCallbackReferenceException("Illegal annotation @Callback found on "+method, method);
- }
- if (method.getParameterTypes().length != 1) {
- throw new IllegalCallbackReferenceException("Setter must have one parameter", method);
- }
- JavaElementImpl element = new JavaElementImpl(method, 0);
- createCallback(type, element);
- }
-
- @Override
- public void visitField(Field field, JavaImplementation type) throws IntrospectionException {
-
- Callback annotation = field.getAnnotation(Callback.class);
- if (annotation == null) {
- return;
- }
- if(Modifier.isPrivate(field.getModifiers())) {
- throw new IllegalCallbackReferenceException("Illegal annotation @Callback found on "+field, field);
- }
- JavaElementImpl element = new JavaElementImpl(field);
- createCallback(type, element);
- }
-
- public Service createService(Class<?> interfaze) throws InvalidInterfaceException {
- Service service = assemblyFactory.createService();
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- service.setInterfaceContract(interfaceContract);
-
- // create a relative URI
- service.setName(interfaze.getSimpleName());
-
- 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;
- }
-
- /**
- * Utility methods
- */
-
-
- /**
- * @param type
- * @param element
- * @throws IllegalCallbackReferenceException
- */
- private static void createCallback(JavaImplementation type, JavaElementImpl element)
- throws IllegalCallbackReferenceException {
- Service callbackService = null;
- Class<?> callbackClass = element.getType();
- Type genericType = element.getGenericType();
- Class<?> baseType = callbackClass;
- if(CallableReference.class.isAssignableFrom(baseType)) {
- // @Callback protected CallableReference<MyCallback> callback;
- // The base type will be MyCallback
- baseType = JavaIntrospectionHelper.getBusinessInterface(baseType, genericType);
- }
- for (Service service : type.getServices()) {
- JavaInterface javaInterface = (JavaInterface)service.getInterfaceContract().getCallbackInterface();
- if (javaInterface != null && baseType == javaInterface.getJavaClass()) {
- callbackService = service;
- }
- }
- if (callbackService == null) {
- throw new IllegalCallbackReferenceException("Callback type does not match a service callback interface: " + type.getName() );
- }
- if(type.getCallbackMembers().get(baseType.getName()) == null) {
- type.getCallbackMembers().put(baseType.getName(), new ArrayList<JavaElementImpl>());
- }
- type.getCallbackMembers().get(baseType.getName()).add(element);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceTypeNotFoundException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceTypeNotFoundException.java
deleted file mode 100644
index e1ca3ea565..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceTypeNotFoundException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-
-/**
- * Thrown when a service interface cannot be determined based on a heuristic evaluation of an implementation
- *
- * @version $Rev$ $Date$
- */
-public class ServiceTypeNotFoundException extends IntrospectionException {
- private static final long serialVersionUID = -5124437274726947007L;
-
- public ServiceTypeNotFoundException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/UnknownContextTypeException.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/UnknownContextTypeException.java
deleted file mode 100644
index bfaa759cd2..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/UnknownContextTypeException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-/**
- * Thrown when a method or field marked with {@link org.oasisopen.sca.annotation.Context} takes an unknown type
- *
- * @version $Rev$ $Date$
- */
-public class UnknownContextTypeException extends IllegalContextException {
- private static final long serialVersionUID = 8125863714365422419L;
-
- public UnknownContextTypeException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index 856d4e55b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.implementation.java.JavaImplementationActivator
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.JavaImplementationFactory b/tags/java/sca/2.0-M1/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.JavaImplementationFactory
deleted file mode 100644
index dc9de12632..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.JavaImplementationFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractProcessorTest.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractProcessorTest.java
deleted file mode 100644
index 842897606c..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractProcessorTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import java.lang.reflect.Constructor;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-
-
-/**
- * Base class to simulate the processor sequences
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractProcessorTest {
- protected AssemblyFactory factory;
- protected JavaInterfaceFactory javaFactory;
- protected ConstructorProcessor constructorProcessor;
- private ReferenceProcessor referenceProcessor;
- private PropertyProcessor propertyProcessor;
- private ResourceProcessor resourceProcessor;
-
-
- protected AbstractProcessorTest() {
- factory = new DefaultAssemblyFactory();
- javaFactory = new DefaultJavaInterfaceFactory();
- referenceProcessor = new ReferenceProcessor(factory, javaFactory);
- propertyProcessor = new PropertyProcessor(factory);
- resourceProcessor = new ResourceProcessor(factory);
- constructorProcessor = new ConstructorProcessor(factory);
- referenceProcessor = new ReferenceProcessor(factory, javaFactory);
- propertyProcessor = new PropertyProcessor(factory);
- }
-
- protected <T> void visitConstructor(Constructor<T> constructor,
- JavaImplementation type) throws IntrospectionException {
- constructorProcessor.visitConstructor(constructor, type);
- JavaConstructorImpl<?> definition = type.getConstructor();
- if (definition == null) {
- definition = new JavaConstructorImpl<T>(constructor);
- type.getConstructors().put(constructor, definition);
- }
- JavaParameterImpl[] parameters = definition.getParameters();
- for (int i = 0; i < parameters.length; i++) {
- referenceProcessor.visitConstructorParameter(parameters[i], type);
- propertyProcessor.visitConstructorParameter(parameters[i], type);
- resourceProcessor.visitConstructorParameter(parameters[i], type);
- // monitorProcessor.visitConstructorParameter(parameters[i], type);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AllowsPassByReferenceProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AllowsPassByReferenceProcessorTestCase.java
deleted file mode 100644
index ce79ae2045..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AllowsPassByReferenceProcessorTestCase.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.AllowsPassByReference;
-
-/**
- * @version $Rev$ $Date$
- */
-public class AllowsPassByReferenceProcessorTestCase {
-
- JavaImplementation type;
- AllowsPassByReferenceProcessor processor;
- private JavaImplementationFactory javaImplementationFactory;
-
- @Test
- public void testClassAnnotation() throws Exception {
- processor.visitClass(Foo.class, type);
- assertEquals(true, type.isAllowsPassByReference());
-
- processor.visitClass(Bar.class, type);
- assertEquals(false, type.isAllowsPassByReference());
-
- Method m1 = Bar.class.getMethod("m1", new Class[] {});
- processor.visitMethod(m1, type);
- assertTrue(type.isAllowsPassByReference(m1));
- }
-
- @Before
- public void setUp() throws Exception {
- javaImplementationFactory = new DefaultJavaImplementationFactory();
- type = javaImplementationFactory.createJavaImplementation();
- processor = new AllowsPassByReferenceProcessor(new DefaultAssemblyFactory());
- }
-
- @AllowsPassByReference
- private class Foo {
- }
-
- // no annotation
- private class Bar {
- @AllowsPassByReference
- public void m1() {
-
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessorTestCase.java
deleted file mode 100644
index 625aec4858..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessorTestCase.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.impl.ModelHelper.getProperty;
-import static org.apache.tuscany.sca.implementation.java.introspect.impl.ModelHelper.getReference;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Constructor;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConstructorProcessorTestCase {
- private ConstructorProcessor processor = new ConstructorProcessor(new DefaultAssemblyFactory());
-
- private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- @Test
- public void testDuplicateConstructor() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- try {
- processor.visitClass(BadFoo.class, type);
- fail();
- } catch (DuplicateConstructorException e) {
- // expected
- }
- }
-
- @Test
- public void testConstructorAnnotation() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor1 = Foo.class.getConstructor(String.class);
- processor.visitConstructor(ctor1, type);
- assertEquals("foo", type.getConstructor().getParameters()[0].getName());
- }
-
- @Test
- public void testNoAnnotation() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<NoAnnotation> ctor1 = NoAnnotation.class.getConstructor();
- processor.visitConstructor(ctor1, type);
- assertNull(type.getConstructor());
- }
-
- @Test
- public void testBadAnnotation() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<BadAnnotation> ctor1 = BadAnnotation.class.getConstructor(String.class, Foo.class);
- try {
- processor.visitConstructor(ctor1, type);
- fail();
- } catch (InvalidConstructorException e) {
- // expected
- }
- }
-
- @Test
- public void testMixedParameters() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Mixed> ctor1 = Mixed.class.getConstructor(String.class, String.class, String.class);
- processor.visitConstructor(ctor1, type);
-
- AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
- JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
- ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory);
- PropertyProcessor propertyProcessor = new PropertyProcessor(assemblyFactory);
- JavaParameterImpl[] parameters = type.getConstructor().getParameters();
- for (int i = 0; i < parameters.length; i++) {
- referenceProcessor.visitConstructorParameter(parameters[i], type);
- propertyProcessor.visitConstructorParameter(parameters[i], type);
- }
-
- assertEquals("_ref0", parameters[0].getName());
- assertEquals("foo", parameters[1].getName());
- assertEquals("bar", parameters[2].getName());
- }
-
- private static class BadFoo {
-
- @org.oasisopen.sca.annotation.Constructor("foo")
- public BadFoo(String foo) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor( {"foo", "bar"})
- public BadFoo(String foo, String bar) {
-
- }
- }
-
- private static class Foo {
- @org.oasisopen.sca.annotation.Constructor("foo")
- public Foo(String foo) {
-
- }
- }
-
- private static class NoAnnotation {
- public NoAnnotation() {
- }
- }
-
- private static class BadAnnotation {
- @org.oasisopen.sca.annotation.Constructor("foo")
- public BadAnnotation(String foo, Foo ref) {
- }
- }
-
- public static final class Mixed {
- @org.oasisopen.sca.annotation.Constructor
- public Mixed(@Reference
- String param1, @Property(name = "foo")
- String param2, @Reference(name = "bar")
- String param3) {
- }
- }
-
- public static final class Multiple {
- @org.oasisopen.sca.annotation.Constructor
- public Multiple(@Reference
- Collection<String> param1, @Property(name = "foo")
- String[] param2, @Reference(name = "bar", required = true)
- List<String> param3, @Property(name = "abc")
- Set<String> param4, @Reference(name = "xyz")
- String[] param5) {
- }
- }
-
- @Test
- public void testMultiplicity() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Multiple> ctor1 = Multiple.class.getConstructor(Collection.class,
- String[].class,
- List.class,
- Set.class,
- String[].class);
- processor.visitConstructor(ctor1, type);
- AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
- JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
- ReferenceProcessor referenceProcessor = new ReferenceProcessor(assemblyFactory, javaFactory);
- PropertyProcessor propertyProcessor = new PropertyProcessor(assemblyFactory);
- JavaParameterImpl[] parameters = type.getConstructor().getParameters();
- for (int i = 0; i < parameters.length; i++) {
- referenceProcessor.visitConstructorParameter(parameters[i], type);
- propertyProcessor.visitConstructorParameter(parameters[i], type);
- }
-
- org.apache.tuscany.sca.assembly.Reference ref0 = getReference(type, "_ref0");
- assertNotNull(ref0);
- assertEquals(Multiplicity.ONE_N, ref0.getMultiplicity());
- org.apache.tuscany.sca.assembly.Reference ref1 = getReference(type, "bar");
- assertNotNull(ref1);
- assertEquals(Multiplicity.ONE_N, ref1.getMultiplicity());
- org.apache.tuscany.sca.assembly.Reference ref2 = getReference(type, "xyz");
- assertNotNull(ref2);
- assertEquals(Multiplicity.ONE_N, ref2.getMultiplicity());
- org.apache.tuscany.sca.assembly.Property prop1 = getProperty(type, "foo");
- assertNotNull(prop1);
- assertTrue(prop1.isMany());
- org.apache.tuscany.sca.assembly.Property prop2 = getProperty(type, "abc");
- assertNotNull(prop2);
- assertTrue(prop2.isMany());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorPropertyTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorPropertyTestCase.java
deleted file mode 100644
index 3f531e48d6..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorPropertyTestCase.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.impl.ModelHelper.getProperty;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Constructor;
-import java.util.List;
-
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Property;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConstructorPropertyTestCase extends AbstractProcessorTest {
-
- private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- @Test
- public void testProperty() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor = Foo.class.getConstructor(String.class);
- visitConstructor(ctor, type);
- org.apache.tuscany.sca.assembly.Property property = getProperty(type, "myProp");
- assertTrue(property.isMustSupply());
- assertEquals("myProp", property.getName());
- }
-
- @Test
- public void testTwoPropertiesSameType() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor = Foo.class.getConstructor(String.class, String.class);
- visitConstructor(ctor, type);
- assertNotNull(getProperty(type, "myProp1"));
- assertNotNull(getProperty(type, "myProp2"));
- }
-
- @Test
- public void testDuplicateProperty() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<BadFoo> ctor = BadFoo.class.getConstructor(String.class, String.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (DuplicatePropertyException e) {
- // expected
- }
- }
-
- @Test
- public void testNoName() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<BadFoo> ctor = BadFoo.class.getConstructor(String.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (InvalidPropertyException e) {
- // expected
- }
- }
-
- @Test
- public void testNamesOnConstructor() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor = Foo.class.getConstructor(Integer.class);
- visitConstructor(ctor, type);
- assertNotNull(getProperty(type, "myProp"));
- }
-
- @Test
- public void testInvalidNumberOfNames() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<BadFoo> ctor = BadFoo.class.getConstructor(Integer.class, Integer.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (InvalidConstructorException e) {
- // expected
- }
- }
-
- @Test
- public void testNoMatchingNames() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<BadFoo> ctor = BadFoo.class.getConstructor(List.class, List.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (InvalidConstructorException e) {
- // expected
- }
- }
-
-// public void testMultiplicityRequired() throws Exception {
- // TODO multiplicity
-// }
-
- private static class Foo {
-
- @org.oasisopen.sca.annotation.Constructor()
- public Foo(@Property(name = "myProp", required = true)String prop) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor("myProp")
- public Foo(@Property Integer prop) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor()
- public Foo(@Property(name = "myProp1")String prop1, @Property(name = "myProp2")String prop2) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor()
- public Foo(@Property List prop) {
-
- }
- }
-
- private static class BadFoo {
-
- @org.oasisopen.sca.annotation.Constructor()
- public BadFoo(@Property(name = "myProp")String prop1, @Property(name = "myProp")String prop2) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor()
- public BadFoo(@Property String prop) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor("myProp")
- public BadFoo(@Property Integer prop, @Property Integer prop2) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor({"myRef", "myRef2"})
- public BadFoo(@Property List ref, @Property(name = "myOtherRef")List ref2) {
-
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorReferenceTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorReferenceTestCase.java
deleted file mode 100644
index decdc34386..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorReferenceTestCase.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.impl.ModelHelper.getReference;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Constructor;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConstructorReferenceTestCase extends AbstractProcessorTest {
-
- private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- @Test
- public void testReference() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor = Foo.class.getConstructor(String.class);
- visitConstructor(ctor, type);
- org.apache.tuscany.sca.assembly.Reference reference = getReference(type, "myRef");
- assertEquals(Multiplicity.ONE_ONE, reference.getMultiplicity());
- assertEquals("myRef", reference.getName());
- }
-
- @Test
- public void testTwoReferencesSameType() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor = Foo.class.getConstructor(String.class, String.class);
- visitConstructor(ctor, type);
- assertNotNull(getReference(type, "myRef1"));
- assertNotNull(getReference(type, "myRef2"));
- }
-
- @Test
- public void testDuplicateProperty() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<BadFoo> ctor = BadFoo.class.getConstructor(String.class, String.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (DuplicateReferenceException e) {
- // expected
- }
- }
-
- @Test
- public void testNoName() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<NoNameFoo> ctor = NoNameFoo.class.getConstructor(String.class);
- visitConstructor(ctor, type);
- assertNotNull(getReference(type, "_ref0"));
- }
-
- @Test
- public void testNamesOnConstructor() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor = Foo.class.getConstructor(Integer.class);
- visitConstructor(ctor, type);
- assertNotNull(getReference(type, "myRef"));
- }
-
- @Test
- public void testInvalidNumberOfNames() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<BadFoo> ctor = BadFoo.class.getConstructor(Integer.class, Integer.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (InvalidConstructorException e) {
- // expected
- }
- }
-
- @Test
- public void testNoMatchingNames() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<BadFoo> ctor = BadFoo.class.getConstructor(List.class, List.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (InvalidConstructorException e) {
- // expected
- }
- }
-
-// public void testMultiplicityRequired() throws Exception {
- // TODO multiplicity
-// }
-
- private static class Foo {
-
- @org.oasisopen.sca.annotation.Constructor()
- public Foo(@Reference(name = "myRef", required = true)String prop) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor()
- public Foo(@Reference(name = "myRef1")String prop1, @Reference(name = "myRef2")String prop2) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor("myRef")
- public Foo(@Reference Integer prop) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor()
- public Foo(@Reference List prop) {
-
- }
- }
-
- private static class NoNameFoo {
-
- @org.oasisopen.sca.annotation.Constructor
- public NoNameFoo(@Reference String prop) {
-
- }
- }
-
- private static class BadFoo {
-
- @org.oasisopen.sca.annotation.Constructor
- public BadFoo(@Reference(name = "myRef")String prop1, @Reference(name = "myRef")String prop2) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor
- public BadFoo(@Reference String prop) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor("myRef")
- public BadFoo(@Reference Integer ref, @Reference Integer ref2) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor({"myRef", "myRef2"})
- public BadFoo(@Reference List ref, @Reference(name = "myOtherRef")List ref2) {
-
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorResourceTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorResourceTestCase.java
deleted file mode 100644
index e8d26f6103..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorResourceTestCase.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Constructor;
-import java.util.List;
-
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConstructorResourceTestCase extends AbstractProcessorTest {
-
- private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- @Test
- public void testResource() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor = Foo.class.getConstructor(String.class);
- visitConstructor(ctor, type);
- org.apache.tuscany.sca.implementation.java.JavaResourceImpl resource = type.getResources().get("myResource");
- assertFalse(resource.isOptional());
- }
-
- @Test
- public void testTwoResourcesSameType() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor = Foo.class.getConstructor(String.class, String.class);
- visitConstructor(ctor, type);
- assertNotNull(type.getResources().get("myResource1"));
- assertNotNull(type.getResources().get("myResource2"));
- }
-
- @Test
- public void testDuplicateResource() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<BadFoo> ctor = BadFoo.class.getConstructor(String.class, String.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (DuplicateResourceException e) {
- // expected
- }
- }
-
- @Test
- public void testNoName() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<ConstructorResourceTestCase.BadFoo> ctor =
- ConstructorResourceTestCase.BadFoo.class.getConstructor(String.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (InvalidResourceException e) {
- // expected
- }
- }
-
- @Test
- public void testNamesOnConstructor() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor = Foo.class.getConstructor(Integer.class);
- visitConstructor(ctor, type);
- assertNotNull(type.getResources().get("myResource"));
- }
-
- @Test
- public void testInvalidNumberOfNames() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<ConstructorResourceTestCase.BadFoo> ctor =
- ConstructorResourceTestCase.BadFoo.class.getConstructor(Integer.class, Integer.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (InvalidConstructorException e) {
- // expected
- }
- }
-
- @Test
- public void testNoMatchingNames() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<ConstructorResourceTestCase.BadFoo> ctor =
- ConstructorResourceTestCase.BadFoo.class.getConstructor(List.class, List.class);
- try {
- visitConstructor(ctor, type);
- fail();
- } catch (InvalidConstructorException e) {
- // expected
- }
- }
-
- private static class Foo {
-
- @org.oasisopen.sca.annotation.Constructor
- public Foo(@Resource(name = "myResource") String resource) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor("myResource")
- public Foo(@Resource Integer resource) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor
- public Foo(@Resource(name = "myResource1") String res1, @Resource(name = "myResource2") String res2) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor
- public Foo(@Resource List res) {
-
- }
- }
-
- private static class BadFoo {
-
- @org.oasisopen.sca.annotation.Constructor
- public BadFoo(@Resource(name = "myResource") String res1, @Resource(name = "myResource") String res2) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor
- public BadFoo(@Resource String res) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor("myProp")
- public BadFoo(@Resource Integer res, @Resource Integer res2) {
-
- }
-
- @org.oasisopen.sca.annotation.Constructor({"myRes", "myRes2"})
- public BadFoo(@Resource List res, @Resource(name = "myOtherRes") List res2) {
-
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ContextProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ContextProcessorTestCase.java
deleted file mode 100644
index 124c83e9e2..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ContextProcessorTestCase.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.annotation.ComponentName;
-import org.oasisopen.sca.annotation.Context;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ContextProcessorTestCase {
- private ContextProcessor processor;
- private ComponentNameProcessor nameProcessor;
- private JavaImplementationFactory javaImplementationFactory;
-
- @Test
- public void testComponentContextMethod() throws Exception {
- Method method = Foo.class.getMethod("setContext", ComponentContext.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitMethod(method, type);
- assertNotNull(type.getResources().get("context"));
- }
-
- @Test
- public void testComponentContextField() throws Exception {
- Field field = Foo.class.getDeclaredField("context");
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitField(field, type);
- assertNotNull(type.getResources().get("context"));
- }
-
- @Test
- public void testRequestContextMethod() throws Exception {
- Method method = Foo.class.getMethod("setRequestContext", RequestContext.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitMethod(method, type);
- assertNotNull(type.getResources().get("requestContext"));
- }
-
- @Test
- public void testRequestContextField() throws Exception {
- Field field = Foo.class.getDeclaredField("requestContext");
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitField(field, type);
- assertNotNull(type.getResources().get("requestContext"));
- }
-
- @Test
- public void testComponentNameMethod() throws Exception {
- Method method = Foo.class.getMethod("setName", String.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- nameProcessor.visitMethod(method, type);
- assertNotNull(type.getResources().get("name"));
- }
-
- @Test
- public void testComponentNameField() throws Exception {
- Field field = Foo.class.getDeclaredField("name");
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- nameProcessor.visitField(field, type);
- assertNotNull(type.getResources().get("name"));
- }
-
- @Test
- public void testInvalidParamType() throws Exception {
- Method method = Foo.class.getMethod("setContext", String.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (UnknownContextTypeException e) {
- // expected
- }
- }
-
- @Test
- public void testInvalidParamTypeField() throws Exception {
- Field field = Foo.class.getDeclaredField("badContext");
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- try {
- processor.visitField(field, type);
- fail();
- } catch (UnknownContextTypeException e) {
- // expected
- }
- }
-
-
- @Test
- public void testInvalidParamNum() throws Exception {
- Method method = Foo.class.getMethod("setContext", ComponentContext.class, String.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalContextException e) {
- // expected
- }
- }
-
- @Test
- public void testInvalidNoParams() throws Exception {
- Method method = Foo.class.getMethod("setContext");
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalContextException e) {
- // expected
- }
- }
-
- @Test
- public void testNoContext() throws Exception {
- Method method = Foo.class.getMethod("noContext", ComponentContext.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitMethod(method, type);
- assertEquals(0, type.getResources().size());
- }
-
- @Test
- public void testNoContextField() throws Exception {
- Field field = Foo.class.getDeclaredField("noContext");
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitField(field, type);
- assertEquals(0, type.getResources().size());
- }
-
- @Before
- public void setUp() throws Exception {
- javaImplementationFactory = new DefaultJavaImplementationFactory();
- processor = new ContextProcessor(new DefaultAssemblyFactory());
- nameProcessor = new ComponentNameProcessor(new DefaultAssemblyFactory());
- }
-
- private class Foo {
- @Context
- protected ComponentContext context;
-
- @ComponentName
- protected String name;
-
- @Context
- protected Object badContext;
-
- protected ComponentContext noContext;
-
- @Context
- protected RequestContext requestContext;
-
- @Context
- public void setContext(ComponentContext context) {
-
- }
-
- @ComponentName
- public void setName(String name) {
-
- }
-
- @Context
- public void setContext(String context) {
-
- }
-
- @Context
- public void setContext(ComponentContext context, String string) {
-
- }
-
- @Context
- public void setContext() {
-
- }
-
- public void noContext(ComponentContext context) {
-
- }
-
- @Context
- public void setRequestContext(RequestContext requestContext) {
- this.requestContext = requestContext;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationIDProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationIDProcessorTestCase.java
deleted file mode 100644
index 9bff2aa556..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationIDProcessorTestCase.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.ConversationID;
-
-/**
- * Test the ConversationIDProcessor
- *
- * @version $Rev$ $Date$
- */
-public class ConversationIDProcessorTestCase {
- private ConversationIDProcessor processor;
- private JavaImplementationFactory javaImplementationFactory;
-
- @Test
- public void testConversationIDMethod() throws Exception {
- Method method = Foo.class.getMethod("setConversationID", String.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitMethod(method, type);
- assertNotNull(type.getResources().get("conversationID"));
- }
-
- @Test
- public void testConversationIDField() throws Exception {
- Field field = Foo.class.getDeclaredField("cid");
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitField(field, type);
- assertNotNull(type.getResources().get("cid"));
- }
-
- @Test
- public void testConversationIDMethodNotString() throws Exception {
- Method method = Foo.class.getMethod("setConversationID", Long.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitMethod(method, type);
- assertNotNull(type.getResources().get("conversationID"));
- }
-
- @Test
- public void testConversationIDFieldNotString() throws Exception {
- Field field = Foo.class.getDeclaredField("longCID");
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitField(field, type);
- assertNotNull(type.getResources().get("longCID"));
- }
-
- @Before
- public void setUp() throws Exception {
- javaImplementationFactory = new DefaultJavaImplementationFactory();
- processor = new ConversationIDProcessor(new DefaultAssemblyFactory());
- }
-
- private class Foo {
-
- @ConversationID
- protected String cid;
-
- @ConversationID
- public void setConversationID(String cid) {
-
- }
-
- @ConversationID
- protected Long longCID;
-
- @ConversationID
- public void setConversationID(Long cid) {
-
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationProcessorTestCase.java
deleted file mode 100644
index 9978cd456d..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationProcessorTestCase.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConversationProcessorTestCase {
- private ConversationProcessor processor = new ConversationProcessor(new DefaultAssemblyFactory());
- private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- @Test
- public void testMaxIdleTime() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(FooMaxIdle.class, type);
- assertEquals(10000L, type.getMaxIdleTime());
- assertEquals(-1, type.getMaxAge());
- }
-
- @Test
- public void testMaxAge() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(FooMaxAge.class, type);
- assertEquals(10000L, type.getMaxAge());
- assertEquals(-1, type.getMaxIdleTime());
- }
-
- @Test
- public void testImplicitScope() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(ImplicitFooScope.class, type);
- assertEquals(org.apache.tuscany.sca.implementation.java.JavaScopeImpl.CONVERSATION, type.getJavaScope());
- }
-
- /* TUSCANY-1999 - apply conversation properties to all scopes
- public void testBadFooScope() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- try {
- processor.visitClass(BadFooScope.class, type);
- fail();
- } catch (InvalidConversationalImplementation e) {
- // expected
- }
- }
- */
-
- @Test
- public void testBadFooBoth() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(BadFooBoth.class, type);
- assertEquals(10000L, type.getMaxAge());
- assertEquals(10000L, type.getMaxIdleTime());
- }
-
- @Test
- public void testJustConversation() throws Exception {
- // TODO do we want these semantics
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(FooJustConversation.class, type);
- assertEquals(org.apache.tuscany.sca.implementation.java.JavaScopeImpl.CONVERSATION, type.getJavaScope());
- assertEquals(-1, type.getMaxAge());
- assertEquals(-1, type.getMaxIdleTime());
- }
-
- @Test
- public void testSetConversationIDField() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Field field = FooWithConversationIDField.class.getDeclaredField("conversationID");
- processor.visitField(field, type);
- assertNotNull(type.getConversationIDMembers());
- assertEquals(field, type.getConversationIDMembers().get(0));
- }
-
- @Test
- public void testSetConversationIDMethod() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = FooWithConversationIDMethod.class.getDeclaredMethods()[0];
- processor.visitMethod(method, type);
- assertNotNull(type.getConversationIDMembers());
- assertEquals(method, type.getConversationIDMembers().get(0));
- }
-
- @Scope("CONVERSATION")
- @ConversationAttributes(maxIdleTime = "10 seconds")
- private class FooMaxIdle {
- }
-
- @Scope("CONVERSATION")
- @ConversationAttributes(maxAge = "10 seconds")
- private class FooMaxAge {
- }
-
- @Scope("CONVERSATION")
- @ConversationAttributes(maxAge = "10 seconds", maxIdleTime = "10 seconds")
- private class BadFooBoth {
- }
-
- @ConversationAttributes(maxAge = "10 seconds")
- private class ImplicitFooScope {
- }
-
- @Scope("STATELESS")
- @ConversationAttributes(maxAge = "10 seconds")
- private class BadFooScope {
- }
-
- @ConversationAttributes
- private class FooJustConversation {
- }
-
- private class FooWithConversationIDField {
-
- @ConversationID
- String conversationID;
- }
-
- private class FooWithConversationIDMethod {
- @ConversationID
- void setConversationID(String conversationID) {
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConvertTimeMillisTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConvertTimeMillisTestCase.java
deleted file mode 100644
index 4e5a2dfee6..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConvertTimeMillisTestCase.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConvertTimeMillisTestCase {
-
- @Test
- public void testConvertSeconds() throws Exception {
- assertEquals(10000L, MockProcessor.convertTimeMillis("10 seconds"));
- assertEquals(10000L, MockProcessor.convertTimeMillis("10 SECONDS"));
- try {
- MockProcessor.convertTimeMillis("10seconds");
- fail();
- } catch (NumberFormatException e) {
- // expected
- }
- }
-
- @Test
- public void testConvertMinutes() throws Exception {
- assertEquals(600000L, MockProcessor.convertTimeMillis("10 minutes"));
- assertEquals(600000L, MockProcessor.convertTimeMillis("10 MINUTES"));
- try {
- MockProcessor.convertTimeMillis("10minutes");
- fail();
- } catch (NumberFormatException e) {
- // expected
- }
- }
-
- @Test
- public void testConvertHours() throws Exception {
- assertEquals(36000000L, MockProcessor.convertTimeMillis("10 hours"));
- assertEquals(36000000L, MockProcessor.convertTimeMillis("10 HOURS"));
- try {
- MockProcessor.convertTimeMillis("10hours");
- fail();
- } catch (NumberFormatException e) {
- // expected
- }
- }
-
- @Test
- public void testConvertDays() throws Exception {
- assertEquals(864000000L, MockProcessor.convertTimeMillis("10 days"));
- assertEquals(864000000L, MockProcessor.convertTimeMillis("10 DAYS"));
- try {
- MockProcessor.convertTimeMillis("10days");
- fail();
- } catch (NumberFormatException e) {
- // expected
- }
- }
-
- @Test
- public void testConvertYears() throws Exception {
- assertEquals(315569260000L, MockProcessor.convertTimeMillis("10 years"));
- assertEquals(315569260000L, MockProcessor.convertTimeMillis("10 YEARS"));
- try {
- MockProcessor.convertTimeMillis("10years");
- fail();
- } catch (NumberFormatException e) {
- // expected
- }
- }
-
- @Test
- public void testConvertDefault() throws Exception {
- assertEquals(10000L, MockProcessor.convertTimeMillis("10 "));
- assertEquals(10000L, MockProcessor.convertTimeMillis("10"));
- }
-
- @Test
- public void testInvalid() throws Exception {
- try {
- MockProcessor.convertTimeMillis("foo");
- fail();
- } catch (NumberFormatException e) {
- // expected
- }
- }
-
- private class MockProcessor extends ConversationProcessor {
-
- public MockProcessor() {
- super(new DefaultAssemblyFactory());
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessorTestCase.java
deleted file mode 100644
index b82205863c..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessorTestCase.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Destroy;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DestroyProcessorTestCase {
-
- private AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
- private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- @Test
- public void testDestroy() throws Exception {
- DestroyProcessor processor = new DestroyProcessor(assemblyFactory);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = Foo.class.getMethod("destroy");
- processor.visitMethod(method, type);
- assertNotNull(type.getDestroyMethod());
- }
-
- @Test
- public void testBadDestroy() throws Exception {
- DestroyProcessor processor = new DestroyProcessor(assemblyFactory);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = Bar.class.getMethod("badDestroy", String.class);
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalDestructorException e) {
- // expected
- }
- }
-
- @Test
- public void testTwoDestroy() throws Exception {
- DestroyProcessor processor = new DestroyProcessor(assemblyFactory);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = Bar.class.getMethod("destroy");
- Method method2 = Bar.class.getMethod("destroy2");
- processor.visitMethod(method, type);
- try {
- processor.visitMethod(method2, type);
- fail();
- } catch (DuplicateDestructorException e) {
- // expected
- }
- }
-
- @Test
- public void testProtectedDestroy() throws Exception {
- DestroyProcessor processor = new DestroyProcessor(assemblyFactory);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = Bar.class.getDeclaredMethod("protectedDestroy");
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalDestructorException e) {
- // expected
- }
- }
-
- @Test
- public void testPrivateDestroy() throws Exception {
- DestroyProcessor processor = new DestroyProcessor(assemblyFactory);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = Bar.class.getDeclaredMethod("privateDestroy");
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalDestructorException e) {
- // expected
- }
- }
-
- private class Foo {
-
- @Destroy
- public void destroy() {
- }
- }
-
-
- private class Bar {
-
- @Destroy
- public void destroy() {
- }
-
- @Destroy
- public void destroy2() {
- }
-
- @Destroy
- public void badDestroy(String foo) {
- }
-
- @Destroy
- protected void protectedDestroy(){
- }
-
- @Destroy
- private void privateDestroy(){
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessorTestCase.java
deleted file mode 100644
index 04d87f60fe..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessorTestCase.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.EagerInit;
-
-/**
- * @version $Rev$ $Date$
- */
-public class EagerInitProcessorTestCase {
-
- private AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
- private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- @Test
- public void testNoLevel() throws IntrospectionException {
- EagerInitProcessor processor = new EagerInitProcessor(assemblyFactory);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(Level.class, type);
- }
-
- @Test
- public void testSubclass() throws IntrospectionException {
- EagerInitProcessor processor = new EagerInitProcessor(assemblyFactory);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(SubClass.class, type);
- }
-
- @EagerInit
- private class Level {
- }
-
- private class SubClass extends Level {
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java
deleted file mode 100644
index 53dd94c1a3..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import java.lang.reflect.Constructor;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Property;
-
-/**
- * @version $Rev$ $Date$
- */
-public class HeuristicAndPropertyTestCase {
-
- private PropertyProcessor propertyProcessor;
- private HeuristicPojoProcessor heuristicProcessor;
- private AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
- private JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- /**
- * Verifies the property and heuristic processors don't collide
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testPropertyProcessorWithHeuristicProcessor() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor ctor = Foo.class.getConstructor(String.class);
- type.setConstructor(new JavaConstructorImpl(ctor));
- propertyProcessor.visitConstructorParameter(type.getConstructor().getParameters()[0], type);
- heuristicProcessor.visitEnd(Foo.class, type);
- assertEquals(1, type.getProperties().size());
- assertEquals("foo", type.getProperties().get(0).getName());
- }
-
- @Before
- public void setUp() throws Exception {
- propertyProcessor = new PropertyProcessor(assemblyFactory);
- heuristicProcessor = new HeuristicPojoProcessor(assemblyFactory, new DefaultJavaInterfaceFactory());
- }
-
- public static class Foo {
- public Foo(@Property(name = "foo")
- String prop) {
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicConstructorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicConstructorTestCase.java
deleted file mode 100644
index 19197e81e4..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicConstructorTestCase.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.impl.ModelHelper.getProperty;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Constructor;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * @version $Rev$ $Date$
- */
-public class HeuristicConstructorTestCase extends AbstractProcessorTest {
-
- private AssemblyFactory factory;
- private JavaInterfaceFactory javaFactory;
- private HeuristicPojoProcessor processor;
- private JavaImplementationFactory javaImplementationFactory;
-
- public HeuristicConstructorTestCase() {
- factory = new DefaultAssemblyFactory();
- javaFactory = new DefaultJavaInterfaceFactory();
- javaImplementationFactory = new DefaultJavaImplementationFactory();
- processor = new HeuristicPojoProcessor(factory, javaFactory);
- }
-
- private <T> void visitEnd(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- for (Constructor<?> constructor : clazz.getConstructors()) {
- visitConstructor(constructor, type);
- }
- processor.visitEnd(clazz, type);
- }
-
- /**
- * Verifies a single constructor is chosen with a parameter as the type
- */
- @Test
- public void testSingleConstructorWithParam() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- org.apache.tuscany.sca.assembly.Property prop = factory.createProperty();
- prop.setName("foo");
- type.getProperties().add(prop);
- // Hack to add a property member
- JavaElementImpl element = new JavaElementImpl("foo", String.class, null);
- type.getPropertyMembers().put("foo", element);
- visitEnd(Foo1.class, type);
- assertNotNull(type.getConstructor().getConstructor());
- assertEquals("foo", type.getConstructor().getParameters()[0].getName());
- }
-
- /**
- * Verifies a single constructor is chosen with a reference as the type
- */
- @Test
- public void testSingleConstructorWithRef() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- org.apache.tuscany.sca.assembly.Reference ref = factory.createReference();
- ref.setName("foo");
- type.getReferences().add(ref);
- type.getReferenceMembers().put("foo", new JavaElementImpl("foo", String.class, null));
- visitEnd(Foo1.class, type);
- assertNotNull(type.getConstructor().getConstructor());
- assertEquals("foo", type.getConstructor().getParameters()[0].getName());
- }
-
- /**
- * Verifies a single constructor is chosen with a property and a reference
- * as the type
- */
- @Test
- public void testSingleConstructorWithPropRef() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
-
- org.apache.tuscany.sca.assembly.Property prop = factory.createProperty();
- prop.setName("foo");
- type.getProperties().add(prop);
- // Hack to add a property member
- JavaElementImpl element = new JavaElementImpl("foo", String.class, null);
- type.getPropertyMembers().put("foo", element);
-
- org.apache.tuscany.sca.assembly.Reference ref = ModelHelper.createReference(factory, javaFactory, "ref", Foo1.class);
- type.getReferences().add(ref);
- type.getReferenceMembers().put("ref", new JavaElementImpl("ref", Foo1.class, null));
- visitEnd(Foo2.class, type);
- assertNotNull(type.getConstructor().getConstructor());
- assertEquals(2, type.getConstructor().getParameters().length);
- }
-
- @Test
- public void testSingleConstructorResolvableParam() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- visitEnd(Foo5.class, type);
- assertEquals(String.class, type.getPropertyMembers().get("string").getType());
- }
-
- @Test
- public void testSingleConstructorResolvableRef() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- visitEnd(Foo6.class, type);
- assertTrue(ModelHelper.matches(ModelHelper.getReference(type, "ref"), Ref.class));
- }
-
- @Test
- public void testSingleConstructorAmbiguousRef() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- org.apache.tuscany.sca.assembly.Reference ref = ModelHelper.createReference(factory, javaFactory, "ref", Foo1.class);
- type.getReferences().add(ref);
- type.getReferenceMembers().put("ref", new JavaElementImpl("ref", Foo1.class, null));
- org.apache.tuscany.sca.assembly.Reference ref2 = ModelHelper.createReference(factory, javaFactory, "ref2", Foo1.class);
- type.getReferences().add(ref2);
- type.getReferenceMembers().put("ref2", new JavaElementImpl("ref2", Foo1.class, null));
- try {
- visitEnd(Foo4.class, type);
- fail();
- } catch (AmbiguousConstructorException e) {
- // expected
- }
- }
-
- @Test
- public void testConstructorPropertyAnnotatedParamsOnly() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- visitEnd(Foo7.class, type);
- assertNotNull(getProperty(type, "myProp"));
- }
-
- @Test
- public void testConstructorReferenceAnnotatedParamsOnly() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- visitEnd(Foo8.class, type);
- assertNotNull(ModelHelper.getReference(type, "myRef"));
- }
-
- @Test
- public void testDefaultConstructor() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- visitEnd(Foo3.class, type);
- assertNotNull(type.getConstructor().getConstructor());
- }
-
- @Test
- public void testSameTypesButAnnotated() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- visitEnd(Foo12.class, type);
- assertEquals(2, type.getProperties().size());
- assertNotNull(getProperty(type, "prop1"));
- assertNotNull(getProperty(type, "prop2"));
- }
-
- /**
- * Verifies processing executes with additional extension annotations
- */
- @Test
- public void testRandomAnnotation() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- visitEnd(Foo11.class, type);
- assertEquals(1, type.getProperties().size());
- assertNotNull(getProperty(type, "prop1"));
- }
-
- @Test
- public void testPrivateConstructor() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- try {
- visitEnd(Foo14.class, type);
- fail();
- } catch (NoConstructorException e) {
- // expected
- }
- }
-
- @Test
- public void testMultipleConstructors() throws Exception {
- // throw new UnsupportedOperationException("Finish heuristic multiple
- // constructors - Foo10");
- }
-
- public static class Foo1 {
- public Foo1(String val) {
- }
- }
-
- public static class Foo2 {
- public Foo2(String val, Foo1 ref) {
- }
- }
-
- public static class Foo3 {
- }
-
- public static class Foo4 {
- public Foo4(Foo1 ref) {
- }
- }
-
- public static class Prop {
-
- }
-
- @Remotable
- public static interface Ref {
-
- }
-
- public static class Foo5 {
- public Foo5(String val) {
- }
- }
-
- public static class Foo6 {
- public Foo6(Ref ref) {
- }
- }
-
- public static class Foo7 {
- public Foo7(@Property(name = "myProp")
- String prop) {
- }
- }
-
- public static class Foo8 {
- public Foo8(@Reference(name = "myRef")
- String ref) {
- }
- }
-
- public static class Foo9 {
- public Foo9(@Reference(name = "myRef")
- String ref) {
- }
- }
-
- public static class Foo10 {
-
- public Foo10() {
- }
-
- public Foo10(String prop) {
- }
-
- public Foo10(@Property(name = "prop1")
- String prop1, @Property(name = "prop2")
- String prop2) {
-
- }
- }
-
- public static class Foo11 {
-
- public Foo11(@Property(name = "prop1")
- String prop, @Baz
- String baz) {
- }
- }
-
- public static class Foo12 {
-
- public Foo12(@Property(name = "prop1")
- String prop, @Property(name = "prop2")
- String baz) {
- }
- }
-
- public @interface Baz {
-
- }
-
- public static class Foo13 {
- public Foo13(@Reference
- String foo) {
- }
- }
-
- public static final class Foo14 {
- private Foo14() {
- }
- }
-
- public static final class Foo15 {
- public Foo15(@Reference
- String param1, @Reference
- String param2) {
- }
- }
-
- public static final class Foo16 {
- public Foo16(@Reference
- String param1, @Property(name = "foo")
- String param2, @Reference(name = "bar")
- String param3) {
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java
deleted file mode 100644
index a163652ead..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java
+++ /dev/null
@@ -1,581 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.lang.reflect.Constructor;
-import java.util.Collection;
-import java.util.List;
-
-import javax.jws.WebService;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-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.JavaImplementationFactory;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Remotable;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * Verifies component type information is properly introspected from an unadorned
- * POJO according to the SCA Java Client and Implementation Model Specification
- *
- * @version $Rev$ $Date$
- */
-public class HeuristicPojoProcessorTestCase extends AbstractProcessorTest {
-
- private org.apache.tuscany.sca.implementation.java.introspect.impl.HeuristicPojoProcessor processor;
- private JavaImplementationFactory javaImplementationFactory;
-
- public HeuristicPojoProcessorTestCase() {
- processor = new HeuristicPojoProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory());
- javaImplementationFactory = new DefaultJavaImplementationFactory();
- }
-
- private <T> void visitEnd(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- for (Constructor<?> constructor : clazz.getConstructors()) {
- visitConstructor(constructor, type);
- }
- processor.visitEnd(clazz, type);
- }
-
- /**
- * Verifies a single service interface is computed when only one interface
- * is implemented
- */
- @Test
- public void testSingleInterface() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<SingleInterfaceImpl> ctor = SingleInterfaceImpl.class.getConstructor();
- type.setConstructor(new JavaConstructorImpl<SingleInterfaceImpl>(ctor));
- processor.visitEnd(SingleInterfaceImpl.class, type);
- assertEquals(1, type.getServices().size());
- assertTrue(ModelHelper.matches(ModelHelper.getService(type, PropertyInterface.class.getSimpleName()),
- PropertyInterface.class));
- assertTrue(type.getProperties().isEmpty());
- assertTrue(type.getReferences().isEmpty());
- }
-
- /**
- * Verifies property and reference setters are computed
- */
- @Test
- public void testPropertyReference() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<SingleInterfaceWithPropertyReferenceImpl> ctor = SingleInterfaceWithPropertyReferenceImpl.class
- .getConstructor();
- type.setConstructor(new JavaConstructorImpl<SingleInterfaceWithPropertyReferenceImpl>(ctor));
- processor.visitEnd(SingleInterfaceWithPropertyReferenceImpl.class, type);
- assertEquals(1, type.getServices().size());
- assertTrue(ModelHelper
- .matches(ModelHelper.getService(type, Interface1.class.getSimpleName()), Interface1.class));
- assertEquals(1, type.getProperties().size());
- org.apache.tuscany.sca.assembly.Property prop = ModelHelper.getProperty(type, "property");
- assertNotNull(prop);
- assertEquals(ComplexProperty.class, type.getPropertyMembers().get("property").getType());
- assertEquals(1, type.getReferences().size());
- assertTrue(ModelHelper.matches(ModelHelper.getReference(type, "reference"), Ref.class));
- }
-
- /**
- * Verifies that a property setter is not introspected if an analogous
- * operation is in the service interface
- */
- @Test
- public void testPropertySetterInInterface() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<SingleInterfaceImpl> ctor = SingleInterfaceImpl.class.getConstructor();
- type.setConstructor(new JavaConstructorImpl<SingleInterfaceImpl>(ctor));
- processor.visitEnd(SingleInterfaceImpl.class, type);
- assertEquals(0, type.getProperties().size());
- }
-
- /**
- * Verifies that a reference setter is not introspected if an analogous
- * operation is in the service interface
- */
- @Test
- public void testReferenceSetterInInterface() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<RefInterfaceImpl> ctor = RefInterfaceImpl.class.getConstructor();
- type.setConstructor(new JavaConstructorImpl<RefInterfaceImpl>(ctor));
- processor.visitEnd(RefInterfaceImpl.class, type);
- assertEquals(0, type.getReferences().size());
- }
-
- /**
- * Verifies collection generic types or array types are introspected as
- * references according to specification rules
- */
- @Test
- public void testReferenceCollectionType() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<ReferenceCollectionImpl> ctor = ReferenceCollectionImpl.class.getConstructor();
- type.setConstructor(new JavaConstructorImpl<ReferenceCollectionImpl>(ctor));
- processor.visitEnd(ReferenceCollectionImpl.class, type);
- assertEquals(1, type.getProperties().size());
- assertEquals(3, type.getReferences().size());
- }
-
- /**
- * Verifies collection generic types or array types are introspected as
- * properties according to specification rules
- */
- @Test
- public void testPropertyCollectionType() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<PropertyCollectionImpl> ctor = PropertyCollectionImpl.class.getConstructor();
- type.setConstructor(new JavaConstructorImpl<PropertyCollectionImpl>(ctor));
- processor.visitEnd(PropertyCollectionImpl.class, type);
- assertEquals(0, type.getReferences().size());
- assertEquals(4, type.getProperties().size());
- }
-
- /**
- * Verifies references are calculated when the type marked with is
- *
- * @Remotable
- */
- @Test
- public void testRemotableRef() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<RemotableRefImpl> ctor = RemotableRefImpl.class.getConstructor();
- type.setConstructor(new JavaConstructorImpl<RemotableRefImpl>(ctor));
- processor.visitEnd(RemotableRefImpl.class, type);
- assertEquals(2, type.getReferences().size());
- assertEquals(0, type.getProperties().size());
- }
-
- @Test
- public void testParentInterface() throws IntrospectionException, NoSuchMethodException {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Child> ctor = Child.class.getConstructor();
- type.setConstructor(new JavaConstructorImpl<Child>(ctor));
- processor.visitEnd(Child.class, type);
- assertNotNull(ModelHelper.getService(type, Interface1.class.getSimpleName()));
- }
-
- /**
- * Verifies a service interface is calculated when only props and refs are
- * given
- */
- @Test
- public void testExcludedPropertyAndReference() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- org.apache.tuscany.sca.assembly.Reference ref = factory.createReference();
- ref.setName("reference");
- type.getReferences().add(ref);
- type.getReferenceMembers().put("reference", new JavaElementImpl("reference", Ref.class, null));
- org.apache.tuscany.sca.assembly.Reference ref2 = factory.createReference();
- ref2.setName("reference2");
- type.getReferences().add(ref2);
- type.getReferenceMembers().put("reference2", new JavaElementImpl("reference2", Ref.class, null));
- org.apache.tuscany.sca.assembly.Property prop1 = factory.createProperty();
- prop1.setName("string1");
- type.getProperties().add(prop1);
- type.getPropertyMembers().put("string1", new JavaElementImpl("string1", String.class, null));
- org.apache.tuscany.sca.assembly.Property prop2 = factory.createProperty();
- prop2.setName("string2");
- type.getProperties().add(prop2);
- type.getPropertyMembers().put("string2", new JavaElementImpl("string2", String.class, null));
- visitEnd(MockService.class, type);
- assertEquals(1, type.getServices().size());
- }
-
- @Test
- public void testProtectedRemotableRefField() throws IntrospectionException, NoSuchMethodException {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<ProtectedRemotableRefFieldImpl> ctor = ProtectedRemotableRefFieldImpl.class.getConstructor();
- type.setConstructor(new JavaConstructorImpl<ProtectedRemotableRefFieldImpl>(ctor));
- processor.visitEnd(ProtectedRemotableRefFieldImpl.class, type);
- assertNotNull(ModelHelper.getReference(type, "otherRef"));
- }
-
- @Test
- public void testProtectedRemotableRefMethod() throws IntrospectionException, NoSuchMethodException {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<ProtectedRemotableRefMethodImpl> ctor = ProtectedRemotableRefMethodImpl.class.getConstructor();
- type.setConstructor(new JavaConstructorImpl<ProtectedRemotableRefMethodImpl>(ctor));
- processor.visitEnd(ProtectedRemotableRefMethodImpl.class, type);
- assertNotNull(ModelHelper.getReference(type, "otherRef"));
- }
-
- @Test
- public void testSetDataTypes() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<PropertyIntTypeOnConstructor> ctor = PropertyIntTypeOnConstructor.class.getConstructor();
- type.setConstructor(new JavaConstructorImpl<PropertyIntTypeOnConstructor>(ctor));
- processor.visitEnd(PropertyIntTypeOnConstructor.class, type);
- org.apache.tuscany.sca.assembly.Property foo = ModelHelper.getProperty(type, "foo");
- assertEquals(int.class, type.getPropertyMembers().get("foo").getType());
- assertEquals(new QName(JavaXMLMapper.URI_2001_SCHEMA_XSD, "int"), foo.getXSDType());
- }
-
- /**
- * Errata for Java Component Implementation Specification v1.0 corrects the algorithm for determining
- * references of an unannotated POJO (section 1.2.7). This test makes sure that the earlier implementation
- * is corrected as per the errata. A notable difference is that the interfaces annotated with @Service
- * no longer result in references.
- */
- @Test
- public void testUpdatedRule() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- visitEnd(SomeServiceImpl.class, type);
- assertEquals(12, type.getReferenceMembers().size());
- assertTrue(type.getReferenceMembers().containsKey("rri1"));
- assertTrue(type.getReferenceMembers().containsKey("rri2"));
- assertTrue(type.getReferenceMembers().containsKey("rri3"));
- assertTrue(type.getReferenceMembers().containsKey("rri4"));
-
- assertTrue(type.getReferenceMembers().containsKey("rria1"));
- assertTrue(type.getReferenceMembers().containsKey("rria2"));
- assertTrue(type.getReferenceMembers().containsKey("rria3"));
- assertTrue(type.getReferenceMembers().containsKey("rria4"));
-
- assertTrue(type.getReferenceMembers().containsKey("rric1"));
- assertTrue(type.getReferenceMembers().containsKey("rric2"));
- assertTrue(type.getReferenceMembers().containsKey("rric3"));
- assertTrue(type.getReferenceMembers().containsKey("rric4"));
-
- assertEquals(16, type.getPropertyMembers().size());
- assertTrue(type.getPropertyMembers().containsKey("pnri1"));
- assertTrue(type.getPropertyMembers().containsKey("pnri2"));
- assertTrue(type.getPropertyMembers().containsKey("pnri3"));
- assertTrue(type.getPropertyMembers().containsKey("pnri4"));
-
- assertTrue(type.getPropertyMembers().containsKey("pnria1"));
- assertTrue(type.getPropertyMembers().containsKey("pnria2"));
- assertTrue(type.getPropertyMembers().containsKey("pnria3"));
- assertTrue(type.getPropertyMembers().containsKey("pnria4"));
-
- assertTrue(type.getPropertyMembers().containsKey("pnric1"));
- assertTrue(type.getPropertyMembers().containsKey("pnric2"));
- assertTrue(type.getPropertyMembers().containsKey("pnric3"));
- assertTrue(type.getPropertyMembers().containsKey("pnric4"));
-
- assertTrue(type.getPropertyMembers().containsKey("gen1"));
- assertTrue(type.getPropertyMembers().containsKey("gen2"));
- assertTrue(type.getPropertyMembers().containsKey("gen3"));
- assertTrue(type.getPropertyMembers().containsKey("gen4"));
- }
-
- /**
- * Interfaces with "@WebService" annotation implemented by the class should result
- * in a Service in the same manner as an "@Remotable" annotation would.
- */
- @Test
- public void testInterfaceWithWebServiceAnnotation() throws Exception{
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- visitEnd(SomeWebServiceImpl.class, type);
- assertEquals(1, type.getServices().size());
- assertEquals("SomeWebService", type.getServices().get(0).getName());
- }
-
- @Remotable
- private interface ReferenceRemotableInterface {
- void operation1(String param1);
- }
-
- @Service
- private interface PropertyNonRemotableInterface {
- void operation1(String param1);
- }
-
- @Remotable
- private interface SomeService {
- void serviceOperation1();
- }
-
- private static class SomeServiceImpl implements SomeService {
-
- public SomeServiceImpl() {
- }
-
- // References - interface with @Remotable
- public void setRri1(ReferenceRemotableInterface rri) {
- }
- protected void setRri2(ReferenceRemotableInterface rri) {
- }
- public ReferenceRemotableInterface rri3;
- protected ReferenceRemotableInterface rri4;
-
- // References - array of interface with @Remotable
- public void setRria1(ReferenceRemotableInterface[] rri) {
- }
- protected void setRria2(ReferenceRemotableInterface[] rri) {
- }
- public ReferenceRemotableInterface[] rria3;
- protected ReferenceRemotableInterface[] rria4;
-
- // References - parametrized Collection of interface with @Remotable
- public void setRric1(Collection<ReferenceRemotableInterface> rri) {
- }
- protected void setRric2(Collection<ReferenceRemotableInterface> rri) {
- }
- public Collection<ReferenceRemotableInterface> rric3;
- protected Collection<ReferenceRemotableInterface> rric4;
-
- // Properties - interface with @Service and without @Remotable
- public void setPnri1(PropertyNonRemotableInterface arg) {
- }
- protected void setPnri2(PropertyNonRemotableInterface arg) {
- }
- public PropertyNonRemotableInterface pnri3;
- protected PropertyNonRemotableInterface pnri4;
-
- // Properties - array of interface with @Service and without @Remotable
- public void setPnria1(PropertyNonRemotableInterface[] arg) {
- }
- protected void setPnria2(PropertyNonRemotableInterface[] arg) {
- }
- public PropertyNonRemotableInterface[] pnria3;
- protected PropertyNonRemotableInterface[] pnria4;
-
- // Properties - parametrized Collection of interface with @Service and without @Remotable
- public void setPnric1(Collection<PropertyNonRemotableInterface> arg) {
- }
- protected void setPnric2(Collection<PropertyNonRemotableInterface> arg) {
- }
- public Collection<PropertyNonRemotableInterface> pnric3;
- protected Collection<PropertyNonRemotableInterface> pnric4;
-
- // Properties - Non-parametrized Collection
- public void setGen1(Collection arg) {
- }
- protected void setGen2(Collection arg) {
- }
- public Collection gen3;
- protected Collection gen4;
-
- public void serviceOperation1() {
- }
- }
-
- private static class PropertyIntTypeOnConstructor {
- protected int foo;
-
- public PropertyIntTypeOnConstructor() {
- }
-
- public int getFoo() {
- return foo;
- }
- }
-
- @Remotable
- private interface PropertyInterface {
- void setString1(String val);
- }
-
- @Remotable
- private interface Interface1 {
- }
-
- private static class Parent implements Interface1 {
-
- }
-
- private static class Child extends Parent {
- public Child() {
- }
-
- }
-
- private static class SingleInterfaceImpl implements PropertyInterface {
- public SingleInterfaceImpl() {
- }
-
- public void setString1(String val) {
- }
-
- }
-
- private interface HeuristicServiceInterface {
- void fooOperation(String ref);
-
- void setInvalid1(); // No parameter
-
- void setInvalid2(String str, int i); // More than one parameter
-
- String setInvalid3(String str); // return should be void
- }
-
- public static class MockService implements PropertyInterface, RefInterface, HeuristicServiceInterface {
-
- @Property
- public void setString1(String val) {
- }
-
- @Property
- public void setString2(String val) {
- }
-
- @Reference
- public void setReference(Ref ref) {
- }
-
- @Reference
- public void setReference2(Ref ref) {
- }
-
- public void fooOperation(String ref) {
-
- }
-
- public void setInvalid1() {
- }
-
- public void setInvalid2(String str, int i) {
- }
-
- public String setInvalid3(String str) {
- return null;
- }
-
- }
-
- @Remotable
- private interface Ref {
- }
-
- private class ComplexProperty {
- }
-
- private interface RefInterface {
- void setReference(Ref ref);
- }
-
- private static class RefInterfaceImpl implements RefInterface {
- public RefInterfaceImpl() {
- }
-
- public void setReference(Ref ref) {
- }
- }
-
- private static class SingleInterfaceWithPropertyReferenceImpl implements Interface1 {
- public SingleInterfaceWithPropertyReferenceImpl() {
- }
-
- public void setReference(Ref ref) {
- }
-
- public void setProperty(ComplexProperty prop) {
- }
- }
-
- private static class ReferenceCollectionImpl implements Interface1 {
- public ReferenceCollectionImpl() {
- }
-
- public void setCollectionReference(Collection<Ref> ref) {
- }
-
- public void setNonGenericCollectionReference(Collection ref) {
- // [rfeng] By the SCA specification, this should be classified as property
- }
-
- public void setListReference(List<Ref> ref) {
- }
-
- public void setArrayReference(Ref[] ref) {
- }
- }
-
- private static class PropertyCollectionImpl implements Interface1 {
- public PropertyCollectionImpl() {
- }
-
- public void setCollectionProperty(Collection<ComplexProperty> prop) {
- }
-
- public void setCollectionProperty2(Collection<String> prop) {
- }
-
- public void setArrayProperty(ComplexProperty[] prop) {
- }
-
- public void setArrayProperty2(String[] prop) {
- }
- }
-
- @Remotable
- private interface RemotableRef {
- }
-
- private static class RemotableRefImpl implements Interface1 {
- protected RemotableRef otherRef;
-
- public RemotableRefImpl() {
- }
-
- public void setRef(RemotableRef ref) {
-
- }
- }
-
- private static class ProtectedRemotableRefFieldImpl implements Interface1 {
- protected RemotableRef otherRef;
-
- public ProtectedRemotableRefFieldImpl() {
- }
-
- public ProtectedRemotableRefFieldImpl(RemotableRef otherRef) {
- this.otherRef = otherRef;
- }
-
- }
-
- private static class ProtectedRemotableRefMethodImpl implements Interface1 {
- public ProtectedRemotableRefMethodImpl() {
- }
-
- protected void setOtherRef(RemotableRef otherRef) {
- }
-
- }
-
- @WebService
- private interface SomeWebService {
- void serviceOperation1();
- }
-
- @Service
- private static class SomeWebServiceImpl implements SomeWebService {
- public SomeWebServiceImpl() {
-
- }
-
- public void serviceOperation1() {
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeutisticExtensibleConstructorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeutisticExtensibleConstructorTestCase.java
deleted file mode 100644
index 17b5381641..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeutisticExtensibleConstructorTestCase.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import java.lang.reflect.Constructor;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-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.JavaImplementationFactory;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.junit.Test;
-
-/**
- * Verifies constructors that have extensible annotation types, i.e. that have
- * parameters marked by annotations which are themselves processed by some other
- * implementation processor
- *
- * @version $Rev$ $Date$
- */
-public class HeutisticExtensibleConstructorTestCase extends AbstractProcessorTest {
-
- private org.apache.tuscany.sca.implementation.java.introspect.impl.HeuristicPojoProcessor processor;
- private JavaImplementationFactory javaImplementationFactory;
-
- public HeutisticExtensibleConstructorTestCase() {
- processor = new HeuristicPojoProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory());
- javaImplementationFactory = new DefaultJavaImplementationFactory();
- }
-
- private <T> void visitEnd(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- for (Constructor<?> constructor : clazz.getConstructors()) {
- visitConstructor(constructor, type);
- }
- processor.visitEnd(clazz, type);
- }
-
- /**
- * Verifies heuristic processing can be called prior to an extension
- * annotation processors being called.
- */
- @Test
- public void testBarAnnotationProcessedFirst() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo> ctor = Foo.class.getConstructor(String.class, String.class);
- JavaConstructorImpl<Foo> definition = new JavaConstructorImpl<Foo>(ctor);
- type.setConstructor(definition);
- Property property = factory.createProperty();
- property.setName("myBar");
- definition.getParameters()[0].setName("myBar");
- type.getProperties().add(property);
- visitEnd(Foo.class, type);
- assertEquals(2, type.getProperties().size());
- }
-
- /**
- * Verifies heuristic processing can be called before an extension
- * annotation processors is called. <p/> For example, given:
- *
- * <pre>
- * Foo(@Bar String prop, @org.oasisopen.sca.annotation.Property(name = &quot;foo&quot;) String prop2)
- * </pre>
- *
- * <p/> Heuristic evaluation of
- * @Property can occur prior to another implementation processor evaluating
- * @Bar
- * @throws Exception
- */
- @Test
- public void testBarAnnotationProcessedLast() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- visitEnd(Foo.class, type);
-
- // now simulate process the bar impl
- JavaConstructorImpl<?> definition = type.getConstructor();
- definition.getParameters()[0].setName("myBar");
- Property property = factory.createProperty();
- property.setName("myBar");
- type.getProperties().add(property);
-
- assertEquals(2, type.getProperties().size());
- assertEquals("foo", definition.getParameters()[1].getName());
- }
-
- /**
- * Verifies heuristic processing can be called before an extension
- * annotation processors is called with the extension parameter in a middle
- * position. Specifically, verifies that the heuristic processor updates
- * injection names and preserves their ordering.
- */
- @Test
- public void testBarAnnotationProcessedFirstInMiddle() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Constructor<Foo2> ctor = Foo2.class.getConstructor(String.class, String.class, String.class);
- JavaConstructorImpl<Foo2> definition = new JavaConstructorImpl<Foo2>(ctor);
- type.setConstructor(definition);
- // insert placeholder for first param, which would be done by a
- // processor
- definition.getParameters()[0].setName("");
- Property property = factory.createProperty();
- // Hack to add a property member
- JavaElementImpl element = new JavaElementImpl("myBar", String.class, null);
- type.getPropertyMembers().put("myBar", element);
- property.setName("myBar");
- definition.getParameters()[1].setName("myBar");
- type.getProperties().add(property);
- visitEnd(Foo2.class, type);
- assertEquals("baz", definition.getParameters()[0].getName());
- assertEquals(2, type.getProperties().size());
- assertEquals(1, type.getReferences().size());
- }
-
- public @interface Bar {
-
- }
-
- public static class Foo {
- public Foo(@Bar
- String prop, @org.oasisopen.sca.annotation.Property(name = "foo")
- String prop2) {
- }
- }
-
- public static class Foo2 {
- public Foo2(@org.oasisopen.sca.annotation.Reference(name = "baz")
- String prop1, @Bar
- String prop2, @org.oasisopen.sca.annotation.Property(name = "foo")
- String prop3) {
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessorTestCase.java
deleted file mode 100644
index 5df7078aa6..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessorTestCase.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Init;
-
-/**
- * @version $Rev$ $Date$
- */
-public class InitProcessorTestCase {
-
- private JavaImplementationFactory javaImplementationFactory;
-
- public InitProcessorTestCase() {
- javaImplementationFactory = new DefaultJavaImplementationFactory();
- }
-
- @Test
- public void testInit() throws Exception {
- InitProcessor processor = new InitProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = InitProcessorTestCase.Foo.class.getMethod("init");
- processor.visitMethod(method, type);
- assertNotNull(type.getInitMethod());
- }
-
- @Test
- public void testBadInit() throws Exception {
- InitProcessor processor = new InitProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = InitProcessorTestCase.Bar.class.getMethod("badInit", String.class);
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalInitException e) {
- // expected
- }
- }
-
- @Test
- public void testTwoInit() throws Exception {
- InitProcessor processor = new InitProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = InitProcessorTestCase.Bar.class.getMethod("init");
- Method method2 = InitProcessorTestCase.Bar.class.getMethod("init2");
- processor.visitMethod(method, type);
- try {
- processor.visitMethod(method2, type);
- fail();
- } catch (DuplicateInitException e) {
- // expected
- }
- }
-
- @Test
- public void testProtectedInit() throws Exception {
- InitProcessor processor = new InitProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = InitProcessorTestCase.Bar.class.getDeclaredMethod("protectedInit");
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalInitException e) {
- // expected
- }
- }
-
- @Test
- public void testPrivateInit() throws Exception {
- InitProcessor processor = new InitProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = InitProcessorTestCase.Bar.class.getDeclaredMethod("privateInit");
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalInitException e) {
- // expected
- }
- }
-
- @Test
- public void testBadInit2() throws Exception {
- InitProcessor processor = new InitProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- Method method = InitProcessorTestCase.Bar.class.getDeclaredMethod("badInit2");
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalInitException e) {
- // expected
- }
- }
-
- private class Foo {
- @Init
- public void init() {
- }
- }
-
-
- private class Bar {
- @Init
- public void init() {
- }
-
- @Init
- public void init2() {
- }
-
- @Init
- public void badInit(String foo) {
- }
-
- @Init
- public String badInit2() {
- return null;
- }
-
- @Init
- protected void protectedInit() {
- }
-
- @Init
- private void privateInit() {
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ModelHelper.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ModelHelper.java
deleted file mode 100644
index aad6b96cf9..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ModelHelper.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ModelHelper {
-
- public static Property getProperty(JavaImplementation type, String name) {
- for (Property prop : type.getProperties()) {
- if (prop.getName().equals(name)) {
- return prop;
- }
- }
- return null;
- }
-
- public static Reference getReference(JavaImplementation type, String name) {
- for (Reference ref : type.getReferences()) {
- if (ref.getName().equals(name)) {
- return ref;
- }
- }
- return null;
- }
-
- public static Service getService(JavaImplementation type, String name) {
- for (Service svc : type.getServices()) {
- if (svc.getName().equals(name)) {
- return svc;
- }
- }
- return null;
- }
-
- public static boolean matches(Contract contract, Class<?> type) {
- Interface interface1 = contract.getInterfaceContract().getInterface();
- if (interface1 instanceof JavaInterface) {
- return type == ((JavaInterface)interface1).getJavaClass();
- } else {
- return false;
- }
- }
-
- public static ComponentService createService(AssemblyFactory factory,
- JavaInterfaceFactory javaFactory, Class<?> type) {
- org.apache.tuscany.sca.assembly.ComponentService ref = factory.createComponentService();
- ref.setName(type.getSimpleName());
- JavaInterface i = javaFactory.createJavaInterface();
- i.setJavaClass(type);
- JavaInterfaceContract ic = javaFactory.createJavaInterfaceContract();
- ic.setInterface(i);
- ref.setInterfaceContract(ic);
- return ref;
- }
-
- public static Reference createReference(AssemblyFactory factory,
- JavaInterfaceFactory javaFactory, String name, Class<?> type) {
- org.apache.tuscany.sca.assembly.Reference ref = factory.createReference();
- ref.setName(name);
- JavaInterface i = javaFactory.createJavaInterface();
- i.setJavaClass(type);
- JavaInterfaceContract ic = javaFactory.createJavaInterfaceContract();
- ic.setInterface(i);
- ref.setInterfaceContract(ic);
- return ref;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java
deleted file mode 100644
index e6a29b0e13..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.impl.PolicyJavaInterfaceVisitor;
-import org.apache.tuscany.sca.policy.DefaultPolicyFactory;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Requires;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PolicyProcessorTestCase {
- private ServiceProcessor serviceProcessor;
- private PolicyProcessor policyProcessor;
- private PolicyJavaInterfaceVisitor visitor;
- private JavaImplementation type;
-
- // This actually is a test for PolicyJavaInterfaceProcessor. It will get
- // invoked via the call to ImplementationProcessorServiceImpl.createService in
- // ServiceProcessor. Of course ServiceProcessor class has to be working.
- public void stestSingleInterfaceWithIntentsOnInterfaceAtInterfaceLevel() throws Exception {
- serviceProcessor.visitClass(Service1.class, type);
- visitor.visitInterface((JavaInterface)type.getServices().get(0).getInterfaceContract().getInterface());
- policyProcessor.visitClass(Service1.class, type);
- verifyIntents(Service1.class, type);
- }
-
- public void stestMultipleInterfacesWithIntentsOnInterfaceAtInterfaceLevel() throws Exception {
- serviceProcessor.visitClass(Service2.class, type);
- visitor.visitInterface((JavaInterface)type.getServices().get(0).getInterfaceContract().getInterface());
- policyProcessor.visitClass(Service2.class, type);
- verifyIntents(Service2.class, type);
- }
-
- public void stestSingleInterfaceWithIntentsOnImplAtClassLevel() throws Exception {
- serviceProcessor.visitClass(Service3.class, type);
- visitor.visitInterface((JavaInterface)type.getServices().get(0).getInterfaceContract().getInterface());
- policyProcessor.visitClass(Service3.class, type);
- verifyIntents(Service3.class, type);
- }
-
- public void stestMultipleInterfacesWithIntentsOnImplAtClassLevel() throws Exception {
- serviceProcessor.visitClass(Service4.class, type);
- visitor.visitInterface((JavaInterface)type.getServices().get(0).getInterfaceContract().getInterface());
- policyProcessor.visitClass(Service4.class, type);
- verifyIntents(Service4.class, type);
- }
-
- public void stestSingleInterfaceWithIntentsOnInterfaceAtMethodLevel() throws Exception {
- serviceProcessor.visitClass(Service5.class, type);
- visitor.visitInterface((JavaInterface)type.getServices().get(0).getInterfaceContract().getInterface());
- policyProcessor.visitClass(Service5.class, type);
- verifyIntents(Service5.class, type);
- }
-
- @Test
- public void testSingleInterfaceWithIntentsOnServiceAndInterfaceAtImplAndInertfaceAndMethodLevel() throws Exception {
- serviceProcessor.visitClass(Service6.class, type);
- visitor.visitInterface((JavaInterface)type.getServices().get(0).getInterfaceContract().getInterface());
- policyProcessor.visitClass(Service6.class, type);
- for (Method method : Service6.class.getDeclaredMethods()) {
- policyProcessor.visitMethod(method, type);
- }
- verifyIntents(Service6.class, type);
- }
-
- private void verifyIntents(Class<?> serviceImplClass, JavaImplementation type) {
- if ( !(type instanceof PolicySetAttachPoint) ) {
- fail("No Intents on the service ");
- }
- Requires serviceImplIntentAnnotation = (Requires)serviceImplClass.getAnnotation(Requires.class);
- if (serviceImplIntentAnnotation != null) {
- String[] serviceImplIntents = serviceImplIntentAnnotation.value();
- List<Intent> requiredIntents = ((PolicySetAttachPoint)type).getRequiredIntents();
- if (serviceImplIntents.length > 0) {
- if (requiredIntents == null || requiredIntents.size() == 0) {
- fail("No Intents on the service ");
- }
- Map<String, Intent> intentMap = new HashMap<String, Intent>();
- for (Intent intent : requiredIntents) {
- intentMap.put(intent.getName().getLocalPart(), intent);
- }
- for (String intent : serviceImplIntents) {
- assertTrue("ComponentType for Service class " + serviceImplClass.getName()
- + " did not contain Service Implementation intent "
- + intent, intentMap.containsKey(intent));
- }
- }
- }
-
- // This should match what was specified on @Service for a Service Implementation
- // If we use these to get the Service names and we get a null Service
- // name then it would seem that wrong values were put on the @Service annotation
- // or the wrong interfaces were specified on the implements list of the class
- // statement?
- Map<String, org.apache.tuscany.sca.assembly.Service> serviceMap = new HashMap<String, org.apache.tuscany.sca.assembly.Service>();
- for (org.apache.tuscany.sca.assembly.Service service: type.getServices()) {
- serviceMap.put(service.getName(), service);
- }
- for (Class<?> interfaceClass : serviceImplClass.getInterfaces()) {
- Requires interfaceIntentAnnotation = (Requires)interfaceClass.getAnnotation(Requires.class);
- org.apache.tuscany.sca.assembly.Service service = serviceMap.get(interfaceClass.getSimpleName());
- if (service == null) {
- fail("No service defined for interface " + interfaceClass.getSimpleName()
- + " on Service Implementation "
- + serviceImplClass.getName());
- }
-
- if (interfaceIntentAnnotation != null) {
- String[] interfaceIntents = interfaceIntentAnnotation.value();
- List<Intent> requiredIntents = service.getInterfaceContract().getInterface().getRequiredIntents();
- if (interfaceIntents.length > 0) {
- if (requiredIntents == null || requiredIntents.size() == 0) {
- fail("No Intents on the service " + service.getName());
- }
- Map<String, Intent> intentMap = new HashMap<String, Intent>();
- for (Intent intent : requiredIntents) {
- intentMap.put(intent.getName().getLocalPart(), intent);
- }
- for (String intent : interfaceIntents) {
- assertTrue("Interface " + service.getName()
- + " did not contain Service Interface intent "
- + intent, intentMap.containsKey(intent));
- }
- }
- }
-
- for (Method method : interfaceClass.getDeclaredMethods()) {
- Requires methodIntentAnnotation = method.getAnnotation(Requires.class);
-
- // Verify that each of the Intents on each of the Service
- // Interface Methods exist on their associated operation.
- if (methodIntentAnnotation != null) {
- String[] methodIntents = methodIntentAnnotation.value();
- if (methodIntents.length > 0) {
- List<Intent> requiredIntents = null;
- for ( ConfiguredOperation confOp : service.getConfiguredOperations() ) {
- if ( confOp.getName().equals(method.getName()) &&
- confOp.getContractName().equals(service.getName()) ) {
- requiredIntents = confOp.getRequiredIntents();
- }
- }
-
- if (requiredIntents == null || requiredIntents.size() == 0) {
- fail("No Intents on operation " + method.getName());
- }
- for (String intent : methodIntents) {
- boolean found = false;
- for (Intent requiredIntent: requiredIntents) {
- if (requiredIntent.getName().getLocalPart().equals(intent)) {
- found = true;
- break;
- }
- }
- assertTrue("Operation " + method.getName()
- + " did not contain Service Interface method intent "
- + intent, found);
- }
- }
- }
- }
-
- for (Method method : serviceImplClass.getDeclaredMethods()) {
- Requires methodIntentAnnotation = method.getAnnotation(Requires.class);
-
- // Verify that each of the Intents on each of the Service
- // Implementation Methods exist on their associated
- // operation.
- if (methodIntentAnnotation != null) {
- String[] methodIntents = methodIntentAnnotation.value();
- if (methodIntents.length > 0) {
- List<Intent> requiredIntents = null;
- for ( ConfiguredOperation confOp : ((OperationsConfigurator)type).getConfiguredOperations() ) {
- if ( confOp.getName().equals(method.getName()) ) {
- requiredIntents = confOp.getRequiredIntents();
- }
- }
-
- if (requiredIntents == null || requiredIntents.size() == 0) {
- fail("No Intents on operation " + method.getName());
- }
-
- for (String intent : methodIntents) {
- boolean found = false;
- for (Intent requiredIntent: requiredIntents) {
- if (requiredIntent.getName().getLocalPart().equals(intent)) {
- found = true;
- break;
- }
- }
- assertTrue("Operation " + method.getName()
- + " did not contain Implementation method intent "
- + intent, found);
- }
- }
- }
- }
- }
- }
-
- @Before
- public void setUp() throws Exception {
- serviceProcessor = new ServiceProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory());
- policyProcessor = new PolicyProcessor(new DefaultAssemblyFactory(), new DefaultPolicyFactory());
- visitor = new PolicyJavaInterfaceVisitor(new DefaultPolicyFactory());
- JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
- type = javaImplementationFactory.createJavaImplementation();
- }
-
- // @Remotable
- @Requires( {"transaction.global"})
- private interface Interface1 {
- int method1();
-
- int method2();
-
- int method3();
-
- int method4();
- }
-
- @Service(Interface1.class)
- private class Service1 implements Interface1 {
- public int method1() {
- return 0;
- }
-
- public int method2() {
- return 0;
- }
-
- public int method3() {
- return 0;
- }
-
- public int method4() {
- return 0;
- }
- }
-
- // @Remotable
- @Requires( {"transaction.local"})
- private interface Interface2 {
- int method5();
-
- int method6();
- }
-
- @Service(interfaces = {Interface1.class, Interface2.class})
- private class Service2 implements Interface1, Interface2 {
- public int method1() {
- return 0;
- }
-
- public int method2() {
- return 0;
- }
-
- public int method3() {
- return 0;
- }
-
- public int method4() {
- return 0;
- }
-
- public int method5() {
- return 0;
- }
-
- public int method6() {
- return 0;
- }
- }
-
- // @Remotable
- private interface Interface3 {
- int method1();
-
- int method2();
-
- int method3();
-
- int method4();
- }
-
- @Service(Interface3.class)
- @Requires( {"transaction.global"})
- private class Service3 implements Interface3 {
- public int method1() {
- return 0;
- }
-
- public int method2() {
- return 0;
- }
-
- public int method3() {
- return 0;
- }
-
- public int method4() {
- return 0;
- }
- }
-
- // @Remotable
- private interface Interface4 {
- int method5();
-
- int method6();
- }
-
- @Service(interfaces = {Interface3.class, Interface4.class})
- @Requires( {"transaction.local"})
- private class Service4 implements Interface3, Interface4 {
- public int method1() {
- return 0;
- }
-
- public int method2() {
- return 0;
- }
-
- public int method3() {
- return 0;
- }
-
- public int method4() {
- return 0;
- }
-
- public int method5() {
- return 0;
- }
-
- public int method6() {
- return 0;
- }
- }
-
- private interface Interface5 {
- @Requires( {"transaction.global"})
- int method1();
-
- @Requires( {"transaction.local"})
- int method2();
- }
-
- @Service(Interface5.class)
- private class Service5 implements Interface5 {
- public int method1() {
- return 0;
- }
-
- public int method2() {
- return 0;
- }
- }
-
- @Requires( {"transaction.global.Interface6"})
- private interface Interface6 {
- @Requires( {"transaction.global.Interface6.method1"})
- int method1();
-
- @Requires( {"transaction.local.Interface6.method2"})
- int method2();
- }
-
- @Service(Interface6.class)
- @Requires( {"transaction.global.Service6"})
- private class Service6 implements Interface6 {
- @Requires( {"transaction.global.Service6.method1"})
- public int method1() {
- return 0;
- }
-
- @Requires( {"transaction.global.Service6.method1"})
- public int method2() {
- return 0;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessorTestCase.java
deleted file mode 100644
index 99e28365da..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessorTestCase.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.impl.ModelHelper.getProperty;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Property;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PropertyProcessorTestCase {
-
- JavaImplementation type;
- PropertyProcessor processor;
-
- @Test
- public void testMethodAnnotation() throws Exception {
- processor.visitMethod(Foo.class.getMethod("setFoo", String.class), type);
- assertNotNull(getProperty(type, "foo"));
- }
-
- @Test
- public void testMethodRequired() throws Exception {
- processor.visitMethod(Foo.class.getMethod("setFooRequired", String.class), type);
- org.apache.tuscany.sca.assembly.Property prop = getProperty(type, "fooRequired");
- assertNotNull(prop);
- assertTrue(prop.isMustSupply());
- }
-
- @Test
- public void testMethodName() throws Exception {
- processor.visitMethod(Foo.class.getMethod("setBarMethod", String.class), type);
- assertNotNull(getProperty(type, "bar"));
- }
-
- @Test
- public void testFieldAnnotation() throws Exception {
- processor.visitField(Foo.class.getDeclaredField("baz"), type);
- assertNotNull(getProperty(type, "baz"));
- }
-
- @Test
- public void testFieldRequired() throws Exception {
- processor.visitField(Foo.class.getDeclaredField("bazRequired"), type);
- org.apache.tuscany.sca.assembly.Property prop = getProperty(type, "bazRequired");
- assertNotNull(prop);
- assertTrue(prop.isMustSupply());
- }
-
- @Test
- public void testFieldName() throws Exception {
- processor.visitField(Foo.class.getDeclaredField("bazField"), type);
- assertNotNull(getProperty(type, "theBaz"));
- }
-
- @Test
- public void testDuplicateFields() throws Exception {
- processor.visitField(Bar.class.getDeclaredField("dup"), type);
- try {
- processor.visitField(Bar.class.getDeclaredField("baz"), type);
- fail();
- } catch (DuplicatePropertyException e) {
- // expected
- }
- }
-
- @Test
- public void testDuplicateMethods() throws Exception {
- processor.visitMethod(Bar.class.getMethod("setDupMethod", String.class), type);
- try {
- processor.visitMethod(Bar.class.getMethod("setDupSomeMethod", String.class), type);
- fail();
- } catch (DuplicatePropertyException e) {
- // expected
- }
- }
-
- @Test
- public void testInvalidProperty() throws Exception {
- try {
- processor.visitMethod(Bar.class.getMethod("badMethod"), type);
- fail();
- } catch (IllegalPropertyException e) {
- // expected
- }
- }
-
- @Before
- public void setUp() throws Exception {
- JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
- type = javaImplementationFactory.createJavaImplementation();
- processor = new PropertyProcessor(new DefaultAssemblyFactory());
- }
-
- private class Foo {
-
- @Property
- protected String baz;
- @Property(required = true)
- protected String bazRequired;
- @Property(name = "theBaz")
- protected String bazField;
-
- @Property
- public void setFoo(String string) {
- }
-
- @Property(required = true)
- public void setFooRequired(String string) {
- }
-
- @Property(name = "bar")
- public void setBarMethod(String string) {
- }
-
- }
-
- private class Bar {
-
- @Property
- protected String dup;
-
- @Property(name = "dup")
- protected String baz;
-
- @Property
- public void setDupMethod(String s) {
- }
-
- @Property(name = "dupMethod")
- public void setDupSomeMethod(String s) {
- }
-
- @Property
- public void badMethod() {
- }
-
- }
-
- private class Multiple {
- @Property
- protected List<String> refs1;
-
- @Property
- protected String[] refs2;
-
- @Property
- public void setRefs3(String[] refs) {
- }
-
- @Property
- public void setRefs4(Collection<String> refs) {
- }
-
- }
-
- private Class<?> getBaseType(JavaElementImpl element) {
- return JavaIntrospectionHelper.getBaseType(element.getType(), element.getGenericType());
- }
-
- @Test
- public void testMultiplicityCollection() throws Exception {
- processor.visitField(Multiple.class.getDeclaredField("refs1"), type);
- org.apache.tuscany.sca.assembly.Property prop = getProperty(type, "refs1");
- assertNotNull(prop);
- assertSame(String.class, getBaseType(type.getPropertyMembers().get(prop.getName())));
- assertTrue(prop.isMany());
- }
-
- @Test
- public void testMultiplicityArray() throws Exception {
- processor.visitField(Multiple.class.getDeclaredField("refs2"), type);
- org.apache.tuscany.sca.assembly.Property prop = getProperty(type, "refs2");
- assertNotNull(prop);
- assertSame(String.class, getBaseType(type.getPropertyMembers().get(prop.getName())));
- assertTrue(prop.isMany());
- }
-
- @Test
- public void testMultiplicityArrayMethod() throws Exception {
- processor.visitMethod(Multiple.class.getMethod("setRefs3", String[].class), type);
- org.apache.tuscany.sca.assembly.Property prop = getProperty(type, "refs3");
- assertNotNull(prop);
- assertSame(String.class, getBaseType(type.getPropertyMembers().get(prop.getName())));
- assertTrue(prop.isMany());
- }
-
- @Test
- public void testMultiplicityCollectionMethod() throws Exception {
- processor.visitMethod(Multiple.class.getMethod("setRefs4", Collection.class), type);
- org.apache.tuscany.sca.assembly.Property prop = getProperty(type, "refs4");
- assertNotNull(prop);
- assertSame(String.class, getBaseType(type.getPropertyMembers().get(prop.getName())));
- assertTrue(prop.isMany());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessorTestCase.java
deleted file mode 100644
index 1c061bfd43..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessorTestCase.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.impl.ModelHelper.getReference;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ReferenceProcessorTestCase {
-
- private JavaImplementation type;
- private ReferenceProcessor processor;
-
- @Test
- public void testMethodAnnotation() throws Exception {
- processor.visitMethod(ReferenceProcessorTestCase.Foo.class.getMethod("setFoo", Ref.class), type);
- org.apache.tuscany.sca.assembly.Reference reference = getReference(type, "foo");
- assertNotNull(reference);
- assertEquals(Ref.class, ((JavaInterface)reference.getInterfaceContract().getInterface()).getJavaClass());
- }
-
- @Test
- public void testMethodRequired() throws Exception {
- processor.visitMethod(ReferenceProcessorTestCase.Foo.class.getMethod("setFooRequired", Ref.class), type);
- org.apache.tuscany.sca.assembly.Reference ref = getReference(type, "fooRequired");
- assertNotNull(ref);
- assertEquals(Multiplicity.ONE_ONE, ref.getMultiplicity());
- }
-
- @Test
- public void testMethodName() throws Exception {
- processor.visitMethod(ReferenceProcessorTestCase.Foo.class.getMethod("setBarMethod", Ref.class), type);
- assertNotNull(getReference(type, "bar"));
- }
-
- @Test
- public void testFieldAnnotation() throws Exception {
- processor.visitField(ReferenceProcessorTestCase.Foo.class.getDeclaredField("baz"), type);
- org.apache.tuscany.sca.assembly.Reference reference = getReference(type, "baz");
- assertNotNull(reference);
- assertEquals(Ref.class, ((JavaInterface)reference.getInterfaceContract().getInterface()).getJavaClass());
- }
-
- @Test
- public void testFieldRequired() throws Exception {
- processor.visitField(ReferenceProcessorTestCase.Foo.class.getDeclaredField("bazRequired"), type);
- org.apache.tuscany.sca.assembly.Reference ref = getReference(type, "bazRequired");
- assertNotNull(ref);
- assertEquals(Multiplicity.ONE_ONE, ref.getMultiplicity());
- }
-
- @Test
- public void testFieldName() throws Exception {
- processor.visitField(ReferenceProcessorTestCase.Foo.class.getDeclaredField("bazField"), type);
- assertNotNull(getReference(type, "theBaz"));
- }
-
- @Test
- public void testDuplicateFields() throws Exception {
- processor.visitField(ReferenceProcessorTestCase.Bar.class.getDeclaredField("dup"), type);
- try {
- processor.visitField(ReferenceProcessorTestCase.Bar.class.getDeclaredField("baz"), type);
- fail();
- } catch (DuplicateReferenceException e) {
- // expected
- }
- }
-
- @Test
- public void testDuplicateMethods() throws Exception {
- processor.visitMethod(ReferenceProcessorTestCase.Bar.class.getMethod("setDupMethod", Ref.class), type);
- try {
- processor.visitMethod(ReferenceProcessorTestCase.Bar.class.getMethod("setDupSomeMethod", Ref.class), type);
- fail();
- } catch (DuplicateReferenceException e) {
- // expected
- }
- }
-
- @Test
- public void testInvalidProperty() throws Exception {
- try {
- processor.visitMethod(ReferenceProcessorTestCase.Bar.class.getMethod("badMethod"), type);
- fail();
- } catch (IllegalReferenceException e) {
- // expected
- }
- }
-
- @Before
- public void setUp() throws Exception {
- JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
- type = javaImplementationFactory.createJavaImplementation();
- processor = new ReferenceProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory());
- }
-
- private interface Ref {
- }
-
- private class Foo {
-
- @Reference
- protected Ref baz;
- @Reference(required = true)
- protected Ref bazRequired;
- @Reference(name = "theBaz")
- protected Ref bazField;
-
- @Reference
- public void setFoo(Ref ref) {
- }
-
- @Reference(required = true)
- public void setFooRequired(Ref ref) {
- }
-
- @Reference(name = "bar")
- public void setBarMethod(Ref ref) {
- }
-
- }
-
- private class Bar {
-
- @Reference
- protected Ref dup;
-
- @Reference(name = "dup")
- protected Ref baz;
-
- @Reference
- public void setDupMethod(Ref s) {
- }
-
- @Reference(name = "dupMethod")
- public void setDupSomeMethod(Ref s) {
- }
-
- @Reference
- public void badMethod() {
- }
-
- }
-
- private class Multiple {
- @Reference(required = true)
- protected List<Ref> refs1;
-
- @Reference(required = false)
- protected Ref[] refs2;
-
- @Reference(required = true)
- public void setRefs3(Ref[] refs) {
- }
-
- @Reference(required = false)
- public void setRefs4(Collection<Ref> refs) {
- }
-
- }
-
- @Test
- public void testMultiplicity1ToN() throws Exception {
- processor.visitField(Multiple.class.getDeclaredField("refs1"), type);
- org.apache.tuscany.sca.assembly.Reference ref = getReference(type, "refs1");
- assertNotNull(ref);
- assertSame(Ref.class, ((JavaInterface)ref.getInterfaceContract().getInterface()).getJavaClass());
- assertEquals(Multiplicity.ONE_N, ref.getMultiplicity());
- // assertEquals(Multiplicity.ONE_ONE, ref.getMultiplicity());
- }
-
- @Test
- public void testMultiplicityTo0ToN() throws Exception {
- processor.visitField(Multiple.class.getDeclaredField("refs2"), type);
- org.apache.tuscany.sca.assembly.Reference ref = getReference(type, "refs2");
- assertNotNull(ref);
- assertSame(Ref.class, ((JavaInterface)ref.getInterfaceContract().getInterface()).getJavaClass());
- assertEquals(Multiplicity.ZERO_N, ref.getMultiplicity());
- // assertFalse(ref.isMustSupply());
- }
-
- @Test
- public void testMultiplicity1ToNMethod() throws Exception {
- processor.visitMethod(Multiple.class.getMethod("setRefs3", Ref[].class), type);
- org.apache.tuscany.sca.assembly.Reference ref = getReference(type, "refs3");
- assertNotNull(ref);
- assertSame(Ref.class, ((JavaInterface)ref.getInterfaceContract().getInterface()).getJavaClass());
- assertEquals(Multiplicity.ONE_N, ref.getMultiplicity());
- // assertEquals(Multiplicity.ONE_ONE, ref.getMultiplicity());
- }
-
- @Test
- public void testMultiplicity0ToNMethod() throws Exception {
- processor.visitMethod(Multiple.class.getMethod("setRefs4", Collection.class), type);
- org.apache.tuscany.sca.assembly.Reference ref = getReference(type, "refs4");
- assertNotNull(ref);
- assertSame(Ref.class, ((JavaInterface)ref.getInterfaceContract().getInterface()).getJavaClass());
- assertEquals(Multiplicity.ZERO_N, ref.getMultiplicity());
- // assertFalse(ref.isMustSupply());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ResourceProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ResourceProcessorTestCase.java
deleted file mode 100644
index c09b0547c9..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ResourceProcessorTestCase.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaResourceImpl;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ResourceProcessorTestCase {
-
- JavaImplementation type;
- ResourceProcessor processor = new ResourceProcessor(new DefaultAssemblyFactory());
-
- @Test
- public void testVisitField() throws Exception {
- Field field = Foo.class.getDeclaredField("bar");
- processor.visitField(field, type);
- JavaResourceImpl resource = type.getResources().get("bar");
- assertFalse(resource.isOptional());
- assertNull(resource.getMappedName());
- assertEquals(field.getType(), resource.getElement().getType());
- }
-
- @Test
- public void testVisitMethod() throws Exception {
- Method method = Foo.class.getMethod("setBar", Bar.class);
- processor.visitMethod(method, type);
- JavaResourceImpl resource = type.getResources().get("bar");
- assertFalse(resource.isOptional());
- assertNull(resource.getMappedName());
- assertEquals(method.getParameterTypes()[0], resource.getElement().getType());
- }
-
- @Test
- public void testVisitNamedMethod() throws Exception {
- Method method = Foo.class.getMethod("setBar2", Bar.class);
- processor.visitMethod(method, type);
- JavaResourceImpl resource = type.getResources().get("someName");
- assertFalse(resource.isOptional());
- assertEquals("mapped", resource.getMappedName());
- }
-
- @Test
- public void testVisitBadMethod() throws Exception {
- Method method = Foo.class.getMethod("setBad");
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalResourceException e) {
- // expected
- }
- }
-
- @Test
- public void testDuplicateResources() throws Exception {
- Field field = Foo.class.getDeclaredField("bar");
- processor.visitField(field, type);
- try {
- processor.visitField(field, type);
- fail();
- } catch (DuplicateResourceException e) {
- //expected
- }
- }
-
- @Before
- public void setUp() throws Exception {
- JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
- type = javaImplementationFactory.createJavaImplementation();
- }
-
- private class Foo {
-
- @org.apache.tuscany.sca.implementation.java.introspect.impl.Resource
- protected Bar bar;
-
- @org.apache.tuscany.sca.implementation.java.introspect.impl.Resource(optional = true)
- protected Bar barNotRequired;
-
- @org.apache.tuscany.sca.implementation.java.introspect.impl.Resource
- public void setBar(Bar bar) {
- }
-
- @org.apache.tuscany.sca.implementation.java.introspect.impl.Resource(name = "someName", mappedName = "mapped")
- public void setBar2(Bar bar) {
- }
-
- @org.apache.tuscany.sca.implementation.java.introspect.impl.Resource
- public void setBad() {
- }
-
- }
-
- private interface Bar {
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessorTestCase.java
deleted file mode 100644
index fe5eee55de..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessorTestCase.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-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.JavaScopeImpl;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ScopeProcessorTestCase {
-
- private JavaImplementationFactory javaImplementationFactory;
-
- @Test
- public void testCompositeScope() throws IntrospectionException {
- ScopeProcessor processor = new ScopeProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
-
- processor.visitClass(Composite.class, type);
- assertEquals(JavaScopeImpl.COMPOSITE, type.getJavaScope());
- }
-
- @Test
- public void testSessionScope() throws IntrospectionException {
- ScopeProcessor processor = new ScopeProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(Session.class, type);
- assertEquals(JavaScopeImpl.SESSION, type.getJavaScope());
- }
-
- @Test
- public void testConversationalScope() throws IntrospectionException {
- ScopeProcessor processor = new ScopeProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(Conversation.class, type);
- assertEquals(JavaScopeImpl.CONVERSATION, type.getJavaScope());
- }
-
- @Test
- public void testRequestScope() throws IntrospectionException {
- ScopeProcessor processor = new ScopeProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(Request.class, type);
- assertEquals(JavaScopeImpl.REQUEST, type.getJavaScope());
- }
-
- @Test
- public void testStatelessScope() throws IntrospectionException {
- ScopeProcessor processor = new ScopeProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(Stateless.class, type);
- assertEquals(JavaScopeImpl.STATELESS, type.getJavaScope());
- }
-
- @Test
- public void testNoScope() throws IntrospectionException {
- ScopeProcessor processor = new ScopeProcessor(new DefaultAssemblyFactory());
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(None.class, type);
- assertEquals(JavaScopeImpl.STATELESS, type.getJavaScope());
- }
-
- @Before
- public void setUp() throws Exception {
- javaImplementationFactory = new DefaultJavaImplementationFactory();
- }
-
- @org.oasisopen.sca.annotation.Scope("COMPOSITE")
- private class Composite {
- }
-
- @org.oasisopen.sca.annotation.Scope("SESSION")
- private class Session {
- }
-
- @org.oasisopen.sca.annotation.Scope("CONVERSATION")
- private class Conversation {
- }
-
- @org.oasisopen.sca.annotation.Scope("REQUEST")
- private class Request {
- }
-
- @org.oasisopen.sca.annotation.Scope("STATELESS")
- private class Stateless {
- }
-
- private class None {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceCallbackTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceCallbackTestCase.java
deleted file mode 100644
index 32988b2768..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceCallbackTestCase.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.impl.ModelHelper.getService;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-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.interfacedef.InvalidCallbackException;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ServiceCallbackTestCase {
- private ServiceProcessor processor;
- private JavaImplementationFactory javaImplementationFactory;
-
- @Before
- public void setUp() throws Exception {
- processor = new ServiceProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory());
- javaImplementationFactory = new DefaultJavaImplementationFactory();
- }
-
- @Test
- public void testMethodCallbackInterface() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(FooImpl.class, type);
- org.apache.tuscany.sca.assembly.Service service = getService(type, Foo.class.getSimpleName());
- assertNotNull(service);
- Method method = FooImpl.class.getMethod("setCallback", FooCallback.class);
- processor.visitMethod(method, type);
- assertEquals(method, type.getCallbackMembers().get(FooCallback.class.getName()).iterator().next().getAnchor());
- }
-
- @Test
- public void testFieldCallbackInterface() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(FooImpl.class, type);
- org.apache.tuscany.sca.assembly.Service service = getService(type, Foo.class.getSimpleName());
- assertNotNull(service);
- Field field = FooImpl.class.getDeclaredField("callback");
- processor.visitField(field, type);
- assertEquals(field, type.getCallbackMembers().get(FooCallback.class.getName()).iterator().next().getAnchor());
- }
-
- @Test
- public void testFieldCallbackInterface1() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(FooImpl1.class, type);
- org.apache.tuscany.sca.assembly.Service service = getService(type, Foo.class.getSimpleName());
- assertNotNull(service);
- Field field1 = FooImpl1.class.getDeclaredField("callbackRef");
- processor.visitField(field1, type);
- assertEquals(field1, type.getCallbackMembers().get(FooCallback.class.getName()).iterator().next().getAnchor());
-
- }
-
- @Test
- public void testMethodDoesNotMatchCallback() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(BadBarImpl.class, type);
- Method method = BadBarImpl.class.getMethod("setWrongInterfaceCallback", String.class);
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalCallbackReferenceException e) {
- // expected
- }
- }
-
- @Test
- public void testNoParamCallback() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(BadBarImpl.class, type);
- Method method = BadBarImpl.class.getMethod("setNoParamCallback");
- try {
- processor.visitMethod(method, type);
- fail();
- } catch (IllegalCallbackReferenceException e) {
- // expected
- }
- }
-
- @Test
- public void testFieldDoesNotMatchCallback() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- processor.visitClass(BadBarImpl.class, type);
- Field field = BadBarImpl.class.getDeclaredField("wrongInterfaceCallback");
- try {
- processor.visitField(field, type);
- fail();
- } catch (IllegalCallbackReferenceException e) {
- // expected
- }
- }
-
- @Test
- public void testBadCallbackInterfaceAnnotation() throws Exception {
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- try {
- processor.visitClass(BadFooImpl.class, type);
- fail();
- } catch (IntrospectionException e) {
- // expected
- assertTrue(e.getCause() instanceof InvalidCallbackException);
- }
- }
-
- @Callback(FooCallback.class)
- private interface Foo {
-
- }
-
- private interface FooCallback {
-
- }
-
- @Service(Foo.class)
- private static class FooImpl implements Foo {
-
- @Callback
- protected FooCallback callback;
-
- @Callback
- public void setCallback(FooCallback cb) {
-
- }
- }
-
- @Service(Foo.class)
- private static class FooImpl1 implements Foo {
- @Callback
- protected CallableReference<FooCallback> callbackRef;
- }
-
- private static class BadBarImpl implements Foo {
- @Callback
- protected String wrongInterfaceCallback;
-
- @Callback
- public void setWrongInterfaceCallback(String cb) {
-
- }
-
- @Callback
- public void setNoParamCallback() {
-
- }
-
- }
-
- @Callback
- private interface BadFoo {
-
- }
-
- @Service(BadFoo.class)
- private static class BadFooImpl implements BadFoo {
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
deleted file mode 100644
index 528639a008..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.introspect.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import javax.jws.WebService;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Remotable;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ServiceProcessorTestCase {
- private ServiceProcessor processor;
- private JavaImplementation type;
-
- @Test
- public void testMultipleInterfaces() throws Exception {
- processor.visitClass(FooMultiple.class, type);
- assertEquals(2, type.getServices().size());
- org.apache.tuscany.sca.assembly.Service service = ModelHelper.getService(type, Baz.class.getSimpleName());
- assertEquals(Baz.class, ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass());
- assertEquals(Bar.class, ((JavaInterface)service.getInterfaceContract().getCallbackInterface()).getJavaClass());
- assertNotNull(ModelHelper.getService(type, Bar.class.getSimpleName()));
- }
-
- @Test
- public void testSingleInterfaces() throws Exception {
- processor.visitClass(FooSingle.class, type);
- assertEquals(1, type.getServices().size());
- assertNotNull(ModelHelper.getService(type, Baz.class.getSimpleName()));
- }
-
- @Test
- public void testMultipleNoService() throws Exception {
- processor.visitClass(FooMultipleNoService.class, type);
- assertEquals(0, type.getServices().size());
- }
-
- /**
- * Verifies a service with a callback annotation is recognized
- */
- @Test
- public void testMultipleWithCallbackAnnotation() throws Exception {
- processor.visitClass(FooMultipleWithCalback.class, type);
- assertEquals(1, type.getServices().size());
- }
-
-
- @Test
- public void testMultipleWithWebServiceAnnotation() throws Exception {
- processor.visitClass(FooMultipleWithWebService.class, type);
- assertEquals(2, type.getServices().size());
- }
-
- @Test
- public void testRemotableNoService() throws Exception {
- processor.visitClass(FooRemotableNoService.class, type);
- assertEquals(1, type.getServices().size());
- org.apache.tuscany.sca.assembly.Service service = ModelHelper.getService(type, BazRemotable.class.getSimpleName());
- assertEquals(BazRemotable.class, ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass());
- }
-
- @Test
- public void testNonInterface() throws Exception {
- processor.visitClass(FooServiceUsingClassImpl.class, type);
- }
-
- @Test
- public void testNoInterfaces() throws Exception {
- try {
- processor.visitClass(BadDefinition.class, type);
- } catch (IllegalServiceDefinitionException e) {
- //not expected
- fail();
- }
- }
-
- @Before
- public void setUp() throws Exception {
- processor = new ServiceProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory());
- JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
- type = javaImplementationFactory.createJavaImplementation();
- }
-
- @Callback(Bar.class)
- private interface Baz {
- }
-
- private interface Bar {
- }
-
- private interface Bar2 {
- }
-
- @WebService
- private interface Bar3 {
- }
-
- @Remotable
- private interface BazRemotable {
- }
-
- @Service(interfaces = {Baz.class, Bar.class})
- private class FooMultiple implements Baz, Bar {
-
- }
-
- @Service(Baz.class)
- private class FooSingle implements Baz, Bar {
-
- }
-
- private class FooMultipleNoService implements Bar, Bar2 {
-
- }
-
- private class FooMultipleWithCalback implements Baz, Bar {
-
- }
-
- private class FooMultipleWithWebService implements BazRemotable, Bar3 {
- }
-
- private class FooRemotableNoService implements BazRemotable, Bar {
-
- }
-
- @Service(FooSingle.class)
- private class FooServiceUsingClassImpl extends FooSingle {
-
- }
-
-
- @Service()
- private class BadDefinition extends FooSingle {
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/TestAbstractPropertyProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/TestAbstractPropertyProcessorTestCase.java
deleted file mode 100644
index 3b56d146a4..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/TestAbstractPropertyProcessorTestCase.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.introspect.impl;
-
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static org.apache.tuscany.sca.implementation.java.introspect.impl.ModelHelper.getProperty;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.lang.annotation.Retention;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor;
-import org.junit.Before;
-import org.junit.Test;
-
-
-/**
- * @version $Rev$ $Date$
- */
-public class TestAbstractPropertyProcessorTestCase {
-
- private JavaClassVisitor extension;
- private JavaImplementationFactory javaImplementationFactory;
-
- @Test
- public void testVisitMethod() throws Exception {
- Method method = Foo.class.getMethod("setBar", String.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- extension.visitMethod(method, type);
- Property prop = getProperty(type, "test");
- assertNotNull(prop);
- }
-
- @Test
- public void testVisitNoParamsMethod() throws Exception {
- Method method = Foo.class.getMethod("setNoParamsBar");
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- try {
- extension.visitMethod(method, type);
- fail();
- } catch (IllegalPropertyException e) {
- // expected
- }
- }
-
- @Test
- public void testVisitNonVoidMethod() throws Exception {
- Method method = Foo.class.getMethod("setBadBar", String.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- try {
- extension.visitMethod(method, type);
- fail();
- } catch (IllegalPropertyException e) {
- // expected
- }
- }
-
- @Test
- public void testDuplicateMethod() throws Exception {
- Method method = Foo.class.getMethod("setBar", String.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- extension.visitMethod(method, type);
- try {
- extension.visitMethod(method, type);
- fail();
- } catch (DuplicatePropertyException e) {
- // expected
- }
- }
-
- @Test
- public void testVisitField() throws Exception {
- Field field = Foo.class.getDeclaredField("d");
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- extension.visitField(field, type);
- Property prop = getProperty(type, "test");
- assertNotNull(prop);
- }
-
- @Test
- public void testVisitConstructor() throws Exception {
- Constructor<Foo> ctor = Foo.class.getConstructor(String.class);
- JavaImplementation type = javaImplementationFactory.createJavaImplementation();
- JavaConstructorImpl<Foo> def = new JavaConstructorImpl<Foo>(ctor);
- JavaParameterImpl parameter = def.getParameters()[0];
- extension.visitConstructorParameter(parameter, type);
- assertEquals("test", def.getParameters()[0].getName());
- assertNotNull(getProperty(type, "test"));
- }
-
- @Before
- public void setUp() throws Exception {
- extension = new TestProcessor();
- javaImplementationFactory = new DefaultJavaImplementationFactory();
- }
-
- @Retention(RUNTIME)
- private @interface Bar {
-
- }
-
- private class TestProcessor extends AbstractPropertyProcessor<Bar> {
-
- public TestProcessor() {
- super(new DefaultAssemblyFactory(), Bar.class);
- }
-
- @Override
- protected void initProperty(Property property, Bar annotation) {
- // property.setDefaultValueFactory(EasyMock.createMock(ObjectFactory.class));
- property.setName("test");
- }
-
- @Override
- protected String getName(Bar annotation) {
- return "test";
- }
- }
-
- private static class Foo {
-
- @Bar
- protected String d;
-
- public Foo(String a, @Bar
- String b) {
- }
-
- public Foo(@Bar
- String d) {
- this.d = d;
- }
-
- @Bar
- public void setBar(String d) {
- this.d = d;
- }
-
- @Bar
- public void setNoParamsBar() {
- }
-
- @Bar
- public String setBadBar(String d) {
- return null;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/LICENSE b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/META-INF/MANIFEST.MF
deleted file mode 100644
index 066332344b..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,36 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.implementation.node.launcher;us
- es:="org.apache.tuscany.sca.node,org.oasisopen.sca";version="2.0.0",org.apac
- he.tuscany.sca.implementation.node.webapp;uses:="org.apache.tuscany.s
- ca.implementation.node.launcher,org.apache.tuscany.sca.node,org.apach
- e.tuscany.sca.core,javax.servlet,org.apache.tuscany.sca.host.http,jav
- ax.servlet.http";version="2.0.0"
-Private-Package: org.apache.tuscany.sca.implementation.node.provider;v
- ersion="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Node Implementation Extension
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397409312
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Node Implementation Extension
-Import-Package: javax.servlet,
- javax.servlet.http,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.host.http;version="2.0.0",
- org.apache.tuscany.sca.implementation.node;version="2.0.0",
- org.apache.tuscany.sca.implementation.node.launcher;version="2.0.0",
- org.apache.tuscany.sca.implementation.node.webapp;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.node;version="2.0.0",
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.oasisopen.sca;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.implementation.node.runtim
- e
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/NOTICE b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/pom.xml b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/pom.xml
deleted file mode 100644
index 0cf1c3dd9a..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-node-runtime</artifactId>
- <name>Apache Tuscany SCA Node Implementation Model Runtime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationDaemonBootstrap.java b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationDaemonBootstrap.java
deleted file mode 100644
index 202514d89e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationDaemonBootstrap.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.node.launcher;
-
-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.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * Bootstrap class for the SCA node daemon.
- *
- * @version $Rev$ $Date$
- */
-public class NodeImplementationDaemonBootstrap {
- private Node node;
-
- /**
- * A node wrappering an instance of a node daemon.
- */
- public static class NodeFacade implements Node {
- private ClassLoader threadContextClassLoader;
- private ClassLoader runtimeClassLoader;
- private Node daemon;
-
- private NodeFacade() {
- runtimeClassLoader = Thread.currentThread().getContextClassLoader();
- }
-
- public void start() {
- threadContextClassLoader = Thread.currentThread().getContextClassLoader();
- boolean started = false;
- try {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- NodeFactory factory = NodeFactory.newInstance();
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- daemon = factory.createNode("NodeDaemon.composite", new Contribution("node-runtime", contribution));
- started = true;
- } finally {
- if (!started) {
- Thread.currentThread().setContextClassLoader(threadContextClassLoader);
- }
- }
- }
-
- public void stop() {
- try {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- daemon.stop();
- } finally {
- Thread.currentThread().setContextClassLoader(threadContextClassLoader);
- }
- }
-
- public void destroy() {
- try {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- daemon.destroy();
- } finally {
- Thread.currentThread().setContextClassLoader(threadContextClassLoader);
- }
- }
-
- public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
- throw new UnsupportedOperationException();
- }
-
- public <B> B getService(Class<B> businessInterface, String serviceName) {
- throw new UnsupportedOperationException();
- }
-
- public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String serviceName) {
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * Constructs a new daemon bootstrap.
- */
- public NodeImplementationDaemonBootstrap() throws Exception {
- node = new NodeFacade();
- }
-
- /**
- * Returns the node representing the daemon.
- * @return
- */
- public Node getNode() {
- return node;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherBootstrap.java b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherBootstrap.java
deleted file mode 100644
index 2daab36796..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherBootstrap.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.node.launcher;
-
-import org.apache.tuscany.sca.node.Client;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * Bootstrap class for standalone SCA nodes.
- *
- * @version $Rev$ $Date$
- */
-public class NodeImplementationLauncherBootstrap {
-
- private Node node;
-
- /**
- * A node facade.
- */
- public static class NodeFacade implements Node, Client {
- private ClassLoader threadContextClassLoader;
- private ClassLoader runtimeClassLoader;
- private Node delegate;
-
- private NodeFacade(Node delegate) {
- runtimeClassLoader = Thread.currentThread().getContextClassLoader();
- this.delegate = delegate;
- }
-
- public void start() {
- threadContextClassLoader = Thread.currentThread().getContextClassLoader();
- boolean started = false;
- try {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- delegate.start();
- started = true;
- } finally {
- if (!started) {
- Thread.currentThread().setContextClassLoader(threadContextClassLoader);
- }
- }
- }
-
- public void stop() {
- try {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- delegate.stop();
- } finally {
- Thread.currentThread().setContextClassLoader(threadContextClassLoader);
- }
- }
-
- public void destroy() {
- try {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- delegate.destroy();
- } finally {
- Thread.currentThread().setContextClassLoader(threadContextClassLoader);
- }
- }
-
- public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
- return (R)((Client)delegate).cast(target);
- }
-
- public <B> B getService(Class<B> businessInterface, String serviceName) {
- return (B)((Client)delegate).getService(businessInterface, serviceName);
- }
-
- public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName) {
- return (ServiceReference<B>)((Client)delegate).getServiceReference(businessInterface, referenceName);
- }
- }
-
- /**
- * Bootstrap a new SCA node.
- *
- * @param configurationURI
- */
- public NodeImplementationLauncherBootstrap(String configurationURI) throws Exception {
- NodeFactory nodeFactory = NodeFactory.newInstance();
- node = new NodeFacade(nodeFactory.createNode(configurationURI));
- }
-
- /**
- * Bootstrap a new SCA node.
- *
- * @param compositeURI
- * @param uris
- * @param locations
- */
- public NodeImplementationLauncherBootstrap(String compositeURI, String[] uris, String[] locations) throws Exception {
- NodeFactory nodeFactory = NodeFactory.newInstance();
- Contribution[] contributions = new Contribution[uris.length];
- for (int i = 0; i < uris.length; i++) {
- contributions[i] = new Contribution(uris[i], locations[i]);
- }
- node = new NodeFacade(nodeFactory.createNode(compositeURI, contributions));
- }
-
- /**
- * Bootstrap a new SCA node.
- *
- * @param compositeURI
- * @param uris
- * @param locations
- */
- public NodeImplementationLauncherBootstrap(String compositeURI, String compositeContent, String[] uris, String[] locations) throws Exception {
- NodeFactory nodeFactory = NodeFactory.newInstance();
- Contribution[] contributions = new Contribution[uris.length];
- for (int i = 0; i < uris.length; i++) {
- contributions[i] = new Contribution(uris[i], locations[i]);
- }
- node = new NodeFacade(nodeFactory.createNode(compositeURI, compositeContent, contributions));
- }
-
- /**
- * Returns the SCA node.
- *
- * @return
- */
- public Node getNode() {
- return node;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherUtil.java b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherUtil.java
deleted file mode 100644
index 62a822a85e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherUtil.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.node.launcher;
-
-/**
- * Utility methods for node implementation launchers.
- *
- * @version $Rev$ $Date$
- */
-public class NodeImplementationLauncherUtil {
-
- private static final String TUSCANY_DOMAIN = "TUSCANY_DOMAIN";
- private static final String DEFAULT_DOMAIN = "http://localhost:9990";
-
- /**
- * Determine the URI of a node configuration. The domain URI can be configured
- * using a TUSCANY_DOMAIN system property or environment variable.
- *
- * @param nodeName
- * @return
- */
- public static String nodeConfigurationURI(String nodeName) {
- String domain = System.getProperty(TUSCANY_DOMAIN);
- if (domain == null || domain.length() == 0) {
- domain = System.getenv(TUSCANY_DOMAIN);
- }
- if (domain == null || domain.length() ==0) {
- domain = DEFAULT_DOMAIN;
- }
- String nodeConfiguration = domain + "/node-config/" + nodeName;
- return nodeConfiguration;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationInvoker.java b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationInvoker.java
deleted file mode 100644
index 5895a8614d..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationInvoker.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.node.provider;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-/**
- * Implements an invoker for node component implementations.
- *
- * @version $Rev$ $Date$
- */
-class NodeImplementationInvoker implements Invoker {
- private Composite composite;
-
- NodeImplementationInvoker(Composite composite) {
- this.composite = composite;
- }
-
- public Message invoke(Message msg) {
- //FIXME Implement later
- msg.setBody(composite);
- return msg;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationProvider.java b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationProvider.java
deleted file mode 100644
index 6cdb18938e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationProvider.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.node.provider;
-
-import org.apache.tuscany.sca.implementation.node.NodeImplementation;
-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;
-
-/**
- * An implementation provider for node component implementations.
- *
- * @version $Rev$ $Date$
- */
-class NodeImplementationProvider implements ImplementationProvider {
-
- private NodeImplementation implementation;
-
- /**
- * Constructs a new node implementation provider.
- *
- * @param component
- * @param implementation
- */
- NodeImplementationProvider(RuntimeComponent component, NodeImplementation implementation) {
- this.implementation = implementation;
- }
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- NodeImplementationInvoker invoker = new NodeImplementationInvoker(implementation.getComposite());
- return invoker;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationProviderFactory.java b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationProviderFactory.java
deleted file mode 100644
index e2a3e4df92..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/provider/NodeImplementationProviderFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.node.provider;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.node.NodeImplementation;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * Factory for node component implementation providers.
- *
- * @version $Rev$ $Date$
- */
-public class NodeImplementationProviderFactory implements ImplementationProviderFactory<NodeImplementation> {
-
- /**
- * Constructs a new factory.
- *
- * @param extensionPoints
- */
- public NodeImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component, NodeImplementation implementation) {
- return new NodeImplementationProvider(component, implementation);
- }
-
- public Class<NodeImplementation> getModelType() {
- return NodeImplementation.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppRequestDispatcher.java b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppRequestDispatcher.java
deleted file mode 100644
index f6a601a3cd..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppRequestDispatcher.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.node.webapp;
-
-import java.io.IOException;
-import java.util.StringTokenizer;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-
-/**
- * A Servlet request dispatcher that can be used to delegate requests to a
- * Serlvet registered with the Webapp Servlet host.
- *
- * @version $Rev$ $Date$
- */
-class NodeWebAppRequestDispatcher implements RequestDispatcher {
- private String servletPath;
- private Servlet servlet;
-
- /**
- * Constructs a new request dispatcher.
- *
- * @param mapping
- * @param servlet
- */
- public NodeWebAppRequestDispatcher(String mapping, Servlet servlet) {
- if (mapping.endsWith("*")) {
- mapping = mapping.substring(0, mapping.length()-1);
- }
- if (mapping.endsWith("/")) {
- mapping = mapping.substring(0, mapping.length()-1);
- }
- this.servletPath = mapping;
- this.servlet = servlet;
- }
-
- /**
- * Returns a request wrapper which will return the correct Servlet path
- * and path info.
- *
- * @param request
- * @return
- */
- private HttpServletRequest createRequestWrapper(ServletRequest request) {
- HttpServletRequest requestWrapper = new HttpServletRequestWrapper((HttpServletRequest)request) {
-
- @Override
- public String getServletPath() {
- return servletPath;
- }
-
- @Override
- public String getPathInfo() {
- String path = super.getServletPath();
- if (path.length() == 0) {
- path = super.getPathInfo();
- }
-
- // TODO: another context path hack, revisit when context path is sorted out
- path = fiddlePath(path, servletPath);
-
- return path;
- }
- };
- return requestWrapper;
- }
-
- /**
- * Remove any path suffix thats part of the Servlet context path.
- *
- * @param path
- * @param servletPath
- */
- private static String fiddlePath(String path, String servletPath) {
- StringTokenizer st = new StringTokenizer(path, "/");
- String root = "";
- while (st.hasMoreTokens()){
- String s = st.nextToken();
- if (servletPath.endsWith((root + "/" + s))) {
- root += "/" + s;
- } else {
- break;
- }
- }
- String fiddlePath = path.substring(root.length());
- return fiddlePath;
- }
-
- public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException {
- servlet.service(createRequestWrapper(request), response);
- }
-
- public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException {
- servlet.service(createRequestWrapper(request), response);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppServletHost.java b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppServletHost.java
deleted file mode 100644
index 43c91ac9af..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppServletHost.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.node.webapp;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterConfig;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-
-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.host.http.ServletMappingException;
-import org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherUtil;
-import org.apache.tuscany.sca.node.Client;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * ServletHost implementation for use in a Webapp Node environment.
- *
- * @version $Rev$ $Date$
- */
-public class NodeWebAppServletHost implements ServletHost, Filter {
- private static final Logger logger = Logger.getLogger(NodeWebAppServletHost.class.getName());
-
- private static final NodeWebAppServletHost servletHost = new NodeWebAppServletHost();
-
- private Map<String, Servlet> servlets = new HashMap<String, Servlet>();
- private Node node;
-
- private String contextPath = "/";
- private int defaultPort = 8080;
-
- /**
- * Constructs a new NodeWebAppServletHost.
- */
- private NodeWebAppServletHost() {
- }
-
- /**
- * Returns the Servlet host for the current Web app.
- *
- * @return
- */
- public static NodeWebAppServletHost servletHost() {
- return servletHost;
- }
-
- /**
- * Initialize the Servlet host.
- *
- * @param filterConfig
- * @throws ServletException
- */
- public void init(final FilterConfig filterConfig) throws ServletException {
-
- // Create a Servlet config wrapping the given filter config
- ServletConfig servletConfig = servletConfig(filterConfig);
-
- // Get the Servlet context
- ServletContext servletContext = servletConfig.getServletContext();
-
- // Initialize the context path
- contextPath = contextPath(servletContext);
-
- // Derive the node name from the Webapp context path
- String nodeName = contextPath;
- if (nodeName.startsWith("/")) {
- nodeName = nodeName.substring(1);
- }
- if (nodeName.endsWith("/")) {
- nodeName = nodeName.substring(0, nodeName.length() - 1);
- }
-
- // Determine the node configuration URI
- String nodeConfiguration = NodeImplementationLauncherUtil.nodeConfigurationURI(nodeName);
-
- // Create the SCA node
- NodeFactory nodeFactory = NodeFactory.newInstance();
- node = nodeFactory.createNode(nodeConfiguration);
-
- // Register the Servlet host
- ServletHostExtensionPoint servletHosts = servletHosts(node);
- servletHosts.getServletHosts().clear();
- servletHosts.addServletHost(servletHost);
-
- // Save the node in the Servlet context
- servletContext.setAttribute(Client.class.getName(), node);
-
- // Start the node
- node.start();
-
- // Initialize the registered Servlets
- for (Servlet servlet : servlets.values()) {
- servlet.init(servletConfig);
- }
- }
-
- public void addServletMapping(String suri, Servlet servlet) throws ServletMappingException {
- URI pathURI = URI.create(suri);
-
- // Make sure that the path starts with a /
- suri = pathURI.getPath();
- if (!suri.startsWith("/")) {
- suri = '/' + suri;
- }
-
- if (!suri.startsWith(contextPath)) {
- suri = contextPath + suri;
- }
-
- // In a webapp just use the given path and ignore the host and port
- // as they are fixed by the Web container
- servlets.put(suri, servlet);
-
- logger.info("Added Servlet mapping: " + suri);
- }
-
- public Servlet removeServletMapping(String suri) throws ServletMappingException {
- URI pathURI = URI.create(suri);
-
- // Make sure that the path starts with a /
- suri = pathURI.getPath();
- if (!suri.startsWith("/")) {
- suri = '/' + suri;
- }
-
- if (!suri.startsWith(contextPath)) {
- suri = contextPath + suri;
- }
-
- // In a webapp just use the given path and ignore the host and port
- // as they are fixed by the Web container
- return servlets.remove(suri);
- }
-
- public Servlet getServletMapping(String suri) throws ServletMappingException {
- if (!suri.startsWith("/")) {
- suri = '/' + suri;
- }
-
- if (!suri.startsWith(contextPath)) {
- suri = contextPath + suri;
- }
-
- // Get the Servlet mapped to the given path
- Servlet servlet = servlets.get(suri);
- return servlet;
- }
-
- public URL getURLMapping(String suri) throws ServletMappingException {
- URI uri = URI.create(suri);
-
- // Get the URI scheme and port
- String scheme = uri.getScheme();
- if (scheme == null) {
- scheme = "http";
- }
- int portNumber = uri.getPort();
- if (portNumber == -1) {
- portNumber = defaultPort;
- }
-
- // Get the host
- String host;
- try {
- host = InetAddress.getLocalHost().getHostName();
- } catch (UnknownHostException e) {
- host = "localhost";
- }
-
- // Construct the URL
- String path = uri.getPath();
- if (!path.startsWith("/")) {
- path = '/' + path;
- }
-
- if (contextPath != null && !path.startsWith(contextPath)) {
- path = contextPath + path;
- }
-
- URL url;
- try {
- url = new URL(scheme, host, portNumber, path);
- } catch (MalformedURLException e) {
- throw new ServletMappingException(e);
- }
- return url;
- }
-
- public RequestDispatcher getRequestDispatcher(String suri) throws ServletMappingException {
-
- // Make sure that the path starts with a /
- if (!suri.startsWith("/")) {
- suri = '/' + suri;
- }
-
- suri = contextPath + suri;
-
- // Get the Servlet mapped to the given path
- Servlet servlet = servlets.get(suri);
- if (servlet != null) {
- return new NodeWebAppRequestDispatcher(suri, servlet);
- }
-
- for (Map.Entry<String, Servlet> entry : servlets.entrySet()) {
- String servletPath = entry.getKey();
- if (servletPath.endsWith("*")) {
- servletPath = servletPath.substring(0, servletPath.length() - 1);
- if (suri.startsWith(servletPath)) {
- return new NodeWebAppRequestDispatcher(entry.getKey(), entry.getValue());
- } else {
- if ((suri + "/").startsWith(servletPath)) {
- return new NodeWebAppRequestDispatcher(entry.getKey(), entry.getValue());
- }
- }
- }
- }
-
- // No Servlet found
- return null;
- }
-
- /**
- * Destroy the Servlet host.
- *
- * @throws ServletException
- */
- public void destroy() {
-
- // Destroy the registered Servlets
- for (Servlet servlet : servlets.values()) {
- servlet.destroy();
- }
-
- // Stop the node
- if (node != null) {
- node.stop();
- }
- }
-
- public void doFilter(ServletRequest request, ServletResponse response, javax.servlet.FilterChain chain)
- throws IOException, ServletException {
-
- // Get the Servlet path
- HttpServletRequest httpRequest = (HttpServletRequest)request;
- String path = httpRequest.getPathInfo();
- if (path == null) {
- path = httpRequest.getServletPath();
- }
- if (path == null) {
- path = "/";
- }
-
- // Get a request dispatcher for the Servlet mapped to that path
- RequestDispatcher dispatcher = getRequestDispatcher(path);
- if (dispatcher != null) {
-
- // Let the dispatcher forward the request to the Servlet
- dispatcher.forward(request, response);
-
- } else {
-
- // Proceed down the filter chain
- chain.doFilter(request, response);
- }
- }
-
- public void setDefaultPort(int port) {
- defaultPort = port;
- }
-
- public int getDefaultPort() {
- return defaultPort;
- }
-
- public String getContextPath() {
- return contextPath;
- }
-
- public void setContextPath(String path) {
- //this.contextPath = path;
- }
-
- /**
- * Initializes the contextPath
- * The 2.5 Servlet API has a getter for this, for pre 2.5 Servlet
- * containers use an init parameter.
- */
- private static String contextPath(ServletContext context) {
- String contextPath = "/";
-
- // The getContextPath() is introduced since Servlet 2.5
- Method m;
- try {
- // Try to get the method anyway since some ServletContext impl has this method even before 2.5
- m = context.getClass().getMethod("getContextPath", new Class[] {});
- contextPath = (String)m.invoke(context, new Object[] {});
- } catch (Exception e) {
- contextPath = context.getInitParameter("contextPath");
- if (contextPath == null) {
- logger.warning("Servlet level is: " + context.getMajorVersion() + "." + context.getMinorVersion());
- throw new IllegalStateException(
- "'contextPath' init parameter must be set for pre-2.5 servlet container");
- }
- }
-
- logger.info("ContextPath: " + contextPath);
- return contextPath;
- }
-
- /**
- * Returns the Servlet host extension point used by the given node.
- *
- * @return
- */
- private static ServletHostExtensionPoint servletHosts(Node node) {
- //FIXME Need a clean way to get the extension point registry
- // from the node
- ExtensionPointRegistry registry;
- try {
- registry = (ExtensionPointRegistry)node.getClass().getMethod("getExtensionPointRegistry").invoke(node);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- ServletHostExtensionPoint servletHosts = registry.getExtensionPoint(ServletHostExtensionPoint.class);
- return servletHosts;
- }
-
- /**
- * Returns a Servlet config wrapping a filter config.
- *
- * @param filterConfig
- * @return
- */
- private static ServletConfig servletConfig(final FilterConfig filterConfig) {
- ServletConfig servletConfig = new ServletConfig() {
- public String getInitParameter(String name) {
- return filterConfig.getInitParameter(name);
- }
-
- public Enumeration getInitParameterNames() {
- return filterConfig.getInitParameterNames();
- }
-
- public ServletContext getServletContext() {
- return filterConfig.getServletContext();
- }
-
- public String getServletName() {
- return filterConfig.getFilterName();
- }
- };
- return servletConfig;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index 306b53be5b..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the implementation extension
-org.apache.tuscany.sca.implementation.node.provider.NodeImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.node.NodeImplementation
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/java/org/apache/tuscany/sca/implementation/node/NodeImplementationTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/java/org/apache/tuscany/sca/implementation/node/NodeImplementationTestCase.java
deleted file mode 100644
index 6845dd679c..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/java/org/apache/tuscany/sca/implementation/node/NodeImplementationTestCase.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.node;
-
-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.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test case for node component implementations.
- *
- * @version $Rev$ $Date$
- */
-public class NodeImplementationTestCase {
-
- private Node node;
-
- @Before
- public void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode("TestNode.composite", new Contribution("test", contribution));
- node.start();
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-
- @Test
- public void testNode() {
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/resources/TestComposite.composite b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/resources/TestComposite.composite
deleted file mode 100644
index 55644c27e5..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/resources/TestComposite.composite
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/composite"
- xmlns:sc="http://sample/composite"
- name="TestComposite">
-
- <component name="TestComponent">
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/resources/TestNode.composite b/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/resources/TestNode.composite
deleted file mode 100644
index d4dc62a42d..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node-runtime/src/test/resources/TestNode.composite
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/node"
- xmlns:sc="http://sample/composite"
- name="TestNode">
-
- <component name="TestNode">
- <tuscany:implementation.node uri="TestNode" composite="sc:TestComposite"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/LICENSE b/tags/java/sca/2.0-M1/modules/implementation-node/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/implementation-node/META-INF/MANIFEST.MF
deleted file mode 100644
index f89a513dc5..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,34 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.implementation.node;uses:="org.
- apache.tuscany.sca.assembly";version="2.0.0"
-Private-Package: org.apache.tuscany.sca.implementation.node.builder.im
- pl;version="2.0.0",org.apache.tuscany.sca.implementation.node.impl;vers
- ion="2.0.0",org.apache.tuscany.sca.implementation.node.xml;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Node Implementation Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397193593
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Node Implementation Model
-Import-Package: javax.xml.namespace,
- javax.xml.parsers,
- javax.xml.stream,
- javax.xml.transform,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.builder;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0",
- org.apache.tuscany.sca.implementation.node;version="2.0.0",
- org.apache.tuscany.sca.implementation.node.impl;resolution:=optional,
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0";resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.implementation.node
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/NOTICE b/tags/java/sca/2.0-M1/modules/implementation-node/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/pom.xml b/tags/java/sca/2.0-M1/modules/implementation-node/pom.xml
deleted file mode 100644
index 21ea4e3c30..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/pom.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-node</artifactId>
- <name>Apache Tuscany SCA Node Implementation Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca-xml</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/ConfiguredNodeImplementation.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/ConfiguredNodeImplementation.java
deleted file mode 100644
index d4755f4071..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/ConfiguredNodeImplementation.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.node;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.contribution.Contribution;
-
-
-
-/**
- * The model representing a resource implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public interface ConfiguredNodeImplementation extends Implementation {
-
- /**
- * Returns the composite deployed to this node.
- * @return the composite deployed to this node
- */
- Composite getComposite();
-
- /**
- * Sets the composite deployed to this node.
- * @param composite the composite deployed to this node
- */
- void setComposite(Composite composite);
-
- /**
- * Returns the list of contributions deployed to this node.
- * @return the list of contributions deployed to this node
- */
- List<Contribution> getContributions();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/NodeImplementation.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/NodeImplementation.java
deleted file mode 100644
index 527698ea91..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/NodeImplementation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.node;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Implementation;
-
-
-
-/**
- * The model representing a resource implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-public interface NodeImplementation extends Implementation {
-
- /**
- * Returns the composite deployed to this node.
- * @return the composite deployed to this node
- */
- Composite getComposite();
-
- /**
- * Sets the composite deployed to this node.
- * @param composite the composite deployed to this node
- */
- void setComposite(Composite composite);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/NodeImplementationFactory.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/NodeImplementationFactory.java
deleted file mode 100644
index 9c4fed689b..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/NodeImplementationFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.node;
-
-
-/**
- * Factory for the resource implementation model.
- *
- * @version $Rev$ $Date$
- */
-public interface NodeImplementationFactory {
-
- /**
- * Creates a new node implementation.
- * @return a new node implementation
- */
- NodeImplementation createNodeImplementation();
-
- /**
- * Creates a new configured node implementation.
- * @return a new configured node implementation
- */
- ConfiguredNodeImplementation createConfiguredNodeImplementation();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/builder/impl/NodeCompositeBuilderImpl.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/builder/impl/NodeCompositeBuilderImpl.java
deleted file mode 100644
index 14046065b5..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/builder/impl/NodeCompositeBuilderImpl.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.node.builder.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.TransformerFactory;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.implementation.node.NodeImplementation;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- * A composite builder that handles the configuration of composites assigned to
- * node components, from the default configuration from the node components.
- *
- * @version $Rev$ $Date$
- */
-public class NodeCompositeBuilderImpl implements CompositeBuilder {
-
- private CompositeBuilder bindingConfigurationBuilder;
-
- public NodeCompositeBuilderImpl(CompositeBuilderExtensionPoint compositeBuilders, FactoryExtensionPoint factories, InterfaceContractMapper mapper) {
- bindingConfigurationBuilder = compositeBuilders.getCompositeBuilder("org.apache.tuscany.assembly.builder.CompositeBindingConfigurationBuilder");
- }
-
- @Deprecated
- public NodeCompositeBuilderImpl(AssemblyFactory assemblyFactory,
- SCABindingFactory scaBindingFactory,
- InterfaceContractMapper interfaceContractMapper,
- CompositeBuilder bindingConfigurationBuilder) {
- this.bindingConfigurationBuilder = bindingConfigurationBuilder;
- }
-
- public NodeCompositeBuilderImpl(AssemblyFactory assemblyFactory,
- SCABindingFactory scaBindingFactory,
- DocumentBuilderFactory documentBuilderFactory,
- TransformerFactory transformerFactory,
- InterfaceContractMapper interfaceContractMapper,
- CompositeBuilder bindingConfigurationBuilder) {
- this.bindingConfigurationBuilder = bindingConfigurationBuilder;
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.implementation.node.builder.NodeCompositeBuilder";
- }
-
- public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
-
- // Process each node component in the given composite
- for (Component component: composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof NodeImplementation) {
-
- // Get the application composite assigned to the node
- NodeImplementation nodeImplementation = (NodeImplementation)implementation;
- Composite applicationComposite = nodeImplementation.getComposite();
-
- // Get the default bindings configured on the node
- List<Binding> defaultBindings = new ArrayList<Binding>();
- for (ComponentService componentService: component.getServices()) {
- defaultBindings.addAll(componentService.getBindings());
- }
-
- // Configure services in the application composite assigned to
- // the node using the default bindings.
- applicationComposite.getExtensions().add(defaultBindings);
- bindingConfigurationBuilder.build(applicationComposite, definitions, monitor);
- applicationComposite.getExtensions().remove(defaultBindings);
- }
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/ConfiguredNodeImplementationImpl.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/ConfiguredNodeImplementationImpl.java
deleted file mode 100644
index 1d183513b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/ConfiguredNodeImplementationImpl.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.node.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-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.contribution.Contribution;
-import org.apache.tuscany.sca.implementation.node.ConfiguredNodeImplementation;
-
-
-/**
- * The model representing a configured node implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-class ConfiguredNodeImplementationImpl implements ConfiguredNodeImplementation {
-
- private String uri;
- private boolean unresolved;
- private Composite composite;
- private List<Contribution> contributions = new ArrayList<Contribution>();
-
- /**
- * Constructs a new node implementation.
- */
- ConfiguredNodeImplementationImpl() {
- }
-
- public ConstrainingType getConstrainingType() {
- // The node implementation does not support constrainingTypes
- return null;
- }
-
- public List<Property> getProperties() {
- // The node implementation does not support properties
- return Collections.emptyList();
- }
-
- public List<Service> getServices() {
- // The node implementation does not support services
- return Collections.emptyList();
- }
-
- public List<Reference> getReferences() {
- // The node implementation does not support properties
- return Collections.emptyList();
- }
-
- public String getURI() {
- return uri;
- }
-
- public Composite getComposite() {
- return composite;
- }
-
- public List<Contribution> getContributions() {
- return contributions;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- // The node implementation does not support constrainingTypes
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public void setComposite(Composite composite) {
- this.composite = composite;
- }
-
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/NodeImplementationFactoryImpl.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/NodeImplementationFactoryImpl.java
deleted file mode 100644
index 94ea610314..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/NodeImplementationFactoryImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.node.impl;
-
-import org.apache.tuscany.sca.implementation.node.ConfiguredNodeImplementation;
-import org.apache.tuscany.sca.implementation.node.NodeImplementation;
-import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory;
-
-/**
- * Factory for the resource implementation model.
- *
- * @version $Rev$ $Date$
- */
-public class NodeImplementationFactoryImpl implements NodeImplementationFactory {
-
- public NodeImplementationFactoryImpl() {
- }
-
- public NodeImplementation createNodeImplementation() {
- return new NodeImplementationImpl();
- }
-
- public ConfiguredNodeImplementation createConfiguredNodeImplementation() {
- return new ConfiguredNodeImplementationImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/NodeImplementationImpl.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/NodeImplementationImpl.java
deleted file mode 100644
index 8f6315d969..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/impl/NodeImplementationImpl.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.node.impl;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.implementation.node.NodeImplementation;
-
-
-/**
- * The model representing a node implementation in an SCA assembly model.
- *
- * @version $Rev$ $Date$
- */
-class NodeImplementationImpl implements NodeImplementation {
-
- private String uri;
- private boolean unresolved;
- private Composite composite;
-
- /**
- * Constructs a new node implementation.
- */
- NodeImplementationImpl() {
- }
-
- public ConstrainingType getConstrainingType() {
- // The node implementation does not support constrainingTypes
- return null;
- }
-
- public List<Property> getProperties() {
- // The node implementation does not support properties
- return Collections.emptyList();
- }
-
- public List<Service> getServices() {
- // The node implementation does not support services
- return Collections.emptyList();
- }
-
- public List<Reference> getReferences() {
- // The node implementation does not support properties
- return Collections.emptyList();
- }
-
- public String getURI() {
- return uri;
- }
-
- public Composite getComposite() {
- return composite;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- // The node implementation does not support constrainingTypes
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public void setComposite(Composite composite) {
- this.composite = composite;
- }
-
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/xml/ConfiguredNodeImplementationProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/xml/ConfiguredNodeImplementationProcessor.java
deleted file mode 100644
index 8ed57a8a0e..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/xml/ConfiguredNodeImplementationProcessor.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.node.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.List;
-
-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.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-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.implementation.node.ConfiguredNodeImplementation;
-import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-
-/**
- * Implements a StAX artifact processor for configured node implementations.
- *
- * @version $Rev$ $Date$
- */
-public class ConfiguredNodeImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<ConfiguredNodeImplementation> {
-
- 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 String HREF = "href";
-
- private ContributionFactory contributionFactory;
- private AssemblyFactory assemblyFactory;
- private NodeImplementationFactory implementationFactory;
-
- public ConfiguredNodeImplementationProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.implementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
- }
-
- public QName getArtifactType() {
- return null;
- }
-
- public Class<ConfiguredNodeImplementation> getModelType() {
- // Returns the type of model processed by this processor
- return ConfiguredNodeImplementation.class;
- }
-
- public ConfiguredNodeImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- ConfiguredNodeImplementation implementation = implementationFactory.createConfiguredNodeImplementation();
- implementation.setUnresolved(true);
-
- // Read a feed containing links to the composite and the contributions assigned to
- // the node
- Composite composite = null;
- Contribution 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>
- if (implementation.getComposite() == null) {
- composite = assemblyFactory.createComposite();
- } else {
- contribution = contributionFactory.createContribution();
- }
- } 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 (composite != null) {
- composite.setURI(href);
- } else if (contribution != null) {
- contribution.setLocation(href);
- }
- }
- 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 (composite != null) {
- implementation.setComposite(composite);
- } else if (contribution != null) {
- implementation.getContributions().add(contribution);
- }
-
- composite = null;
- 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 implementation;
- }
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- return implementation;
- }
-
- public void resolve(ConfiguredNodeImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve the referenced composite
- Composite composite = implementation.getComposite();
- if (composite != null) {
- composite = resolver.resolveModel(Composite.class, composite);
- if (!composite.isUnresolved()) {
- implementation.setComposite(composite);
- }
- }
-
- // Resolve the referenced contributions
- List<Contribution> contributions = implementation.getContributions();
- for (int i = 0, n = contributions.size(); i < n; i++) {
- Contribution contribution = contributions.get(i);
- contribution = resolver.resolveModel(Contribution.class, contribution);
- if (!contribution.isUnresolved()) {
- contributions.set(i, contribution);
- }
- }
-
- implementation.setUnresolved(false);
- }
-
- public void write(ConfiguredNodeImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- //TODO Write the feed describing the node configuration
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/xml/NodeImplementationProcessor.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/xml/NodeImplementationProcessor.java
deleted file mode 100644
index 8d2650ec85..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/java/org/apache/tuscany/sca/implementation/node/xml/NodeImplementationProcessor.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.node.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.Composite;
-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.implementation.node.NodeImplementation;
-import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-
-/**
- * Implements a StAX artifact processor for node implementations.
- *
- * @version $Rev$ $Date$
- */
-public class NodeImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<NodeImplementation> {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- private static final QName IMPLEMENTATION_NODE = new QName(SCA10_TUSCANY_NS, "implementation.node");
-
- private AssemblyFactory assemblyFactory;
- private NodeImplementationFactory implementationFactory;
-
- public NodeImplementationProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.implementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
- }
-
- public QName getArtifactType() {
- // Returns the QName of the XML element processed by this processor
- return IMPLEMENTATION_NODE;
- }
-
- public Class<NodeImplementation> getModelType() {
- // Returns the type of model processed by this processor
- return NodeImplementation.class;
- }
-
- public NodeImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Read an <implementation.node> element
- NodeImplementation implementation = implementationFactory.createNodeImplementation();
- implementation.setUnresolved(false);
-
- // Read the composite attribute
- QName qname = getQName(reader, "composite");
- if (qname != null) {
- Composite composite = assemblyFactory.createComposite();
- composite.setName(qname);
- String uri = getString(reader, "uri");
- composite.setURI(uri);
- composite.setUnresolved(true);
- implementation.setComposite(composite);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && IMPLEMENTATION_NODE.equals(reader.getName())) {
- break;
- }
- }
-
- return implementation;
- }
-
- public void resolve(NodeImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
- // We do not need to resolve the referenced composites here
- // Nodes and application composites are not in the same composition tree
- }
-
- public void write(NodeImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <implementation.node>
- Composite composite = implementation.getComposite();
- QName qname;
- String uri;
- if (composite != null) {
- qname = composite.getName();
- uri = composite.getURI();
- } else {
- qname = null;
- uri = null;
- }
- writeStart(writer, IMPLEMENTATION_NODE.getNamespaceURI(), IMPLEMENTATION_NODE.getLocalPart(),
- new XAttr("composite", qname), new XAttr("uri", uri));
-
- writeEnd(writer);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilder b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilder
deleted file mode 100644
index 1ad6df149d..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.CompositeBuilder
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http:..www.apache.org.licenses.LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.implementation.node.builder.impl.NodeCompositeBuilderImpl;id=org.apache.tuscany.sca.implementation.node.builder.NodeCompositeBuilder
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 9378db0875..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.implementation.node.xml.NodeImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.node,model=org.apache.tuscany.sca.implementation.node.NodeImplementation,factory=org.apache.tuscany.sca.implementation.node.NodeImplementationFactory
-org.apache.tuscany.sca.implementation.node.xml.ConfiguredNodeImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.node.configured,model=org.apache.tuscany.sca.implementation.node.ConfiguredNodeImplementation,factory=org.apache.tuscany.sca.implementation.node.NodeImplementationFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.node.NodeImplementationFactory b/tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.node.NodeImplementationFactory
deleted file mode 100644
index b8a63a3b16..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.node.NodeImplementationFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for model factory
-org.apache.tuscany.sca.implementation.node.impl.NodeImplementationFactoryImpl
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java
deleted file mode 100644
index 3ec5ce20f8..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java
+++ /dev/null
@@ -1,603 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.node.builder.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.node.NodeImplementation;
-import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory;
-import org.apache.tuscany.sca.implementation.node.impl.NodeImplementationFactoryImpl;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class CalculateBindingURITestCase {
- private static final Logger logger = Logger.getLogger(CalculateBindingURITestCase.class.getName());
- private AssemblyFactory assemblyFactory;
- private SCABindingFactory scaBindingFactory;
- private NodeImplementationFactory nodeImplementationFactory;
- private Monitor monitor;
- private CompositeBuilder bindingConfigurationBuilder;
- private CompositeBuilder nodeConfigurationBuilder;
- private List<Binding> defaultBindings = new ArrayList<Binding>();
-
- @Before
- public void setUp() throws Exception {
- assemblyFactory = new DefaultAssemblyFactory();
- scaBindingFactory = new TestBindingFactory();
- nodeImplementationFactory = new NodeImplementationFactoryImpl();
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- bindingConfigurationBuilder =
- extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class)
- .getCompositeBuilder("org.apache.tuscany.assembly.builder.CompositeBindingConfigurationBuilder");
- nodeConfigurationBuilder =
- extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class)
- .getCompositeBuilder("org.apache.tuscany.sca.implementation.node.builder.NodeCompositeBuilder");
- Binding defaultBinding = new TestBindingImpl();
- defaultBinding.setURI("http://myhost:8080/root");
- defaultBindings.add(defaultBinding);
- }
-
- /**
- * Create a composite containing a node component pointing to the
- * given application composite.
- *
- * @param composite
- * @return
- */
- private Composite nodeComposite(Composite composite) {
- Composite nodeComposite = assemblyFactory.createComposite();
- Component nodeComponent = assemblyFactory.createComponent();
- NodeImplementation nodeImplementation = nodeImplementationFactory.createNodeImplementation();
- nodeImplementation.setComposite(composite);
- nodeComponent.setImplementation(nodeImplementation);
- ComponentService nodeService = assemblyFactory.createComponentService();
- nodeService.getBindings().addAll(defaultBindings);
- nodeComponent.getServices().add(nodeService);
- nodeComposite.getComponents().add(nodeComponent);
- return nodeComposite;
- }
-
- @After
- public void tearDown() throws Exception {
- assemblyFactory = null;
- }
-
- /**
- * Test that URI are generated in accordance with the Assembly Specification section 1.7.2.1 as
- * follows. For the 3 parts that make up the URI;
- *
- * BaseURI / Component URI / Service Binding URI
- *
- * Test the following combinations for:
- *
- * NB. The short hand here, e.g. <service name="s1"> <binding.sca> <service name="s2"> means
- * two services appear where the first has the sca binding specified.
- *
- * component service bindings
- *
- * http://myhost:8080/root / <component name="c1"> / <service name="s1"> <binding.sca>
- * --> http://myhost:8080/root/c1
- * http://myhost:8080/root / <component name="c1"> / <service name="s1"> <binding.sca> <service name="s2">
- * --> http://myhost:8080/root/c1/s1
- * http://myhost:8080/root / <component name="c1"> / <service name="s1"> <binding.sca name="n"> <service name="s2">
- * --> http://myhost:8080/root/c1/n
- * http://myhost:8080/root / <component name="c1"> / <service name="s1"> <binding.sca uri="b"> <service name="s2">
- * --> http://myhost:8080/root/c1/b
- * http://myhost:8080/root / <component name="c1"> / <service name="s1"> <binding.sca uri="http://myhost:8080/b"> <service name="s2">
- * --> http://myhost:8080/b
- * http://myhost:8080/root / <component name="c1"> / <service name="s1"> <binding.sca uri="../../b"> <service name="s2">
- * --> http://myhost:8080/b
- *
- * top level composite service bindings
- *
- * http://myhost:8080/root / null / <service name="s1"> <binding.sca> <service name="s2">
- * --> http://myhost:8080/root
- * http://myhost:8080/root / null / <service name="s1"> <binding.sca> <service name="s2">
- * --> http://myhost:8080/root/s1
- * http://myhost:8080/root / null / <service name="s1"> <binding.sca name="n"> <service name="s2">
- * --> http://myhost:8080/root/n
- * http://myhost:8080/root / null / <service name="s1"> <binding.sca uri="b"> <service name="s2">
- * --> http://myhost:8080/root/b
- * http://myhost:8080/root / null / <service name="s1"> <binding.sca uri="http://myhost:8080/b"> <service name="s2">
- * --> http://myhost:8080/b
- *
- * nested composite service bindings
- *
- * http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca>
- * --> http://myhost:8080/root/c1/c2
- * http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca> <service name="s2">
- * --> http://myhost:8080/root/c1/c2/s1
- * http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca name="n"> <service name="s2">
- * --> http://myhost:8080/root/c1/c2/n
- * http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca uri="b"> <service name="s2">
- * --> http://myhost:8080/root/c1/c2/b
- * http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca uri="http://myhost:8080/b"> <service name="s2">
- * --> http://myhost:8080/b
- *
- * binding name duplication errors
- *
- * http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca> <binding.xyz>
- * --> Error
- * http://myhost:8080/root / <component name="c1"> implemented by composite with <component name="c2"> / <service name="s1"> <binding.sca name="b1"> <binding.xyz name="b1">
- * --> Error
- */
-
- private Composite createComponentServiceBinding() {
- Composite composite1 = assemblyFactory.createComposite();
- composite1.setName(new QName("http://foo", "C1"));
-
- Component c1 = assemblyFactory.createComponent();
- c1.setName("c1");
- composite1.getComponents().add(c1);
-
- ComponentService s1 = assemblyFactory.createComponentService();
- c1.getServices().add(s1);
- s1.setName("s1");
-
- ComponentService s2 = assemblyFactory.createComponentService();
- c1.getServices().add(s2);
- s2.setName("s2");
-
- Binding b1 = new TestBindingImpl();
- s1.getBindings().add(b1);
-
- Binding b2 = new TestBindingImpl();
- s2.getBindings().add(b2);
-
- return composite1;
- }
-
- private Composite createTopLevelCompositeServiceBinding() {
- Composite composite1 = assemblyFactory.createComposite();
- composite1.setName(new QName("http://foo", "C1"));
-
- CompositeService s1 = assemblyFactory.createCompositeService();
- s1.setName("s1");
- composite1.getServices().add(s1);
-
- Binding b1 = new TestBindingImpl();
- s1.getBindings().add(b1);
-
- CompositeService s2 = assemblyFactory.createCompositeService();
- s2.setName("s2");
- composite1.getServices().add(s2);
-
- Binding b2 = new TestBindingImpl();
- s2.getBindings().add(b2);
-
- return composite1;
- }
-
- private Composite createNestCompositeServiceBinding() {
- Composite composite1 = assemblyFactory.createComposite();
- composite1.setName(new QName("http://foo", "C1"));
-
- Component c1 = assemblyFactory.createComponent();
- c1.setName("c1");
- composite1.getComponents().add(c1);
-
- Composite composite2 = assemblyFactory.createComposite();
- c1.setImplementation(composite2);
- composite2.setName(new QName("http://foo", "C2"));
-
- Component c2 = assemblyFactory.createComponent();
- composite2.getComponents().add(c2);
- c2.setName("c2");
-
- ComponentService s1 = assemblyFactory.createComponentService();
- c2.getServices().add(s1);
- s1.setName("s1");
-
- ComponentService s2 = assemblyFactory.createComponentService();
- c2.getServices().add(s2);
- s2.setName("s2");
-
- Binding b1 = new TestBindingImpl();
- s1.getBindings().add(b1);
-
- Binding b2 = new TestBindingImpl();
- s2.getBindings().add(b2);
-
- return composite1;
- }
-
- // component service binding tests
-
- @Test
- public void testComponentServiceSingleService() {
- Composite composite = createComponentServiceBinding();
- composite.getComponents().get(0).getServices().remove(1);
- Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/c1", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testComponentServiceBindingDefault() {
- Composite composite = createComponentServiceBinding();
- Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/c1/s1", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testComponentServiceBindingName() {
- Composite composite = createComponentServiceBinding();
- Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
- b.setName("n");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/c1/n", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testComponentServiceBindingURIRelative() {
- Composite composite = createComponentServiceBinding();
- Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
- b.setName("n");
- b.setURI("b");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/c1/b", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testComponentServiceBindingURIAbsolute() {
- Composite composite = createComponentServiceBinding();
- Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
- b.setName("n");
- b.setURI("http://myhost:8080/b");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/b", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testComponentServiceBindingURIRelative2() {
- Composite composite = createComponentServiceBinding();
- Binding b = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
- b.setName("n");
- b.setURI("../../b");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/b", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- // top level composite service binding tests
-
- @Test
- public void testCompositeServiceSingleService() {
- Composite composite = createTopLevelCompositeServiceBinding();
- composite.getServices().remove(1);
- Binding b = composite.getServices().get(0).getBindings().get(0);
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testCompositeServiceBindingDefault() {
- Composite composite = createTopLevelCompositeServiceBinding();
- Binding b = composite.getServices().get(0).getBindings().get(0);
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/s1", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testCompositeServiceBindingName() {
- Composite composite = createTopLevelCompositeServiceBinding();
- Binding b = composite.getServices().get(0).getBindings().get(0);
- b.setName("n");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/n", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testCompositeServiceBindingURIRelative() {
- Composite composite = createTopLevelCompositeServiceBinding();
- Binding b = composite.getServices().get(0).getBindings().get(0);
- b.setName("n");
- b.setURI("b");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/b", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testCompositeServiceBindingURIAbsolute() {
- Composite composite = createTopLevelCompositeServiceBinding();
- Binding b = composite.getServices().get(0).getBindings().get(0);
- b.setName("n");
- b.setURI("http://myhost:8080/b");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/b", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- // nested composite service binding tests
-
- @Test
- public void testNestedCompositeServiceSingleService() {
- Composite composite = createNestCompositeServiceBinding();
- ((Composite)composite.getComponents().get(0).getImplementation()).getComponents().get(0).getServices()
- .remove(1);
- Binding b =
- ((Composite)composite.getComponents().get(0).getImplementation()).getComponents().get(0).getServices()
- .get(0).getBindings().get(0);
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/c1/c2", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testNestedCompositeServiceBindingDefault() {
- Composite composite = createNestCompositeServiceBinding();
- Binding b =
- ((Composite)composite.getComponents().get(0).getImplementation()).getComponents().get(0).getServices()
- .get(0).getBindings().get(0);
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/c1/c2/s1", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testNestedCompositeServiceBindingName() {
- Composite composite = createNestCompositeServiceBinding();
- Binding b =
- ((Composite)composite.getComponents().get(0).getImplementation()).getComponents().get(0).getServices()
- .get(0).getBindings().get(0);
- b.setName("n");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/c1/c2/n", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testNestedCompositeServiceBindingURIRelative() {
- Composite composite = createNestCompositeServiceBinding();
- Binding b =
- ((Composite)composite.getComponents().get(0).getImplementation()).getComponents().get(0).getServices()
- .get(0).getBindings().get(0);
- b.setName("n");
- b.setURI("b");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/root/c1/c2/b", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- @Test
- public void testNestedCompositeServiceBindingURIAbsolute() {
- Composite composite = createNestCompositeServiceBinding();
- Binding b =
- ((Composite)composite.getComponents().get(0).getImplementation()).getComponents().get(0).getServices()
- .get(0).getBindings().get(0);
- b.setName("n");
- b.setURI("http://myhost:8080/b");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
-
- assertEquals("http://myhost:8080/b", b.getURI());
- } catch (Exception ex) {
- System.out.println(ex.toString());
- fail();
- }
- }
-
- // component service binding name error tests
-
- //FIXME Need to find a better way to test these error cases as
- // the composite builder now (intentionally) logs warnings instead of
- // throwing exceptions
- public void FIXMEtestComponentServiceBindingNameError1() {
- Composite composite = createComponentServiceBinding();
- Binding b1 = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
- Binding b2 = new TestBindingImpl();
- composite.getComponents().get(0).getServices().get(0).getBindings().add(b2);
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
- fail();
- } catch (Exception ex) {
- //System.out.println(ex.toString());
- }
- }
-
- //FIXME Need to find a better way to test these error cases as
- // the composite builder now (intentionally) logs warnings instead of
- // throwing exceptions
- public void FIXMEtestComponentServiceBindingNameError2() {
- Composite composite = createComponentServiceBinding();
- Binding b1 = composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
- Binding b2 = new TestBindingImpl();
- composite.getComponents().get(0).getServices().get(0).getBindings().add(b2);
-
- b1.setName("b");
- b2.setName("b");
-
- try {
- nodeConfigurationBuilder.build(nodeComposite(composite), null, null);
- fail();
- } catch (Exception ex) {
- System.out.println(ex.toString());
- }
- }
-
- public class TestBindingFactory implements SCABindingFactory {
- public SCABinding createSCABinding() {
- return new TestBindingImpl();
- }
- }
-
- public class TestBindingImpl implements SCABinding {
- private String name;
- private String uri;
- private boolean unresolved;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/xml/ReadTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/xml/ReadTestCase.java
deleted file mode 100644
index 8720d5c607..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/xml/ReadTestCase.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.node.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.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.junit.Before;
-import org.junit.Test;
-
-/**
- * Test reading Node implementations.
- *
- * @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);
-
- compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
-
- }
-
- @Test
- public void testReadComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestNode.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
-
- compositeBuilder.build(composite, null, null);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/xml/WriteTestCase.java b/tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/xml/WriteTestCase.java
deleted file mode 100644
index de1506ae59..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/xml/WriteTestCase.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.node.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.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;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test reading/writing Node implementations.
- *
- * @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 testReadWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestNode.composite");
- Composite composite = (Composite)staxProcessor.read(inputFactory.createXMLStreamReader(is));
- assertNotNull(composite);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/implementation/node/xml/TestComposite.composite b/tags/java/sca/2.0-M1/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/implementation/node/xml/TestComposite.composite
deleted file mode 100644
index 55644c27e5..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/implementation/node/xml/TestComposite.composite
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/composite"
- xmlns:sc="http://sample/composite"
- name="TestComposite">
-
- <component name="TestComponent">
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/implementation/node/xml/TestNode.composite b/tags/java/sca/2.0-M1/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/implementation/node/xml/TestNode.composite
deleted file mode 100644
index 92787d3ac1..0000000000
--- a/tags/java/sca/2.0-M1/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/implementation/node/xml/TestNode.composite
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/node"
- xmlns:sc="http://sample/composite"
- name="TestNode">
-
- <component name="TestNode">
- <tuscany:implementation.node composite="sc:TestComposite"/>
- <service name="Default">
- <binding.sca uri="http://localhost:8080"/>
- </service>
- </component>
-
- <component name="TestNode2">
- <tuscany:implementation.node.configured>
-
- <feed xmlns="http://www.w3.org/2005/Atom">
- <title type="text">Feed</title>
- <entry>
- <id>composite:store;http://store;store</id>
- <title type="text">store - http://store;store</title>
- <content type="text" />
- <link
- href="/resolved/composite/composite:store;http://store;store" />
- </entry>
- <entry>
- <id>assets</id>
- <title type="text">assets</title>
- <content type="text" />
- <link
- href="http://localhost:9990/files/tutorial-assets.jar" />
- </entry>
- <entry>
- <id>store</id>
- <title type="text">store</title>
- <content type="text" />
- <link
- href="http://localhost:9990/files/tutorial-store.jar" />
- </entry>
- </feed>
-
- </tuscany:implementation.node.configured>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/LICENSE b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/META-INF/MANIFEST.MF
deleted file mode 100644
index 057e562cfe..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,49 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.interfacedef.java.jaxws;uses:="
- org.apache.tuscany.sca.databinding,org.apache.tuscany.sca.interfacede
- f.util,org.objectweb.asm,javax.jws,javax.xml.namespace,javax.jws.soap
- ,org.apache.tuscany.sca.interfacedef.java.impl,org.apache.tuscany.sca
- .databinding.annotation,org.oasisopen.sca,javax.xml.bind.annotation.adapte
- rs,org.apache.tuscany.sca.interfacedef.java,org.apache.tuscany.sca.in
- terfacedef,org.apache.tuscany.sca.interfacedef.java.introspect,javax.
- xml.bind.annotation,org.apache.tuscany.sca.databinding.jaxb,org.apach
- e.tuscany.sca.interfacedef.impl,javax.xml.ws";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany Java Interface for JAXWS
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397232156
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany Java Interface for JAXWS
-Import-Package: javax.jws,
- javax.jws.soap,
- javax.xml.bind;resolution:=optional,
- javax.xml.bind.annotation,
- javax.xml.bind.annotation.adapters,
- javax.xml.namespace,
- javax.xml.stream;resolution:=optional,
- javax.xml.transform;resolution:=optional,
- javax.xml.transform.stream;resolution:=optional,
- javax.xml.ws,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.databinding;version="2.0.0",
- org.apache.tuscany.sca.databinding.annotation;version="2.0.0",
- org.apache.tuscany.sca.databinding.javabeans;version="2.0.0",
- org.apache.tuscany.sca.databinding.jaxb;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.introspect;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.jaxws;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.objectweb.asm;version="3.1",
- org.objectweb.asm.util;version="3.1";resolution:=optional,
- org.oasisopen.sca;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0";resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.interface.java.jaxws
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/NOTICE b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/pom.xml b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/pom.xml
deleted file mode 100644
index 764dc6c78c..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/pom.xml
+++ /dev/null
@@ -1,252 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-interface-java-jaxws</artifactId>
- <name>Apache Tuscany SCA Interface Java For JAXWS</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.xml.ws</groupId>
- <artifactId>jaxws-api</artifactId>
- <version>2.1</version>
- <exclusions>
- <exclusion>
- <groupId>javax.xml.soap</groupId>
- <artifactId>saaj-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- <version>3.1</version>
- </dependency>
-
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm-util</artifactId>
- <version>3.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm-analysis</artifactId>
- <version>3.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <repositories>
- <repository>
- <id>java.net</id>
- <name>java.net Maven 1.x Repository</name>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
- <repository>
- <id>java.net2</id>
- <name>java.net Maven 2.x Repository</name>
- <url>http://download.java.net/maven/2</url>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>java.net2</id>
- <name>java.net Maven 2.x Repository</name>
- <url>http://download.java.net/maven/2</url>
- </pluginRepository>
- </pluginRepositories>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Djava.endorsed.dirs=target/endorsed</argLine>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>javax.xml.ws</groupId>
- <artifactId>jaxws-api</artifactId>
- <version>2.1</version>
- <type>jar</type>
- </artifactItem>
- <artifactItem>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- <type>jar</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>add-test-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/jaxws-source</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jaxws-maven-plugin</artifactId>
- <version>1.11</version>
- <executions>
- <execution>
- <id>wsimport</id>
- <phase>generate-test-sources</phase>
- <goals>
- <goal>wsimport</goal>
- </goals>
- <configuration>
- <packageName>com.example.stock</packageName>
- <wsdlDirectory>${basedir}/src/test/resources/wsdl</wsdlDirectory>
- <wsdlFiles>
- <wsdlFile>StockExceptionTest.wsdl</wsdlFile>
- </wsdlFiles>
- <sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
- <verbose>false</verbose>
- <xnocompile>true</xnocompile>
- </configuration>
- </execution>
-
- <!--
- <execution>
- <id>wsgen</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>wsgen-test</goal>
- </goals>
- <configuration>
- <sei>org.apache.tuscany.sca.interfacedef.java.jaxws.MyServiceImpl</sei>
- <genWsdl>true</genWsdl>
- <keep>true</keep>
- <resourceDestDir>${project.build.directory}/jaxws-source</resourceDestDir>
- <sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
- </configuration>
- </execution>
- -->
- </executions>
-
- </plugin>
-
- <!--
- wsimport cannot handle WSDL files without a service/binding element.
- CXF wsdl2java plugin does support that. I had to override the default
- value of wsdlRoot/testWsdlRoot to a non-existent file to avoid NPE -->
- <!--
- <plugin>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-codegen-plugin</artifactId>
- <version>2.1</version>
- <executions>
- <execution>
- <id>generate-sources</id>
- <phase>generate-sources</phase>
-
- <configuration>
- <sourceRoot>${basedir}/target/jaxws-source</sourceRoot>
- <wsdlRoot>NONE</wsdlRoot>
- <testWsdlRoot>NONE</testWsdlRoot>
- <wsdlOptions>
- <wsdlOption>
- <wsdl>${basedir}/src/test/resources/wsdl/Stock.wsdl</wsdl>
- <outputDir>${basedir}/target/jaxws-source</outputDir>
- <packagenames>
- <packagename>com.example.stock.cxf</packagename>
- </packagenames>
- </wsdlOption>
- </wsdlOptions>
- </configuration>
- <goals>
- <goal>wsdl2java</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- -->
-
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java
deleted file mode 100644
index 6c64ad0689..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BaseBeanGenerator.java
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.java.jaxws;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import javax.xml.bind.annotation.XmlAttachmentRef;
-import javax.xml.bind.annotation.XmlList;
-import javax.xml.bind.annotation.XmlMimeType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.ws.Holder;
-
-import org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint;
-import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.FieldVisitor;
-import org.objectweb.asm.Label;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
-
-public abstract class BaseBeanGenerator implements Opcodes {
- private static final Map<String, String> COLLECTION_CLASSES = new HashMap<String, String>();
- static {
- COLLECTION_CLASSES.put("Ljava/util/Collection;", "java/util/ArrayList");
- COLLECTION_CLASSES.put("Ljava/util/List;", "java/util/ArrayList");
- COLLECTION_CLASSES.put("Ljava/util/Set;", "java/util/HashSet");
- COLLECTION_CLASSES.put("Ljava/util/Queue;", "java/util/LinkedList");
- }
- private final static Class[] KNOWN_JAXB_ANNOTATIONS =
- {XmlAttachmentRef.class, XmlMimeType.class, XmlJavaTypeAdapter.class, XmlList.class};
- private static final Map<String, String> JAVA_KEYWORDS = new HashMap<String, String>();
-
- static {
- JAVA_KEYWORDS.put("abstract", "_abstract");
- JAVA_KEYWORDS.put("assert", "_assert");
- JAVA_KEYWORDS.put("boolean", "_boolean");
- JAVA_KEYWORDS.put("break", "_break");
- JAVA_KEYWORDS.put("byte", "_byte");
- JAVA_KEYWORDS.put("case", "_case");
- JAVA_KEYWORDS.put("catch", "_catch");
- JAVA_KEYWORDS.put("char", "_char");
- JAVA_KEYWORDS.put("class", "_class");
- JAVA_KEYWORDS.put("const", "_const");
- JAVA_KEYWORDS.put("continue", "_continue");
- JAVA_KEYWORDS.put("default", "_default");
- JAVA_KEYWORDS.put("do", "_do");
- JAVA_KEYWORDS.put("double", "_double");
- JAVA_KEYWORDS.put("else", "_else");
- JAVA_KEYWORDS.put("extends", "_extends");
- JAVA_KEYWORDS.put("false", "_false");
- JAVA_KEYWORDS.put("final", "_final");
- JAVA_KEYWORDS.put("finally", "_finally");
- JAVA_KEYWORDS.put("float", "_float");
- JAVA_KEYWORDS.put("for", "_for");
- JAVA_KEYWORDS.put("goto", "_goto");
- JAVA_KEYWORDS.put("if", "_if");
- JAVA_KEYWORDS.put("implements", "_implements");
- JAVA_KEYWORDS.put("import", "_import");
- JAVA_KEYWORDS.put("instanceof", "_instanceof");
- JAVA_KEYWORDS.put("int", "_int");
- JAVA_KEYWORDS.put("interface", "_interface");
- JAVA_KEYWORDS.put("long", "_long");
- JAVA_KEYWORDS.put("native", "_native");
- JAVA_KEYWORDS.put("new", "_new");
- JAVA_KEYWORDS.put("null", "_null");
- JAVA_KEYWORDS.put("package", "_package");
- JAVA_KEYWORDS.put("private", "_private");
- JAVA_KEYWORDS.put("protected", "_protected");
- JAVA_KEYWORDS.put("public", "_public");
- JAVA_KEYWORDS.put("return", "_return");
- JAVA_KEYWORDS.put("short", "_short");
- JAVA_KEYWORDS.put("static", "_static");
- JAVA_KEYWORDS.put("strictfp", "_strictfp");
- JAVA_KEYWORDS.put("super", "_super");
- JAVA_KEYWORDS.put("switch", "_switch");
- JAVA_KEYWORDS.put("synchronized", "_synchronized");
- JAVA_KEYWORDS.put("this", "_this");
- JAVA_KEYWORDS.put("throw", "_throw");
- JAVA_KEYWORDS.put("throws", "_throws");
- JAVA_KEYWORDS.put("transient", "_transient");
- JAVA_KEYWORDS.put("true", "_true");
- JAVA_KEYWORDS.put("try", "_try");
- JAVA_KEYWORDS.put("void", "_void");
- JAVA_KEYWORDS.put("volatile", "_volatile");
- JAVA_KEYWORDS.put("while", "_while");
- JAVA_KEYWORDS.put("enum", "_enum");
- }
-
- protected static final Map<Object, Class<?>> generatedClasses =
- Collections.synchronizedMap(new WeakHashMap<Object, Class<?>>());
-
- protected XMLAdapterExtensionPoint xmlAdapters;
-
- public byte[] defineClass(ClassWriter cw,
- String classDescriptor,
- String classSignature,
- String namespace,
- String name,
- BeanProperty[] properties) {
- // Declare the class
- declareClass(cw, classDescriptor);
-
- // Compute the propOrder
- String[] propOrder = null;
- if (properties != null && properties.length > 0) {
- int size = properties.length;
- propOrder = new String[size];
- for (int i = 0; i < size; i++) {
- propOrder[i] = getFieldName(properties[i].getName());
- }
- }
- // Annotate the class
- annotateClass(cw, name, namespace, propOrder);
-
- // Decalre the default constructor
- declareConstructor(cw, classSignature);
- if (properties != null) {
- for (BeanProperty p : properties) {
- boolean isElement = p.isElement() && (!Map.class.isAssignableFrom(p.getType()));
- String xmlAdapterClassSignature = null;
- if (xmlAdapters != null) {
- Class<?> adapterClass = xmlAdapters.getAdapter(p.getType());
- if (adapterClass != null) {
- xmlAdapterClassSignature = CodeGenerationHelper.getSignature(adapterClass);
- }
- }
- declareProperty(cw, classDescriptor, classSignature, p.getName(), p.getSignature(), p
- .getGenericSignature(), isElement, p.isNillable(), xmlAdapterClassSignature, p.getJaxbAnnotaions());
- }
- }
-
- // Close the generation
- cw.visitEnd();
- return cw.toByteArray();
- }
-
- protected static boolean isHolder(java.lang.reflect.Type type) {
- if (type instanceof ParameterizedType) {
- Class<?> cls = CodeGenerationHelper.getErasure(type);
- return cls == Holder.class;
- }
- return false;
- }
-
- protected static java.lang.reflect.Type getHolderValueType(java.lang.reflect.Type paramType) {
- if (paramType instanceof ParameterizedType) {
- ParameterizedType p = (ParameterizedType)paramType;
- Class<?> cls = CodeGenerationHelper.getErasure(p);
- if (cls == Holder.class) {
- return p.getActualTypeArguments()[0];
- }
- }
- return paramType;
- }
-
- protected void declareProperty(ClassWriter cw,
- String classDescriptor,
- String classSignature,
- String propName,
- String propClassSignature,
- String propTypeSignature,
- boolean isElement,
- boolean isNillable,
- String xmlAdapterClassSignature,
- List<Annotation> jaxbAnnotations) {
- if (propClassSignature.equals(propTypeSignature)) {
- propTypeSignature = null;
- }
- declareField(cw,
- propName,
- propClassSignature,
- propTypeSignature,
- isElement,
- isNillable,
- xmlAdapterClassSignature,
- jaxbAnnotations);
- decalreGetter(cw, classDescriptor, classSignature, propName, propClassSignature, propTypeSignature);
- declareSetter(cw, classDescriptor, classSignature, propName, propClassSignature, propTypeSignature);
- }
-
- protected String getFieldName(String propName) {
- String name = JAVA_KEYWORDS.get(propName);
- return name != null ? name : propName;
- }
-
- protected void declareField(ClassWriter cw,
- String propName,
- String propClassSignature,
- String propTypeSignature,
- boolean isElement,
- boolean isNillable,
- String xmlAdapterClassSignature,
- List<Annotation> jaxbAnnotations) {
- FieldVisitor fv;
- AnnotationVisitor av0;
- fv = cw.visitField(ACC_PROTECTED, getFieldName(propName), propClassSignature, propTypeSignature, null);
-
- // For Map property, we cannot have the XmlElement annotation
- if (isElement && xmlAdapterClassSignature == null) {
- av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
- av0.visit("name", propName);
- av0.visit("namespace", "");
- if (isNillable) {
- av0.visit("nillable", Boolean.TRUE);
- }
- // FIXME:
- // av0.visit("required", Boolean.FALSE);
- av0.visitEnd();
- }
-
- if (xmlAdapterClassSignature != null) {
- av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlAnyElement;", true);
- av0.visit("lax", Boolean.TRUE);
- av0.visitEnd();
- av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/adapters/XmlJavaTypeAdapter;", true);
- av0.visit("value", org.objectweb.asm.Type.getType(xmlAdapterClassSignature));
- av0.visitEnd();
- }
-
- for (Annotation ann : jaxbAnnotations) {
- if (ann instanceof XmlMimeType) {
- AnnotationVisitor mime = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlMimeType;", true);
- mime.visit("value", ((XmlMimeType)ann).value());
- mime.visitEnd();
- } else if (ann instanceof XmlJavaTypeAdapter) {
- AnnotationVisitor ada = fv.visitAnnotation("Ljavax/xml/bind/annotation/adapters/XmlJavaTypeAdapter;", true);
- ada.visit("value", org.objectweb.asm.Type.getType(((XmlJavaTypeAdapter)ann).value()));
- ada.visit("type", org.objectweb.asm.Type.getType(((XmlJavaTypeAdapter)ann).type()));
- ada.visitEnd();
- } else if (ann instanceof XmlAttachmentRef) {
- AnnotationVisitor att = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlAttachmentRef;", true);
- att.visitEnd();
- } else if (ann instanceof XmlList) {
- AnnotationVisitor list = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlList;", true);
- list.visitEnd();
- }
- }
-
- fv.visitEnd();
- }
-
- protected void declareSetter(ClassWriter cw,
- String classDescriptor,
- String classSignature,
- String propName,
- String propClassSignature,
- String propTypeSignature) {
- if ("Ljava/util/List;".equals(propClassSignature)) {
- return;
- }
- MethodVisitor mv =
- cw.visitMethod(ACC_PUBLIC,
- "set" + capitalize(propName),
- "(" + propClassSignature + ")V",
- propTypeSignature == null ? null : "(" + propTypeSignature + ")V",
- null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- // mv.visitLineNumber(57, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitVarInsn(CodeGenerationHelper.getLoadOPCode(propClassSignature), 1);
- mv.visitFieldInsn(PUTFIELD, classDescriptor, getFieldName(propName), propClassSignature);
- Label l1 = new Label();
- mv.visitLabel(l1);
- // mv.visitLineNumber(58, l1);
- mv.visitInsn(RETURN);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLocalVariable("this", classSignature, null, l0, l2, 0);
- mv.visitLocalVariable(getFieldName(propName), propClassSignature, propTypeSignature, l0, l2, 1);
- mv.visitMaxs(3, 3);
- mv.visitEnd();
-
- }
-
- protected void decalreGetter(ClassWriter cw,
- String classDescriptor,
- String classSignature,
- String propName,
- String propClassSignature,
- String propTypeSignature) {
- String collectionImplClass = COLLECTION_CLASSES.get(propClassSignature);
- if (collectionImplClass != null) {
- decalreCollectionGetter(cw,
- classDescriptor,
- classSignature,
- propName,
- propClassSignature,
- propTypeSignature,
- collectionImplClass);
- return;
- }
-
- String getterName = ("Z".equals(propClassSignature) ? "is" : "get") + capitalize(propName);
- MethodVisitor mv =
- cw.visitMethod(ACC_PUBLIC, getterName, "()" + propClassSignature, propTypeSignature == null ? null
- : "()" + propTypeSignature, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- // mv.visitLineNumber(48, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, classDescriptor, getFieldName(propName), propClassSignature);
- mv.visitInsn(CodeGenerationHelper.getReturnOPCode(propClassSignature));
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", classSignature, null, l0, l1, 0);
- mv.visitMaxs(2, 1);
- mv.visitEnd();
- }
-
- protected void decalreCollectionGetter(ClassWriter cw,
- String classDescriptor,
- String classSignature,
- String propName,
- String propClassSignature,
- String propTypeSignature,
- String collectionImplClass) {
- String getterName = "get" + capitalize(propName);
- String fieldName = getFieldName(propName);
- MethodVisitor mv =
- cw.visitMethod(ACC_PUBLIC, getterName, "()" + propClassSignature, propTypeSignature == null ? null
- : "()" + propTypeSignature, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- mv.visitLineNumber(63, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, classDescriptor, fieldName, propClassSignature);
- Label l1 = new Label();
- mv.visitJumpInsn(IFNONNULL, l1);
- Label l2 = new Label();
- mv.visitLabel(l2);
- mv.visitLineNumber(64, l2);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitTypeInsn(NEW, collectionImplClass);
- mv.visitInsn(DUP);
- mv.visitMethodInsn(INVOKESPECIAL, collectionImplClass, "<init>", "()V");
- mv.visitFieldInsn(PUTFIELD, classDescriptor, fieldName, propClassSignature);
- mv.visitLabel(l1);
- mv.visitLineNumber(66, l1);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, classDescriptor, fieldName, propClassSignature);
- mv.visitInsn(ARETURN);
- Label l3 = new Label();
- mv.visitLabel(l3);
- mv.visitLocalVariable("this", classSignature, null, l0, l3, 0);
- mv.visitMaxs(3, 1);
- mv.visitEnd();
- }
-
- protected static String capitalize(String name) {
- if (name == null || name.length() == 0) {
- return name;
- } else {
- return Character.toUpperCase(name.charAt(0)) + name.substring(1);
- }
- }
-
- protected void declareConstructor(ClassWriter cw, String classSignature) {
- MethodVisitor mv;
- mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
- mv.visitCode();
- Label l0 = new Label();
- mv.visitLabel(l0);
- // mv.visitLineNumber(37, l0);
- mv.visitVarInsn(ALOAD, 0);
- mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
- mv.visitInsn(RETURN);
- Label l1 = new Label();
- mv.visitLabel(l1);
- mv.visitLocalVariable("this", classSignature, null, l0, l1, 0);
- mv.visitMaxs(1, 1);
- mv.visitEnd();
- }
-
- protected void declareClass(ClassWriter cw, String classDescriptor) {
- cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, classDescriptor, null, "java/lang/Object", null);
- }
-
- protected void annotateClass(ClassWriter cw, String name, String namespace, String[] propOrder) {
- AnnotationVisitor av0;
- // @XmlRootElement
- av0 = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlRootElement;", true);
- av0.visit("name", name);
- av0.visit("namespace", namespace);
- av0.visitEnd();
- // @XmlAccessorType
- av0 = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlAccessorType;", true);
- av0.visitEnum("value", "Ljavax/xml/bind/annotation/XmlAccessType;", "FIELD");
- av0.visitEnd();
- // @XmlType
- av0 = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlType;", true);
- av0.visit("name", name);
- av0.visit("namespace", namespace);
- if (propOrder != null) {
- AnnotationVisitor pv = av0.visitArray("propOrder");
- for (String p : propOrder) {
- pv.visit(null, p);
- }
- pv.visitEnd();
- }
- av0.visitEnd();
- }
-
- public Class<?> generate(String classDescriptor,
- String classSignature,
- String namespace,
- String name,
- BeanProperty[] properties,
- GeneratedClassLoader classLoader) {
- ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
- byte[] byteCode = defineClass(cw, classDescriptor, classSignature, namespace, name, properties);
- String className = classDescriptor.replace('/', '.');
- Class<?> generated = classLoader.getGeneratedClass(className, byteCode);
- return generated;
- }
-
- public static class BeanProperty {
- private Class<?> type;
- private String namespace;
- private String name;
- private String signature;
- private String genericSignature;
- private List<Annotation> jaxbAnnotaions = new ArrayList<Annotation>();
- private boolean element;
- private boolean nillable;
-
- public BeanProperty(String namespace, String name, Class<?> javaClass, Type type, boolean isElement) {
- super();
- this.namespace = namespace;
- this.name = name;
- this.signature = CodeGenerationHelper.getJAXWSSignature(javaClass);
- this.type = javaClass;
- this.genericSignature = CodeGenerationHelper.getJAXWSSignature(type);
- this.element = isElement;
- // FIXME: How to test nillable?
- // this.nillable = (type instanceof GenericArrayType) || Collection.class.isAssignableFrom(javaClass) || javaClass.isArray();
- // TUSCANY-2389: Set the nillable consistent with what wsgen produces
- this.nillable = javaClass.isArray();
- }
-
- public String getName() {
- return name;
- }
-
- public String getSignature() {
- return signature;
- }
-
- public String getGenericSignature() {
- return genericSignature;
- }
-
- public Class<?> getType() {
- return type;
- }
-
- public List<Annotation> getJaxbAnnotaions() {
- return jaxbAnnotaions;
- }
-
- public String getNamespace() {
- return namespace;
- }
-
- public boolean isElement() {
- return element;
- }
-
- public boolean isNillable() {
- return nillable;
- }
- }
-
- public XMLAdapterExtensionPoint getXmlAdapters() {
- return xmlAdapters;
- }
-
- public void setXmlAdapters(XMLAdapterExtensionPoint xmlAdapters) {
- this.xmlAdapters = xmlAdapters;
- }
-
- protected static <T extends Annotation> T findAnnotation(Annotation[] anns, Class<T> annotationClass) {
- for (Annotation a : anns) {
- if (a.annotationType() == annotationClass) {
- return annotationClass.cast(a);
- }
- }
- return null;
- }
-
- protected static List<Annotation> findJAXBAnnotations(Annotation[] anns) {
- List<Annotation> jaxbAnnotation = new ArrayList<Annotation>();
- for (Class<? extends Annotation> c : KNOWN_JAXB_ANNOTATIONS) {
- Annotation a = findAnnotation(anns, c);
- if (a != null) {
- jaxbAnnotation.add(a);
- }
- }
- return jaxbAnnotation;
- }
-
- protected List<Annotation> findJAXBAnnotations(Method method) {
- List<Annotation> anns = new ArrayList<Annotation>();
- for (Class<? extends Annotation> c : KNOWN_JAXB_ANNOTATIONS) {
- Annotation ann = method.getAnnotation(c);
- if (ann != null) {
- anns.add(ann);
- }
- }
- return anns;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java
deleted file mode 100644
index b05715b54e..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/CodeGenerationHelper.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.java.jaxws;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.lang.reflect.WildcardType;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.objectweb.asm.Opcodes;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CodeGenerationHelper {
- /**
- * @param type
- * @return
- */
- public static Class<?> getErasure(Type type) {
- if (type instanceof Class) {
- return (Class<?>)type;
- } else if (type instanceof GenericArrayType) {
- GenericArrayType arrayType = (GenericArrayType)type;
- Class<?> componentType = getErasure(arrayType.getGenericComponentType());
- return Array.newInstance(componentType, 0).getClass();
- } else if (type instanceof ParameterizedType) {
- ParameterizedType pType = (ParameterizedType)type;
- return getErasure(pType.getRawType());
- } else if (type instanceof WildcardType) {
- WildcardType wType = (WildcardType)type;
- Type[] types = wType.getUpperBounds();
- if (types.length == 0) {
- return Object.class;
- }
- return getErasure(types[0]);
- } else if (type instanceof TypeVariable) {
- TypeVariable<?> var = (TypeVariable<?>)type;
- Type[] types = var.getBounds();
- if (types.length == 0) {
- return Object.class;
- }
- return getErasure(types[0]);
- }
- return null;
- }
-
- /**
- * @param type
- * @return
- */
- public static String getJAXWSSignature(Type type) {
- Class<?> cls = getErasure(type);
- if (Collection.class.isAssignableFrom(cls) && (type instanceof ParameterizedType)) {
- ParameterizedType pType = (ParameterizedType)type;
- Type p = pType.getActualTypeArguments()[0];
- StringBuffer sb = new StringBuffer();
- sb.append(getSignature(cls));
- sb.deleteCharAt(sb.length() - 1); // Remove ;
- sb.append('<').append(getSignature(getErasure(p))).append(">;");
- return sb.toString();
- } else if (Map.class.isAssignableFrom(cls) && (type instanceof ParameterizedType)) {
- ParameterizedType pType = (ParameterizedType)type;
- Type key = pType.getActualTypeArguments()[0];
- Type value = pType.getActualTypeArguments()[1];
- StringBuffer sb = new StringBuffer();
- sb.append(getSignature(cls));
- sb.deleteCharAt(sb.length() - 1); // Remove ;
- sb.append('<').append(getSignature(getErasure(key))).append(getSignature(getErasure(value))).append(">;");
- return sb.toString();
- } else {
- return getSignature(cls);
- }
- }
-
- /**
- * @param type
- * @return
- */
- public static String getSignature(Type type) {
- if (!(type instanceof Class)) {
- if (type instanceof ParameterizedType) {
- ParameterizedType pType = (ParameterizedType)type;
- StringBuffer sb = new StringBuffer();
- String rawType = getSignature(pType.getRawType());
- sb.append(rawType.substring(0, rawType.length() - 1));
- sb.append('<');
- for (Type t : pType.getActualTypeArguments()) {
- String argType = getSignature(t);
- sb.append(argType);
- }
- sb.append('>');
- sb.append(rawType.substring(rawType.length() - 1));
- return sb.toString();
- }
- if (type instanceof TypeVariable) {
- return "T" + ((TypeVariable<?>)type).getName() + ";";
- }
- if (type instanceof GenericArrayType) {
- GenericArrayType arrayType = (GenericArrayType)type;
- return "[" + getSignature(arrayType.getGenericComponentType());
- }
- if (type instanceof WildcardType) {
- WildcardType wType = (WildcardType)type;
- Type[] types = wType.getUpperBounds();
- StringBuffer sb = new StringBuffer();
- if (types.length == 0 || !(types.length == 1 && types[0] == Object.class)) {
- sb.append('+');
- for (Type t : types) {
- sb.append(getSignature(t));
- }
- }
- types = wType.getLowerBounds();
- if (types.length != 0) {
- sb.append('-');
- for (Type t : wType.getLowerBounds()) {
- sb.append(getSignature(t));
- }
- }
- if (sb.length() == 0) {
- return "*";
- }
- return sb.toString();
- }
- }
- Class<?> cls = (Class<?>)type;
- return org.objectweb.asm.Type.getDescriptor(cls);
- }
-
- /**
- * Get the actual type arguments a child class has used to extend a generic base class.
- *
- * @param baseClass the base class
- * @param childClass the child class
- * @return a list of the raw classes for the actual type arguments.
- */
- public static <T> List<Class<?>> resovleTypeArguments(Class<T> baseClass, Class<? extends T> childClass) {
- Map<Type, Type> resolvedTypes = new HashMap<Type, Type>();
- Type type = childClass;
- // start walking up the inheritance hierarchy until we hit baseClass
- while (!getErasure(type).equals(baseClass)) {
- if (type instanceof Class) {
- // there is no useful information for us in raw types, so just keep going.
- type = ((Class<?>)type).getGenericSuperclass();
- } else {
- ParameterizedType parameterizedType = (ParameterizedType)type;
- Class<?> rawType = getErasure(parameterizedType.getRawType());
-
- Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
- TypeVariable<?>[] typeParameters = rawType.getTypeParameters();
- for (int i = 0; i < actualTypeArguments.length; i++) {
- resolvedTypes.put(typeParameters[i], actualTypeArguments[i]);
- }
-
- if (!rawType.equals(baseClass)) {
- type = rawType.getGenericSuperclass();
- }
- }
- }
-
- // finally, for each actual type argument provided to baseClass, determine (if possible)
- // the raw class for that type argument.
- Type[] actualTypeArguments;
- if (type instanceof Class) {
- actualTypeArguments = ((Class<?>)type).getTypeParameters();
- } else {
- actualTypeArguments = ((ParameterizedType)type).getActualTypeArguments();
- }
- List<Class<?>> typeArgumentsAsClasses = new ArrayList<Class<?>>();
- // resolve types by chasing down type variables.
- for (Type baseType : actualTypeArguments) {
- while (resolvedTypes.containsKey(baseType)) {
- baseType = resolvedTypes.get(baseType);
- }
- typeArgumentsAsClasses.add(getErasure(baseType));
- }
- return typeArgumentsAsClasses;
- }
-
- /*
- signatures.put(boolean.class, "Z");
- signatures.put(byte.class, "B");
- signatures.put(char.class, "C");
- signatures.put(short.class, "S");
- signatures.put(int.class, "I");
- signatures.put(long.class, "J");
- signatures.put(float.class, "F");
- signatures.put(double.class, "D");
- */
- public static int getLoadOPCode(String signature) {
- if ("Z".equals(signature) || "B".equals(signature)
- || "C".equals(signature)
- || "S".equals(signature)
- || "I".equals(signature)) {
- return Opcodes.ILOAD;
- }
-
- if ("J".equals(signature)) {
- return Opcodes.LLOAD;
- }
-
- if ("F".equals(signature)) {
- return Opcodes.FLOAD;
- }
-
- if ("D".equals(signature)) {
- return Opcodes.DLOAD;
- }
-
- return Opcodes.ALOAD;
-
- }
-
- public static int getReturnOPCode(String signature) {
- if ("Z".equals(signature) || "B".equals(signature)
- || "C".equals(signature)
- || "S".equals(signature)
- || "I".equals(signature)) {
- return Opcodes.IRETURN;
- }
-
- if ("J".equals(signature)) {
- return Opcodes.LRETURN;
- }
-
- if ("F".equals(signature)) {
- return Opcodes.FRETURN;
- }
-
- if ("D".equals(signature)) {
- return Opcodes.DRETURN;
- }
- if ("V".equals(signature)) {
- return Opcodes.RETURN;
- }
-
- return Opcodes.ARETURN;
-
- }
-
- /**
- * Get the package prefix for generated JAXWS artifacts
- * @param cls
- * @return
- */
- public static String getPackagePrefix(Class<?> cls) {
- String name = cls.getName();
- int index = name.lastIndexOf('.');
- if (index == -1) {
- return "jaxws.";
- } else {
- return name.substring(0, index) + ".jaxws.";
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGenerator.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGenerator.java
deleted file mode 100644
index 40fbefa3ed..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGenerator.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.java.jaxws;
-
-import java.beans.BeanInfo;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.WebFault;
-
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-import org.objectweb.asm.ClassWriter;
-
-public class FaultBeanGenerator extends BaseBeanGenerator {
- public FaultBeanGenerator() {
- super();
- }
-
- protected BeanProperty[] getProperties(Class<? extends Throwable> exceptionClass) {
- BeanInfo beanInfo;
- try {
- beanInfo = Introspector.getBeanInfo(exceptionClass);
- } catch (IntrospectionException e) {
- throw new IllegalArgumentException(e);
- }
- List<BeanProperty> props = new ArrayList<BeanProperty>();
- for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
- if (pd.getReadMethod() != null) {
- String name = pd.getReadMethod().getName();
- if ("getClass".equals(name) || "getStackTrace".equals(name)
- || "getCause".equals(name)
- || "getLocalizedMessage".equals(name)) {
- continue;
- }
- // Add the field
- String field = pd.getName();
- Method getter = pd.getReadMethod();
- props.add(new BeanProperty("", field, getter.getReturnType(), getter.getGenericReturnType(), false));
- }
- }
- Collections.sort(props, new Comparator<BeanProperty>() {
- public int compare(BeanProperty o1, BeanProperty o2) {
- return o1.getName().compareTo(o2.getName());
- }
- });
- return props.toArray(new BeanProperty[0]);
- }
-
- public byte[] generate(Class<? extends Throwable> exceptionClass) {
- String className = getFaultBeanName(exceptionClass);
- ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
- String classDescriptor = className.replace('.', '/');
- String classSignature = "L" + classDescriptor + ";";
- QName element = getElementName(exceptionClass);
- String namespace = element.getNamespaceURI();
- String name = element.getLocalPart();
- return defineClass(cw, classDescriptor, classSignature, namespace, name, getProperties(exceptionClass));
- }
-
- public Class<?> generate(Class<? extends Throwable> exceptionClass, GeneratedClassLoader cl) {
- synchronized (exceptionClass) {
- Class<?> faultBeanClass = generatedClasses.get(exceptionClass);
- if (faultBeanClass == null) {
- String className = getFaultBeanName(exceptionClass);
- String classDescriptor = className.replace('.', '/');
- String classSignature = "L" + classDescriptor + ";";
- QName element = getElementName(exceptionClass);
- String namespace = element.getNamespaceURI();
- String name = element.getLocalPart();
- faultBeanClass =
- generate(classDescriptor, classSignature, namespace, name, getProperties(exceptionClass), cl);
- generatedClasses.put(exceptionClass, faultBeanClass);
- }
- return faultBeanClass;
- }
- }
-
- private static String getFaultBeanName(Class<?> exceptionClass) {
- String faultBeanName = null;
- WebFault webFault = exceptionClass.getAnnotation(WebFault.class);
- if (webFault != null) {
- faultBeanName = webFault.faultBean();
- if (!"".equals(faultBeanName)) {
- return faultBeanName;
- }
- }
-
- String name = exceptionClass.getName();
- int index = name.lastIndexOf('.');
- String pkg = name.substring(0, index);
- String clsName = name.substring(index + 1);
-
- // FIXME: [rfeng] This is a workaround to avoid "Prohibited package name: java.lang.jaxws"
- if (pkg.startsWith("java.") || pkg.startsWith("javax.")) {
- pkg = "tuscany";
- }
- faultBeanName = (pkg + ".jaxws." + clsName + "Bean");
- return faultBeanName;
- }
-
- public static QName getElementName(Class<? extends Throwable> exceptionClass) {
- WebFault webFault = exceptionClass.getAnnotation(WebFault.class);
- String namespace = null;
- String name = null;
- if (webFault != null) {
- namespace = webFault.targetNamespace();
- name = webFault.name();
- }
- if (namespace == null) {
- namespace = JavaInterfaceUtil.getNamespace(exceptionClass);
- }
- if (name == null) {
- name = exceptionClass.getSimpleName();
- }
- return new QName(namespace, name);
- }
-
- public static Class<?> generateFaultBeanClass(Class<? extends Throwable> exceptionClass) {
- FaultBeanGenerator generator = new FaultBeanGenerator();
- GeneratedClassLoader cl = new GeneratedClassLoader(exceptionClass.getClassLoader());
- return generator.generate(exceptionClass, cl);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedClassLoader.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedClassLoader.java
deleted file mode 100644
index f36dd3a443..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedClassLoader.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-import java.security.SecureClassLoader;
-import java.util.HashMap;
-import java.util.Map;
-
-public class GeneratedClassLoader extends SecureClassLoader {
- private class GeneratedClass {
- private String className;
- private byte[] byteCode;
- private Class<?> cls;
-
- public GeneratedClass(String className, byte[] byteCode) {
- super();
- this.className = className;
- this.byteCode = byteCode;
- }
-
- public synchronized Class<?> getGeneratedClass() {
- if (cls == null) {
- cls = defineClass(className, byteCode, 0, byteCode.length);
- }
- return cls;
- }
- }
-
- private Map<String, GeneratedClass> generatedClasses = new HashMap<String, GeneratedClass>();
-
- public GeneratedClassLoader(ClassLoader parentLoader) {
- super(parentLoader);
- }
-
- @Override
- protected Class<?> findClass(String className) throws ClassNotFoundException {
- GeneratedClass cls = generatedClasses.get(className);
- if (cls != null) {
- return cls.getGeneratedClass();
- }
- return super.findClass(className);
- }
-
- public synchronized Class<?> getGeneratedClass(String className, byte[] byteCode) {
- GeneratedClass cls = generatedClasses.get(className);
- if (cls == null) {
- cls = new GeneratedClass(className, byteCode);
- generatedClasses.put(className, cls);
- }
- return cls.getGeneratedClass();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedDataTypeImpl.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedDataTypeImpl.java
deleted file mode 100644
index c3f568ef48..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/GeneratedDataTypeImpl.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding;
-import org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * A special data type that generate the class on demand
- * @version $Rev$ $Date$
- */
-public class GeneratedDataTypeImpl implements DataType<XMLType> {
- private XMLAdapterExtensionPoint xmlAdapters;
-
- private Class<?> physical;
- private XMLType logical;
-
- private Map<Class<?>, Object> metaDataMap;
- private Method method;
- private String wrapperClassName;
- private String wrapperNamespace;
- private String wrapperName;
- private boolean request;
- private GeneratedClassLoader classLoader;
-
- private Class<? extends Throwable> exceptionClass;
-
- public GeneratedDataTypeImpl(XMLAdapterExtensionPoint xmlAdapters, Class<? extends Throwable> exceptionClass, GeneratedClassLoader cl) {
- super();
- this.exceptionClass = exceptionClass;
- this.classLoader = cl;
- QName name = FaultBeanGenerator.getElementName(exceptionClass);
- this.logical = new XMLType(name, name);
- this.xmlAdapters = xmlAdapters;
- }
-
- public GeneratedDataTypeImpl(XMLAdapterExtensionPoint xmlAdapters,
- Method m,
- String wrapperClassName,
- String wrapperNamespace,
- String wrapperName,
- boolean request,
- GeneratedClassLoader cl) {
- super();
- this.method = m;
- this.wrapperClassName = wrapperClassName;
- this.wrapperNamespace = wrapperNamespace;
- this.wrapperName = wrapperName;
- this.classLoader = cl;
- this.request = request;
- QName name = new QName(wrapperNamespace, wrapperName);
- this.logical = new XMLType(name, name);
- this.xmlAdapters = xmlAdapters;
- }
-
- public String getDataBinding() {
- return JAXBDataBinding.NAME;
- }
-
- public Type getGenericType() {
- return getPhysical();
- }
-
- public XMLType getLogical() {
- return logical;
- }
-
- public synchronized Class<?> getPhysical() {
- if (physical == null) {
- if (method != null) {
- WrapperBeanGenerator generator = new WrapperBeanGenerator();
- generator.setXmlAdapters(xmlAdapters);
- physical =
- request ? generator.generateRequestWrapper(method, wrapperClassName, wrapperNamespace, wrapperName, classLoader)
- : generator.generateResponseWrapper(method, wrapperClassName, wrapperNamespace, wrapperName, classLoader);
- ;
- } else if (exceptionClass != null) {
- FaultBeanGenerator faultBeanGenerator = new FaultBeanGenerator();
- faultBeanGenerator.setXmlAdapters(xmlAdapters);
- physical = faultBeanGenerator.generate(exceptionClass, classLoader);
- }
- }
- return physical;
- }
-
- public void setDataBinding(String dataBinding) {
- // NOP
- }
-
- public void setGenericType(Type genericType) {
- // NOP
- }
-
- public void setLogical(XMLType logical) {
- this.logical = logical;
- }
-
- public void setPhysical(Class<?> cls) {
- // NOP
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public <T> T getMetaData(Class<T> type) {
- return metaDataMap == null ? null : type.cast(metaDataMap.get(type));
- }
-
- public <T> void setMetaData(Class<T> type, T metaData) {
- if (metaDataMap == null) {
- metaDataMap = new ConcurrentHashMap<Class<?>, Object>();
- }
- metaDataMap.put(type, metaData);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java
deleted file mode 100644
index 242da0ebd4..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSFaultExceptionMapper.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.java.jaxws;
-
-import java.beans.BeanInfo;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.WebFault;
-
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.util.FaultException;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * JAX-WS ExceptionHandler
- *
- * @version $Rev$ $Date$
- */
-public class JAXWSFaultExceptionMapper implements FaultExceptionMapper {
- 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 static final Class<?>[] EMPTY_CLASS_ARRAY = new Class[0];
- private DataBindingExtensionPoint dataBindingExtensionPoint;
- private XMLAdapterExtensionPoint xmlAdapterExtensionPoint;
-
-
- public JAXWSFaultExceptionMapper(DataBindingExtensionPoint dataBindingExtensionPoint, XMLAdapterExtensionPoint xmlAdapters) {
- super();
- this.dataBindingExtensionPoint = dataBindingExtensionPoint;
- this.xmlAdapterExtensionPoint = xmlAdapters;
- }
-
- /**
- * The following is quoted from the JAX-WS Specification v2.1
- * <ul>
- * <li>WrapperException(String message, FaultBean faultInfo) <br>
- * A constructor where WrapperException is replaced with the name of the
- * generated wrapper exception and FaultBean is replaced by the name of the
- * generated fault bean.
- * <li> WrapperException(String message, FaultBean faultInfo, Throwable
- * cause) <br>
- * A constructor where WrapperException is replaced with the name of the
- * generated wrapper exception and FaultBean is replaced by the name of the
- * generated fault bean. The last argument, cause, may be used to convey
- * protocol specific fault information
- * </ul>
- */
- @SuppressWarnings("unchecked")
- public Throwable wrapFaultInfo(DataType<DataType> exceptionType, String message, Object faultInfo, Throwable cause, Operation operation) {
- Class<?> exceptionClass = exceptionType.getPhysical();
- if (exceptionClass.isInstance(faultInfo)) {
- return (Throwable)faultInfo;
- }
- DataType<?> faultBeanType = exceptionType.getLogical();
- Class<?> faultBeanClass = faultBeanType.getPhysical();
- try {
- Throwable exc =
- newInstance((Class<? extends Throwable>)exceptionClass, message, faultBeanClass, faultInfo, cause);
- // Include the elem name into the FaultException we build so it can be used for matching in the DataTransformationInterceptor
- //
- // Note this may happen even if we find a constructor above, that is the type of the non-generic fault exc may be an instance
- // of FaultException
- //
- if ((exc instanceof FaultException) && (faultBeanType.getLogical() instanceof XMLType)) {
- FaultException faultExc = (FaultException)exc;
- DataType<XMLType> faultBeanXMLType = (DataType<XMLType>)faultBeanType;
- XMLType faultLogical = faultBeanXMLType.getLogical();
- faultExc.setFaultName(faultLogical.getElementName());
- }
- return exc;
- } catch (Throwable e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- private Throwable newInstance(Class<? extends Throwable> exceptionClass,
- String message,
- Class<?> faultBeanClass,
- Object faultInfo,
- Throwable cause) throws Exception {
- Throwable ex = null;
- Constructor<? extends Throwable> ctor = null;
- try {
- // Get the message property
- Method getMessage = faultBeanClass.getMethod("getMessage");
- message = (String)getMessage.invoke(faultInfo);
- } catch (Throwable e) {
- // Ignore
- }
- try {
- // FIXME: What about if the faultBeanClass is a subclass of the argument type?
- ctor = exceptionClass.getConstructor(String.class, faultBeanClass, Throwable.class);
- ex = ctor.newInstance(message, faultInfo, cause);
- } catch (NoSuchMethodException e1) {
- try {
- ctor = exceptionClass.getConstructor(String.class, faultInfo.getClass());
- ex = ctor.newInstance(message, faultInfo);
- } catch (NoSuchMethodException e2) {
- try {
- ctor = exceptionClass.getConstructor(String.class, Throwable.class);
- ex = ctor.newInstance(message, cause);
- populateException(ex, faultInfo);
- } catch (NoSuchMethodException e3) {
- try {
- ctor = exceptionClass.getConstructor(String.class);
- ex = ctor.newInstance(message);
- populateException(ex, faultInfo);
- } catch (NoSuchMethodException e4) {
- ctor = exceptionClass.getConstructor();
- if (ctor != null) {
- ex = ctor.newInstance();
- populateException(ex, faultInfo);
- } else {
- ex = new FaultException(message, faultInfo, cause);
- }
- }
- }
- }
- }
- return ex;
- }
-
- /**
- * Populate the java exception from the fault bean
- * @param ex
- * @param faultBean
- * @throws Exception
- */
- private void populateException(Throwable ex, Object faultBean) throws Exception {
- PropertyDescriptor props[] = Introspector.getBeanInfo(faultBean.getClass()).getPropertyDescriptors();
- for (PropertyDescriptor p : props) {
- Method getter = p.getReadMethod();
- Method setter = p.getWriteMethod();
- if (getter == null || setter == null) {
- continue;
- }
- try {
- Method m = ex.getClass().getMethod(setter.getName(), setter.getParameterTypes());
- Object pv = getter.invoke(faultBean);
- m.invoke(ex, pv);
- } catch (Exception e) {
- // Ignore;
- }
- }
- }
-
- public Object getFaultInfo(Throwable exception, Class<?> faultBeanClass, Operation operation) {
- if (exception == null) {
- return null;
- }
-
- // Check if it's the generic FaultException
- if (exception instanceof FaultException) {
- return ((FaultException)exception).getFaultInfo();
- }
-
- try {
- Method method = exception.getClass().getMethod("getFaultInfo", EMPTY_CLASS_ARRAY);
- return method.invoke(exception, (Object[])null);
- } catch (NoSuchMethodException e) {
- // Follow the JAX-WS v2.1 Specification section 3.7
- return createFaultBean(exception, faultBeanClass);
- } catch (Throwable e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- private Object createFaultBean(Throwable exception, Class<?> faultBeanClass) {
- /**
- * For each getter in the exception and its superclasses, a property of the same
- * type and name is added to the bean. The getCause, getLocalizedMessage and
- * getStackTrace getters from java.lang.Throwable and the getClass getter from
- * java.lang.Object are excluded from the list of getters to be mapped.
- */
- // Return the exception as-is if it's already the fault bean
- if (faultBeanClass.isInstance(exception)) {
- return exception;
- }
- try {
- Object faultBean = null;
- for (Constructor<?> ctor : faultBeanClass.getConstructors()) {
- Class<?>[] params = ctor.getParameterTypes();
- if (params.length == 1 && String.class == params[0]) {
- faultBean = ctor.newInstance(exception.getMessage());
- } else if (params.length == 2 && String.class == params[0]
- && Throwable.class.isAssignableFrom(params[1])) {
- faultBean = ctor.newInstance(exception.getMessage(), exception);
- } else if (params.length == 0) {
- faultBean = ctor.newInstance();
- }
- if (faultBean != null) {
- break;
- }
- }
- if (faultBean == null) {
- return exception;
- }
- BeanInfo beanInfo = Introspector.getBeanInfo(exception.getClass());
- for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
- Method getter = pd.getReadMethod();
- String name = getter.getName();
- if (!isMappedGetter(name)) {
- continue;
- }
- Method setter = null;
- try {
- setter = faultBeanClass.getMethod("set" + capitalize(pd.getName()), getter.getReturnType());
- } catch (NoSuchMethodException e) {
- continue;
- }
- Object prop = getter.invoke(exception);
- setter.invoke(faultBean, prop);
- }
- return faultBean;
- } catch (Throwable ex) {
- throw new IllegalArgumentException(ex);
- }
- }
-
- @SuppressWarnings("unchecked")
- public boolean introspectFaultDataType(DataType<DataType> exceptionType, final Operation operation, final boolean generatingFaultBean) {
- QName faultName = null;
- boolean result = false;
-
- final Class<?> cls = exceptionType.getPhysical();
- if (cls == FaultException.class) {
- return true;
- }
- DataType faultType = (DataType)exceptionType.getLogical();
- Class<?> faultBean = null;
- final WebFault fault = cls.getAnnotation(WebFault.class);
- if (fault != null) {
- if (!"".equals(fault.name()) || !"".equals(fault.targetNamespace())) {
- QName faultQName = ((XMLType)faultType.getLogical()).getElementName();
- String faultNS =
- "".equals(fault.targetNamespace()) ? faultQName.getNamespaceURI() : fault.targetNamespace();
- String faultLocal = "".equals(fault.name()) ? faultQName.getLocalPart() : fault.name();
- faultName = new QName(faultNS, faultLocal);
- XMLType xmlType = new XMLType(faultName, null);
- faultType.setLogical(xmlType);
- }
- if (!"".equals(fault.faultBean())) {
- faultBean = AccessController.doPrivileged(new PrivilegedAction<Class<?>>() {
- public Class<?> run() {
- try {
- return Class.forName(fault.faultBean(), false, cls.getClassLoader());
- } catch (ClassNotFoundException e) {
- throw new ServiceRuntimeException(e);
- }
- }
- });
- } else {
- Method m;
- try {
- m = cls.getMethod("getFaultInfo", (Class[])null);
- faultBean = m.getReturnType();
- } catch (NoSuchMethodException e) {
- // Ignore
- }
- }
- }
-
- if (faultBean == null) {
- final String faultBeanClassName = CodeGenerationHelper.getPackagePrefix(cls) + cls.getSimpleName() + "Bean";
- final QName qname = faultName;
- faultType = AccessController.doPrivileged(new PrivilegedAction<DataType<XMLType>>() {
- public DataType<XMLType> run() {
- try {
- Class<?> faultBean = Class.forName(faultBeanClassName, false, cls.getClassLoader());
- return new DataTypeImpl<XMLType>(faultBean, new XMLType(qname, qname));
- } catch (ClassNotFoundException e) {
- if (generatingFaultBean) {
- Class<? extends Throwable> t = (Class<? extends Throwable>)cls;
- ClassLoader parent =
- operation == null ? t.getClassLoader() : ((JavaInterface)operation.getInterface())
- .getJavaClass().getClassLoader();
- GeneratedClassLoader cl = new GeneratedClassLoader(parent);
- GeneratedDataTypeImpl dt = new GeneratedDataTypeImpl(xmlAdapterExtensionPoint, t, cl);
- return dt;
- } else {
- return new DataTypeImpl<XMLType>(cls, new XMLType(qname, qname));
- }
- }
- }
- });
- } else {
- faultType.setDataBinding(null);
- faultType.setGenericType(faultBean);
- faultType.setPhysical(faultBean);
- }
-
- // TODO: Use the databinding framework to introspect the fault bean class
- if (faultType.getDataBinding() == null && dataBindingExtensionPoint != null) {
- faultBean = faultType.getPhysical();
- result =
- dataBindingExtensionPoint.introspectType(faultType, operation);
- }
- ((DataType) exceptionType).setLogical(faultType);
-
- /*
- The introspection of the fault DT may not have calculated the correct element name,
- though we may have already done this in this method. Let's look at the DataType now
- that introspection is done, and, if it has an XMLType, let's set the element to the
- 'faultName' if we calculated one.
- */
- if ((faultName != null) && (faultType.getLogical() instanceof XMLType)) {
- XMLType faultTypeXML = (XMLType)faultType.getLogical();
- // The element name (if set) should match the fault name
- faultTypeXML.setElementName(faultName);
- }
-
- return result;
- }
-
- public static boolean isMappedGetter(String methodName) {
- if (GETCAUSE.equals(methodName) || GETLOCALIZEDMESSAGE.equals(methodName)
- || GETSTACKTRACE.equals(methodName)
- || GETCLASS.equals(methodName)) {
- return false;
- } else {
- return true;
- }
- }
-
- private static String capitalize(String name) {
- if (name == null || name.length() == 0) {
- return name;
- } else {
- return Character.toUpperCase(name.charAt(0)) + name.substring(1);
- }
- }
-
- public void setDataBindingExtensionPoint(DataBindingExtensionPoint dataBindingExtensionPoint) {
- this.dataBindingExtensionPoint = dataBindingExtensionPoint;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
deleted file mode 100644
index 262b0405ec..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.java.jaxws;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPBinding.Style;
-import javax.xml.namespace.QName;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.javabeans.JavaExceptionDataBinding;
-import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding;
-import org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
-import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * Introspect the java class/interface with JSR-181 and JAXWS annotations
- *
- * @version $Rev$ $Date$
- */
-public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor {
- private static final String JAXB_DATABINDING = JAXBDataBinding.NAME;
- private static final String GET = "get";
- private DataBindingExtensionPoint dataBindingExtensionPoint;
- private FaultExceptionMapper faultExceptionMapper;
- private XMLAdapterExtensionPoint xmlAdapterExtensionPoint;
-
-
- public JAXWSJavaInterfaceProcessor(DataBindingExtensionPoint dataBindingExtensionPoint,
- FaultExceptionMapper faultExceptionMapper,
- XMLAdapterExtensionPoint xmlAdapters) {
- super();
- this.dataBindingExtensionPoint = dataBindingExtensionPoint;
- this.faultExceptionMapper = faultExceptionMapper;
- this.xmlAdapterExtensionPoint = xmlAdapters;
- }
-
- public JAXWSJavaInterfaceProcessor() {
- super();
- }
-
- private static String capitalize(String name) {
- if (name == null || name.length() == 0) {
- return name;
- } else {
- return Character.toUpperCase(name.charAt(0)) + name.substring(1);
- }
- }
-
- public void visitInterface(JavaInterface contract) throws InvalidInterfaceException {
-
- final Class<?> clazz = contract.getJavaClass();
- WebService webService = clazz.getAnnotation(WebService.class);
- String tns = JavaXMLMapper.getNamespace(clazz);
- String localName = clazz.getSimpleName();
- if (webService != null) {
- tns = getValue(webService.targetNamespace(), tns);
- localName = getValue(webService.name(), localName);
- contract.setQName(new QName(tns, localName));
- // Mark SEI as Remotable
- contract.setRemotable(true);
- }
- if (!contract.isRemotable()) {
- return;
- }
-
- // SOAP binding (doc/lit/wrapped|bare or rpc/lit)
- SOAPBinding soapBinding = clazz.getAnnotation(SOAPBinding.class);
-
- for (Iterator<Operation> it = contract.getOperations().iterator(); it.hasNext();) {
- final JavaOperation operation = (JavaOperation)it.next();
- final Method method = operation.getJavaMethod();
- introspectFaultTypes(operation);
-
- // SOAP binding (doc/lit/wrapped|bare or rpc/lit)
- SOAPBinding methodSOAPBinding = method.getAnnotation(SOAPBinding.class);
- if (methodSOAPBinding == null) {
- methodSOAPBinding = soapBinding;
- }
-
- boolean documentStyle = true;
- boolean bare = false;
- if (methodSOAPBinding != null) {
- bare = methodSOAPBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE;
- if(bare) {
- // For BARE parameter style, the data won't be unwrapped
- // The wrapper should be null
- operation.setWrapperStyle(false);
- }
- documentStyle = methodSOAPBinding.style() == Style.DOCUMENT;
- }
-
- String operationName = operation.getName();
- // WebMethod
- WebMethod webMethod = method.getAnnotation(WebMethod.class);
- if (webMethod != null) {
- if (webMethod.exclude()) {
- // Exclude the method
- it.remove();
- continue;
- }
- operationName = getValue(webMethod.operationName(), operationName);
- operation.setName(operationName);
- operation.setAction(webMethod.action());
- }
-
- // Is one way?
- Oneway oneway = method.getAnnotation(Oneway.class);
- if (oneway != null) {
- // JSR 181
- assert method.getReturnType() == void.class;
- operation.setNonBlocking(true);
- }
-
- // Handle BARE mapping
- if (bare) {
- for (int i = 0; i < method.getParameterTypes().length; i++) {
- WebParam param = getAnnotation(method, i, WebParam.class);
- if (param != null) {
- String ns = getValue(param.targetNamespace(), tns);
- // Default to <operationName> for doc-bare
- String name = getValue(param.name(), documentStyle ? operationName : "arg" + i);
- QName element = new QName(ns, name);
- Object logical = operation.getInputType().getLogical().get(i).getLogical();
- if (logical instanceof XMLType) {
- ((XMLType)logical).setElementName(element);
- }
- }
- }
- WebResult result = method.getAnnotation(WebResult.class);
- if (result != null) {
- String ns = getValue(result.targetNamespace(), tns);
- // Default to <operationName>Response for doc-bare
- String name = getValue(result.name(), documentStyle ? operationName + "Response" : "return");
- QName element = new QName(ns, name);
- Object logical = operation.getOutputType().getLogical();
- if (logical instanceof XMLType) {
- ((XMLType)logical).setElementName(element);
- }
- }
- // FIXME: [rfeng] For the BARE mapping, do we need to create a Wrapper?
- // it's null at this point
- } else {
-
- RequestWrapper requestWrapper = method.getAnnotation(RequestWrapper.class);
- String ns = requestWrapper == null ? tns : getValue(requestWrapper.targetNamespace(), tns);
- String name =
- requestWrapper == null ? operationName : getValue(requestWrapper.localName(), operationName);
- String wrapperBeanName = requestWrapper == null ? "" : requestWrapper.className();
- if ("".equals(wrapperBeanName)) {
- wrapperBeanName = CodeGenerationHelper.getPackagePrefix(clazz) + capitalize(method.getName());
- }
-
- DataType<XMLType> inputWrapperDT = null;
-
- final String inputWrapperClassName = wrapperBeanName;
- final String inputNS = ns;
- final String inputName = name;
- inputWrapperDT = AccessController.doPrivileged(new PrivilegedAction<DataType<XMLType>>() {
- public DataType<XMLType> run() {
- try {
- Class<?> wrapperClass = Class.forName(inputWrapperClassName, false, clazz.getClassLoader());
- QName qname = new QName(inputNS, inputName);
- DataType dt = new DataTypeImpl<XMLType>(wrapperClass, new XMLType(qname, qname));
- dataBindingExtensionPoint.introspectType(dt, operation);
- // TUSCANY-2505
- if (dt.getLogical() instanceof XMLType) {
- XMLType xmlType = (XMLType)dt.getLogical();
- xmlType.setElementName(qname);
- }
- return dt;
- } catch (ClassNotFoundException e) {
- GeneratedClassLoader cl = new GeneratedClassLoader(clazz.getClassLoader());
- return new GeneratedDataTypeImpl(xmlAdapterExtensionPoint, method, inputWrapperClassName, inputNS, inputName, true,
- cl);
- }
- }
- });
-
- QName inputWrapper = inputWrapperDT.getLogical().getElementName();
-
- ResponseWrapper responseWrapper = method.getAnnotation(ResponseWrapper.class);
- ns = responseWrapper == null ? tns : getValue(responseWrapper.targetNamespace(), tns);
- name =
- responseWrapper == null ? operationName + "Response" : getValue(responseWrapper.localName(),
- operationName + "Response");
- wrapperBeanName = responseWrapper == null ? "" : responseWrapper.className();
- if ("".equals(wrapperBeanName)) {
- wrapperBeanName =
- CodeGenerationHelper.getPackagePrefix(clazz) + capitalize(method.getName()) + "Response";
- }
-
- DataType<XMLType> outputWrapperDT = null;
- final String outputWrapperClassName = wrapperBeanName;
- final String outputNS = ns;
- final String outputName = name;
-
- outputWrapperDT = AccessController.doPrivileged(new PrivilegedAction<DataType<XMLType>>() {
- public DataType<XMLType> run() {
- try {
- Class<?> wrapperClass =
- Class.forName(outputWrapperClassName, false, clazz.getClassLoader());
- QName qname = new QName(outputNS, outputName);
- DataType dt = new DataTypeImpl<XMLType>(wrapperClass, new XMLType(qname, qname));
- dataBindingExtensionPoint.introspectType(dt, operation);
- // TUSCANY-2505
- if (dt.getLogical() instanceof XMLType) {
- XMLType xmlType = (XMLType)dt.getLogical();
- xmlType.setElementName(qname);
- }
- return dt;
- } catch (ClassNotFoundException e) {
- GeneratedClassLoader cl = new GeneratedClassLoader(clazz.getClassLoader());
- return new GeneratedDataTypeImpl(xmlAdapterExtensionPoint, method, outputWrapperClassName, outputNS, outputName,
- false, cl);
- }
- }
- });
- QName outputWrapper = outputWrapperDT.getLogical().getElementName();
-
- List<ElementInfo> inputElements = new ArrayList<ElementInfo>();
- for (int i = 0; i < method.getParameterTypes().length; i++) {
- WebParam param = getAnnotation(method, i, WebParam.class);
- ns = param != null ? param.targetNamespace() : "";
- // Default to "" for doc-lit-wrapped && non-header
- ns = getValue(ns, documentStyle && (param == null || !param.header()) ? "" : tns);
- name = param != null ? param.name() : "";
- name = getValue(name, "arg" + i);
- QName element = new QName(ns, name);
- Object logical = operation.getInputType().getLogical().get(i).getLogical();
- if (logical instanceof XMLType) {
- ((XMLType)logical).setElementName(element);
- }
- inputElements.add(new ElementInfo(element, null));
- }
-
- List<ElementInfo> outputElements = new ArrayList<ElementInfo>();
- WebResult result = method.getAnnotation(WebResult.class);
- // Default to "" for doc-lit-wrapped && non-header
- ns = result != null ? result.targetNamespace() : "";
- ns = getValue(ns, documentStyle && (result == null || !result.header()) ? "" : tns);
- name = result != null ? result.name() : "";
- name = getValue(name, "return");
- QName element = new QName(ns, name);
-
- if (operation.getOutputType() != null) {
- Object logical = operation.getOutputType().getLogical();
- if (logical instanceof XMLType) {
- ((XMLType)logical).setElementName(element);
- }
- outputElements.add(new ElementInfo(element, null));
- }
-
- String db = inputWrapperDT != null ? inputWrapperDT.getDataBinding() : JAXB_DATABINDING;
- WrapperInfo wrapperInfo =
- new WrapperInfo(db, new ElementInfo(inputWrapper, null), new ElementInfo(outputWrapper, null),
- inputElements, outputElements);
-
- wrapperInfo.setInputWrapperType(inputWrapperDT);
- wrapperInfo.setOutputWrapperType(outputWrapperDT);
-
- operation.setWrapper(wrapperInfo);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private void introspectFaultTypes(Operation operation) {
- if (operation != null && operation.getFaultTypes() != null) {
- for (DataType exceptionType : operation.getFaultTypes()) {
- faultExceptionMapper.introspectFaultDataType(exceptionType, operation, true);
- DataType faultType = (DataType)exceptionType.getLogical();
- if (faultType.getDataBinding() == JavaExceptionDataBinding.NAME) {
- // The exception class doesn't have an associated bean class, so
- // synthesize a virtual bean by introspecting the exception class.
- createSyntheticBean(operation, exceptionType);
- }
- }
- }
- }
-
- private void createSyntheticBean(Operation operation, DataType exceptionType) {
- DataType faultType = (DataType)exceptionType.getLogical();
- QName faultBeanName = ((XMLType)faultType.getLogical()).getElementName();
- List<DataType<XMLType>> beanDataTypes = new ArrayList<DataType<XMLType>>();
- for (Method aMethod : exceptionType.getPhysical().getMethods()) {
- if (Modifier.isPublic(aMethod.getModifiers()) && aMethod.getName().startsWith(GET)
- && aMethod.getParameterTypes().length == 0
- && JAXWSFaultExceptionMapper.isMappedGetter(aMethod.getName())) {
- String propName = resolvePropertyFromMethod(aMethod.getName());
- QName propQName = new QName(faultBeanName.getNamespaceURI(), propName);
- Class<?> propType = aMethod.getReturnType();
- XMLType xmlPropType = new XMLType(propQName, null);
- DataType<XMLType> propDT = new DataTypeImpl<XMLType>(propType, xmlPropType);
- org.apache.tuscany.sca.databinding.annotation.DataType dt =
- aMethod.getAnnotation(org.apache.tuscany.sca.databinding.annotation.DataType.class);
- if (dt != null) {
- propDT.setDataBinding(dt.value());
- }
- dataBindingExtensionPoint.introspectType(propDT, operation);
-
- // sort the list lexicographically as specified in JAX-WS spec section 3.7
- int i = 0;
- for (; i < beanDataTypes.size(); i++) {
- if (beanDataTypes.get(i).getLogical().getElementName().getLocalPart().compareTo(propName) > 0) {
- break;
- }
- }
- beanDataTypes.add(i, propDT);
- }
- }
- operation.getFaultBeans().put(faultBeanName, beanDataTypes);
- }
-
- private String resolvePropertyFromMethod(String methodName) {
- StringBuffer propName = new StringBuffer();
- propName.append(Character.toLowerCase(methodName.charAt(GET.length())));
- propName.append(methodName.substring(GET.length() + 1));
- return propName.toString();
- }
-
- private <T extends Annotation> T getAnnotation(Method method, int index, Class<T> annotationType) {
- Annotation[] annotations = method.getParameterAnnotations()[index];
- for (Annotation annotation : annotations) {
- if (annotation.annotationType() == annotationType) {
- return annotationType.cast(annotation);
- }
- }
- return null;
- }
-
- private static String getValue(String value, String defaultValue) {
- return "".equals(value) ? defaultValue : value;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java
deleted file mode 100644
index 764c10ff00..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGenerator.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.java.jaxws;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-
-public class WrapperBeanGenerator extends BaseBeanGenerator {
-
- public List<Class<?>> generateWrapperBeans(Class<?> sei) {
- GeneratedClassLoader cl = new GeneratedClassLoader(sei.getClassLoader());
- List<Class<?>> classes = new ArrayList<Class<?>>();
- for (Method m : sei.getMethods()) {
- if (m.getDeclaringClass() == Object.class) {
- continue;
- }
- classes.add(generateRequestWrapper(sei, m, cl));
- classes.add(generateResponseWrapper(sei, m, cl));
- }
- return classes;
-
- }
-
- public Class<?> generateRequestWrapper(Class<?> sei, Method m, GeneratedClassLoader cl) {
- String wrapperNamespace = JavaInterfaceUtil.getNamespace(sei);
- String wrapperName = m.getName();
- String wrapperBeanName = capitalize(wrapperName);
- String wrapperClassName = CodeGenerationHelper.getPackagePrefix(sei) + wrapperBeanName;
-
- return generateRequestWrapper(m, wrapperClassName, wrapperNamespace, wrapperName, cl);
- }
-
- public Class<?> generateRequestWrapper(Method m,
- String wrapperClassName,
- String wrapperNamespace,
- String wrapperName,
- GeneratedClassLoader cl) {
- synchronized (m.getDeclaringClass()) {
- MethodKey key = new MethodKey(m, true);
- Class<?> wrapperClass = generatedClasses.get(key);
- if (wrapperClass == null) {
- String wrapperClassDescriptor = wrapperClassName.replace('.', '/');
- String wrapperClassSignature = "L" + wrapperClassDescriptor + ";";
-
- Class<?>[] paramTypes = m.getParameterTypes();
- Type[] genericParamTypes = m.getGenericParameterTypes();
- Annotation[][] paramAnnotations = m.getParameterAnnotations();
- List<BeanProperty> properties = new ArrayList<BeanProperty>();
- for (int i = 0; i < paramTypes.length; i++) {
- String propNS = "";
- String propName = "arg" + i;
-
- WebParam webParam = findAnnotation(paramAnnotations[i], WebParam.class);
- if (webParam != null && webParam.header()) {
- continue;
- }
- WebParam.Mode mode = WebParam.Mode.IN;
- if (webParam != null) {
- mode = webParam.mode();
- if (webParam.name().length() > 0) {
- propName = webParam.name();
- }
- propNS = webParam.targetNamespace();
- }
- if (mode.equals(WebParam.Mode.IN) || mode.equals(WebParam.Mode.INOUT)) {
- java.lang.reflect.Type genericParamType = getHolderValueType(genericParamTypes[i]);
- Class<?> paramType = CodeGenerationHelper.getErasure(genericParamType);
- BeanProperty prop = new BeanProperty(propNS, propName, paramType, genericParamType, true);
- prop.getJaxbAnnotaions().addAll(findJAXBAnnotations(paramAnnotations[i]));
- properties.add(prop);
- }
- }
-
- wrapperClass =
- generate(wrapperClassDescriptor, wrapperClassSignature, wrapperNamespace, wrapperName, properties
- .toArray(new BeanProperty[properties.size()]), cl);
- generatedClasses.put(key, wrapperClass);
- }
- return wrapperClass;
-
- }
- }
-
- public Class<?> generateResponseWrapper(Class<?> sei, Method m, GeneratedClassLoader cl) {
- String wrapperNamespace = JavaInterfaceUtil.getNamespace(sei);
-
- String wrapperName = m.getName() + "Response";
- String wrapperBeanName = capitalize(wrapperName);
- String wrapperClassName = CodeGenerationHelper.getPackagePrefix(sei) + wrapperBeanName;
- return generateResponseWrapper(m, wrapperClassName, wrapperNamespace, wrapperName, cl);
-
- }
-
- public Class<?> generateResponseWrapper(Method m,
- String wrapperClassName,
- String wrapperNamespace,
- String wrapperName,
- GeneratedClassLoader cl) {
- synchronized (m.getDeclaringClass()) {
- MethodKey key = new MethodKey(m, false);
- Class<?> wrapperClass = generatedClasses.get(key);
- if (wrapperClass == null) {
- String wrapperClassDescriptor = wrapperClassName.replace('.', '/');
- String wrapperClassSignature = "L" + wrapperClassDescriptor + ";";
-
- List<BeanProperty> properties = new ArrayList<BeanProperty>();
- // Collect all OUT, INOUT parameters as fields
- Annotation[][] paramAnns = m.getParameterAnnotations();
- Class<?>[] paramTypes = m.getParameterTypes();
- java.lang.reflect.Type[] genericParamTypes = m.getGenericParameterTypes();
- for (int i = 0; i < paramTypes.length; i++) {
- WebParam webParam = findAnnotation(paramAnns[i], WebParam.class);
- if (webParam != null) {
- if (webParam.header() || webParam.mode() == WebParam.Mode.IN) {
- continue;
- }
- }
- if (!isHolder(genericParamTypes[i])) {
- continue;
- }
-
- List<Annotation> jaxb = findJAXBAnnotations(paramAnns[i]);
-
- java.lang.reflect.Type genericParamType = getHolderValueType(genericParamTypes[i]);
- Class<?> paramType = CodeGenerationHelper.getErasure(genericParamType);
-
- String paramNamespace = "";
- String paramName = "arg" + i;
-
- if (webParam != null) {
- if (webParam.name().length() > 0)
- paramName = webParam.name();
- if (webParam.targetNamespace().length() > 0)
- paramNamespace = webParam.targetNamespace();
- }
-
- BeanProperty prop = new BeanProperty(paramNamespace, paramName, paramType, genericParamType, true);
- prop.getJaxbAnnotaions().addAll(jaxb);
- properties.add(prop);
- }
-
- WebResult webResult = m.getAnnotation(WebResult.class);
- Class<?> returnType = m.getReturnType();
- if (!((webResult != null && webResult.header()) || returnType == Void.TYPE)) {
- String propName = "return";
- String propNS = "";
-
- if (webResult != null) {
- if (webResult.name().length() > 0) {
- propName = webResult.name();
- }
- if (webResult.targetNamespace().length() > 1) {
- propNS = webResult.targetNamespace();
- }
- }
-
- List<Annotation> jaxb = findJAXBAnnotations(m.getAnnotations());
-
- Type genericReturnType = m.getGenericReturnType();
- BeanProperty prop = new BeanProperty(propNS, propName, returnType, genericReturnType, true);
- prop.getJaxbAnnotaions().addAll(jaxb);
- properties.add(prop);
- }
- wrapperClass =
- generate(wrapperClassDescriptor, wrapperClassSignature, wrapperNamespace, wrapperName, properties
- .toArray(new BeanProperty[properties.size()]), cl);
- generatedClasses.put(key, wrapperClass);
- }
- return wrapperClass;
-
- }
- }
-
- private static class MethodKey {
- private Method m;
- private boolean request;
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((m == null) ? 0 : m.hashCode());
- result = prime * result + (request ? 1231 : 1237);
- 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 MethodKey other = (MethodKey)obj;
- if (m == null) {
- if (other.m != null)
- return false;
- } else if (!m.equals(other.m))
- return false;
- if (request != other.request)
- return false;
- return true;
- }
-
- public MethodKey(Method m, boolean request) {
- super();
- this.m = m;
- this.request = request;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java
deleted file mode 100644
index 1b07e25bad..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public interface Bean<T> {
- T getP1();
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java
deleted file mode 100644
index d38a21ba52..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean1.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Bean1 {
- private String p1;
- private int p2;
- public String getP1() {
- return p1;
- }
- public void setP1(String p1) {
- this.p1 = p1;
- }
- public int getP2() {
- return p2;
- }
- public void setP2(int p2) {
- this.p2 = p2;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java
deleted file mode 100644
index 7b9375063d..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/Bean2.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Bean2 implements Bean<String>{
- private String p1;
- private int p2;
- public String getP1() {
- return p1;
- }
- public void setP1(String p1) {
- this.p1 = p1;
- }
- public int getP2() {
- return p2;
- }
- public void setP2(int p2) {
- this.p2 = p2;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java
deleted file mode 100644
index 67b9c84399..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterface.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-/**
- * Bean Interface
- */
-public interface BeanInterface {
- String getAttr();
- void setAttr(String attr);
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java
deleted file mode 100644
index f964ea374b..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/BeanInterfaceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-/**
- * Impl of BeanInterface
- */
-public class BeanInterfaceImpl implements BeanInterface {
- private String attr;
-
- public String getAttr() {
- return attr;
- }
-
- public void setAttr(String attr) {
- this.attr = attr;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java
deleted file mode 100644
index 4caeb79fca..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/FaultBeanGeneratorTestCase.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.annotation.Annotation;
-
-import javax.xml.bind.JAXBContext;
-
-import org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper;
-import org.junit.Assert;
-import org.junit.Test;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.util.CheckClassAdapter;
-
-/**
- * @version $Rev$ $Date$
- */
-public class FaultBeanGeneratorTestCase {
-
- @Test
- public void testGenerate() throws IOException {
- byte[] content = new FaultBeanGenerator().generate(MyException.class);
- ClassReader cr = new ClassReader(content);
- PrintWriter pw = new PrintWriter(System.out);
- CheckClassAdapter.verify(cr, false, pw);
- }
-
- @Test
- public void testGenerateClass() throws Exception {
- Class<?> cls = FaultBeanGenerator.generateFaultBeanClass(MyException.class);
- Assert.assertEquals("org.apache.tuscany.sca.interfacedef.java.jaxws.jaxws.MyExceptionBean", cls.getName());
- for (Annotation a : cls.getAnnotations()) {
- System.out.println(a);
- }
- // XmlType xmlType = cls.getAnnotation(XmlType.class);
- // System.out.println(xmlType);
- Object bean = cls.newInstance();
- JAXBContext context = JAXBContextHelper.createJAXBContext(cls);
- StringWriter sw = new StringWriter();
- context.createMarshaller().marshal(bean, sw);
- System.out.println(sw.toString());
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java
deleted file mode 100644
index f82342fe28..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessorTestCase.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.jaxb.DefaultXMLAdapterExtensionPoint;
-import org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.example.stock.StockExceptionTest;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JAXWSJavaInterfaceProcessorTestCase {
- private JAXWSJavaInterfaceProcessor interfaceProcessor;
-
- @Before
- public void setUp() throws Exception {
- DataBindingExtensionPoint db = new DefaultDataBindingExtensionPoint();
- XMLAdapterExtensionPoint xa = new DefaultXMLAdapterExtensionPoint();
- interfaceProcessor = new JAXWSJavaInterfaceProcessor(db, new JAXWSFaultExceptionMapper(db, xa), xa);
- }
-
- @Test
- public void testWrapper() throws Exception {
- DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory();
- JavaInterface contract = iFactory.createJavaInterface(StockExceptionTest.class);
-
- interfaceProcessor.visitInterface(contract);
- Operation op = contract.getOperations().get(0);
- Assert.assertTrue(!op.isWrapperStyle());
- Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOffer"), op.getWrapper().getInputWrapperElement().getQName());
- Assert.assertEquals(new QName("http://www.example.com/stock", "stockQuoteOfferResponse"), op.getWrapper().getOutputWrapperElement().getQName());
- }
-
- /**
- * Test method for
- * {@link org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor#visitInterface(JavaInterface)}.
- */
- @Test
- public final void testProcessor() throws Exception {
- DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory();
- JavaInterface contract = iFactory.createJavaInterface(WebServiceInterfaceWithoutAnnotation.class);
-
- interfaceProcessor.visitInterface(contract);
- assertFalse(contract.isRemotable());
-
- contract = iFactory.createJavaInterface(WebServiceInterfaceWithAnnotation.class);
- interfaceProcessor.visitInterface(contract);
- assertTrue(contract.isRemotable());
-
- Operation op1 = contract.getOperations().get(0);
- Operation op2 = contract.getOperations().get(1);
-
- Operation op = null;
- if ("m1".equals(op1.getName())) {
- op = op1;
- } else {
- op = op2;
- }
-
- assertTrue(!op.isWrapperStyle() && op.getWrapper() == null);
-
- if ("M2".equals(op2.getName())) {
- op = op2;
- } else {
- op = op1;
- }
- assertTrue(!op.isWrapperStyle() && op.getWrapper() != null);
-
- }
-
- @WebService
- private static interface WebServiceInterfaceWithAnnotation {
-
- @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
- @WebMethod(operationName = "m1")
- String m1(String str);
-
- @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
- @WebMethod(operationName = "M2")
- String m2(String str, int i);
- }
-
- private static interface WebServiceInterfaceWithoutAnnotation {
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java
deleted file mode 100644
index 6315e12ff8..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JavaReflectionHelperTestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-import java.lang.reflect.Field;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaReflectionHelperTestCase {
- @Test
- public void testErasure() throws Exception {
- for (Field f : TestGenericClass.class.getDeclaredFields()) {
- Class<?> cls = CodeGenerationHelper.getErasure(f.getGenericType());
- System.out.println(cls.getName());
- Assert.assertSame(f.getType(), cls);
- }
- }
-
- @Test
- public void testSignature() throws Exception {
- for (Field f : TestGenericClass.class.getDeclaredFields()) {
- String sig = CodeGenerationHelper.getSignature(f.getGenericType());
- System.out.println(sig);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java
deleted file mode 100644
index 4df0517de6..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyException.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class MyException extends Exception {
- private String error;
- private int code;
-
- public MyException() {
- super();
- }
-
- public MyException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public MyException(String message) {
- super(message);
- }
-
- public MyException(Throwable cause) {
- super(cause);
- }
-
- public String getError() {
- return error;
- }
-
- public void setError(String error) {
- this.error = error;
- }
-
- public int getCode() {
- return code;
- }
-
- public void setCode(int code) {
- this.code = code;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java
deleted file mode 100644
index 78527193d5..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/MyServiceImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-import java.util.List;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-
-/**
- * @version $Rev$ $Date$
- */
-@WebService
-public class MyServiceImpl {
-
- public MyServiceImpl() {
- super();
- }
-
- @WebMethod
- public <T extends Bean1> T getBean(T b, Bean2 b2) {
- return null;
- }
-
- @WebMethod
- public List<? extends Bean1> getBeans() {
- return null;
- }
-
- @WebMethod
- public String convert(String str, int i) throws MyException {
- return "ME";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java
deleted file mode 100644
index fb319a3b0f..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestAdapter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-/**
- * Test XML Adapter
- */
-public class TestAdapter extends XmlAdapter<BeanInterfaceImpl, BeanInterface> {
-
- @Override
- public BeanInterfaceImpl marshal(BeanInterface v) throws Exception {
- return (BeanInterfaceImpl)v;
- }
-
- @Override
- public BeanInterface unmarshal(BeanInterfaceImpl v) throws Exception {
- return v;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java
deleted file mode 100644
index 2ecf822904..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestGenericClass.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TestGenericClass <T extends Serializable & List<String>, S> {
- public TestGenericClass<?, S> i;
- public T f1;
- public T[] f2;
- public S f3;
- public List<? extends T> list1;
- public List<?> list2;
- public List<? extends Serializable> list3;
- public int f4;
- public int[] f5;
- public Map<? super T, S> map;
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java
deleted file mode 100644
index 1f8e6cb445..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/TestInterface.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.ws.Holder;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface TestInterface {
- int convert(String currency1, String currency2);
-
- List<Double> getRates(String currency);
-
- void check(boolean flag);
-
- String[] list(int[] list);
-
- int[][] map(String[][] strs);
-
- String getGreetings(String name);
-
- String[] getGreetingsArray(String[] names);
-
- List<String> getGreetingsList(List<String> names);
-
- ArrayList<String> getGreetingsArrayList(ArrayList<String> names);
-
- Map<String, String> getGreetingsMap(Map<String, String> namesMap);
-
- HashMap<String, String> getGreetingsHashMap(HashMap<String, String> namesMap);
-
- @WebMethod
- @WebResult(name = "output")
- String webMethod(@WebParam(name = "input", mode = WebParam.Mode.IN) String in,
- @WebParam(name = "holder", mode = WebParam.Mode.INOUT) Holder<String> holder);
-
- @XmlJavaTypeAdapter(type = BeanInterface.class, value = TestAdapter.class)
- BeanInterface beanMethod(@XmlJavaTypeAdapter(type = BeanInterface.class, value = TestAdapter.class) BeanInterface in,
- String str);
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java
deleted file mode 100644
index b14ef19939..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.jaxws;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper;
-import org.apache.tuscany.sca.databinding.jaxb.JAXBTypeHelper;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WrapperBeanGeneratorTestCase {
- @Test
- public void testGenerate() throws Exception {
- List<Class<?>> classes = new WrapperBeanGenerator().generateWrapperBeans(TestInterface.class);
- for (Class<?> cls : classes) {
- for (Field f : cls.getDeclaredFields()) {
- System.out.println(f.getName());
- System.out.println(f.getGenericType());
- for (Annotation a : f.getAnnotations()) {
- System.out.println(a);
- }
- }
- for (Method m : cls.getDeclaredMethods()) {
- System.out.println(m);
- for (Annotation a : m.getAnnotations()) {
- System.out.println(a);
- }
- }
- }
- JAXBContext context = JAXBContextHelper.createJAXBContext(classes.toArray(new Class<?>[classes.size()]));
- for (Class<?> cls : classes) {
- Object obj = cls.newInstance();
- StringWriter sw = new StringWriter();
- context.createMarshaller().marshal(obj, sw);
- // System.out.println(sw.toString());
- StringReader sr = new StringReader(sw.toString());
- context.createUnmarshaller().unmarshal(new StreamSource(sr), cls);
- }
- }
-
- @Test
- public void testGenerateSchema() throws Exception {
- List<Class<?>> classes = new WrapperBeanGenerator().generateWrapperBeans(TestInterface.class);
- JAXBContext context = JAXBContextHelper.createJAXBContext(classes.toArray(new Class<?>[classes.size()]));
- Map<String, String> results = JAXBTypeHelper.generateSchema(context);
- for (String xsd : results.values()) {
- System.out.println(xsd);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl
deleted file mode 100644
index 882408ade6..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl b/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl
deleted file mode 100644
index e92409bfdb..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl
+++ /dev/null
@@ -1,171 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/interface-java-xml/LICENSE b/tags/java/sca/2.0-M1/modules/interface-java-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/interface-java-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index d2a7f8884e..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,27 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.interfacedef.java.xml;version=
- "2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Java Interface XML Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397167906
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Java Interface XML Model
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.assembly.builder;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.interface.java.xml
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-xml/NOTICE b/tags/java/sca/2.0-M1/modules/interface-java-xml/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-xml/pom.xml b/tags/java/sca/2.0-M1/modules/interface-java-xml/pom.xml
deleted file mode 100644
index 698959e070..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-interface-java-xml</artifactId>
- <name>Apache Tuscany SCA Interface Java XML Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaConstants.java b/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaConstants.java
deleted file mode 100644
index 2b45eac7bc..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaConstants.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.xml;
-
-import javax.xml.namespace.QName;
-
-/**
- * Interface Java XML Constants.
- *
- * @version $Rev$ $Date$
- */
-public interface JavaConstants {
- String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- String INTERFACE_JAVA = "interface.java";
- QName INTERFACE_JAVA_QNAME = new QName(SCA10_NS, "interface.java");
- String INTERFACE = "interface";
- String CALLBACK_INTERFACE = "callbackInterface";
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java b/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java
deleted file mode 100644
index 23de150374..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.java.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.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.ClassReference;
-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.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.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaInterfaceProcessor implements StAXArtifactProcessor<JavaInterfaceContract>, JavaConstants {
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- private JavaInterfaceFactory javaFactory;
- private Monitor monitor;
-
- public JavaInterfaceProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.javaFactory = modelFactories.getFactory(JavaInterfaceFactory.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-javaxml-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(), "interface-javaxml-validation-messages", Severity.ERROR, model, message,(Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- private JavaInterface createJavaInterface(String interfaceName) {
- JavaInterface javaInterface = javaFactory.createJavaInterface();
- javaInterface.setUnresolved(true);
- javaInterface.setName(interfaceName);
- return javaInterface;
- }
-
- public JavaInterfaceContract read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Read an <interface.java>
- JavaInterfaceContract javaInterfaceContract = javaFactory.createJavaInterfaceContract();
- String interfaceName = reader.getAttributeValue(null, INTERFACE);
- if (interfaceName != null) {
- JavaInterface javaInterface = createJavaInterface(interfaceName);
- javaInterfaceContract.setInterface(javaInterface);
- }
-
- String callbackInterfaceName = reader.getAttributeValue(null, CALLBACK_INTERFACE);
- if (callbackInterfaceName != null) {
- JavaInterface javaCallbackInterface = createJavaInterface(callbackInterfaceName);
- javaInterfaceContract.setCallbackInterface(javaCallbackInterface);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && INTERFACE_JAVA_QNAME.equals(reader.getName())) {
- break;
- }
- }
- return javaInterfaceContract;
- }
-
- public void write(JavaInterfaceContract javaInterfaceContract, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write an <interface.java>
- writer.writeStartElement(SCA10_NS, INTERFACE_JAVA);
- JavaInterface javaInterface = (JavaInterface)javaInterfaceContract.getInterface();
-
- if (javaInterface != null && javaInterface.getName() != null) {
- writer.writeAttribute(INTERFACE, javaInterface.getName());
- }
-
- JavaInterface javaCallbackInterface = (JavaInterface)javaInterfaceContract.getCallbackInterface();
- if (javaCallbackInterface != null && javaCallbackInterface.getName() != null) {
- writer.writeAttribute(CALLBACK_INTERFACE, javaCallbackInterface.getName());
- }
-
- writer.writeEndElement();
- }
-
- private JavaInterface resolveJavaInterface(JavaInterface javaInterface, ModelResolver resolver) throws ContributionResolveException {
-
- if (javaInterface != null && javaInterface.isUnresolved()) {
-
- // Resolve the Java interface
- javaInterface = resolver.resolveModel(JavaInterface.class, javaInterface);
- if (javaInterface.isUnresolved()) {
-
- // If the Java interface has never been resolved yet, do it now
- ClassReference classReference = new ClassReference(javaInterface.getName());
- classReference = resolver.resolveModel(ClassReference.class, classReference);
- Class<?> javaClass = classReference.getJavaClass();
- if (javaClass == null) {
- error("ClassNotFoundException", resolver, javaInterface.getName());
- return javaInterface;
- //throw new ContributionResolveException(new ClassNotFoundException(javaInterface.getName()));
- }
-
- try {
- // Introspect the Java interface and populate the interface and
- // operations
- javaFactory.createJavaInterface(javaInterface, javaClass);
-
- } catch (InvalidInterfaceException e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", javaFactory, ce);
- return javaInterface;
- //throw ce;
- }
-
- // Cache the resolved interface
- javaInterface.setUnresolved(false);
- resolver.addModel(javaInterface);
- }
- }
- return javaInterface;
- }
-
- public void resolve(JavaInterfaceContract javaInterfaceContract, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve the interface and callback interface
- JavaInterface javaInterface = resolveJavaInterface((JavaInterface)javaInterfaceContract.getInterface(), resolver);
- javaInterfaceContract.setInterface(javaInterface);
-
- JavaInterface javaCallbackInterface = resolveJavaInterface((JavaInterface)javaInterfaceContract.getCallbackInterface(), resolver);
- javaInterfaceContract.setCallbackInterface(javaCallbackInterface);
- }
-
- public QName getArtifactType() {
- return INTERFACE_JAVA_QNAME;
- }
-
- public Class<JavaInterfaceContract> getModelType() {
- return JavaInterfaceContract.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index b3e52e5709..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.interfacedef.java.xml.JavaInterfaceProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#interface.java,model=org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties b/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties
deleted file mode 100644
index bc0a7192b5..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-ClassNotFoundException = Class Not Found Exception: {0}
-ContributionResolveException = ContributionResolveException occured due to :
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/xml/ReadTestCase.java b/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/xml/ReadTestCase.java
deleted file mode 100644
index 9891d79676..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/xml/ReadTestCase.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.xml;
-
-import static org.junit.Assert.assertNotNull;
-
-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.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.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test reading Java interfaces.
- *
- * @version $Rev$ $Date$
- */
-public class ReadTestCase {
-
- private static XMLInputFactory inputFactory;
- private static XMLOutputFactory outputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static CompositeBuilder compositeBuilder;
-
- @BeforeClass
- public static 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);
-
- 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/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/xml/WriteTestCase.java b/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/xml/WriteTestCase.java
deleted file mode 100644
index b21505936b..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/xml/WriteTestCase.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.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.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test writing Java interfaces.
- *
- * @version $Rev$ $Date$
- */
-public class WriteTestCase {
- private static XMLInputFactory inputFactory;
- private static XMLOutputFactory outputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
-
- @BeforeClass
- public static 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/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/Calculator.composite b/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/Calculator.composite
deleted file mode 100644
index 3de6410596..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/Calculator.composite
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:calc="http://sample.calculator"
- targetNamespace="http://calc"
- name="Calculator">
-
- <service name="CalculatorService" promote="CalculatorServiceComponent">
- <interface.java interface="calculator.CalculatorService"/>
- </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/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/CalculatorComponent.constrainingType b/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/CalculatorComponent.constrainingType
deleted file mode 100644
index dca38c9224..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/CalculatorComponent.constrainingType
+++ /dev/null
@@ -1,34 +0,0 @@
-<?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.
--->
-<constrainingType xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:calc="http://calc"
- targetNamespace="http://calc"
- name="CalculatorComponent">
-
- <service name="CalculatorService">
- <interface.java interface="calculator.CalculatorService" />
- </service>
-
- <reference name="divideService">
- <interface.java interface="calculator.DivideService" />
- </reference>
-
-</constrainingType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/CalculatorImpl.componentType b/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/CalculatorImpl.componentType
deleted file mode 100644
index 23ebf576e5..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/CalculatorImpl.componentType
+++ /dev/null
@@ -1,31 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
- <service name="CalculatorService">
- <interface.java interface="calculator.CalculatorService" />
- </service>
-
- <reference name="divideService">
- <interface.java interface="calculator.DivideService" />
- </reference>
-
-</componentType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/LICENSE b/tags/java/sca/2.0-M1/modules/interface-java/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/interface-java/META-INF/MANIFEST.MF
deleted file mode 100644
index 47ca825cd6..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,38 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.interfacedef.java.impl;uses:="o
- rg.osoa.sca.annotations,org.apache.tuscany.sca.interfacedef.util,org.
- apache.tuscany.sca.policy,org.apache.tuscany.sca.interfacedef.java,or
- g.apache.tuscany.sca.interfacedef,javax.xml.namespace,org.apache.tusc
- any.sca.interfacedef.java.introspect,org.apache.tuscany.sca.interface
- def.impl";version="2.0.0",org.apache.tuscany.sca.interfacedef.java.intr
- ospect;uses:="org.apache.tuscany.sca.interfacedef.java,org.apache.tus
- cany.sca.interfacedef";version="2.0.0",org.apache.tuscany.sca.interface
- def.java;uses:="org.apache.tuscany.sca.assembly,org.apache.tuscany.sc
- a.interfacedef.java.impl,org.apache.tuscany.sca.interfacedef.java.int
- rospect,org.apache.tuscany.sca.core,org.apache.tuscany.sca.policy,org
- .apache.tuscany.sca.interfacedef,org.apache.tuscany.sca.extensibility
- ,javax.xml.namespace";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Java Interface Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397130359
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Java Interface Model
-Import-Package: javax.xml.namespace,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.extensibility;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.java.introspect;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.interface.java
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/NOTICE b/tags/java/sca/2.0-M1/modules/interface-java/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/pom.xml b/tags/java/sca/2.0-M1/modules/interface-java/pom.xml
deleted file mode 100644
index a63ff65c8f..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-interface-java</artifactId>
- <name>Apache Tuscany SCA Interface Java Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/DefaultJavaInterfaceFactory.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/DefaultJavaInterfaceFactory.java
deleted file mode 100644
index 67a9c8f2c6..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/DefaultJavaInterfaceFactory.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceFactoryImpl;
-import org.apache.tuscany.sca.interfacedef.java.impl.PolicyJavaInterfaceVisitor;
-import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * A factory for the Java interface model.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultJavaInterfaceFactory extends JavaInterfaceFactoryImpl implements JavaInterfaceFactory {
- private FactoryExtensionPoint modelFactoryExtensionPoint;
- private boolean loadedVisitors;
-
- public DefaultJavaInterfaceFactory() {
- }
-
- public DefaultJavaInterfaceFactory(FactoryExtensionPoint modelFactoryExtensionPoint) {
- this.modelFactoryExtensionPoint = modelFactoryExtensionPoint;
- }
-
- @Override
- public List<JavaInterfaceVisitor> getInterfaceVisitors() {
- loadVisitors();
- return super.getInterfaceVisitors();
- }
-
- /**
- * Load visitors declared under META-INF/services
- */
- @SuppressWarnings("unchecked")
- private void loadVisitors() {
- if (loadedVisitors)
- return;
-
- if (modelFactoryExtensionPoint != null) {
- PolicyFactory policyFactory = modelFactoryExtensionPoint.getFactory(PolicyFactory.class);
- if (policyFactory != null) {
- addInterfaceVisitor(new PolicyJavaInterfaceVisitor(policyFactory));
- }
- }
-
- // Get the databinding service declarations
- Set<ServiceDeclaration> visitorDeclarations;
- try {
- visitorDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(JavaInterfaceVisitor.class.getName());
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
-
- // Load data bindings
- for (ServiceDeclaration visitorDeclaration: visitorDeclarations) {
- JavaInterfaceVisitor visitor;
- try {
- Class<JavaInterfaceVisitor> visitorClass = (Class<JavaInterfaceVisitor>)visitorDeclaration.loadClass();
- visitor = visitorClass.newInstance();
- } catch (ClassNotFoundException e) {
- throw new IllegalArgumentException(e);
- } catch (InstantiationException e) {
- throw new IllegalArgumentException(e);
- } catch (IllegalAccessException e) {
- throw new IllegalArgumentException(e);
- }
- addInterfaceVisitor(visitor);
- }
-
- loadedVisitors = true;
- }
-
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java
deleted file mode 100644
index 9c09ef50c2..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java;
-
-import javax.xml.namespace.QName;
-import org.apache.tuscany.sca.assembly.Base;
-import org.apache.tuscany.sca.interfacedef.Interface;
-
-/**
- * Represents a Java interface.
- *
- * @version $Rev$ $Date$
- */
-public interface JavaInterface extends Interface, Base {
-
- /**
- * Returns the name of the Java interface class.
- *
- * @return the name of the Java interface class
- */
- String getName();
-
- /**
- * Sets the name of the Java interface class.
- *
- * @param className the name of the Java interface class
- */
- void setName(String className);
-
- /**
- * Returns the QName of the JAX-WS interface.
- *
- * @return the QName of the JAX-WS interface
- */
- QName getQName();
-
- /**
- * Sets the QName of the JAX-WS interface.
- *
- * @param interfaceName the QName of the JAX-WS interface
- */
- void setQName(QName interfaceName);
-
- /**
- * Returns the Java interface class.
- *
- * @return the Java interface class
- */
- Class<?> getJavaClass();
-
- /**
- * Sets the Java interface class.
- *
- * @param javaClass the Java interface class
- */
- void setJavaClass(Class<?> javaClass);
-
- /**
- * Returns the callback class specified in an @Callback annotation.
- *
- * @return the callback class specified in an @Callback annotation
- */
- Class<?> getCallbackClass();
-
- /**
- * Sets the callback class specified in an @Callback annotation.
- *
- * @param callbackClass the callback class specified in an @Callback annotation
- */
- void setCallbackClass(Class<?> callbackClass);
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceContract.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceContract.java
deleted file mode 100644
index e3a84c63f0..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceContract.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java;
-
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-
-/**
- * Represents a Java interface contract.
- * JavaInterfaceContract
- *
- * @version $Rev$ $Date$
- */
-public interface JavaInterfaceContract extends InterfaceContract {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceFactory.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceFactory.java
deleted file mode 100644
index 9225926269..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceFactory.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
-
-/**
- * Factory for the Java interface model
- *
- * @version $Rev$ $Date$
- */
-public interface JavaInterfaceFactory {
-
- /**
- * Creates a new Java interface model.
- *
- * @return
- */
- JavaInterface createJavaInterface();
-
- /**
- * Creates a new Java interface model from an interface class.
- * @param interfaceClass the interface class to introspect.
- * @return
- */
- JavaInterface createJavaInterface(Class<?> interfaceClass) throws InvalidInterfaceException;
-
- /**
- * Creates the contents of a Java interface model from an interface class.
- * @param javaInterface the Java interface model
- * @param interfaceClass the interface class to introspect.
- * @return
- */
- void createJavaInterface(JavaInterface javaInterface, Class<?> interfaceClass) throws InvalidInterfaceException;
-
- /**
- * Creates a new Java interface contract.
- *
- * @return
- */
- JavaInterfaceContract createJavaInterfaceContract();
-
- /**
- * Registers the given visitor.
- *
- * @param visitor
- */
- void addInterfaceVisitor(JavaInterfaceVisitor visitor);
-
- /**
- * Deregisters the given visitor.
- *
- * @param visitor
- */
- void removeInterfaceVisitor(JavaInterfaceVisitor visitor);
-
- /**
- * Returns a list of interface visitors.
- *
- * @return
- */
- List<JavaInterfaceVisitor> getInterfaceVisitors();
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaOperation.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaOperation.java
deleted file mode 100644
index e6cb35cc4b..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaOperation.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * Represents a Java operation.
- *
- * @version $Rev$ $Date$
- */
-public interface JavaOperation extends Operation {
-
- /**
- * Returns the Java method defining the operation.
- * @return the Java method
- */
- Method getJavaMethod();
-
- /**
- * Sets the Java method defining the operation.
- * @param method the Java method
- */
- void setJavaMethod(Method method);
-
- /**
- * Returns the JAX-WS @WebMethod action parameter.
- * @return the action value
- */
- String getAction();
-
- /**
- * Sets the JAX-WS @WebMethod action parameter.
- * @param action the action value
- */
- void setAction(String action);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceContractImpl.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceContractImpl.java
deleted file mode 100644
index d43ebe558b..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceContractImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.impl;
-
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractImpl;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-
-/**
- * Represents a Java interface contract.
- *
- * @version $Rev$ $Date$
- */
-public class JavaInterfaceContractImpl extends InterfaceContractImpl implements JavaInterfaceContract {
-
- protected JavaInterfaceContractImpl() {
- }
-
- @Override
- public JavaInterfaceContractImpl clone() throws CloneNotSupportedException {
- return (JavaInterfaceContractImpl) super.clone();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceFactoryImpl.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceFactoryImpl.java
deleted file mode 100644
index 1454851fb1..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceFactoryImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-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.java.introspect.JavaInterfaceVisitor;
-
-/**
- * A factory for the Java model.
- *
- * @version $Rev$ $Date$
- */
-public abstract class JavaInterfaceFactoryImpl implements JavaInterfaceFactory {
-
- private List<JavaInterfaceVisitor> visitors = new ArrayList<JavaInterfaceVisitor>();
- private JavaInterfaceIntrospectorImpl introspector;
- private Map<Class<?>, JavaInterface> cache = Collections.synchronizedMap(new WeakHashMap<Class<?>, JavaInterface>());
-
- public JavaInterfaceFactoryImpl() {
- introspector = new JavaInterfaceIntrospectorImpl(this);
- }
-
- public JavaInterface createJavaInterface() {
- return new JavaInterfaceImpl();
- }
-
- public JavaInterface createJavaInterface(Class<?> interfaceClass) throws InvalidInterfaceException {
- // TODO: Review if the sharing of JavaInterface is ok
- synchronized (interfaceClass) {
- JavaInterface javaInterface = cache.get(interfaceClass);
- if (javaInterface == null) {
- javaInterface = createJavaInterface();
- introspector.introspectInterface(javaInterface, interfaceClass);
- cache.put(interfaceClass, javaInterface);
- }
- return javaInterface;
- }
- }
-
- public void createJavaInterface(JavaInterface javaInterface, Class<?> interfaceClass) throws InvalidInterfaceException {
- introspector.introspectInterface(javaInterface, interfaceClass);
- }
-
- public JavaInterfaceContract createJavaInterfaceContract() {
- return new JavaInterfaceContractImpl();
- }
-
- public void addInterfaceVisitor(JavaInterfaceVisitor extension) {
- visitors.add(extension);
- }
-
- public void removeInterfaceVisitor(JavaInterfaceVisitor extension) {
- visitors.remove(extension);
- }
-
- public List<JavaInterfaceVisitor> getInterfaceVisitors() {
- return visitors;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java
deleted file mode 100644
index 42e45317b7..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.impl;
-
-import javax.xml.namespace.QName;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceImpl;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-
-/**
- * Represents a Java interface.
- *
- * @version $Rev$ $Date$
- */
-public class JavaInterfaceImpl extends InterfaceImpl implements JavaInterface {
-
- private String className;
- private Class<?> javaClass;
- private Class<?> callbackClass;
- private QName qname;
-
- protected JavaInterfaceImpl() {
- }
-
- public String getName() {
- if (isUnresolved()) {
- return className;
- } else if (javaClass != null) {
- return javaClass.getName();
- } else {
- return null;
- }
- }
-
- public void setName(String className) {
- if (!isUnresolved()) {
- throw new IllegalStateException();
- }
- this.className = className;
- }
-
- public QName getQName() {
- return qname;
- }
-
- public void setQName(QName interfacename) {
- qname = interfacename;
- }
-
- public Class<?> getJavaClass() {
- return javaClass;
- }
-
- public void setJavaClass(Class<?> javaClass) {
- this.javaClass = javaClass;
- }
-
- public Class<?> getCallbackClass() {
- return callbackClass;
- }
-
- public void setCallbackClass(Class<?> callbackClass) {
- this.callbackClass = callbackClass;
- }
-
- @Override
- public String toString() {
- return getName();
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(getName()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof JavaInterface) {
- if (getName() != null) {
- return getName().equals(((JavaInterface)obj).getName());
- } else {
- return ((JavaInterface)obj).getName() == null;
- }
- } else {
- return false;
- }
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
deleted file mode 100644
index c05b21c5ed..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.java.impl;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.ConversationSequence;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.InvalidCallbackException;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.InvalidOperationException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.OverloadedOperationException;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-import org.oasisopen.sca.annotation.OneWay;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Default implementation of a Java interface introspector.
- *
- * @version $Rev$ $Date$
- */
-public class JavaInterfaceIntrospectorImpl {
- public static final String IDL_INPUT = "idl:input";
-
- private static final String UNKNOWN_DATABINDING = null;
-
- private List<JavaInterfaceVisitor> visitors = new ArrayList<JavaInterfaceVisitor>();
-
- public JavaInterfaceIntrospectorImpl(JavaInterfaceFactory javaFactory) {
- this.visitors = javaFactory.getInterfaceVisitors();
- }
-
- public void introspectInterface(JavaInterface javaInterface, Class<?> clazz)
- throws InvalidInterfaceException {
- javaInterface.setJavaClass(clazz);
-
- boolean remotable = clazz.isAnnotationPresent(Remotable.class);
-
- // Consider @javax.ejb.Remote, java.rmi.Remote and javax.ejb.EJBObject
- // equivalent to @Remotable
- if (!remotable) {
- for (Annotation annotation : clazz.getAnnotations()) {
- if ("javax.ejb.Remote".equals(annotation.annotationType().getName())) {
- remotable = true;
- break;
- }
- }
- }
- if (!remotable) {
- for (Class<?> superInterface : clazz.getInterfaces()) {
- if (Remote.class == superInterface || "javax.ejb.EJBObject".equals(superInterface.getName())) {
- remotable = true;
- break;
- }
- }
- }
-
- javaInterface.setRemotable(remotable);
-
- boolean conversational = clazz.isAnnotationPresent(Conversational.class);
- javaInterface.setConversational(conversational);
-
- Class<?> callbackClass = null;
- org.oasisopen.sca.annotation.Callback callback = clazz.getAnnotation(org.oasisopen.sca.annotation.Callback.class);
- if (callback != null && !Void.class.equals(callback.value())) {
- callbackClass = callback.value();
- if (remotable && !callbackClass.isAnnotationPresent(Remotable.class)) {
- throw new InvalidCallbackException("Callback must be remotable on a remotable interface");
- }
- if (!remotable && callbackClass.isAnnotationPresent(Remotable.class)) {
- throw new InvalidCallbackException("Callback must not be remotable on a local interface");
- }
- } else if (callback != null && Void.class.equals(callback.value())) {
- throw new InvalidCallbackException("No callback interface specified on annotation");
- }
-
- javaInterface.setCallbackClass(callbackClass);
-
- String ns = JavaXMLMapper.getNamespace(clazz);
- javaInterface.getOperations().addAll(getOperations(clazz, remotable, conversational, ns));
-
- for (JavaInterfaceVisitor extension : visitors) {
- extension.visitInterface(javaInterface);
- }
- }
-
- private Class<?>[] getActualTypes(Type[] types, Class<?>[] rawTypes, Map<String, Type> typeBindings) {
- Class<?>[] actualTypes = new Class<?>[types.length];
- for (int i = 0; i < actualTypes.length; i++) {
- actualTypes[i] = getActualType(types[i], rawTypes[i], typeBindings);
- }
- return actualTypes;
- }
-
- private Class<?> getActualType(Type type, Class<?> rawType, Map<String, Type> typeBindings) {
- if (type instanceof TypeVariable<?>) {
- TypeVariable<?> typeVariable = (TypeVariable<?>)type;
- type = typeBindings.get(typeVariable.getName());
- if (type instanceof Class<?>) {
- return (Class<?>)type;
- }
- }
- return rawType;
- }
-
- private <T> List<Operation> getOperations(Class<T> clazz,
- boolean remotable,
- boolean conversational,
- String ns) throws InvalidInterfaceException {
-
- Set<Type> genericInterfaces = new HashSet<Type>();
- for (Type t : clazz.getGenericInterfaces()) {
- genericInterfaces.add(t);
- }
- Map<String, Type> typeBindings = new HashMap<String, Type>();
- for (Type genericInterface : genericInterfaces) {
- if (genericInterface instanceof ParameterizedType) {
- ParameterizedType parameterizedType = (ParameterizedType)genericInterface;
- TypeVariable<?>[] typeVariables = ((Class<?>)parameterizedType.getRawType()).getTypeParameters();
- Type[] typeArguments = parameterizedType.getActualTypeArguments();
- for (int i = 0; i < typeArguments.length; i++) {
- typeBindings.put(typeVariables[i].getName(), typeArguments[i]);
- }
- }
- }
-
- Method[] methods = clazz.getMethods();
- List<Operation> operations = new ArrayList<Operation>(methods.length);
- Set<String> names = remotable ? new HashSet<String>() : null;
- for (Method method : methods) {
- if (method.getDeclaringClass() == Object.class) {
- // Skip the methods on the Object.class
- continue;
- }
- String name = method.getName();
- if (remotable && names.contains(name)) {
- throw new OverloadedOperationException(method);
- }
- if (remotable) {
- names.add(name);
- }
-
- Class<?> returnType = getActualType(method.getGenericReturnType(), method.getReturnType(), typeBindings);
- Class<?>[] parameterTypes =
- getActualTypes(method.getGenericParameterTypes(), method.getParameterTypes(), typeBindings);
- Class<?>[] faultTypes =
- getActualTypes(method.getGenericExceptionTypes(), method.getExceptionTypes(), typeBindings);
-
- boolean nonBlocking = method.isAnnotationPresent(OneWay.class);
- if (nonBlocking) {
- if (!(returnType == void.class)) {
- throw new InvalidOperationException(
- "Method should return 'void' when declared with an @OneWay annotation. " + method,
- method);
- }
- if (!(faultTypes.length == 0)) {
- throw new InvalidOperationException(
- "Method should not declare exceptions with an @OneWay annotation. " + method,
- method);
- }
- }
-
- ConversationSequence conversationSequence = ConversationSequence.CONVERSATION_NONE;
- if (method.isAnnotationPresent(EndsConversation.class)) {
- if (!conversational) {
- throw new InvalidOperationException(
- "Method is marked as end conversation but contract is not conversational",
- method);
- }
- conversationSequence = ConversationSequence.CONVERSATION_END;
- } else if (conversational) {
- conversationSequence = ConversationSequence.CONVERSATION_CONTINUE;
- }
-
- // Set outputType to null for void
- XMLType xmlReturnType = new XMLType(new QName(ns, "return"), null);
- DataType<XMLType> returnDataType =
- returnType == void.class ? null : new DataTypeImpl<XMLType>(UNKNOWN_DATABINDING, returnType, method
- .getGenericReturnType(), xmlReturnType);
- List<DataType> paramDataTypes = new ArrayList<DataType>(parameterTypes.length);
- Type[] genericParamTypes = method.getGenericParameterTypes();
- for (int i = 0; i < parameterTypes.length; i++) {
- Class<?> paramType = parameterTypes[i];
- XMLType xmlParamType = new XMLType(new QName(ns, "arg" + i), null);
- paramDataTypes.add(new DataTypeImpl<XMLType>(UNKNOWN_DATABINDING, paramType, genericParamTypes[i],
- xmlParamType));
- }
- List<DataType> faultDataTypes = new ArrayList<DataType>(faultTypes.length);
- Type[] genericFaultTypes = method.getGenericExceptionTypes();
- for (int i = 0; i < faultTypes.length; i++) {
- Class<?> faultType = faultTypes[i];
- // Only add checked exceptions
- // JAXWS Specification v2.1 section 3.7 says RemoteException should not be mapped
- if (Exception.class.isAssignableFrom(faultType) && (!RuntimeException.class.isAssignableFrom(faultType))
- && (!RemoteException.class.isAssignableFrom(faultType))) {
- XMLType xmlFaultType = new XMLType(new QName(ns, faultType.getSimpleName()), null);
- DataType<XMLType> faultDataType =
- new DataTypeImpl<XMLType>(UNKNOWN_DATABINDING, faultType, genericFaultTypes[i], xmlFaultType);
- faultDataTypes.add(new DataTypeImpl<DataType>(UNKNOWN_DATABINDING, faultType, genericFaultTypes[i],
- faultDataType));
- }
- }
-
- DataType<List<DataType>> inputType =
- new DataTypeImpl<List<DataType>>(IDL_INPUT, Object[].class, paramDataTypes);
- JavaOperation operation = new JavaOperationImpl();
- operation.setName(name);
- operation.setInputType(inputType);
- operation.setOutputType(returnDataType);
- operation.setFaultTypes(faultDataTypes);
- operation.setConversationSequence(conversationSequence);
- operation.setNonBlocking(nonBlocking);
- operation.setJavaMethod(method);
- operations.add(operation);
- }
- return operations;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtil.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtil.java
deleted file mode 100644
index 2a9e3c5329..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtil.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.java.impl;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-
-/**
- * Contains methods for mapping between an operation in a
- * {@link org.apache.tuscany.spi.model.ServiceContract} and a method defined by
- * a Java interface
- *
- * @version $Rev$ $Date$
- */
-public final class JavaInterfaceUtil {
-
- private JavaInterfaceUtil() {
- }
-
- /**
- * Return the method on the implementation class that matches the operation.
- *
- * @param implClass the implementation class or interface
- * @param operation the operation to match
- * @return the method described by the operation
- * @throws NoSuchMethodException if no such method exists
- * @Deprecated
- */
- public static Method findMethod(Class<?> implClass, Operation operation) throws NoSuchMethodException {
- String name = operation.getName();
- if (operation instanceof JavaOperation) {
- name = ((JavaOperation)operation).getJavaMethod().getName();
- }
- Interface interface1 = operation.getInterface();
- int numParams = operation.getInputType().getLogical().size();
- if (interface1 != null && interface1.isRemotable()) {
- List<Method> matchingMethods = new ArrayList<Method>();
- for (Method m : implClass.getMethods()) {
- if (m.getName().equals(name) && m.getParameterTypes().length == numParams) {
- matchingMethods.add(m);
- }
- }
-
- // TUSCANY-2180 If there is only one method then we just match on the name
- // (this is the same as the existing behaviour)
- if (matchingMethods.size() == 1) {
- return matchingMethods.get(0);
- }
- if (matchingMethods.size() > 1) {
- // TUSCANY-2180 We need to check the parameter types too
- Class<?>[] paramTypes = getPhysicalTypes(operation);
- return implClass.getMethod(name, paramTypes);
- }
-
- // No matching method found
- throw new NoSuchMethodException("No matching method for operation " + operation.getName()
- + " is found on "
- + implClass);
- }
- Class<?>[] paramTypes = getPhysicalTypes(operation);
- return implClass.getMethod(name, paramTypes);
- }
-
- /**
- * @Deprecated
- */
- private static Class<?>[] getPhysicalTypes(Operation operation) {
- DataType<List<DataType>> inputType = operation.getInputType();
- if (inputType == null) {
- return new Class<?>[] {};
- }
- List<DataType> types = inputType.getLogical();
- Class<?>[] javaTypes = new Class<?>[types.size()];
- for (int i = 0; i < javaTypes.length; i++) {
- Type physical = types.get(i).getPhysical();
- if (physical instanceof Class<?>) {
- javaTypes[i] = (Class<?>)physical;
- } else {
- throw new UnsupportedOperationException();
- }
- }
- return javaTypes;
- }
-
- /**
- * Searches a collection of operations for a match against the given method
- *
- * @param method the method to match
- * @param operations the operations to match against
- * @return a matching operation or null
- * @Deprecated
- */
- public static Operation findOperation(Method method, Collection<Operation> operations) {
- for (Operation operation : operations) {
- if (match(operation, method)) {
- return operation;
- }
- }
- return null;
- }
-
- /**
- * Determines if the given operation matches the given method
- *
- * @return true if the operation matches, false if does not
- */
- private static boolean match(Operation operation, Method method) {
- Class<?>[] params = method.getParameterTypes();
- DataType<List<DataType>> inputType = operation.getInputType();
- List<DataType> types = inputType.getLogical();
- boolean found = true;
- if (types.size() == params.length && method.getName().equals(operation.getName())) {
- for (int i = 0; i < params.length; i++) {
- Class<?> clazz = params[i];
- if (!clazz.equals(operation.getInputType().getLogical().get(i).getPhysical())) {
- found = false;
- }
- }
- } else {
- found = false;
- }
- return found;
-
- }
-
- private static String getPackageName(Class<?> cls) {
- String name = cls.getName();
- int index = name.lastIndexOf('.');
- return index == -1 ? "" : name.substring(0, index);
- }
-
- public static String getNamespace(Class<?> cls) {
- String packageName = getPackageName(cls);
- if ("".equals(packageName)) {
- return "";
- }
- StringBuffer ns = new StringBuffer("http://");
- String[] names = packageName.split("\\.");
- for (int i = names.length - 1; i >= 0; i--) {
- ns.append(names[i]);
- if (i != 0) {
- ns.append('.');
- }
- }
- ns.append('/');
- return ns.toString();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaOperationImpl.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaOperationImpl.java
deleted file mode 100644
index 4384213bf5..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaOperationImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.java.impl;
-
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-
-/**
- * Represents a Java operation.
- *
- * @version $Rev$ $Date$
- */
-public class JavaOperationImpl extends OperationImpl implements JavaOperation {
-
- private Method method;
- private String action;
-
- public Method getJavaMethod() {
- return method;
- }
-
- public void setJavaMethod(Method method) {
- this.method = method;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((method == null) ? 0 : method.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- final JavaOperationImpl other = (JavaOperationImpl)obj;
- if (method == null) {
- if (other.method != null)
- return false;
- } else if (!method.equals(other.method))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return method == null ? "null" : method.toGenericString();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java
deleted file mode 100644
index bf80bef175..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.impl;
-
-import java.lang.reflect.Method;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.oasisopen.sca.annotation.PolicySets;
-import org.oasisopen.sca.annotation.Requires;
-
-/**
- * Processes an {@link org.oasisopen.sca.annotation.Requires} annotation
- *
- * @version $Rev$ $Date$
- */
-public class PolicyJavaInterfaceVisitor implements JavaInterfaceVisitor {
- private PolicyFactory policyFactory;
-
- public PolicyJavaInterfaceVisitor(PolicyFactory policyFactory) {
- super();
- this.policyFactory = policyFactory;
- }
-
- private 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 {
- qname = new QName("", intentName);
- }
- } else {
- qname = new QName("", intentName);
- }
- return qname;
- }
-
- /**
- * Read policy intents on the given interface or class
- * @param clazz
- * @param requiredIntents
- */
- private void readIntentsAndPolicySets(Class<?> clazz, List<Intent> requiredIntents, List<PolicySet> policySets) {
- Requires intentAnnotation = clazz.getAnnotation(Requires.class);
- if (intentAnnotation != null) {
- String[] intentNames = intentAnnotation.value();
- if (intentNames.length != 0) {
- for (String intentName : intentNames) {
-
- // Add each intent to the list
- Intent intent = policyFactory.createIntent();
- intent.setName(getQName(intentName));
- requiredIntents.add(intent);
- }
- }
- }
-
- PolicySets policySetAnnotation = clazz.getAnnotation(PolicySets.class);
- if (policySetAnnotation != null) {
- String[] policySetNames = policySetAnnotation.value();
- if (policySetNames.length != 0) {
- for (String policySetName : policySetNames) {
-
- // Add each intent to the list
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(getQName(policySetName));
- policySets.add(policySet);
- }
- }
- }
- }
-
- private void readIntents(Requires intentAnnotation, List<Intent> requiredIntents) {
- //Requires intentAnnotation = method.getAnnotation(Requires.class);
- if (intentAnnotation != null) {
- String[] intentNames = intentAnnotation.value();
- if (intentNames.length != 0) {
- //Operation operation = assemblyFactory.createOperation();
- //operation.setName(method.getName());
- //operation.setUnresolved(true);
- for (String intentName : intentNames) {
-
- // Add each intent to the list, associated with the
- // operation corresponding to the annotated method
- Intent intent = policyFactory.createIntent();
- intent.setName(getQName(intentName));
- //intent.getOperations().add(operation);
- requiredIntents.add(intent);
- }
- }
- }
- }
-
- private void readPolicySets(PolicySets policySetAnnotation, List<PolicySet> policySets) {
- if (policySetAnnotation != null) {
- String[] policySetNames = policySetAnnotation.value();
- if (policySetNames.length != 0) {
- //Operation operation = assemblyFactory.createOperation();
- //operation.setName(method.getName());
- //operation.setUnresolved(true);
- for (String policySetName : policySetNames) {
- // Add each intent to the list, associated with the
- // operation corresponding to the annotated method
- PolicySet policySet = policyFactory.createPolicySet();
- policySet.setName(getQName(policySetName));
- //intent.getOperations().add(operation);
- policySets.add(policySet);
- }
- }
- }
- }
-
- public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException {
-
- if (javaInterface.getJavaClass() != null) {
- readIntentsAndPolicySets(javaInterface.getJavaClass(), javaInterface.getRequiredIntents(), javaInterface
- .getPolicySets());
-
- // Read intents on the service interface methods
- List<Operation> operations = javaInterface.getOperations();
- for (Operation op : operations) {
- JavaOperation operation = (JavaOperation)op;
- Method method = operation.getJavaMethod();
- if (method.getAnnotation(Requires.class) != null || method.getAnnotation(PolicySets.class) != null) {
- readIntents(method.getAnnotation(Requires.class), op.getRequiredIntents());
- readPolicySets(method.getAnnotation(PolicySets.class), op.getPolicySets());
- }
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/introspect/JavaInterfaceVisitor.java b/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/introspect/JavaInterfaceVisitor.java
deleted file mode 100644
index 3bc03a528e..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/introspect/JavaInterfaceVisitor.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.introspect;
-
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-
-/**
- * Implementations introspect metadata on a Java interface, populating the
- * corresponding {@link JavaInterface}
- *
- * @version $Rev$ $Date$
- */
-public interface JavaInterfaceVisitor {
-
- /**
- * Visit a java interface
- * @param javaInterface
- * @throws InvalidInterfaceException
- */
- void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory b/tags/java/sca/2.0-M1/modules/interface-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory
deleted file mode 100644
index 5ba12ec137..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilDuplicateRemotableTestCase.java b/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilDuplicateRemotableTestCase.java
deleted file mode 100644
index c0b1443207..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilDuplicateRemotableTestCase.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.java.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.OverloadedOperationException;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceImpl;
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.junit.Assert;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * This test case will test that a Component that has multiple Remotable interfaces
- * that contain methods with the same name will correctly select the right method.
- *
- * @version $Rev$ $Date$
- */
-public class JavaInterfaceUtilDuplicateRemotableTestCase {
-
- /**
- * Test to get the getTime() method from the LocalTimeService
- *
- * @throws Exception Test failed
- */
- @Test
- public void testLocalTimeServiceGetTime() throws Exception {
- doTestLocalTimeServiceGetTime(LocalTimeService.class);
- }
-
- /**
- * Test to get the getTime() method from the LocalTimeService interface from
- * the specified class
- *
- * @param timeServiceClass The class that implements the LocalTimeService
- * @throws Exception Test failed
- */
- private void doTestLocalTimeServiceGetTime(Class<?> timeServiceClass) throws Exception {
- // Add a getTime() method
- Operation operation = newOperation("getTime", LocalTimeService.class);
-
- Method method = JavaInterfaceUtil.findMethod(timeServiceClass, operation);
- assertEquals("getTime", method.getName());
- assertEquals(0, method.getParameterTypes().length);
- }
-
- /**
- * Test to get the getTime(String) method from the WorldTimeService
- *
- * @throws Exception Test failed
- */
- @Test
- public void testWorldTimeServiceGetTime() throws Exception {
- doTestWorldTimeServiceGetTime(WorldTimeService.class);
- }
-
- /**
- * Test to get the getTime(String) method from the WorldTimeService interface from
- * the specified class
- *
- * @param timeServiceClass The class that implements the WorldTimeService
- * @throws Exception Test failed
- */
- private void doTestWorldTimeServiceGetTime(Class<?> timeServiceClass) throws Exception {
- // Add a getTime(String) method
- Operation operation = newOperation("getTime", WorldTimeService.class, String.class);
-
- Method method = JavaInterfaceUtil.findMethod(timeServiceClass, operation);
- assertEquals("getTime", method.getName());
- assertEquals(1, method.getParameterTypes().length);
- assertEquals(String.class, method.getParameterTypes()[0]);
- }
-
- /**
- * Test to get the getTime(int) method from the GMTTimeService
- *
- * @throws Exception Test failed
- */
- @Test
- public void testGMTTimeServiceGetTime() throws Exception {
- doTestGMTTimeServiceGetTime(GMTTimeService.class);
- }
-
- /**
- * Test to get the getTime(int) method from the GMTTimeService interface from
- * the specified class
- *
- * @param timeServiceClass The class that implements the WorldTimeService
- * @throws Exception Test failed
- */
- private void doTestGMTTimeServiceGetTime(Class<?> timeServiceClass) throws Exception {
- // Add a getTime(String) method
- Operation operation = newOperation("getTime", GMTTimeService.class, Integer.TYPE);
-
- Method method = JavaInterfaceUtil.findMethod(timeServiceClass, operation);
- assertEquals("getTime", method.getName());
- assertEquals(1, method.getParameterTypes().length);
- assertEquals(Integer.TYPE, method.getParameterTypes()[0]);
- }
-
-
- /**
- * Test to get the getTime() method from the LocalTimeService on the
- * TimeServiceImpl class
- *
- * @throws Exception Test failed
- */
- @Test
- public void testLocalTimeServiceGetTimeFromTimeServiceImpl() throws Exception {
- doTestLocalTimeServiceGetTime(TimeServiceImpl.class);
- }
-
- /**
- * Test to get the getTime(String) method from the WorldTimeService on the
- * TimeServiceImpl class
- *
- * @throws Exception Test failed
- */
- @Test
- public void testWorldTimeServiceGetTimeFromTimeServiceImpl() throws Exception {
- doTestWorldTimeServiceGetTime(TimeServiceImpl.class);
- }
-
- /**
- * Test to get the getTime(int) method from the GMTTimeService
- *
- * @throws Exception Test failed
- */
- @Test
- public void testGMTTimeServiceGetTimeFromTimeServiceImpl() throws Exception {
- doTestGMTTimeServiceGetTime(TimeServiceImpl.class);
- }
-
- /**
- * Creates a new operation with the specified name and parameter types
- *
- * @param name The name of the operation
- * @param operationInterface The interface to which the operation belongs
- * @param parameterTypes The types of the parameters for this operation
- * @return An operation with the specified name and parameter types
- */
- private static Operation newOperation(String name, Class<?> operationInterface, Class<?>... parameterTypes) {
- // Create and set the operation name
- Operation operation = new OperationImpl();
- operation.setName(name);
-
- // Make the operation remotable
- Interface iface = new InterfaceImpl();
- iface.setRemotable(true);
- operation.setInterface(iface);
-
- // Construct the parameters
- List<DataType> types = new ArrayList<DataType>();
- DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
- for (Class<?> parameterType : parameterTypes) {
- DataType type = new DataTypeImpl<Class>(parameterType, Object.class);
- types.add(type);
- }
- operation.setInputType(inputType);
-
- // Return the created operation
- return operation;
- }
-
- /**
- * Test case that validates that a @Remotable interface with Overloaded operations
- * is detected.
- *
- * This test case is for TUSCANY-2194
- */
- @Test
- public void testDuplicateOpeartionOnRemotableInterface()
- {
- JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
- JavaInterfaceIntrospectorImpl introspector = new JavaInterfaceIntrospectorImpl(javaFactory);
- JavaInterfaceImpl javaInterface = new JavaInterfaceImpl();
-
- try {
- introspector.introspectInterface(javaInterface, DuplicateMethodOnRemotableInterface.class);
- Assert.fail("Should have thrown an exception as @Remotable interface has overloaded methods");
- } catch (OverloadedOperationException ex) {
- // As expected
- // Make sure that the class and method names are in the exception
- String exMsg = ex.toString();
- Assert.assertTrue("Method name missing from exception", exMsg.indexOf("aDuplicateMethod") != -1);
- Assert.assertTrue("Class name missing from exception",
- exMsg.indexOf(DuplicateMethodOnRemotableInterface.class.getName()) != -1);
- } catch (InvalidInterfaceException ex) {
- // Should have thrown OverloadedOperationException
- Assert.fail("Should have thrown an OverloadedOperationException but threw " + ex);
- }
- }
-
-
- /**
- * Sample @Remotable interface that has an overloaded operation which is not
- * allowed according to the SCA Assembly Specification.
- */
- @Remotable
- private interface DuplicateMethodOnRemotableInterface {
- void aNonDuplicateMethod();
- void aDuplicateMethod();
- void aDuplicateMethod(String aParam);
- }
-
-
- /**
- * Sample interface needed for the unit tests
- */
- @Remotable
- private interface LocalTimeService {
-
- /**
- * Gets the local time
- *
- * @return The Local Time
- */
- String getTime();
- }
-
- /**
- * Sample interface needed for the unit tests
- */
- @Remotable
- private interface WorldTimeService {
-
- /**
- * Gets the time in the specified TimeZone
- *
- * @param timeZone A Time Zone
- *
- * @return The time in the specified TimeZone
- */
- String getTime(String timeZone);
- }
-
- /**
- * Sample interface needed for the unit tests
- */
- @Remotable
- private interface GMTTimeService {
-
- /**
- * Gets the time with the specified GMT offset
- *
- * @param gmtOffset A GMT offset in hours
- *
- * @return The time with the specified GMT offset
- */
- String getTime(int gmtOffset);
- }
-
- /**
- * Sample implementation class that implements the three @Remotable interfaces
- */
- private class TimeServiceImpl implements LocalTimeService, WorldTimeService, GMTTimeService {
- /**
- * Gets the local time
- *
- * @return The Local Time
- */
- public String getTime() {
- return "The current local time";
- }
-
- /**
- * Gets the time in the specified TimeZone
- *
- * @param timeZone A Time Zone
- *
- * @return The time in the specified TimeZone
- */
- public String getTime(String timeZone) {
- return "The current time in TimeZone " + timeZone;
- }
-
- /**
- * Gets the time with the specified GMT offset
- *
- * @param gmtOffset A GMT offset in hours
- *
- * @return The time with the specified GMT offset
- */
- public String getTime(int gmtOffset) {
- return "The current time with GMT offset of " + gmtOffset;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilTestCase.java b/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilTestCase.java
deleted file mode 100644
index 86a38fa0c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilTestCase.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.impl;
-
-import static org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil.findOperation;
-import static org.junit.Assert.assertEquals;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaInterfaceUtilTestCase {
- private List<Operation> operations;
-
- @Test
- public void testNoParamsFindOperation() throws Exception {
- Method method = Foo.class.getMethod("foo");
- Operation ret = findOperation(method, operations);
- assertEquals("foo", ret.getName());
- assertEquals(0, method.getParameterTypes().length);
- }
-
- @Test
- public void testParamsFindOperation() throws Exception {
- Method method = Foo.class.getMethod("foo", String.class);
- Operation ret = findOperation(method, operations);
- assertEquals("foo", ret.getName());
- assertEquals(String.class, method.getParameterTypes()[0]);
- }
-
- @Test
- public void testPrimitiveParamFindOperation() throws NoSuchMethodException {
- Method method = Foo.class.getMethod("foo", Integer.TYPE);
- Operation operation = findOperation(method, operations);
- assertEquals(Integer.TYPE, operation.getInputType().getLogical().get(0).getPhysical());
- }
-
- @Before
- public void setUp() throws Exception {
- Operation operation = newOperation("foo");
- List<DataType> types = new ArrayList<DataType>();
- DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
- operation.setInputType(inputType);
-
- operations = new ArrayList<Operation>();
- operations.add(operation);
-
- types = new ArrayList<DataType>();
- inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
- DataType type = new DataTypeImpl<Class>(String.class, Object.class);
- types.add(type);
- operation = newOperation("foo");
- operation.setInputType(inputType);
- operations.add(operation);
-
- types = new ArrayList<DataType>();
- type = new DataTypeImpl<Class>(String.class, Object.class);
- DataType type2 = new DataTypeImpl<Class>(String.class, Object.class);
- types.add(type);
- types.add(type2);
- inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
- operation = newOperation("foo");
- operation.setInputType(inputType);
- operations.add(operation);
-
- types = new ArrayList<DataType>();
- type = new DataTypeImpl<Class>(Integer.class, Object.class);
- types.add(type);
- inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
- operation = newOperation("foo");
- operation.setInputType(inputType);
- operations.add(operation);
-
- types = new ArrayList<DataType>();
- type = new DataTypeImpl<Class>(Integer.TYPE, Object.class);
- types.add(type);
- inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
- operation = newOperation("foo");
- operation.setInputType(inputType);
- operations.add(operation);
-
- }
-
- private interface Foo {
- void foo();
-
- void foo(String foo);
-
- void foo(int b);
- }
-
- private static Operation newOperation(String name) {
- Operation operation = new OperationImpl();
- operation.setName(name);
- return operation;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/ConversationalIntrospectionTestCase.java b/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/ConversationalIntrospectionTestCase.java
deleted file mode 100644
index 638603a02e..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/ConversationalIntrospectionTestCase.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.introspection.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.tuscany.sca.interfacedef.ConversationSequence;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InvalidOperationException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConversationalIntrospectionTestCase {
- private JavaInterfaceFactory javaFactory;
-
- @Before
- public void setUp() throws Exception {
- javaFactory = new DefaultJavaInterfaceFactory();
- }
-
- private Operation getOperation(Interface i, String name) {
- for (Operation op : i.getOperations()) {
- if (op.getName().equals(name)) {
- return op;
- }
- }
- return null;
- }
-
- @Test
- public void testServiceContractConversationalInformationIntrospection() throws Exception {
- Interface i = javaFactory.createJavaInterface(Foo.class);
- assertNotNull(i);
- assertTrue(i.isConversational());
- ConversationSequence seq = getOperation(i, "operation").getConversationSequence();
- assertEquals(ConversationSequence.CONVERSATION_CONTINUE, seq);
- seq = getOperation(i, "endOperation").getConversationSequence();
- assertEquals(ConversationSequence.CONVERSATION_END, seq);
- }
-
- @Test
- public void testBadServiceContract() throws Exception {
- try {
- javaFactory.createJavaInterface(BadFoo.class);
- fail();
- } catch (InvalidOperationException e) {
- // expected
- }
- }
-
- @Test
- public void testNonConversationalInformationIntrospection() throws Exception {
- Interface i = javaFactory.createJavaInterface(NonConversationalFoo.class);
- assertFalse(i.isConversational());
- ConversationSequence seq = getOperation(i, "operation")
- .getConversationSequence();
- assertEquals(ConversationSequence.CONVERSATION_NONE, seq);
- }
-
- @Conversational
- private interface Foo {
- void operation();
-
- @EndsConversation
- void endOperation();
- }
-
- private interface BadFoo {
- void operation();
-
- @EndsConversation
- void endOperation();
- }
-
- private interface NonConversationalFoo {
- void operation();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/JavaInterfaceProcessorRegistryImplTestCase.java.fixme b/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/JavaInterfaceProcessorRegistryImplTestCase.java.fixme
deleted file mode 100644
index 14ac8b0134..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/JavaInterfaceProcessorRegistryImplTestCase.java.fixme
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.introspection.impl;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaInterfaceProcessorRegistryImplTestCase extends TestCase {
- private JavaInterfaceFactory factory;
-
- @SuppressWarnings("unchecked")
- public void testSimpleInterface() throws InvalidInterfaceException {
- JavaInterface intf = factory.createJavaInterface(Simple.class);
-
- assertEquals(Simple.class, intf.getJavaClass());
- List<Operation> operations = intf.getOperations();
- assertEquals(1, operations.size());
- Operation baseInt = operations.get(0);
- assertEquals("baseInt", baseInt.getName());
-
- QName element = new QName("http://impl.introspection.java.interfacedef.sca.tuscany.apache.org/", "return");
-
- DataType<XMLType> returnType = baseInt.getOutputType();
- assertEquals(Integer.TYPE, returnType.getPhysical());
- assertEquals(element, returnType.getLogical().getElementName());
-
- List<DataType> parameterTypes = baseInt.getInputType().getLogical();
- assertEquals(1, parameterTypes.size());
- DataType<XMLType> arg0 = parameterTypes.get(0);
- assertEquals(Integer.TYPE, arg0.getPhysical());
-
- element = new QName("http://impl.introspection.java.interfacedef.sca.tuscany.apache.org/", "arg0");
- assertEquals(element, arg0.getLogical().getElementName());
-
- List<DataType> faultTypes = baseInt.getFaultTypes();
- assertEquals(1, faultTypes.size());
- DataType<DataType<XMLType>> fault0 = faultTypes.get(0);
- assertEquals(IOException.class, fault0.getPhysical());
- element = new QName("http://impl.introspection.java.interfacedef.sca.tuscany.apache.org/", "IOException");
- assertEquals(element, fault0.getLogical().getLogical().getElementName());
- }
-
- public void testUnregister() throws Exception {
- JavaInterfaceVisitor extension = createMock(JavaInterfaceVisitor.class);
- extension.visitInterface(EasyMock.isA(JavaInterface.class));
- expectLastCall().once();
- replay(extension);
- factory.addInterfaceVisitor(extension);
- factory.createJavaInterface(Base.class);
- factory.removeInterfaceVisitor(extension);
- factory.createJavaInterface(Base.class);
- verify(extension);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- factory = new DefaultJavaInterfaceFactory();
-
- }
-
- private static interface Base {
- int baseInt(int param) throws IllegalArgumentException, IOException;
- }
-
- private static interface Simple extends Base {
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/PolicyProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/PolicyProcessorTestCase.java
deleted file mode 100644
index 3833699421..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/PolicyProcessorTestCase.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.java.introspection.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.impl.PolicyJavaInterfaceVisitor;
-import org.apache.tuscany.sca.policy.DefaultPolicyFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.PolicySets;
-import org.oasisopen.sca.annotation.Requires;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PolicyProcessorTestCase {
- private JavaInterfaceFactory factory = new DefaultJavaInterfaceFactory();
- private PolicyJavaInterfaceVisitor policyProcessor;
-
- @Test
- public void testInterfaceLevel() throws Exception {
- JavaInterface type = factory.createJavaInterface(Interface1.class);
- policyProcessor.visitInterface(type);
- assertEquals(1, type.getRequiredIntents().size());
- assertEquals(1, type.getPolicySets().size());
- }
-
- @Test
- public void testMethodLevel() throws Exception {
- JavaInterface type = factory.createJavaInterface(Interface2.class);
- policyProcessor.visitInterface(type);
- assertEquals(0, type.getRequiredIntents().size());
- assertEquals(1, type.getOperations().get(0).getRequiredIntents().size());
- assertEquals(1, type.getOperations().get(1).getRequiredIntents().size());
- assertEquals(0, type.getPolicySets().size());
- assertEquals(1, type.getOperations().get(0).getPolicySets().size());
- assertEquals(1, type.getOperations().get(1).getPolicySets().size());
- }
-
- @Test
- public void testInterfaceAndMethodLevel() throws Exception {
- JavaInterface type = factory.createJavaInterface(Interface3.class);
- policyProcessor.visitInterface(type);
- assertEquals(1, type.getRequiredIntents().size());
- assertEquals(1, type.getOperations().get(0).getRequiredIntents().size());
- assertEquals(1, type.getOperations().get(1).getRequiredIntents().size());
- assertEquals(1, type.getPolicySets().size());
- assertEquals(1, type.getOperations().get(0).getPolicySets().size());
- assertEquals(1, type.getOperations().get(1).getPolicySets().size());
- }
-
- @Before
- public void setUp() throws Exception {
- policyProcessor = new PolicyJavaInterfaceVisitor(new DefaultPolicyFactory());
- }
-
- // @Remotable
- @Requires( {"transaction.global"})
- @PolicySets( {"{http://ns1}PS1"})
- private interface Interface1 {
- int method1();
-
- int method2();
-
- int method3();
-
- int method4();
- }
-
- private interface Interface2 {
- @Requires( {"transaction.global"})
- @PolicySets( {"{http://ns1}PS1"})
- int method1();
-
- @Requires( {"transaction.local"})
- @PolicySets( {"{http://ns1}PS2"})
- int method2();
- }
-
- @Requires( {"transaction.global.Interface6"})
- @PolicySets( {"{http://ns1}PS1"})
- private interface Interface3 {
- @Requires( {"transaction.global.Interface6.method1"})
- @PolicySets( {"{http://ns1}PS2"})
- int method1();
-
- @Requires( {"transaction.local.Interface6.method2"})
- @PolicySets( {"{http://ns1}PS3"})
- int method2();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/LICENSE b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index 7a65a62f71..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,40 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.interfacedef.wsdl.xml;version=
- "2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA WSDL Interface XML Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397292156
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA WSDL Interface XML Model
-Import-Package: javax.wsdl,
- javax.wsdl.extensions,
- javax.wsdl.extensions.schema,
- javax.wsdl.factory,
- javax.wsdl.xml,
- javax.xml.namespace,
- javax.xml.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.assembly.builder;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.namespace;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.wsdl;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.xsd;version="2.0.0",
- org.apache.tuscany.sca.xsd.xml;version="2.0.0",
- org.apache.ws.commons.schema,
- org.w3c.dom,
- org.xml.sax
-Bundle-SymbolicName: org.apache.tuscany.sca.interface.wsdl.xml
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/NOTICE b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/pom.xml b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/pom.xml
deleted file mode 100644
index f3517c72d5..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <name>Apache Tuscany SCA WSDL Interface XML Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java
deleted file mode 100644
index 5178149b63..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.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
- *
- * @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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java
deleted file mode 100644
index 82d18ca319..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import javax.xml.namespace.QName;
-
-/**
- * Constants for WSDL.
- *
- * @version $Rev$ $Date$
- */
-public interface WSDLConstants {
- String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- String INTERFACE_WSDL = "interface.wsdl";
- QName INTERFACE_WSDL_QNAME = new QName(SCA10_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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
deleted file mode 100644
index 8331215067..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.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 static final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
-
- 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.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();
- 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
deleted file mode 100644
index d40aac9434..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.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
- * @return
- * @throws ContributionReadException
- */
- 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 {
- wsdlInterface = wsdlFactory.createWSDLInterface();
- wsdlInterface.setUnresolved(true);
- String namespace = uri.substring(0, index);
- String name = uri.substring(index + 1);
- name = name.substring("wsdl.interface(".length(), name.length() - 1);
- wsdlInterface.setName(new QName(namespace, name));
- }
-
- return wsdlInterface;
- }
-
- 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.SCA10_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(e);
- error("ContributionResolveException", wsdlFactory, ce);
- //throw ce;
- }
- }
- else {
- warning("WsdlInterfaceDoesNotMatch", wsdlDefinition, wsdlInterface.getName());
- }
- }
- }
- }
- 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
deleted file mode 100644
index 5fd26ca953..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Operation;
-import javax.wsdl.PortType;
-import javax.wsdl.Types;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.AttributeExtensible;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.ExtensionDeserializer;
-import javax.wsdl.extensions.ExtensionRegistry;
-import javax.wsdl.extensions.ExtensionSerializer;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.extensions.UnknownExtensionDeserializer;
-import javax.wsdl.extensions.UnknownExtensionSerializer;
-import javax.wsdl.extensions.schema.Schema;
-import javax.wsdl.xml.WSDLLocator;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.DefaultImport;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionRuntimeException;
-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.xsd.XSDFactory;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-import org.apache.tuscany.sca.xsd.xml.XMLDocumentHelper;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-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) $
- */
-public class WSDLModelResolver implements ModelResolver {
- //Schema element names
- public static final String ELEM_SCHEMA = "schema";
-
- //Schema URI
- public static final String NS_URI_XSD_1999 = "http://www.w3.org/1999/XMLSchema";
- public static final String NS_URI_XSD_2000 = "http://www.w3.org/2000/10/XMLSchema";
- public static final String NS_URI_XSD_2001 = "http://www.w3.org/2001/XMLSchema";
-
- //Schema QNames
- public static final QName Q_ELEM_XSD_1999 = new QName(NS_URI_XSD_1999, ELEM_SCHEMA);
- public static final QName Q_ELEM_XSD_2000 = new QName(NS_URI_XSD_2000, ELEM_SCHEMA);
- public static final QName Q_ELEM_XSD_2001 = new QName(NS_URI_XSD_2001, ELEM_SCHEMA);
- public static final List<QName> XSD_QNAME_LIST =
- Arrays.asList(new QName[] {Q_ELEM_XSD_1999, Q_ELEM_XSD_2000, Q_ELEM_XSD_2001});
-
- // ---- Policy WSDL Attachments
-
- public static final QName Q_POLICY_ATTRIBUTE_EXTENSION = new QName("http://www.osoa.org/xmlns/sca/1.0", "requires");
- public static final QName Q_POLICY_END_CONVERSATION_ATTRIBUTE_EXTENSION = new QName("http://www.osoa.org/xmlns/sca/1.0", "endsConversation");
-
- // ---- Stuff added for BPEL extension elements --- Mike Edwards 01/05/2008
- public static final String ELEM_PLINKTYPE = "partnerLinkType";
- public static final String NS_BPEL_1_1 = "http://schemas.xmlsoap.org/ws/2004/03/partner-link/";
- public static final QName BPEL_PLINKTYPE = new QName( NS_BPEL_1_1, ELEM_PLINKTYPE );
- // ---- end of BPEL extension stuff
-
- private Contribution contribution;
- private Map<String, List<WSDLDefinition>> map = new HashMap<String, List<WSDLDefinition>>();
-
- private ExtensionRegistry wsdlExtensionRegistry;
-
- private WSDLFactory wsdlFactory;
- private javax.wsdl.factory.WSDLFactory wsdl4jFactory;
- private ContributionFactory contributionFactory;
- private XSDFactory xsdFactory;
-
- public WSDLModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
-
- this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
- this.wsdl4jFactory = modelFactories.getFactory(javax.wsdl.factory.WSDLFactory.class);
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- this.xsdFactory = modelFactories.getFactory(XSDFactory.class);
-
- wsdlExtensionRegistry = this.wsdl4jFactory.newPopulatedExtensionRegistry();
- // REVIEW: [rfeng] Disable the schema extension for WSDL4J to avoid aggressive loading
- ExtensionDeserializer deserializer = new UnknownExtensionDeserializer();
- ExtensionSerializer serializer = new UnknownExtensionSerializer();
- for (QName schema : XSD_QNAME_LIST) {
- wsdlExtensionRegistry.registerSerializer(Types.class, schema, serializer);
- wsdlExtensionRegistry.registerDeserializer(Types.class, schema, deserializer);
- }
- // ---- Policy WSDL Extensions
- try {
- wsdlExtensionRegistry.registerExtensionAttributeType(PortType.class, Q_POLICY_ATTRIBUTE_EXTENSION, AttributeExtensible.LIST_OF_QNAMES_TYPE);
- wsdlExtensionRegistry.registerExtensionAttributeType(Operation.class, Q_POLICY_END_CONVERSATION_ATTRIBUTE_EXTENSION, AttributeExtensible.STRING_TYPE);
- } catch (NoSuchMethodError e) {
- // That method does not exist on older WSDL4J levels
- }
-
- // ---- BPEL additions
- serializer = new BPELExtensionHandler();
- deserializer = new BPELExtensionHandler();
- wsdlExtensionRegistry.registerSerializer(Definition.class, BPEL_PLINKTYPE, serializer);
- wsdlExtensionRegistry.registerDeserializer(Definition.class, BPEL_PLINKTYPE, deserializer);
- // ---- end of BPEL additions
- }
-
- /**
- * Implementation of a WSDL locator.
- */
- private class WSDLLocatorImpl implements WSDLLocator {
- private InputStream inputStream;
- private URL base;
- private String latestImportURI;
-
- public WSDLLocatorImpl(URL base, InputStream is) {
- this.base = base;
- this.inputStream = is;
- }
-
- public void close() {
- try {
- inputStream.close();
- } catch (IOException e) {
- // Ignore
- }
- }
-
- public InputSource getBaseInputSource() {
- try {
- return XMLDocumentHelper.getInputSource(base, inputStream);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public String getBaseURI() {
- return base.toString();
- }
-
- public InputSource getImportInputSource(String parentLocation, String importLocation) {
- try {
- if (importLocation == null) {
- throw new IllegalArgumentException("Required attribute 'location' is missing.");
- }
-
- URL url = null;
- if (importLocation.startsWith("/")) {
- // The URI is relative to the contribution
- String uri = importLocation.substring(1);
-
- Artifact proxyArtifact = contributionFactory.createArtifact();
- proxyArtifact.setURI(uri);
-
- //use contribution resolution (this supports import/export)
- Artifact importedArtifact =
- contribution.getModelResolver().resolveModel(Artifact.class, proxyArtifact);
- if (importedArtifact.getLocation() != null) {
- //get the artifact URL
- url = new URL(importedArtifact.getLocation());
- }
- } else {
- url = new URL(new URL(parentLocation), importLocation);
- }
- if (url == null) {
- return null;
- }
- latestImportURI = url.toString();
- return XMLDocumentHelper.getInputSource(url);
- } catch (Exception e) {
- throw new ContributionRuntimeException(e);
- }
- }
-
- public String getLatestImportURI() {
- return latestImportURI;
- }
-
- }
-
- public void addModel(Object resolved) {
- WSDLDefinition definition = (WSDLDefinition)resolved;
- for (XSDefinition d : definition.getXmlSchemas()) {
- if (contribution != null) {
- contribution.getModelResolver().addModel(d);
- }
- }
- List<WSDLDefinition> list = map.get(definition.getNamespace());
- if (list == null) {
- list = new ArrayList<WSDLDefinition>();
- map.put(definition.getNamespace(), list);
- }
- list.add(definition);
- }
-
- public Object removeModel(Object resolved) {
- WSDLDefinition definition = (WSDLDefinition)resolved;
- List<WSDLDefinition> list = map.get(definition.getNamespace());
- if (list == null) {
- return null;
- } else {
- return list.remove(definition);
- }
- }
-
- /**
- * Create a facade Definition which imports all the definitions
- *
- * @param definitions A list of the WSDL definitions under the same target namespace
- * @return The aggregated WSDL definition
- */
- private WSDLDefinition aggregate(List<WSDLDefinition> definitions) {
- if (definitions == null || definitions.size() == 0) {
- return null;
- }
- if (definitions.size() == 1) {
- WSDLDefinition d = definitions.get(0);
- loadOnDemand(d);
- return d;
- }
- WSDLDefinition aggregated = wsdlFactory.createWSDLDefinition();
- for (WSDLDefinition d : definitions) {
- loadOnDemand(d);
- }
- Definition facade = wsdl4jFactory.newDefinition();
- String ns = definitions.get(0).getNamespace();
- facade.setQName(new QName(ns, "$aggregated$"));
- facade.setTargetNamespace(ns);
-
- for (WSDLDefinition d : definitions) {
- if (d.getDefinition() != null) {
- javax.wsdl.Import imp = facade.createImport();
- imp.setNamespaceURI(d.getNamespace());
- imp.setDefinition(d.getDefinition());
- imp.setLocationURI(d.getDefinition().getDocumentBaseURI());
- facade.addImport(imp);
- aggregated.getXmlSchemas().addAll(d.getXmlSchemas());
- aggregated.getImportedDefinitions().add(d);
- }
- }
- aggregated.setDefinition(facade);
- definitions.clear();
- definitions.add(aggregated);
- return aggregated;
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
-
- // Lookup a definition for the given namespace
- String namespace = ((WSDLDefinition)unresolved).getNamespace();
- if (namespace == null) {
- return modelClass.cast(unresolved);
- }
- List<WSDLDefinition> list = map.get(namespace);
- WSDLDefinition resolved = aggregate(list);
- if (resolved != null && !resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
-
- // No definition found, delegate the resolution to the imports
- for (Import import_ : this.contribution.getImports()) {
- if (import_ instanceof NamespaceImport) {
- NamespaceImport namespaceImport = (NamespaceImport)import_;
- if (namespaceImport.getNamespace().equals(namespace)) {
-
- // Delegate the resolution to the namespace import resolver
- resolved =
- namespaceImport.getModelResolver().resolveModel(WSDLDefinition.class,
- (WSDLDefinition)unresolved);
- if (!resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- } else if (import_ instanceof DefaultImport) {
-
- // Delegate the resolution to the default import resolver
- resolved =
- import_.getModelResolver().resolveModel(WSDLDefinition.class,
- (WSDLDefinition)unresolved);
- if (!resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- }
- return modelClass.cast(unresolved);
- }
-
- /**
- * Load the WSDL definition on demand
- * @param def
- */
- private void loadOnDemand(WSDLDefinition def) {
- if (def.getDefinition() == null && def.getLocation() != null) {
- // Load the definition on-demand
- try {
- loadDefinition(def);
- } catch (ContributionReadException e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- // private Map<String, WSDLDefinition> loadedDefinitions = new Hashtable<String, WSDLDefinition>();
-
- /**
- * Load the WSDL definition and inline schemas
- *
- * @param wsdlDef
- * @throws ContributionReadException
- */
- private void loadDefinition(WSDLDefinition wsdlDef) throws ContributionReadException {
- if (wsdlDef.getDefinition() != null || wsdlDef.getLocation() == null) {
- return;
- }
- try {
- URL artifactURL = wsdlDef.getLocation().toURL();
- // Read a WSDL document
- InputStream is = artifactURL.openStream();
- WSDLReader reader = wsdl4jFactory.newWSDLReader();
- reader.setFeature("javax.wsdl.verbose", false);
- reader.setFeature("javax.wsdl.importDocuments", true);
- // FIXME: We need to decide if we should disable the import processing by WSDL4J
- // reader.setFeature("javax.wsdl.importDocuments", false);
- reader.setExtensionRegistry(wsdlExtensionRegistry); // use a custom registry
-
- WSDLLocatorImpl locator = new WSDLLocatorImpl(artifactURL, is);
- Definition definition = reader.readWSDL(locator);
- wsdlDef.setDefinition(definition);
-
- // If this definition imports any definitions from other namespaces,
- // set the correct WSDLDefinition import relationships.
- for (Map.Entry<String, List<javax.wsdl.Import>> entry :
- ((Map<String, List<javax.wsdl.Import>>)definition.getImports()).entrySet()) {
- if (!entry.getKey().equals(definition.getTargetNamespace())) {
- WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition();
- wsdlDefinition.setUnresolved(true);
- wsdlDefinition.setNamespace(entry.getKey());
- WSDLDefinition resolved = resolveModel(WSDLDefinition.class, wsdlDefinition);
- if (!resolved.isUnresolved()) {
- for (javax.wsdl.Import imp : entry.getValue()) {
- if (resolved.getDefinition().getDocumentBaseURI().equals(imp.getDefinition().getDocumentBaseURI())) {
- // this WSDLDefinition contains the imported document
- wsdlDef.getImportedDefinitions().add(resolved);
- } else {
- // this is a facade, so look in its imported definitions
- for (WSDLDefinition def : resolved.getImportedDefinitions()) {
- if (def.getDefinition().getDocumentBaseURI().equals(imp.getDefinition().getDocumentBaseURI())) {
- wsdlDef.getImportedDefinitions().add(def);
- break;
- }
- }
- }
- }
- }
- }
- }
-
- //Read inline schemas
- readInlineSchemas(wsdlDef, definition);
- } catch (WSDLException e) {
- throw new ContributionReadException(e);
- } catch (IOException e) {
- throw new ContributionReadException(e);
- }
- }
-
- private Document promote(Element element) {
- Document doc = (Document)element.getOwnerDocument().cloneNode(false);
- Element schema = (Element)doc.importNode(element, true);
- doc.appendChild(schema);
- Node parent = element.getParentNode();
- while (parent instanceof Element) {
- Element root = (Element)parent;
- NamedNodeMap nodeMap = root.getAttributes();
- if (nodeMap != null) {
- for (int i = 0; i < nodeMap.getLength(); i++) {
- Attr attr = (Attr)nodeMap.item(i);
- String name = attr.getName();
- if ("xmlns".equals(name) || name.startsWith("xmlns:")) {
- if (schema.getAttributeNode(name) == null) {
- schema.setAttributeNodeNS((Attr)doc.importNode(attr, true));
- }
- }
- }
- }
- parent = parent.getParentNode();
- }
- doc.setDocumentURI(element.getOwnerDocument().getDocumentURI());
- return doc;
- }
-
- /**
- * Populate the inline schemas including those from the imported definitions
- *
- * @param definition
- * @param schemaCollection
- */
- private void readInlineSchemas(WSDLDefinition wsdlDefinition, Definition definition) {
- if (contribution == null) {
- // Check null for test cases
- return;
- }
- Types types = definition.getTypes();
- if (types != null) {
- int index = 0;
- for (Object ext : types.getExtensibilityElements()) {
- ExtensibilityElement extElement = (ExtensibilityElement)ext;
- Element element = null;
- if (XSD_QNAME_LIST.contains(extElement.getElementType())) {
- if (extElement instanceof Schema) {
- element = ((Schema)extElement).getElement();
- } else if (extElement instanceof UnknownExtensibilityElement) {
- element = ((UnknownExtensibilityElement)extElement).getElement();
- }
- }
- if (element != null) {
- Document doc = promote(element);
- XSDefinition xsDefinition = xsdFactory.createXSDefinition();
- xsDefinition.setUnresolved(true);
- xsDefinition.setNamespace(element.getAttribute("targetNamespace"));
- xsDefinition.setDocument(doc);
- xsDefinition.setLocation(URI.create(doc.getDocumentURI() + "#" + index));
- XSDefinition resolved =
- contribution.getModelResolver().resolveModel(XSDefinition.class, xsDefinition);
- if (resolved != null && !resolved.isUnresolved()) {
- if (!wsdlDefinition.getXmlSchemas().contains(resolved)) {
- // Don't add resolved because it may be an aggregate that
- // contains more than we need. The resolver will have
- // set the specific schema we need into unresolved.
- wsdlDefinition.getXmlSchemas().add(xsDefinition);
- }
- }
- index++;
- }
- }
- }
- for (Object imports : definition.getImports().values()) {
- List impList = (List)imports;
- for (Object i : impList) {
- javax.wsdl.Import anImport = (javax.wsdl.Import)i;
- // Read inline schemas
- if (anImport.getDefinition() != null) {
- readInlineSchemas(wsdlDefinition, anImport.getDefinition());
- }
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 9666a6dbd8..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLInterfaceProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#interface.wsdl,model=org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
deleted file mode 100644
index 553c764233..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLDocumentProcessor;type=.wsdl,model=org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
deleted file mode 100644
index 30d2039e80..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver;model=org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/interface-wsdlxml-validation-messages.properties b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/interface-wsdlxml-validation-messages.properties
deleted file mode 100644
index 2f8c3e0500..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/main/resources/interface-wsdlxml-validation-messages.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
deleted file mode 100644
index bd8f1c5e56..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
deleted file mode 100644
index 666763fe71..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
deleted file mode 100644
index 877ca60c13..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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);
- }
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
deleted file mode 100644
index f03d7d6628..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java
deleted file mode 100644
index d91e206183..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
deleted file mode 100644
index d2a019f47d..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
deleted file mode 100644
index 4f85bb8f1c..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java
deleted file mode 100644
index 6b1f92f372..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.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.processor.ExtensibleURLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
-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 WSDLModelResolver wsdlResolver;
-
- @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);
- wsdlResolver = new WSDLModelResolver(null, 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java
deleted file mode 100644
index a11eb1017f..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java
deleted file mode 100644
index 4558bafdb8..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite
deleted file mode 100644
index 875fdf35d2..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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: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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType
deleted file mode 100644
index 3eb81b61bd..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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.
--->
-<constrainingType xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:calc="http://calc"
- targetNamespace="http://calc"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="CalculatorComponent">
-
- <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>
-
-</constrainingType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType
deleted file mode 100644
index aea7046a3d..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType
+++ /dev/null
@@ -1,33 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl
deleted file mode 100644
index 5e8e5dad0d..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl
deleted file mode 100644
index ad81fc7867..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd
deleted file mode 100644
index 241ec15d36..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl
deleted file mode 100644
index 39cd5547d9..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl
deleted file mode 100644
index 8e26f7b4b5..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd
deleted file mode 100644
index c2210f4a94..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl
deleted file mode 100644
index 529b395fd5..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl
deleted file mode 100644
index 666a7e4069..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl
+++ /dev/null
@@ -1,76 +0,0 @@
-<?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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/policy/stockquote_policy.wsdl b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/policy/stockquote_policy.wsdl
deleted file mode 100644
index 7cdf801692..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/policy/stockquote_policy.wsdl
+++ /dev/null
@@ -1,62 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl
deleted file mode 100644
index b0b6644e7f..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl
deleted file mode 100644
index 0a7979e308..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd
deleted file mode 100644
index 635ca25bfc..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd
deleted file mode 100644
index bb0c9bc7b7..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd b/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd
deleted file mode 100644
index 300de931ec..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/interface-wsdl/LICENSE b/tags/java/sca/2.0-M1/modules/interface-wsdl/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/interface-wsdl/META-INF/MANIFEST.MF
deleted file mode 100644
index 3af0da9e4e..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,36 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.interfacedef.wsdl;uses:="org.ap
- ache.ws.commons.schema,org.apache.tuscany.sca.assembly,org.apache.tus
- cany.sca.contribution.resolver,javax.wsdl.extensions,org.apache.tusca
- ny.sca.core,org.apache.tuscany.sca.interfacedef,javax.wsdl,javax.xml.
- namespace";version="2.0.0"
-Private-Package: org.apache.tuscany.sca.interfacedef.wsdl.impl;version
- ="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA WSDL Interface Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397282593
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA WSDL Interface Model
-Import-Package: javax.wsdl,
- javax.wsdl.extensions,
- javax.xml.namespace,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.contribution.processor;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.impl;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.wsdl;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.xsd;version="2.0.0",
- org.apache.ws.commons.schema
-Bundle-SymbolicName: org.apache.tuscany.sca.interface.wsdl
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/NOTICE b/tags/java/sca/2.0-M1/modules/interface-wsdl/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/pom.xml b/tags/java/sca/2.0-M1/modules/interface-wsdl/pom.xml
deleted file mode 100644
index ff98a587be..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <name>Apache Tuscany SCA WSDL Interface Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- <version>1.4.2</version>
- </dependency>
-
- <dependency>
- <groupId>wsdl4j</groupId>
- <artifactId>wsdl4j</artifactId>
- <version>1.6.2</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/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/BPELPartnerLinkTypeExt.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/BPELPartnerLinkTypeExt.java
deleted file mode 100644
index 0d6f23e732..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/BPELPartnerLinkTypeExt.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java
deleted file mode 100644
index 8d571a4404..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl;
-
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLFactoryImpl;
-
-/**
- * A factory for the WSDL model.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultWSDLFactory extends WSDLFactoryImpl implements WSDLFactory {
-
- public DefaultWSDLFactory(FactoryExtensionPoint modelFactories) {
- super(modelFactories);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLDefinition.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLDefinition.java
deleted file mode 100644
index 039e75f437..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLDefinition.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 java.net.URI;
-import java.util.List;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLElement;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Base;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaType;
-
-/**
- * Represents a WSDL definition.
- * WSDLDefinition
- *
- * @version $Rev$ $Date$
- */
-public interface WSDLDefinition extends Base {
-
- /**
- * Returns the WSDL definition model, if there are more than one WSDL definition under the
- * same namespace, the definition will be a facade which imports all the physical WSDL
- * definitions
- *
- * @return the WSDL definition model
- */
- Definition getDefinition();
-
- /**
- * Sets the WSDL definition model
- * @param definition the WSDL definition model
- */
- void setDefinition(Definition definition);
-
- /**
- * Returns the namespace of this WSDL definition.
- * @return the namespace of this WSDL definition
- */
- String getNamespace();
-
- /**
- * Sets the namespace of this WSDL definition.
- * @param namespace the namespace of this WSDL definition
- */
- void setNamespace(String namespace);
-
- /**
- * Get a list of inline XML schema definitions
- * @return A list of inline XML schema definitions
- */
- List<XSDefinition> getXmlSchemas();
-
- /**
- * Get the location of the WSDL file
- * @return The location of the WSDL file
- */
- URI getLocation();
-
- /**
- * Set the location of the WSDL file
- * @param url
- */
- void setLocation(URI url);
-
- /**
- * Get the contribution artifact URI of the WSDL document
- * @return The URI of the WSDL document
- */
- URI getURI();
-
- /**
- * Set the contribution artifact URI of the WSDL document
- * @param uri
- */
- void setURI(URI uri);
-
- /**
- * Get the WSDL definitions imported by this definition
- * @return A list of imported WSDL definitions
- */
- List<WSDLDefinition> getImportedDefinitions();
-
- /**
- * Get an XSD element by QName
- * @param name
- * @return
- */
- XmlSchemaElement getXmlSchemaElement(QName name);
-
- /**
- * Get an XSD type by QName
- * @param name
- * @return
- */
- XmlSchemaType getXmlSchemaType(QName name);
-
- /**
- * Get the WSDL object by type and name
- * @param <T>
- * @param type javax.wsdl.Service/PortType/Binding/Message.class
- * @param name The QName of the object
- * @return WSDLObject
- */
- <T extends WSDLElement> WSDLObject<T> getWSDLObject(Class<T> type, QName name);
-
- /**
- * Get the generated binding for a WSDLDefinition
- * @return the WSDL binding
- */
- Binding getBinding();
-
- /**
- * Set the generated binding for a WSDLDefinition
- * @param binding the WSDL binding
- */
- void setBinding(Binding binding);
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLFactory.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLFactory.java
deleted file mode 100644
index 95985dcc28..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl;
-
-import javax.wsdl.PortType;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-
-/**
- * Factory for the WSDL model.
- *
- * @version $Rev$ $Date$
- */
-public interface WSDLFactory {
-
- /**
- * Creates a new WSDL interface.
- *
- * @return a new WSDL interface
- */
- WSDLInterface createWSDLInterface();
-
- /**
- * Creates a new WSDL interface from a WSDL portType.
- *
- * @param portType the portType to inspect
- * @return a WSDLInterface corresponding to the WSDL portType
- */
- WSDLInterface createWSDLInterface(PortType portType, WSDLDefinition wsdlDefinition, ModelResolver resolver) throws InvalidInterfaceException;
-
- /**
- * Creates the contents of a WSDL interface from a WSDL portType.
- *
- * @param portType the portType to inspect
- * @return a WSDLInterface corresponding to the WSDL portType
- */
- void createWSDLInterface(WSDLInterface wsdlInterface, PortType portType, WSDLDefinition wsdlDefinition, ModelResolver resolver) throws InvalidInterfaceException;
-
- /**
- * Creates a new WSDL definition.
- *
- * @return a new WSDL definition
- */
- WSDLDefinition createWSDLDefinition();
-
- /**
- * Creates a new WSDL interface contract.
- *
- * @return
- */
- WSDLInterfaceContract createWSDLInterfaceContract();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java
deleted file mode 100644
index c0da060af2..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Base;
-import org.apache.tuscany.sca.interfacedef.Interface;
-
-
-/**
- * Represents a WSDL interface.
- *
- * @version $Rev$ $Date$
- */
-public interface WSDLInterface extends Interface, Base {
-
- /**
- * Returns the name of the WSDL interface.
- *
- * @return the name of the WSDL interface
- */
- QName getName();
-
- /**
- * Sets the name of the WSDL interface.
- *
- * @param interfaceName the name of the WSDL interface
- */
- void setName(QName interfaceName);
-
- /**
- * Returns the WSDL interface portType.
- *
- * @return the WSDL interface portType
- */
- PortType getPortType();
-
- /**
- * Sets the WSDL interface portType
- *
- * @param portType the WSDL interface portType
- */
- void setPortType(PortType portType);
-
- WSDLDefinition getWsdlDefinition();
-
- void setWsdlDefinition(WSDLDefinition wsdlDefinition);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterfaceContract.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterfaceContract.java
deleted file mode 100644
index 59db17116b..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterfaceContract.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl;
-
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-
-
-/**
- * Represents a WSDL interface contract.
- *
- * @version $Rev$ $Date$
- */
-public interface WSDLInterfaceContract extends InterfaceContract {
-
- /**
- * Sets the WSDL location.
- * @param location the WSDL location
- */
- void setLocation(String location);
-
- /**
- * Returns the WSDL location
- * @return the WSDL location
- */
- String getLocation();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLObject.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLObject.java
deleted file mode 100644
index 0b707163da..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLObject.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl;
-
-import java.io.Serializable;
-
-import javax.wsdl.Definition;
-
-/**
- * Model for objects in a WSDL definition
- * @version $Rev$ $Date$
- */
-public interface WSDLObject<T extends Serializable> {
- /**
- * Get the owning definition where the element is declared
- * @return The owning definition
- */
- Definition getDefinition();
-
- /**
- * Set the owning definition
- * @param definition
- */
- void setDefinition(Definition definition);
-
- /**
- * Get the WSDL element such as Service, PortType, Binding or Message
- * @return The WSDL element
- */
- T getElement();
-
- /**
- * Set the WSDL element
- * @param element
- */
- void setElement(T element);
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLOperation.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLOperation.java
deleted file mode 100644
index d73cccb714..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLOperation.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * WSDL 1.1 Operation
- * @version $Rev$ $Date$
- */
-public interface WSDLOperation extends Operation {
- /**
- * Get the underlying WSDL operation
- * @return
- */
- javax.wsdl.Operation getWsdlOperation();
-
- /**
- * Set the underlying WSDL operation
- * @param operation
- */
- void setWsdlOperation(javax.wsdl.Operation operation);
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/InvalidWSDLException.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/InvalidWSDLException.java
deleted file mode 100644
index 1e7b4faa32..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/InvalidWSDLException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.impl;
-
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-
-/**
- * An exception to indicate the WSDL definition is invalid
- *
- * @version $Rev$ $Date$
- */
-public class InvalidWSDLException extends InvalidInterfaceException {
- private static final long serialVersionUID = 3742887584293256519L;
-
- public InvalidWSDLException(String message) {
- super(message);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java
deleted file mode 100644
index 82a7aa1200..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Message;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.WSDLElement;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaType;
-
-/**
- * Represents a WSDL definition.
- *
- * @version $Rev$ $Date$
- */
-public class WSDLDefinitionImpl implements WSDLDefinition {
-
- private Definition definition;
- private String namespace;
- private URI location;
- private URI uri;
- private List<WSDLDefinition> imported = new ArrayList<WSDLDefinition>();
- private List<XSDefinition> schemas = new ArrayList<XSDefinition>();
- private boolean unresolved;
- private Binding binding;
-
- protected WSDLDefinitionImpl() {
- }
-
- public Definition getDefinition() {
- return definition;
- }
-
- public void setDefinition(Definition definition) {
- this.definition = definition;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean undefined) {
- this.unresolved = undefined;
- }
-
- public String getNamespace() {
- if (isUnresolved()) {
- return namespace;
- } else if (definition != null) {
- return definition.getTargetNamespace();
- } else {
- return namespace;
- }
- }
-
- public void setNamespace(String namespace) {
- if (!isUnresolved()) {
- throw new IllegalStateException();
- } else {
- this.namespace = namespace;
- }
- }
-
- /*
- @Override
- public int hashCode() {
- return String.valueOf(getNamespace()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof WSDLDefinition) {
- WSDLDefinition def = (WSDLDefinition)obj;
- if (getNamespace() != null) {
- return getNamespace().equals(def.getNamespace());
- } else {
- return def.getNamespace() == null;
- }
- } else {
- return false;
- }
- }
- */
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition#getXmlSchemas()
- */
- public List<XSDefinition> getXmlSchemas() {
- return schemas;
- }
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition#getLocation()
- */
- public URI getLocation() {
- return location;
- }
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition#setLocation(java.net.URI)
- */
- public void setLocation(URI url) {
- this.location = url;
- }
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition#getURI()
- */
- public URI getURI() {
- return uri;
- }
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition#setURI(java.net.URI)
- */
- public void setURI(URI uri) {
- this.uri = uri;
- }
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition#getImportedDefinitions()
- */
- public List<WSDLDefinition> getImportedDefinitions() {
- return imported;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((location == null) ? 0 : location.hashCode());
- result = prime * result + ((namespace == null) ? 0 : namespace.hashCode());
- return result;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof WSDLDefinitionImpl))
- return false;
- final WSDLDefinitionImpl other = (WSDLDefinitionImpl)obj;
- if (location == null) {
- if (other.location != null)
- return false;
- } else if (!location.equals(other.location))
- return false;
- if (namespace == null) {
- if (other.namespace != null)
- return false;
- } else if (!namespace.equals(other.namespace))
- return false;
- return true;
- }
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition#getXmlSchemaElement(javax.xml.namespace.QName)
- */
- public XmlSchemaElement getXmlSchemaElement(QName name) {
- XmlSchemaCollection schemaCollection = null;
- for (XSDefinition xsd : schemas) {
- if (schemaCollection == null && xsd.getSchemaCollection() != null) {
- schemaCollection = xsd.getSchemaCollection();
- }
- XmlSchemaElement element = xsd.getXmlSchemaElement(name);
- if (element != null) {
- return element;
- }
- }
- if (schemaCollection != null) {
- return schemaCollection.getElementByQName(name);
- }
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition#getXmlSchemaType(javax.xml.namespace.QName)
- */
- public XmlSchemaType getXmlSchemaType(QName name) {
- XmlSchemaCollection schemaCollection = null;
- for (XSDefinition xsd : schemas) {
- if (xsd.getSchemaCollection() != null) {
- schemaCollection = xsd.getSchemaCollection();
- }
- XmlSchemaType type = xsd.getXmlSchemaType(name);
- if (type != null) {
- return type;
- }
- }
- if (schemaCollection != null) {
- return schemaCollection.getTypeByQName(name);
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- private static <T extends WSDLElement> WSDLObject<T> getWSDLObject(Definition definition, Class<T> type, QName name) {
- if (definition == null) {
- return null;
- }
- Map<QName, WSDLElement> map = null;
- if (type == PortType.class) {
- map = definition.getPortTypes();
- } else if (type == Service.class) {
- map = definition.getServices();
- } else if (type == Binding.class) {
- map = definition.getBindings();
- } else if (type == Message.class) {
- map = definition.getMessages();
- } else {
- throw new IllegalArgumentException("Invalid type: " + type.getName());
- }
- if (map.containsKey(name)) {
- return (WSDLObject<T>)new WSDLObjectImpl(definition, map.get(name));
- } else {
- for (Object imports : definition.getImports().values()) {
- List<Import> importList = (List<Import>)imports;
- for (Import i : importList) {
- definition = i.getDefinition();
- WSDLObject<T> element = getWSDLObject(definition, type, name);
- if (element != null) {
- return element;
- }
- }
- }
- }
- return null;
- }
-
- public <T extends WSDLElement> WSDLObject<T> getWSDLObject(Class<T> type, QName name) {
- return getWSDLObject(definition, type, name);
- }
-
- public Binding getBinding() {
- return binding;
- }
-
- public void setBinding(Binding binding) {
- this.binding = binding;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java
deleted file mode 100644
index 883b6b1567..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl.impl;
-
-import javax.wsdl.PortType;
-
-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;
-
-/**
- * A factory for the WSDL model.
- *
- * @version $Rev$ $Date$
- */
-public abstract class WSDLFactoryImpl implements WSDLFactory {
-
- private WSDLInterfaceIntrospectorImpl introspector;
-
- public WSDLFactoryImpl(FactoryExtensionPoint modelFactories) {
- introspector = new WSDLInterfaceIntrospectorImpl(modelFactories);
- }
-
- public WSDLInterface createWSDLInterface() {
- return new WSDLInterfaceImpl();
- }
-
- public WSDLInterface createWSDLInterface(PortType portType,
- WSDLDefinition wsdlDefinition,
- ModelResolver resolver) throws InvalidInterfaceException {
- WSDLInterface wsdlInterface = createWSDLInterface();
- introspector.introspectPortType(wsdlInterface, portType, wsdlDefinition, resolver);
- return wsdlInterface;
- }
-
- public void createWSDLInterface(WSDLInterface wsdlInterface,
- PortType portType,
- WSDLDefinition wsdlDefinition,
- ModelResolver resolver) throws InvalidInterfaceException {
- introspector.introspectPortType(wsdlInterface, portType, wsdlDefinition, resolver);
- }
-
- public WSDLDefinition createWSDLDefinition() {
- return new WSDLDefinitionImpl();
- }
-
- public WSDLInterfaceContract createWSDLInterfaceContract() {
- return new WSDLInterfaceContractImpl();
- }
-
- public WSDLInterfaceIntrospectorImpl getWSDLInterfaceIntrospector() {
- return introspector;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceContractImpl.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceContractImpl.java
deleted file mode 100644
index e10bc0d178..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceContractImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl.impl;
-
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractImpl;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
-
-/**
- * Represents a WSDL interface contract.
- *
- * @version $Rev$ $Date$
- */
-public class WSDLInterfaceContractImpl extends InterfaceContractImpl implements WSDLInterfaceContract {
- private String location;
-
- protected WSDLInterfaceContractImpl() {
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- @Override
- public WSDLInterfaceContractImpl clone() throws CloneNotSupportedException {
- return (WSDLInterfaceContractImpl) super.clone();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
deleted file mode 100644
index 3719bbd79a..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl.impl;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceImpl;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-
-/**
- * Represents a WSDL interface.
- *
- * @version $Rev$ $Date$
- */
-public class WSDLInterfaceImpl extends InterfaceImpl implements WSDLInterface {
-
- private QName name;
- private PortType portType;
- private WSDLDefinition wsdlDefinition;
-
- protected WSDLInterfaceImpl() {
- setRemotable(true);
- }
-
- public QName getName() {
- if (isUnresolved()) {
- return name;
- } else {
- return portType.getQName();
- }
- }
-
- public void setName(QName interfaceName) {
- if (!isUnresolved()) {
- throw new IllegalStateException();
- }
- this.name = interfaceName;
- }
-
- public PortType getPortType() {
- return portType;
- }
-
- public void setPortType(PortType portType) {
- this.portType = portType;
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(getName()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof WSDLInterface) {
- if (getName() != null) {
- return getName().equals(((WSDLInterface)obj).getName());
- } else {
- return ((WSDLInterface)obj).getName() == null;
- }
- } else {
- return false;
- }
- }
-
- public WSDLDefinition getWsdlDefinition() {
- return wsdlDefinition;
- }
-
- public void setWsdlDefinition(WSDLDefinition wsdlDefinition) {
- this.wsdlDefinition = wsdlDefinition;
- }
-
- @Override
- public WSDLInterfaceImpl clone() throws CloneNotSupportedException {
- return (WSDLInterfaceImpl) super.clone();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
deleted file mode 100644
index 377f7b307d..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.impl;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Vector;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.ConversationSequence;
-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.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-
-/**
- * Introspector for creating WSDLInterface definitions from WSDL PortTypes.
- *
- * @version $Rev$ $Date$
- */
-public class WSDLInterfaceIntrospectorImpl {
- private static final QName POLICY_REQUIRES = new QName("http://www.osoa.org/xmlns/sca/1.0", "requires");
- private static final QName POLICY_CONVERSATIONAL = new QName("http://www.osoa.org/xmlns/sca/1.0", "conversational");
- public static final QName POLICY_END_CONVERSATION = new QName("http://www.osoa.org/xmlns/sca/1.0", "endsConversation");
-
- private XSDFactory xsdFactory;
- private PolicyFactory policyFactory;
-
- public WSDLInterfaceIntrospectorImpl(FactoryExtensionPoint modelFactories) {
- this.xsdFactory = modelFactories.getFactory(XSDFactory.class);;
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);;
- }
-
- // FIXME: Do we want to deal with document-literal wrapped style based on the JAX-WS Specification?
- private List<Operation> introspectOperations(PortType portType, WSDLDefinition wsdlDefinition, ModelResolver resolver) throws InvalidWSDLException {
- List<Operation> operations = new ArrayList<Operation>();
- for (Object o : portType.getOperations()) {
- javax.wsdl.Operation wsdlOp = (javax.wsdl.Operation)o;
- Operation operation = getOperation(wsdlOp, wsdlDefinition, resolver, xsdFactory);
- if(isEndConversation(wsdlOp)) {
- operation.setConversationSequence(ConversationSequence.CONVERSATION_END);
- }
- operations.add(operation);
- }
- return operations;
- }
-
- public void introspectPortType(WSDLInterface wsdlInterface, PortType portType, WSDLDefinition wsdlDefinition, ModelResolver resolver) throws InvalidWSDLException {
- processIntents(wsdlInterface, portType);
- wsdlInterface.setPortType(portType);
- wsdlInterface.getOperations().addAll(introspectOperations(portType, wsdlDefinition, resolver));
- wsdlInterface.setConversational(isConversational(portType));
- }
-
- public static Operation getOperation(javax.wsdl.Operation wsdlOp,
- WSDLDefinition wsdlDefinition,
- ModelResolver resolver,
- XSDFactory xsdFactory) throws InvalidWSDLException {
- WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(xsdFactory, wsdlOp, wsdlDefinition, null, resolver);
- return op.getOperation();
- }
-
- private void processIntents(WSDLInterface wsdlInterface, PortType portType) {
- Object o;
- try {
- o = portType.getExtensionAttribute(POLICY_REQUIRES);
- } catch (NoSuchMethodError e) {
- // That method does not exist on older WSDL4J levels
- o = null;
- }
- if(o != null && o instanceof Vector) {
- Vector<QName> policyAttributes = (Vector<QName>) o;
-
- Enumeration<QName> policyItents = policyAttributes.elements();
- while(policyItents.hasMoreElements()) {
- QName intentName = policyItents.nextElement();
-
- //ignores conversational, as it will have it's own
- //attribute in the wsdl interface model
- if(! intentName.equals(POLICY_CONVERSATIONAL)) {
- //process the intent
- System.out.println(">>> Intent : " + intentName);
-
- // Add each intent to the list
- Intent intent = policyFactory.createIntent();
- intent.setName(intentName);
-
- wsdlInterface.getRequiredIntents().add(intent);
- }
- }
-
- }
- }
-
- private boolean isConversational(PortType portType) {
- boolean conversational = false;
-
- Object o;
- try {
- o = portType.getExtensionAttribute(POLICY_REQUIRES);
- } catch (NoSuchMethodError e) {
- // That method does not exist on older WSDL4J levels
- o =null;
- }
- if(o != null && o instanceof Vector) {
- Vector<QName> policyAttributes = (Vector<QName>) o;
-
- if(policyAttributes.contains(POLICY_CONVERSATIONAL)) {
- return true;
- }
-
- }
-
- return conversational;
- }
-
- private boolean isEndConversation(javax.wsdl.Operation operation) {
- boolean endConversation = false;
-
- Object o;
- try {
- o = operation.getExtensionAttribute(POLICY_END_CONVERSATION);
- } catch (NoSuchMethodError e) {
- // That method does not exist on older WSDL4J levels
- o = null;
- }
- if(o != null && o instanceof String) {
- endConversation = Boolean.valueOf((String)o);
- }
-
- return endConversation;
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLObjectImpl.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLObjectImpl.java
deleted file mode 100644
index f18eaef27b..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLObjectImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.impl;
-
-import java.io.Serializable;
-
-import javax.wsdl.Definition;
-
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WSDLObjectImpl<T extends Serializable> implements WSDLObject<T> {
- private Definition definition;
- private T element;
-
- public WSDLObjectImpl() {
- super();
- }
-
- public WSDLObjectImpl(Definition definition, T element) {
- super();
- this.definition = definition;
- this.element = element;
- }
-
- public Definition getDefinition() {
- return definition;
- }
-
- public void setDefinition(Definition definition) {
- this.definition = definition;
- }
-
- public T getElement() {
- return element;
- }
-
- public void setElement(T element) {
- this.element = element;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationImpl.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationImpl.java
deleted file mode 100644
index 317b9cce81..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationImpl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.impl;
-
-import javax.wsdl.Operation;
-
-import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WSDLOperationImpl extends OperationImpl implements WSDLOperation {
- private Operation operation;
-
- public WSDLOperationImpl() {
- super();
- }
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation#getWsdlOperation()
- */
- public Operation getWsdlOperation() {
- return operation;
- }
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation#setWsdlOperation(javax.wsdl.Operation)
- */
- public void setWsdlOperation(Operation operation) {
- this.operation = operation;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((operation == null) ? 0 : operation.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- final WSDLOperationImpl other = (WSDLOperationImpl)obj;
- if (operation == null) {
- if (other.operation != null)
- return false;
- } else if (!operation.equals(other.operation))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return operation == null ? null : operation.toString();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
deleted file mode 100644
index ab6467bfd7..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
+++ /dev/null
@@ -1,602 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.wsdl.Fault;
-import javax.wsdl.Input;
-import javax.wsdl.Message;
-import javax.wsdl.Output;
-import javax.wsdl.Part;
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.interfacedef.ConversationSequence;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-import org.apache.tuscany.sca.interfacedef.util.FaultException;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-
-import org.apache.ws.commons.schema.XmlSchemaComplexType;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaObject;
-import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
-import org.apache.ws.commons.schema.XmlSchemaParticle;
-import org.apache.ws.commons.schema.XmlSchemaSequence;
-import org.apache.ws.commons.schema.XmlSchemaSimpleType;
-import org.apache.ws.commons.schema.XmlSchemaType;
-
-/**
- * Metadata for a WSDL operation
- *
- * @version $Rev$ $Date$
- */
-public class WSDLOperationIntrospectorImpl {
- private static final Logger logger = Logger.getLogger(WSDLOperationIntrospectorImpl.class.getName());
- private static final QName ANY = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "any");
-
- private XSDFactory xsdFactory;
- private ModelResolver resolver;
- private WSDLDefinition wsdlDefinition;
- private javax.wsdl.Operation operation;
- private WSDLOperation operationModel;
- private DataType<List<DataType>> inputType;
- private DataType outputType;
- private List<DataType> faultTypes;
- private String dataBinding;
-
- /**
- * @param wsdlFactory The WSDLFactory to use
- * @param operation The WSDL4J operation
- * @param wsdlDefinition The WSDL Definition
- * @param dataBinding The default databinding
- * @param resolver The ModelResolver to use
- */
- public WSDLOperationIntrospectorImpl(XSDFactory xsdFactory,
- javax.wsdl.Operation operation,
- WSDLDefinition wsdlDefinition,
- String dataBinding,
- ModelResolver resolver) {
- super();
- this.xsdFactory = xsdFactory;
- this.operation = operation;
- this.wsdlDefinition = wsdlDefinition;
- this.resolver = resolver;
- this.dataBinding = dataBinding;
- this.wrapper = new Wrapper();
- }
-
- private Wrapper wrapper;
-
- private Boolean wrapperStyle;
-
- /**
- * Test if the operation qualifies wrapper style as defined by the JAX-WS
- * 2.0 Specification
- *
- * @return true if the operation qualifies wrapper style, otherwise false
- */
- public boolean isWrapperStyle() throws InvalidWSDLException {
- if (wrapperStyle == null) {
- wrapperStyle =
- (operation.getInput() == null || operation.getInput().getMessage() == null
- || operation.getInput().getMessage().getParts().size() == 0 || wrapper.getInputChildElements() != null) && (operation
- .getOutput() == null || operation.getOutput().getMessage() == null
- || operation.getOutput().getMessage().getParts().size() == 0 || wrapper.getOutputChildElements() != null);
- }
- return wrapperStyle;
- }
-
- public Wrapper getWrapper() throws InvalidWSDLException {
- if (!isWrapperStyle()) {
- throw new IllegalStateException("The operation is not wrapper style.");
- } else {
- return wrapper;
- }
- }
-
- /**
- * @return
- * @throws InvalidServiceContractException
- */
- public DataType<List<DataType>> getInputType() throws InvalidWSDLException {
- if (inputType == null) {
- Input input = operation.getInput();
- Message message = (input == null) ? null : input.getMessage();
- inputType = getMessageType(message);
- inputType.setDataBinding("idl:input");
- }
- return inputType;
- }
-
- /**
- * @return
- * @throws NotSupportedWSDLException
- */
- @SuppressWarnings("unchecked")
- public DataType<XMLType> getOutputType() throws InvalidWSDLException {
- if (outputType == null) {
- Output output = operation.getOutput();
- Message outputMsg = (output == null) ? null : output.getMessage();
-
- List outputParts = (outputMsg == null) ? null : outputMsg.getOrderedParts(null);
- if (outputParts != null && outputParts.size() > 0) {
- if (outputParts.size() > 1) {
- // We don't support output with multiple parts
- if (logger.isLoggable(Level.WARNING)) {
- logger.warning("Multi-part output is not supported, please use BARE parameter style.");
- }
- // throw new InvalidWSDLException("Multi-part output is not supported");
- }
- Part part = (Part)outputParts.get(0);
- outputType = new WSDLPart(part, Object.class).getDataType();
- // outputType.setMetadata(WSDLOperation.class.getName(), this);
- }
- }
- return outputType;
- }
-
- /**
- * @return
- * @throws NotSupportedWSDLException
- */
- public List<DataType> getFaultTypes() throws InvalidWSDLException {
- if (faultTypes == null) {
- Collection faults = operation.getFaults().values();
- faultTypes = new ArrayList<DataType>();
- for (Object f : faults) {
- Fault fault = (Fault)f;
- Message faultMsg = fault.getMessage();
- List faultParts = faultMsg.getOrderedParts(null);
- if (faultParts.size() != 1) {
- throw new InvalidWSDLException("The fault message MUST have a single part");
- }
- Part part = (Part)faultParts.get(0);
- WSDLPart wsdlPart = new WSDLPart(part, Object.class);
- faultTypes.add(new DataTypeImpl<DataType>(FaultException.class, wsdlPart.getDataType()));
- }
- }
- return faultTypes;
- }
-
- private DataType<List<DataType>> getMessageType(Message message) throws InvalidWSDLException {
- List<DataType> partTypes = new ArrayList<DataType>();
- if (message != null) {
- Collection parts = message.getOrderedParts(null);
- for (Object p : parts) {
- WSDLPart part = new WSDLPart((Part)p, Object.class);
- DataType<XMLType> partType = part.getDataType();
- partTypes.add(partType);
- }
- }
- return new DataTypeImpl<List<DataType>>(dataBinding, Object[].class, partTypes);
- }
-
- /**
- * @return
- * @throws NotSupportedWSDLException
- */
- public Operation getOperation() throws InvalidWSDLException {
- if (operationModel == null) {
- boolean oneway = (operation.getOutput() == null);
- operationModel = new WSDLOperationImpl();
- operationModel.setWsdlOperation(operation);
- operationModel.setName(operation.getName());
- operationModel.setFaultTypes(getFaultTypes());
- operationModel.setNonBlocking(oneway);
- operationModel.setConversationSequence(ConversationSequence.CONVERSATION_NONE);
- operationModel.setInputType(getInputType());
- operationModel.setOutputType(getOutputType());
-
- operationModel.setWrapperStyle(isWrapperStyle());
- if (isWrapperStyle()) {
- WrapperInfo wrapperInfo = getWrapper().getWrapperInfo();
- operationModel.setWrapper(wrapperInfo);
- }
- }
- return operationModel;
- }
-
- private XmlSchemaElement getElement(QName elementName) {
-
- XmlSchemaElement element = wsdlDefinition.getXmlSchemaElement(elementName);
- if (element == null) {
- XSDefinition definition = xsdFactory.createXSDefinition();
- definition.setUnresolved(true);
- definition.setNamespace(elementName.getNamespaceURI());
- definition = resolver.resolveModel(XSDefinition.class, definition);
- if (definition.getSchema() != null) {
- element = definition.getSchema().getElementByName(elementName);
- }
- }
- return element;
- }
-
- private XmlSchemaType getType(QName typeName) {
- XmlSchemaType type = wsdlDefinition.getXmlSchemaType(typeName);
- if (type == null) {
- XSDefinition definition = xsdFactory.createXSDefinition();
- definition.setUnresolved(true);
- definition.setNamespace(typeName.getNamespaceURI());
- definition = resolver.resolveModel(XSDefinition.class, definition);
- if (definition.getSchema() != null) {
- type = definition.getSchema().getTypeByName(typeName);
- }
- }
- return type;
- }
-
- /**
- * Metadata for a WSDL part
- */
- public class WSDLPart {
- private Part part;
-
- private XmlSchemaElement element;
-
- private DataType dataType;
-
- public WSDLPart(Part part, Class javaType) throws InvalidWSDLException {
- this.part = part;
- QName elementName = part.getElementName();
- if (elementName != null) {
- element = WSDLOperationIntrospectorImpl.this.getElement(elementName);
- if (element == null) {
- throw new InvalidWSDLException("Element cannot be resolved: " + elementName.toString());
- }
- } else {
- // Create an faked XSD element to host the metadata
- element = new XmlSchemaElement();
- element.setName(part.getName());
- element.setQName(new QName(null, part.getName()));
- QName typeName = part.getTypeName();
- if (typeName != null) {
- XmlSchemaType type = WSDLOperationIntrospectorImpl.this.getType(typeName);
- if (type == null) {
- throw new InvalidWSDLException("Type cannot be resolved: " + typeName.toString());
- }
- element.setSchemaType(type);
- element.setSchemaTypeName(type.getQName());
- }
- }
- XMLType xmlType = new XMLType(getElementInfo(element));
- xmlType.setNillable(element.isNillable());
- xmlType.setMany(element.getMaxOccurs() > 1);
- dataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
- }
-
- /**
- * @return the element
- */
- public XmlSchemaElement getElement() {
- return element;
- }
-
- /**
- * @return the part
- */
- public Part getPart() {
- return part;
- }
-
- /**
- * @return the dataType
- */
- public DataType<XMLType> getDataType() {
- return dataType;
- }
- }
-
- /**
- * The "Wrapper Style" WSDL operation is defined by The Java API for
- * XML-Based Web Services (JAX-WS) 2.0 specification, section 2.3.1.2
- * Wrapper Style. <p/> A WSDL operation qualifies for wrapper style mapping
- * only if the following criteria are met:
- * <ul>
- * <li>(i) The operation�s input and output messages (if present) each
- * contain only a single part
- * <li>(ii) The input message part refers to a global element declaration
- * whose localname is equal to the operation name
- * <li>(iii) The output message part refers to a global element declaration
- * <li>(iv) The elements referred to by the input and output message parts
- * (henceforth referred to as wrapper elements) are both complex types
- * defined using the xsd:sequence compositor
- * <li>(v) The wrapper elements only contain child elements, they must not
- * contain other structures such as wildcards (element or attribute),
- * xsd:choice, substitution groups (element references are not permitted) or
- * attributes; furthermore, they must not be nillable.
- * </ul>
- */
- public class Wrapper {
- private XmlSchemaElement inputWrapperElement;
-
- private XmlSchemaElement outputWrapperElement;
-
- private List<XmlSchemaElement> inputElements;
-
- private List<XmlSchemaElement> outputElements;
-
- // private DataType<List<DataType<XMLType>>> unwrappedInputType;
- //
- // private DataType<XMLType> unwrappedOutputType;
-
- private transient WrapperInfo wrapperInfo;
-
- private List<XmlSchemaElement> getChildElements(XmlSchemaElement element) throws InvalidWSDLException {
- if (element == null) {
- return null;
- }
- if (element.isNillable()) {
- // Wrapper element cannot be nillable
- return null;
- }
- XmlSchemaType type = element.getSchemaType();
- if (type == null) {
- String qName = element.getQName().toString();
- throw new InvalidWSDLException("The XML schema element does not have a type: " + qName);
- }
- if (!(type instanceof XmlSchemaComplexType)) {
- // Has to be a complexType
- return null;
- }
- XmlSchemaComplexType complexType = (XmlSchemaComplexType)type;
- if (complexType.getAttributes().getCount() != 0 || complexType.getAnyAttribute() != null) {
- // No attributes
- return null;
- }
- XmlSchemaParticle particle = complexType.getParticle();
- if (particle == null) {
- // No particle
- return Collections.emptyList();
- }
- if (!(particle instanceof XmlSchemaSequence)) {
- return null;
- }
- XmlSchemaSequence sequence = (XmlSchemaSequence)complexType.getParticle();
- XmlSchemaObjectCollection items = sequence.getItems();
- List<XmlSchemaElement> childElements = new ArrayList<XmlSchemaElement>();
- for (int i = 0; i < items.getCount(); i++) {
- XmlSchemaObject schemaObject = items.getItem(i);
- if (!(schemaObject instanceof XmlSchemaElement)) {
- // Should contain elements only
- return null;
- }
- XmlSchemaElement childElement = (XmlSchemaElement)schemaObject;
- /*
- if (childElement.getSubstitutionGroup() != null) {
- return null;
- }
- */
- if (childElement.getName() == null || childElement.getRefName() != null) {
- XmlSchemaElement ref = getElement(childElement.getRefName());
- if (ref == null) {
- throw new InvalidWSDLException("XML schema element ref cannot be resolved: " + childElement);
- }
- childElement = ref;
- }
- if (ANY.equals(childElement.getQName())) {
- // Wildcard is not allowed
- return null;
- }
- // TODO: Do we support maxOccurs >1 ?
- if (childElement.getMaxOccurs() > 1) {
- // TODO: [rfeng] To be implemented
- /*
- if(logger.isLoggable(Level.WARNING)) {
- logger.warning("Support for elements with maxOccurs>1 is not implemented.");
- }
- */
- // return null;
- }
- childElements.add(childElement);
- }
- return childElements;
- }
-
- /**
- * Return a list of child XSD elements under the wrapped request element
- *
- * @return a list of child XSD elements or null if if the request
- * element is not wrapped
- */
- public List<XmlSchemaElement> getInputChildElements() throws InvalidWSDLException {
- if (inputElements != null) {
- return inputElements;
- }
- Input input = operation.getInput();
- if (input != null) {
- Message inputMsg = input.getMessage();
- Collection parts = inputMsg.getParts().values();
- if (parts.size() != 1) {
- return null;
- }
- Part part = (Part)parts.iterator().next();
- QName elementName = part.getElementName();
- if (elementName == null) {
- return null;
- }
- if (!operation.getName().equals(elementName.getLocalPart())) {
- return null;
- }
- inputWrapperElement = getElement(elementName);
- if (inputWrapperElement == null) {
- throw new InvalidWSDLException("The element is not declared in a XML schema: " + elementName
- .toString());
- }
- if (inputWrapperElement.isNillable()) {
- // The wrapper element cannot be nilable
- return null;
- }
- inputElements = getChildElements(inputWrapperElement);
- return inputElements;
- } else {
- return null;
- }
- }
-
- /**
- * Return a list of child XSD elements under the wrapped response
- * element
- *
- * @return a list of child XSD elements or null if if the response
- * element is not wrapped
- */
- public List<XmlSchemaElement> getOutputChildElements() throws InvalidWSDLException {
- if (outputElements != null) {
- return outputElements;
- }
- Output output = operation.getOutput();
- if (output != null) {
- Message outputMsg = output.getMessage();
- Collection parts = outputMsg.getParts().values();
- if (parts.size() != 1) {
- return null;
- }
- Part part = (Part)parts.iterator().next();
- QName elementName = part.getElementName();
- if (elementName == null) {
- throw new InvalidWSDLException("The element is not declared in the XML schema: " + part.getName());
- }
- outputWrapperElement = WSDLOperationIntrospectorImpl.this.getElement(elementName);
- if (outputWrapperElement == null) {
- return null;
- }
- if (outputWrapperElement.isNillable()) {
- // The wrapper element cannot be nilable
- return null;
- }
- outputElements = getChildElements(outputWrapperElement);
- // FIXME: Do we support multiple child elements for the response?
- return outputElements;
- } else {
- return null;
- }
- }
-
- /**
- * @return the inputWrapperElement
- */
- public XmlSchemaElement getInputWrapperElement() {
- return inputWrapperElement;
- }
-
- /**
- * @return the outputWrapperElement
- */
- public XmlSchemaElement getOutputWrapperElement() {
- return outputWrapperElement;
- }
-
- /*
- public DataType<List<DataType<XMLType>>> getUnwrappedInputType() throws InvalidWSDLException {
- if (unwrappedInputType == null) {
- List<DataType<XMLType>> childTypes = new ArrayList<DataType<XMLType>>();
- for (XmlSchemaElement element : getInputChildElements()) {
- DataType<XMLType> type =
- new DataType<XMLType>(dataBinding, Object.class, new XMLType(getElementInfo(element)));
- // type.setMetadata(ElementInfo.class.getName(), getElementInfo(element));
- childTypes.add(type);
- }
- unwrappedInputType =
- new DataType<List<DataType<XMLType>>>("idl:unwrapped.input", Object[].class, childTypes);
- }
- return unwrappedInputType;
- }
-
- public DataType<XMLType> getUnwrappedOutputType() throws InvalidServiceContractException {
- if (unwrappedOutputType == null) {
- List<XmlSchemaElement> elements = getOutputChildElements();
- if (elements != null && elements.size() > 0) {
- if (elements.size() > 1) {
- // We don't support output with multiple parts
- throw new NotSupportedWSDLException("Multi-part output is not supported");
- }
- XmlSchemaElement element = elements.get(0);
- unwrappedOutputType =
- new DataType<XMLType>(dataBinding, Object.class, new XMLType(getElementInfo(element)));
- // unwrappedOutputType.setMetadata(ElementInfo.class.getName(), getElementInfo(element));
- }
- }
- return unwrappedOutputType;
- }
- */
-
- public WrapperInfo getWrapperInfo() throws InvalidWSDLException {
- if (wrapperInfo == null) {
- ElementInfo in = getElementInfo(getInputWrapperElement());
- ElementInfo out = getElementInfo(getOutputWrapperElement());
- List<ElementInfo> inChildren = new ArrayList<ElementInfo>();
- if (in != null) {
- for (XmlSchemaElement e : getInputChildElements()) {
- inChildren.add(getElementInfo(e));
- }
- }
- List<ElementInfo> outChildren = new ArrayList<ElementInfo>();
- if (out != null) {
- for (XmlSchemaElement e : getOutputChildElements()) {
- outChildren.add(getElementInfo(e));
- }
- }
- wrapperInfo = new WrapperInfo(dataBinding, in, out, inChildren, outChildren);
- }
- return wrapperInfo;
- }
- }
-
- private static ElementInfo getElementInfo(XmlSchemaElement element) {
- if (element == null) {
- return null;
- }
- ElementInfo elementInfo = new ElementInfo(element.getQName(), getTypeInfo(element.getSchemaType()));
- elementInfo.setMany(element.getMaxOccurs() > 1);
- elementInfo.setNillable(element.isNillable());
- return elementInfo;
- }
-
- private static TypeInfo getTypeInfo(XmlSchemaType type) {
- if (type == null) {
- return null;
- }
- XmlSchemaType baseType = (XmlSchemaType)type.getBaseSchemaType();
- QName name = type.getQName();
- boolean simple = (type instanceof XmlSchemaSimpleType);
- if (baseType == null) {
- return new TypeInfo(name, simple, null);
- } else {
- return new TypeInfo(name, simple, getTypeInfo(baseType));
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory b/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory
deleted file mode 100644
index c11d22d7b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface-wsdl/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/interface/LICENSE b/tags/java/sca/2.0-M1/modules/interface/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/interface/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/interface/META-INF/MANIFEST.MF
deleted file mode 100644
index c639f23508..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,27 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.interfacedef.util;uses:="javax.
- xml.transform,org.apache.tuscany.sca.interfacedef.impl,org.apache.tus
- cany.sca.interfacedef,javax.xml.datatype,javax.xml.namespace";version
- ="2.0.0",org.apache.tuscany.sca.interfacedef.impl;uses:="org.apache.tus
- cany.sca.interfacedef.util,org.apache.tuscany.sca.policy,org.apache.t
- uscany.sca.interfacedef";version="2.0.0",org.apache.tuscany.sca.interfa
- cedef;uses:="org.apache.tuscany.sca.interfacedef.util,org.apache.tusc
- any.sca.policy";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Interface Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397086703
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Interface Model
-Import-Package: javax.xml.datatype,javax.xml.namespace,javax.xml.trans
- form,org.apache.tuscany.sca.interfacedef;version="2.0.0",org.apache.tus
- cany.sca.interfacedef.impl;version="2.0.0",org.apache.tuscany.sca.inter
- facedef.util;version="2.0.0",org.apache.tuscany.sca.policy;version="1.4
- ",org.apache.tuscany.sca.core;ve
- rsion="2.0.0";resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.interface
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/interface/NOTICE b/tags/java/sca/2.0-M1/modules/interface/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/interface/pom.xml b/tags/java/sca/2.0-M1/modules/interface/pom.xml
deleted file mode 100644
index 2b29f17f36..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/pom.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-interface</artifactId>
- <name>Apache Tuscany SCA Interface Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/ConversationSequence.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/ConversationSequence.java
deleted file mode 100644
index 247a432330..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/ConversationSequence.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef;
-
-/**
- * Enum of the Conversation Sequence values.
- *
- * @version $Rev$ $Date$
- */
-public enum ConversationSequence {
- CONVERSATION_NONE, CONVERSATION_START, CONVERSATION_CONTINUE, CONVERSATION_END
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/DataType.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/DataType.java
deleted file mode 100644
index 1f5620c0b9..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/DataType.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef;
-
-import java.lang.reflect.Type;
-
-/**
- * Representation of the type of data associated with an operation. Data is
- * represented in two forms: the physical form used by the runtime and a logical
- * form used by the assembly. The physical form is a Java Type because the
- * runtime is written in Java. This may be the same form used by the application
- * but it may not; for example, an application that is performing stream
- * processing may want a physical form such as an
- * {@link java.io.InputStream InputStream} to semantially operate on application
- * data such as a purchase order. The logical description is that used by the
- * assembly model and is an identifier into some well-known type space; examples
- * may be a Java type represented by its Class or an XML type represented by its
- * QName. Every data type may also contain metadata describing the expected
- * data; for example, it could specify a preferred data binding technology or
- * the size of a typical instance.
- *
- * @version $Rev$ $Date$
- */
-public interface DataType<L> extends Cloneable {
- /**
- * Set the java type for the data
- * @param cls
- */
- void setPhysical(Class<?> cls);
-
- /**
- * Returns the physical type used by the runtime.
- *
- * @return the physical type used by the runtime
- */
- Class<?> getPhysical();
-
- /**
- * Get the java generic type
- * @return The java generic type
- */
- Type getGenericType();
-
- /**
- * Set the java generic type
- * @param genericType
- */
- void setGenericType(Type genericType);
-
- /**
- * Returns the logical identifier used by the assembly. The type of this
- * value identifies the logical type system in use. Known values are:
- * <ul>
- * <li>a Class identifies a Java type by name and
- * ClassLoader; this includes Java Classes as they are specializations of
- * Type</li>
- * <li>a XMLType identifies an XML type by local name and
- * namespace</li>
- * </ul>
- *
- * @return the logical type name
- */
- L getLogical();
-
- /**
- * Get the databinding for the given data type
- * @return the databinding
- */
- String getDataBinding();
-
- /**
- * Set the databinding for the given data type
- * @param dataBinding the dataBinding to set
- */
- void setDataBinding(String dataBinding);
-
- /**
- * Clone a data type
- * @return The cloned data type
- * @throws CloneNotSupportedException
- */
- Object clone() throws CloneNotSupportedException;
-
- /**
- * Set the logical type of the data type
- * @param logical the logical to set
- */
- void setLogical(L logical);
-
- /**
- * Get the databinding-specific metadata
- * @param type The java type of the metadata
- * @return the databinding-specific metadata
- */
- <T> T getMetaData(Class<T> type);
- /**
- * Set the databinding-specific metadata
- * @param type The java type of the metadata
- * @param metaData the databinding-specific metadata, such as SDO's commonj.sdo.Type or
- * JAXB's javax.xml.bind.JAXBContext
- */
- <T> void setMetaData(Class<T> type, T metaData);
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java
deleted file mode 100644
index 70f6d5b403..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/FaultExceptionMapper.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef;
-
-/**
- * This interface represents the mapping between WSDL faults and Java exceptions
- *
- * @version $Rev$ $Date$
- */
-@SuppressWarnings("unchecked")
-public interface FaultExceptionMapper {
- /**
- * Introspect an exception class to find out the fault data type following the WSDL2Java
- * mapping rules. The result will be populated into the logical type of the exception data
- * type
- *
- * @param exceptionDataType The data type representing a java exception class
- * @param operation TODO
- * @param generatingFaultBean If JAXWS Section 3.7 Fault Bean will be generated
- * @return true if the introspection can recognize the exception data type
- */
- boolean introspectFaultDataType(DataType<DataType> exceptionDataType, Operation operation, boolean generatingFaultBean);
-
- /**
- * Create a java exception to wrap the fault data
- *
- * @param exceptionType The DataType for the exception
- * @param message message for the exception
- * @param faultInfo The fault data
- * @param cause of the exception
- * @param operation TODO
- * @return An instance of java exception to represent the fault
- */
- Throwable wrapFaultInfo(DataType<DataType> exceptionType, String message, Object faultInfo, Throwable cause, Operation operation);
-
- /**
- * Retrieve the fault info from a java exception
- *
- * @param exception The java exception that represents the fault data
- * @param faultBeanClass
- * @param operation TODO
- * @return The fault data
- */
- Object getFaultInfo(Throwable exception, Class<?> faultBeanClass, Operation operation);
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/IncompatibleInterfaceContractException.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/IncompatibleInterfaceContractException.java
deleted file mode 100644
index 179dc1755e..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/IncompatibleInterfaceContractException.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef;
-
-/**
- * Denotes incompatible service contracts for a wire
- *
- * @version $Rev$ $Date$
- */
-public class IncompatibleInterfaceContractException extends Exception {
- private static final long serialVersionUID = 5127478601823295587L;
- private final InterfaceContract source;
- private final InterfaceContract target;
- private final Operation sourceOperation;
- private final Operation targetOperation;
-
- public IncompatibleInterfaceContractException(String message, InterfaceContract source, InterfaceContract target) {
- super(message);
- this.source = source;
- this.target = target;
- this.sourceOperation = null;
- this.targetOperation = null;
- }
-
- public IncompatibleInterfaceContractException(String message,
- InterfaceContract source,
- InterfaceContract target,
- Operation sourceOperation,
- Operation targetOperation) {
- super(message);
- this.source = source;
- this.target = target;
- this.sourceOperation = sourceOperation;
- this.targetOperation = targetOperation;
- }
-
- public InterfaceContract getTarget() {
- return target;
- }
-
- public InterfaceContract getSource() {
- return source;
- }
-
- public Operation getSourceOperation() {
- return sourceOperation;
- }
-
- public Operation getTargetOperation() {
- return targetOperation;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java
deleted file mode 100644
index f9de645a6e..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * Represents a service interface. This interface will typically be extended to
- * support concrete interface type systems, such as Java interfaces, WSDL 1.1
- * portTypes and WSDL 2.0 interfaces.
- *
- * @version $Rev$ $Date$
- */
-public interface Interface extends Cloneable, PolicySetAttachPoint {
-
- /**
- * Returns true if the interface is a remotable interface..
- *
- * @return true if the interface is a remotable interface
- */
- boolean isRemotable();
-
- /**
- * Sets whether the interface is a remotable or local interface.
- *
- * @param remotable indicates whether the interface is remotable or local
- */
- void setRemotable(boolean remotable);
-
-
- // FIXME: [rfeng] We need to re-consider the conversational as an intent
- /**
- * Test if the interface is conversational
- * @return
- */
- boolean isConversational();
-
- /**
- * Set whether the interface is conversational
- * @param conversational
- */
- void setConversational(boolean conversational);
-
- /**
- * Returns the operations defined on this interface.
- *
- * @return the operations defined on this interface
- */
- List<Operation> getOperations();
-
- /**
- * Set the databinding for the interface
- * @param dataBinding
- * @deprecated Please use resetDataBinding
- */
- @Deprecated
- void setDefaultDataBinding(String dataBinding);
-
- /**
- * Reset the databinding for the interface
- * @param dataBinding
- */
- void resetDataBinding(String dataBinding);
-
- /**
- * Returns true if the Interface is dynamic.
- *
- * @return true if the Interface is dynamic.
- */
- boolean isDynamic();
-
- /**
- * Implementations must support cloning.
- */
- Object clone() throws CloneNotSupportedException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContract.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContract.java
deleted file mode 100644
index 568a6c595c..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContract.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef;
-
-
-/**
- * Interface contracts define one or more business functions. These business
- * functions are provided by services and are used by references.
- *
- * @version $Rev$ $Date$
- */
-public interface InterfaceContract extends Cloneable {
-
- /**
- * Returns the interface definition representing the interface for
- * invocations from the requestor to the provider.
- *
- * @return the interface definition representing the interface for
- * invocations from the requestor to the provider
- */
- Interface getInterface();
-
- /**
- * Sets the interface definition representing the interface for invocations
- * from the requestor to the provider.
- *
- * @param callInterface the interface definition representing the interface
- * for invocations from the requestor to the provider
- */
- void setInterface(Interface callInterface);
-
- /**
- * Returns the interface definition representing the interface for
- * invocations from the provider to the requestor.
- *
- * @return the interface definition representing the interface for
- * invocations from the provider to the requestor.
- */
- Interface getCallbackInterface();
-
- /**
- * Sets the interface definition representing the interface for invocations
- * from the provider to the requestor.
- *
- * @param callbackInterface the interface definition representing the
- * interface for invocations from the provider to the requestor.
- */
- void setCallbackInterface(Interface callbackInterface);
-
- // FIXME: We need a better way to do this
- /**
- * Convert an interface contract to a unidirectional interface contract
- *
- * @param isCallback true for a callback interface contract, false for
- * a forward interface contract
- * @return A unidirectional interface contract, cloned if necessary
- */
- InterfaceContract makeUnidirectional(boolean isCallback);
-
- /**
- * Implementations must support cloning.
- */
- Object clone() throws CloneNotSupportedException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java
deleted file mode 100644
index 5601b09660..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef;
-
-/**
- * The InterfaceContractMapper is responsible to match interfaces
- *
- * @version $Rev$ $Date$
- */
-public interface InterfaceContractMapper {
- /**
- * Check the compatibility of the source and the target interface contracts.
- * <p>
- * A wire may only connect a source to a target if the target implements an
- * interface that is compatible with the interface required by the source.
- * The source and the target are compatible if: <p/>
- * <ol>
- * <li>the source interface and the target interface MUST either both be
- * remotable or they are both local
- * <li>the methods on the target interface MUST be the same as or be a
- * superset of the methods in the interface specified on the source
- * <li>compatibility for the individual method is defined as compatibility
- * of the signature, that is method name, input types, and output types MUST
- * BE the same.
- * <li>the order of the input and output types also MUST BE the same.
- * <li>the set of Faults and Exceptions expected by the source MUST BE the
- * same or be a superset of those specified by the service.
- * <li>other specified attributes of the two interfaces MUST match,
- * including Scope and Callback interface
- * </ol>
- * <p/>
- * <p>
- * Please note this test is not symmetric: the success of isCompatible(A, B)
- * does NOT imply isCompatible(B, A)
- *
- * @param source The source interface contract
- * @param target The target interface contract
- * @return true if the source contract can be supported by the target
- * contract
- */
- boolean isCompatible(InterfaceContract source, InterfaceContract target);
-
- /**
- * @param source
- * @param target
- * @param ignoreCallback
- * @param silent
- * @return
- * @throws IncompatibleInterfaceContractException
- */
- boolean checkCompatibility(InterfaceContract source,
- InterfaceContract target,
- boolean ignoreCallback,
- boolean silent) throws IncompatibleInterfaceContractException;
-
- /**
- * Test if the source data type is compatible with the target data type. The
- * compatibility is defined as follows.
- * <ul>
- * <li>source's logical type is either the same or subtype of the target's
- * logical type
- * </ul>
- * For example, if the source type is a SDO Customer and the target type is
- * a JAXB Customer and both Customer are generated from the same XSD type.
- *
- * @param source The source data type
- * @param target The target data type
- * @return
- */
- boolean isCompatible(DataType source, DataType target, boolean remotable);
-
- /**
- * Check if source operation is compatible with the target operation
- *
- * @param source The source operation
- * @param target The target operation
- * @return true if the source operation is compatible with the target
- * operation
- */
- boolean isCompatible(Operation source, Operation target, boolean remotable);
-
- /**
- * @param source
- * @param target
- * @return
- */
- boolean isCompatible(Interface source, Interface target);
-
- /**
- * Map the source operation to a compatible operation in the target
- * interface
- *
- * @param target The target interface
- * @param source The source operation
- * @return A compatible operation
- */
- Operation map(Interface target, Operation source);
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidCallbackException.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidCallbackException.java
deleted file mode 100644
index f952a86478..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidCallbackException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef;
-
-
-/**
- * Denotes an illegal callback interface
- *
- * @version $Rev$ $Date$
- */
-
-public class InvalidCallbackException extends InvalidInterfaceException {
- private static final long serialVersionUID = 2727755895702116397L;
-
- public InvalidCallbackException(String message) {
- super(message);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidInterfaceException.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidInterfaceException.java
deleted file mode 100644
index 2a273c9a26..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidInterfaceException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef;
-
-/**
- * @version $Rev$ $Date$
- */
-public abstract class InvalidInterfaceException extends Exception {
-
- public InvalidInterfaceException() {
- super();
- }
-
- public InvalidInterfaceException(String message) {
- super(message);
- }
-
- public InvalidInterfaceException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public InvalidInterfaceException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidOperationException.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidOperationException.java
deleted file mode 100644
index b19805c5b1..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidOperationException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef;
-
-import java.lang.reflect.Method;
-
-/**
- * Denotes an invalid conversational interface definition
- *
- * @version $Rev$ $Date$
- */
-public class InvalidOperationException extends InvalidInterfaceException {
-
- private static final long serialVersionUID = -1797615361821517091L;
- private final Method operation;
-
- public InvalidOperationException(String message, Method operation) {
- super(message);
- this.operation = operation;
- }
-
- public Method getOperation() {
- return operation;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java
deleted file mode 100644
index 4676e35f80..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * Represents an operation on a service interface.
- *
- * @version $Rev$ $Date$
- */
-public interface Operation extends Cloneable, PolicySetAttachPoint {
- /**
- * Returns the name of the operation.
- *
- * @return the name of the operation
- */
- String getName();
-
- /**
- * Sets the name of the operation.
- *
- * @param name the name of the operation
- */
- void setName(String name);
-
- /**
- * Returns true if the model element is unresolved.
- *
- * @return true if the model element is unresolved.
- */
- boolean isUnresolved();
-
- /**
- * Sets whether the model element is unresolved.
- *
- * @param unresolved whether the model element is unresolved
- */
- void setUnresolved(boolean unresolved);
-
- /**
- * Get the data type that represents the input of this operation. The logic
- * type is a list of data types and each element represents a parameter
- *
- * @return the inputType
- */
- DataType<List<DataType>> getInputType();
-
- /**
- * @param inputType
- */
- void setInputType(DataType<List<DataType>> inputType);
-
- /**
- * Get the data type for the output
- *
- * @return the outputType
- */
- DataType getOutputType();
-
- /**
- * @param outputType
- */
- void setOutputType(DataType outputType);
-
- /**
- * Get a list of data types to represent the faults/exceptions
- *
- * @return the faultTypes
- */
- List<DataType> getFaultTypes();
-
- /**
- * @param faultTypes
- */
- void setFaultTypes(List<DataType> faultTypes);
-
- /**
- * Get the owning interface
- * @return
- */
- Interface getInterface();
-
- /**
- * Set the owning interface
- * @param interfaze
- */
- void setInterface(Interface interfaze);
-
- /**
- * Get the sequence of the conversation
- * @return
- */
- ConversationSequence getConversationSequence();
-
- /**
- * Set the sequence of conversation for the operation
- * @param sequence
- */
- void setConversationSequence(ConversationSequence sequence);
-
- /**
- * Indicate if the operation is non-blocking
- * @return
- */
- boolean isNonBlocking();
-
- /**
- * Set the operation to be non-blocking
- */
- void setNonBlocking(boolean nonBlocking);
-
- /**
- * @return the wrapperInfo
- */
- WrapperInfo getWrapper();
-
- /**
- * @param wrapperInfo the wrapperInfo to set
- */
- void setWrapper(WrapperInfo wrapperInfo);
-
- /**
- * @return the wrapperStyle
- */
- boolean isWrapperStyle();
-
- /**
- * @param wrapperStyle the wrapperStyle to set
- */
- void setWrapperStyle(boolean wrapperStyle);
-
- /**
- * @deprecated This should be the WrapperInfo.getDataBinding()
- * Get the databinding for the operation
- * @return
- */
- @Deprecated
- String getDataBinding();
-
- /**
- * @deprecated This should be the WrapperInfo.setDataBinding()
- * Set the databinding for the operation
- * @param dataBinding
- */
- @Deprecated
- void setDataBinding(String dataBinding);
-
- /**
- * Returns true if the operation is dynamic.
- *
- * @return true if the operation is dynamic otherwise false
- */
- boolean isDynamic();
-
- /**
- * Set if the operation is dynamic
- * @param b
- */
- void setDynamic(boolean b);
-
- /**
- * Get the synthesized fault beans for this operation
- *
- * @return the fault beans
- */
- Map<QName, List<DataType<XMLType>>> getFaultBeans();
-
- /**
- * Set the synthesized fault beans for this operation
- * @param faultBeans
- */
- void setFaultBeans(Map<QName, List<DataType<XMLType>>> faultBeans);
-
- /**
- * Implementations must support cloning.
- */
- Object clone() throws CloneNotSupportedException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/OverloadedOperationException.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/OverloadedOperationException.java
deleted file mode 100644
index 6773b29088..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/OverloadedOperationException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef;
-
-import java.lang.reflect.Method;
-
-/**
- * Exception thrown to indicate that a service contract specification contains
- * an overloaded method.
- *
- * @version $Rev$ $Date$
- */
-public class OverloadedOperationException extends InvalidInterfaceException {
- private static final long serialVersionUID = -4658711318608885638L;
- private final Method operation;
-
- public OverloadedOperationException(Method operation) {
- super(operation == null ?
- null : "Cannot overload operation " + operation.getName()
- + " on " + operation.getDeclaringClass().getName()
- + " as it is a @Remotable interface");
- this.operation = operation;
- }
-
- public Method getOperation() {
- return operation;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java
deleted file mode 100644
index c1c8400b71..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import java.lang.reflect.Type;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-
-/**
- * Representation of the type of data associated with an operation. Data is
- * represented in two forms: the physical form used by the runtime and a logical
- * form used by the assembly. The physical form is a Java Type because the
- * runtime is written in Java. This may be the same form used by the application
- * but it may not; for example, an application that is performing stream
- * processing may want a physical form such as an
- * {@link java.io.InputStream InputStream} to semantially operate on application
- * data such as a purchase order. The logical description is that used by the
- * assembly model and is an identifier into some well-known type space; examples
- * may be a Java type represented by its Class or an XML type represented by its
- * QName. Every data type may also contain metadata describing the expected
- * data; for example, it could specify a preferred data binding technology or
- * the size of a typical instance.
- *
- * @version $Rev$ $Date$
- */
-public class DataTypeImpl<L> implements DataType<L> {
- private String dataBinding;
- private Class<?> physical;
- private Type genericType;
- private L logical;
- private Map<Class<?>, Object> metaDataMap;
-
- /**
- * Construct a data type specifying the physical and logical types.
- *
- * @param physical the physical class used by the runtime
- * @param logical the logical type
- * @see #getLogical()
- */
- public DataTypeImpl(Class<?> physical, L logical) {
- this(null, physical, physical, logical);
- }
-
- /**
- * @param dataBinding
- * @param physical
- * @param logical
- */
- public DataTypeImpl(String dataBinding, Class<?> physical, L logical) {
- this(dataBinding, physical, physical, logical);
- }
-
- /**
- * @param dataBinding
- * @param physical
- * @param genericType
- * @param logical
- */
- public DataTypeImpl(String dataBinding, Class<?> physical, Type genericType, L logical) {
- super();
- this.dataBinding = dataBinding;
- this.physical = physical;
- this.genericType = genericType;
- this.logical = logical;
- }
-
- /**
- * Returns the physical type used by the runtime.
- *
- * @return the physical type used by the runtime
- */
- public Class<?> getPhysical() {
- return physical;
- }
-
- /**
- * @param physical the physical to set
- */
- public void setPhysical(Class<?> physical) {
- this.physical = physical;
- }
-
- /**
- * Get the java generic type
- * @return The java generic type
- */
- public Type getGenericType() {
- return genericType;
- }
-
- /**
- * Set the java generic type
- * @param genericType
- */
- public void setGenericType(Type genericType) {
- this.genericType = genericType;
- }
-
- /**
- * Returns the logical identifier used by the assembly. The type of this
- * value identifies the logical type system in use. Known values are:
- * <ul>
- * <li>a java.lang.reflect.Type identifies a Java type by name and
- * ClassLoader; this includes Java Classes as they are specializations of
- * Type</li>
- * <li>a javax.xml.namespace.QName identifies an XML type by local name and
- * namespace</li>
- * </ul>
- *
- * @return the logical type name
- */
- public L getLogical() {
- return logical;
- }
-
- /**
- * @param logical the logical to set
- */
- public void setLogical(L logical) {
- this.logical = logical;
- }
-
- public String getDataBinding() {
- return dataBinding;
- }
-
- /**
- * @param dataBinding the dataBinding to set
- */
- public void setDataBinding(String dataBinding) {
- this.dataBinding = dataBinding;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append(physical).append(" ").append(dataBinding).append(" ").append(logical);
- return sb.toString();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Object clone() throws CloneNotSupportedException {
- DataTypeImpl copy = (DataTypeImpl)super.clone();
- return copy;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((dataBinding == null) ? 0 : dataBinding.hashCode());
- result = prime * result + ((genericType == null) ? 0 : genericType.hashCode());
- result = prime * result + ((logical == null) ? 0 : logical.hashCode());
- result = prime * result + ((physical == null) ? 0 : physical.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 DataTypeImpl other = (DataTypeImpl)obj;
- if (dataBinding == null) {
- if (other.dataBinding != null)
- return false;
- } else if (!dataBinding.equals(other.dataBinding))
- return false;
- if (genericType == null) {
- if (other.genericType != null)
- return false;
- } else if (!genericType.equals(other.genericType))
- return false;
- if (logical == null) {
- if (other.logical != null)
- return false;
- } else if (!logical.equals(other.logical))
- return false;
- if (physical == null) {
- if (other.physical != null)
- return false;
- } else if (!physical.equals(other.physical))
- return false;
- return true;
- }
-
- public <T> T getMetaData(Class<T> type) {
- return metaDataMap == null ? null : type.cast(metaDataMap.get(type));
- }
-
- public <T> void setMetaData(Class<T> type, T metaData) {
- if (metaDataMap == null) {
- metaDataMap = new ConcurrentHashMap<Class<?>, Object>();
- }
- metaDataMap.put(type, metaData);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractImpl.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractImpl.java
deleted file mode 100644
index 15581b5e04..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractImpl.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.impl;
-
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-
-/**
- * Represents an interface contract. InterfaceContractImpl
- *
- * @version $Rev$ $Date$
- */
-public abstract class InterfaceContractImpl implements InterfaceContract {
- private Interface callInterface;
- private Interface callbackInterface;
-
- public Interface getCallbackInterface() {
- return callbackInterface;
- }
-
- public Interface getInterface() {
- return callInterface;
- }
-
- public void setCallbackInterface(Interface callbackInterface) {
- this.callbackInterface = callbackInterface;
- }
-
- public void setInterface(Interface callInterface) {
- this.callInterface = callInterface;
- }
-
- public InterfaceContract makeUnidirectional(boolean isCallback) {
- if (!isCallback && callbackInterface == null)
- return this; // already a unidirectional forward interface contract
-
- if (isCallback && callInterface == null)
- return this; // already a unidirectional callback interface contract
-
- // contract is bidirectional, so create a new unidirectional contract
- try {
- InterfaceContract newContract = clone();
- if (!isCallback) {
- newContract.setCallbackInterface(null); // create unidirectional forward interface contract
- } else {
- newContract.setInterface(null); // create unidirectional callback interface contract
- }
- return newContract;
- } catch (CloneNotSupportedException e) {
- // will not happen
- return null;
- }
- }
-
- @Override
- public InterfaceContractImpl clone() throws CloneNotSupportedException {
- InterfaceContractImpl copy = (InterfaceContractImpl)super.clone();
- if (this.callbackInterface != null) {
- copy.callbackInterface = (Interface)this.callbackInterface.clone();
- }
- if (this.callInterface != null) {
- copy.callInterface = (Interface)this.callInterface.clone();
- }
- return copy;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((callInterface == null) ? 0 : callInterface.hashCode());
- result = prime * result + ((callbackInterface == null) ? 0 : callbackInterface.hashCode());
- return result;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final InterfaceContractImpl other = (InterfaceContractImpl)obj;
- if (callInterface == null) {
- if (other.callInterface != null) {
- return false;
- }
- } else if (!callInterface.equals(other.callInterface)) {
- return false;
- }
- if (callbackInterface == null) {
- if (other.callbackInterface != null) {
- return false;
- }
- } else if (!callbackInterface.equals(other.callbackInterface)) {
- return false;
- }
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
deleted file mode 100644
index 9e7d6882f7..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.IncompatibleInterfaceContractException;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * @version $Rev$ $Date$
- */
-public class InterfaceContractMapperImpl implements InterfaceContractMapper {
-
- public boolean isCompatible(DataType source, DataType target, boolean remotable) {
- if (source == target) {
- return true;
- }
- if (!remotable) {
- if (source == null || target == null) {
- return false;
- }
- // For local case
- return target.getPhysical().isAssignableFrom(source.getPhysical());
- } else {
- // FIXME: How to test if two remotable data type is compatible?
- // return target.getLogical().equals(source.getLogical());
- return true;
- }
-
- }
-
- public boolean isCompatible(Operation source, Operation target, boolean remotable) {
- if (source == target) {
- return true;
- }
-
- if (source.isDynamic() || target.isDynamic()) {
- return true;
- }
-
- // Check name
- if (!source.getName().equals(target.getName())) {
- return false;
- }
-
- if (source.getInterface().isRemotable() != target.getInterface().isRemotable()) {
- return false;
- }
-
- // if (source.getInterface().isRemotable()) {
- // return true;
- // }
-
- // FIXME: We need to deal with wrapped<-->unwrapped conversion
-
- // Check output type
- DataType sourceOutputType = source.getOutputType();
- DataType targetOutputType = target.getOutputType();
-
- // Note the target output type is now the source for checking
- // compatibility
- if (!isCompatible(targetOutputType, sourceOutputType, remotable)) {
- return false;
- }
-
- boolean checkSourceWrapper = true;
- List<DataType> sourceInputType = source.getInputType().getLogical();
- if (source.isWrapperStyle() && source.getWrapper() != null) {
- sourceInputType = source.getWrapper().getUnwrappedInputType().getLogical();
- checkSourceWrapper = false;
- }
- boolean checkTargetWrapper = true;
- List<DataType> targetInputType = target.getInputType().getLogical();
- if (target.isWrapperStyle() && target.getWrapper() != null) {
- targetInputType = target.getWrapper().getUnwrappedInputType().getLogical();
- checkTargetWrapper = false;
- }
-
- if (checkSourceWrapper != checkTargetWrapper) {
- return true;
- }
- if (sourceInputType.size() != targetInputType.size()) {
- return false;
- }
-
- int size = sourceInputType.size();
- for (int i = 0; i < size; i++) {
- if (!isCompatible(sourceInputType.get(i), targetInputType.get(i), remotable)) {
- return false;
- }
- }
-
- // Check fault types
- for (DataType targetFaultType : target.getFaultTypes()) {
- // Source fault types must be the same or superset of target fault
- // types
- boolean found = true;
- for (DataType sourceFaultType : source.getFaultTypes()) {
- found = false;
- if (isCompatible(targetFaultType, sourceFaultType, remotable)) {
- // Target fault type can be covered by the source fault type
- found = true;
- break;
- }
- }
- if (!found) {
- return false;
- }
- }
-
- return true;
- }
-
- // FIXME: How to improve the performance for the lookup
- private Operation getOperation(List<Operation> operations, String name) {
- for (Operation op : operations) {
- if (op.getName().equals(name)) {
- return op;
- }
- }
- return null;
- }
-
- public boolean checkCompatibility(InterfaceContract source,
- InterfaceContract target,
- boolean ignoreCallback,
- boolean silent) throws IncompatibleInterfaceContractException {
- if (source == target) {
- // Shortcut for performance
- return true;
- }
-
- if (source.getInterface().isDynamic() || target.getInterface().isDynamic()) {
- return true;
- }
-
- if (source.getInterface().isRemotable() != target.getInterface().isRemotable()) {
- if (!silent) {
- throw new IncompatibleInterfaceContractException("Remotable settings do not match", source, target);
- } else {
- return false;
- }
- }
- if (source.getInterface().isConversational() != target.getInterface().isConversational()) {
- if (!silent) {
- throw new IncompatibleInterfaceContractException("Interaction scopes do not match", source, target);
- } else {
- return false;
- }
- }
-
- for (Operation operation : source.getInterface().getOperations()) {
- Operation targetOperation = map(target.getInterface(), operation);
- if (targetOperation == null) {
- if (!silent) {
- throw new IncompatibleInterfaceContractException("Operation not found on target", source, target);
- } else {
- return false;
- }
- }
- if (!source.getInterface().isRemotable()) {
- // FIXME: for remotable operation, only compare name for now
- if (!isCompatible(operation, targetOperation, false)) {
- if (!silent) {
- throw new IncompatibleInterfaceContractException("Target operations are not compatible",
- source, target);
- } else {
- return false;
- }
- }
- }
- }
-
- if (ignoreCallback) {
- return true;
- }
-
- if (source.getCallbackInterface() == null && target.getCallbackInterface() == null) {
- return true;
- }
- if (source.getCallbackInterface() == null || target.getCallbackInterface() == null) {
- if (!silent) {
- throw new IncompatibleInterfaceContractException("Callback interface doesn't match", source, target);
- } else {
- return false;
- }
- }
-
- for (Operation operation : source.getCallbackInterface().getOperations()) {
- Operation targetOperation =
- getOperation(target.getCallbackInterface().getOperations(), operation.getName());
- if (targetOperation == null) {
- if (!silent) {
- throw new IncompatibleInterfaceContractException("Callback operation not found on target", source,
- target, null, targetOperation);
- } else {
- return false;
- }
- }
- if (!source.getCallbackInterface().isRemotable()) {
- // FIXME: for remotable operation, only compare name for now
- if (!operation.equals(targetOperation)) {
- if (!silent) {
- throw new IncompatibleInterfaceContractException("Target callback operation is not compatible",
- source, target, operation, targetOperation);
- } else {
- return false;
- }
- }
- }
- }
- return true;
- }
-
- public boolean isCompatible(Interface source, Interface target) {
- if (source == target) {
- // Shortcut for performance
- return true;
- }
- if (source == null || target == null) {
- return false;
- }
-
- if (source.isDynamic() || target.isDynamic()) {
- return true;
- }
-
- if (source.isRemotable() != target.isRemotable()) {
- return false;
- }
- if (source.isConversational() != target.isConversational()) {
- return false;
- }
-
- for (Operation operation : source.getOperations()) {
- Operation targetOperation = getOperation(target.getOperations(), operation.getName());
- if (targetOperation == null) {
- return false;
- }
- if (!isCompatible(operation, targetOperation, source.isRemotable())) {
- return false;
- }
- }
- return true;
- }
-
- public boolean isCompatible(InterfaceContract source, InterfaceContract target) {
- try {
- return checkCompatibility(source, target, false, false);
- } catch (IncompatibleInterfaceContractException e) {
- return false;
- }
- }
-
- /**
- * @see org.apache.tuscany.sca.interfacedef.InterfaceContractMapper#map(org.apache.tuscany.sca.interfacedef.Interface,
- * org.apache.tuscany.sca.interfacedef.Operation)
- */
- public Operation map(Interface target, Operation source) {
- // TODO: How to handle the case that source operation is dynamic?
- if (target == null || target.isDynamic()) {
- return source;
- } else if (target.isRemotable()) {
- for (Operation op : target.getOperations()) {
- if (op.getName().equals(source.getName())) {
- return op;
- }
- }
- return null;
- } else {
- for (Operation op : target.getOperations()) {
- if (isCompatible(source, op, target.isRemotable())) {
- return op;
- }
- }
- return null;
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java
deleted file mode 100644
index e2a524c5e0..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Represents a service interface.
- *
- * @version $Rev$ $Date$
- */
-public class InterfaceImpl implements Interface {
-
- private boolean remotable;
- private boolean conversational;
- private OperationList operations = new OperationList();
- private boolean unresolved;
-
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
- private IntentAttachPointType type;
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private List<Intent> requiredIntents = new ArrayList<Intent>();
-
-
- public boolean isRemotable() {
- return remotable;
- }
-
- public void setRemotable(boolean local) {
- this.remotable = local;
- }
-
- public List<Operation> getOperations() {
- return operations;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean undefined) {
- this.unresolved = undefined;
- }
-
- /**
- * @return the conversational
- */
- public boolean isConversational() {
- return conversational;
- }
-
- /**
- * @param conversational the conversational to set
- */
- public void setConversational(boolean conversational) {
- this.conversational = conversational;
- }
-
- private class OperationList extends ArrayList<Operation> {
- private static final long serialVersionUID = -903469106307606099L;
-
- @Override
- public Operation set(int index, Operation element) {
- element.setInterface(InterfaceImpl.this);
- return super.set(index, element);
- }
-
- @Override
- public void add(int index, Operation element) {
- element.setInterface(InterfaceImpl.this);
- super.add(index, element);
- }
-
- @Override
- public boolean add(Operation o) {
- o.setInterface(InterfaceImpl.this);
- return super.add(o);
- }
-
- @Override
- public boolean addAll(Collection<? extends Operation> c) {
- for (Operation op : c) {
- op.setInterface(InterfaceImpl.this);
- }
- return super.addAll(c);
- }
-
- @Override
- public boolean addAll(int index, Collection<? extends Operation> c) {
- for (Operation op : c) {
- op.setInterface(InterfaceImpl.this);
- }
- return super.addAll(index, c);
- }
-
- }
-
- @Deprecated
- public void setDefaultDataBinding(String dataBinding) {
- for (Operation op : getOperations()) {
- if (op.getDataBinding() == null) {
- op.setDataBinding(dataBinding);
- DataType<List<DataType>> inputType = op.getInputType();
- if (inputType != null) {
- for (DataType d : inputType.getLogical()) {
- if (d.getDataBinding() == null) {
- d.setDataBinding(dataBinding);
- }
- }
- }
- DataType outputType = op.getOutputType();
- if (outputType != null && outputType.getDataBinding() == null) {
- outputType.setDataBinding(dataBinding);
- }
- List<DataType> faultTypes = op.getFaultTypes();
- if (faultTypes != null) {
- for (DataType d : faultTypes) {
- if (d.getDataBinding() == null) {
- d.setDataBinding(dataBinding);
- }
- DataType ft = (DataType) d.getLogical();
- if (ft.getDataBinding() == null) {
- ft.setDataBinding(dataBinding);
- }
-
- }
- }
- if (op.isWrapperStyle()) {
- WrapperInfo wrapper = op.getWrapper();
- if (wrapper != null) {
- DataType<List<DataType>> unwrappedInputType = wrapper.getUnwrappedInputType();
- if (unwrappedInputType != null) {
- for (DataType d : unwrappedInputType.getLogical()) {
- if (d.getDataBinding() == null) {
- d.setDataBinding(dataBinding);
- }
- }
- }
- DataType unwrappedOutputType = wrapper.getUnwrappedOutputType();
- if (unwrappedOutputType != null && unwrappedOutputType.getDataBinding() == null) {
- unwrappedOutputType.setDataBinding(dataBinding);
- }
- }
- }
- }
- }
- }
-
- private void setDataBinding(DataType dataType, String dataBinding) {
- if ("java:array".equals(dataType.getDataBinding())) {
- setDataBinding((DataType)dataType.getLogical(), dataBinding);
- } else {
- dataType.setDataBinding(dataBinding);
- }
- }
-
- public void resetDataBinding(String dataBinding) {
- for (Operation op : getOperations()) {
- op.setDataBinding(dataBinding);
- DataType<List<DataType>> inputType = op.getInputType();
- if (inputType != null) {
- for (DataType d : inputType.getLogical()) {
- setDataBinding(d, dataBinding);
- }
- }
- DataType outputType = op.getOutputType();
- if (outputType != null) {
- setDataBinding(outputType, dataBinding);
- }
- List<DataType> faultTypes = op.getFaultTypes();
- if (faultTypes != null) {
- for (DataType d : faultTypes) {
- setDataBinding(d, dataBinding);
- setDataBinding((DataType) d.getLogical(), dataBinding);
- }
- }
- if (op.isWrapperStyle()) {
- WrapperInfo wrapper = op.getWrapper();
- if (wrapper != null) {
- DataType<List<DataType>> unwrappedInputType = wrapper.getUnwrappedInputType();
- if (unwrappedInputType != null) {
- for (DataType d : unwrappedInputType.getLogical()) {
- setDataBinding(d, dataBinding);
- }
- }
- DataType unwrappedOutputType = wrapper.getUnwrappedOutputType();
- if (unwrappedOutputType != null) {
- setDataBinding(unwrappedOutputType, dataBinding);
- }
- }
- }
- }
- }
-
- public boolean isDynamic() {
- return false;
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- public IntentAttachPointType getType() {
- return type;
- }
-
- public void setType(IntentAttachPointType type) {
- this.type = type;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- InterfaceImpl copy = (InterfaceImpl)super.clone();
- copy.operations = new OperationList();
- for (Operation operation : this.operations) {
- Operation clonedOperation = (Operation)operation.clone();
- copy.operations.add(clonedOperation);
- }
- return copy;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (conversational ? 1231 : 1237);
- result = prime * result + ((operations == null) ? 0 : operations.hashCode());
- result = prime * result + (remotable ? 1231 : 1237);
- result = prime * result + (unresolved ? 1231 : 1237);
- return result;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final InterfaceImpl other = (InterfaceImpl)obj;
- if (conversational != other.conversational)
- return false;
- if (operations == null) {
- if (other.operations != null)
- return false;
- } else if (!operations.equals(other.operations))
- return false;
- if (remotable != other.remotable)
- return false;
- if (unresolved != other.unresolved)
- return false;
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java
deleted file mode 100644
index 00a5dc3065..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.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.interfacedef.ConversationSequence;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Represents an operation on a service interface.
- *
- * @version $Rev$ $Date$
- */
-public class OperationImpl implements Operation {
-
- private String name;
- private boolean unresolved;
- private DataType outputType;
- private DataType<List<DataType>> inputType;
- private List<DataType> faultTypes;
- private Interface interfaze;
- private ConversationSequence conversationSequence = ConversationSequence.CONVERSATION_NONE;
- private boolean nonBlocking;
- private boolean wrapperStyle;
- private WrapperInfo wrapper;
- private boolean dynamic;
- private Map<QName, List<DataType<XMLType>>> faultBeans;
-
- private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
- private List<PolicySet> policySets = new ArrayList<PolicySet>();
- private List<Intent> requiredIntents = new ArrayList<Intent>();
- private IntentAttachPointType type;
-
- /**
- * @param name
- */
- public OperationImpl() {
- inputType = new DataTypeImpl<List<DataType>>("idl:input", Object[].class, new ArrayList<DataType>());
- faultTypes = new ArrayList<DataType>();
- faultBeans = new HashMap<QName, List<DataType<XMLType>>>();
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean undefined) {
- this.unresolved = undefined;
- }
-
- /**
- * @return the faultTypes
- */
- public List<DataType> getFaultTypes() {
- return faultTypes;
- }
-
- /**
- * @param faultTypes the faultTypes to set
- */
- public void setFaultTypes(List<DataType> faultTypes) {
- this.faultTypes = faultTypes;
- }
-
- /**
- * @return the inputType
- */
- public DataType<List<DataType>> getInputType() {
- return inputType;
- }
-
- /**
- * @param inputType the inputType to set
- */
- public void setInputType(DataType<List<DataType>> inputType) {
- this.inputType = inputType;
- }
-
- /**
- * @return the outputType
- */
- public DataType getOutputType() {
- return outputType;
- }
-
- /**
- * @param outputType the outputType to set
- */
- public void setOutputType(DataType outputType) {
- this.outputType = outputType;
- }
-
- /**
- * @return the interface
- */
- public Interface getInterface() {
- return interfaze;
- }
-
- /**
- * @param interfaze the interface to set
- */
- public void setInterface(Interface interfaze) {
- this.interfaze = interfaze;
- }
-
- /**
- * @return the conversationSequence
- */
- public ConversationSequence getConversationSequence() {
- return conversationSequence;
- }
-
- /**
- * @param conversationSequence the conversationSequence to set
- */
- public void setConversationSequence(ConversationSequence conversationSequence) {
- this.conversationSequence = conversationSequence;
- }
-
- /**
- * @return the nonBlocking
- */
- public boolean isNonBlocking() {
- return nonBlocking;
- }
-
- /**
- * @param nonBlocking the nonBlocking to set
- */
- public void setNonBlocking(boolean nonBlocking) {
- this.nonBlocking = nonBlocking;
- }
-
- @Override
- public int hashCode() {
- final int PRIME = 31;
- int result = 1;
- result = PRIME * result + ((conversationSequence == null) ? 0 : conversationSequence.hashCode());
- // result = PRIME * result + ((faultTypes == null) ? 0 :
- // faultTypes.hashCode());
- result = PRIME * result + ((inputType == null) ? 0 : inputType.hashCode());
- result = PRIME * result + ((name == null) ? 0 : name.hashCode());
- result = PRIME * result + (nonBlocking ? 1231 : 1237);
- result = PRIME * result + ((outputType == null) ? 0 : outputType.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 OperationImpl other = (OperationImpl)obj;
- if (conversationSequence == null) {
- if (other.conversationSequence != null) {
- return false;
- }
- } else if (!conversationSequence.equals(other.conversationSequence)) {
- return false;
- }
- /*
- * if (faultTypes == null) { if (other.faultTypes != null) { return
- * false; } } else if (!faultTypes.equals(other.faultTypes)) { return
- * false; }
- */
-
- if (inputType == null) {
- if (other.inputType != null) {
- return false;
- }
- } else if (!inputType.equals(other.inputType)) {
- return false;
- }
- if (name == null) {
- if (other.name != null) {
- return false;
- }
- } else if (!name.equals(other.name)) {
- return false;
- }
- if (nonBlocking != other.nonBlocking) {
- return false;
- }
- if (outputType == null) {
- if (other.outputType != null) {
- return false;
- }
- } else if (!outputType.equals(other.outputType)) {
- return false;
- }
- return true;
- }
-
- /**
- * @return the wrapperInfo
- */
- public WrapperInfo getWrapper() {
- return wrapper;
- }
-
- /**
- * @param wrapperInfo the wrapperInfo to set
- */
- public void setWrapper(WrapperInfo wrapperInfo) {
- this.wrapper = wrapperInfo;
- }
-
- /**
- * @return the wrapperStyle
- */
- public boolean isWrapperStyle() {
- return wrapperStyle;
- }
-
- /**
- * @param wrapperStyle the wrapperStyle to set
- */
- public void setWrapperStyle(boolean wrapperStyle) {
- this.wrapperStyle = wrapperStyle;
- }
-
- public String getDataBinding() {
- return wrapper != null ? wrapper.getDataBinding() : null;
- }
-
- public void setDataBinding(String dataBinding) {
- if (wrapper != null) {
- wrapper.setDataBinding(dataBinding);
- }
- }
-
- public boolean isDynamic() {
- return dynamic;
- }
-
- public void setDynamic(boolean b) {
- this.dynamic = b;
- }
-
- public Map<QName, List<DataType<XMLType>>> getFaultBeans() {
- return faultBeans;
- }
-
- public void setFaultBeans(Map<QName, List<DataType<XMLType>>> faultBeans) {
- this.faultBeans = faultBeans;
- }
-
- @Override
- public OperationImpl clone() throws CloneNotSupportedException {
- OperationImpl copy = (OperationImpl) super.clone();
-
- final List<DataType> clonedFaultTypes = new ArrayList<DataType>(this.faultTypes.size());
- for (DataType t : this.faultTypes) {
- clonedFaultTypes.add((DataType) t.clone());
- }
- copy.faultTypes = clonedFaultTypes;
-
- List<DataType> clonedLogicalTypes = new ArrayList<DataType>();
- for (DataType t : inputType.getLogical()) {
- DataType type = (DataType) t.clone();
- clonedLogicalTypes.add(type);
- }
- DataType<List<DataType>> clonedInputType =
- new DataTypeImpl<List<DataType>>(inputType.getPhysical(), clonedLogicalTypes);
- clonedInputType.setDataBinding(inputType.getDataBinding());
- copy.inputType = clonedInputType;
-
- if (this.outputType != null) {
- copy.outputType = (DataType) this.outputType.clone();
- }
-
- return copy;
- }
-
- public List<PolicySet> getApplicablePolicySets() {
- return applicablePolicySets;
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
- public IntentAttachPointType getType() {
- return type;
- }
-
- public void setType(IntentAttachPointType type) {
- this.type = type;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/ElementInfo.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/ElementInfo.java
deleted file mode 100644
index 777fa567f1..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/ElementInfo.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.util;
-
-import javax.xml.namespace.QName;
-
-/**
- * An abstraction of XML schema elements.
- *
- * @version $Rev$ $Date$
- */
-public class ElementInfo {
- private final QName name;
- private final TypeInfo type;
- private boolean many = false;
- private boolean nillable = false;
-
- /**
- * @param name
- * @param type
- */
- public ElementInfo(QName name, TypeInfo type) {
- super();
- this.name = name;
- this.type = type;
- }
-
- /**
- * @return the name
- */
- public QName getQName() {
- return name;
- }
-
- /**
- * @return the type
- */
- public TypeInfo getType() {
- return type;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("Element: ").append(name).append(" ").append(type);
- return sb.toString();
- }
-
- public boolean isMany() {
- return many;
- }
-
- public void setMany(boolean many) {
- this.many = many;
- }
-
- public boolean isNillable() {
- return nillable;
- }
-
- public void setNillable(boolean nillable) {
- this.nillable = nillable;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((type == null) ? 0 : type.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 ElementInfo other = (ElementInfo)obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- /*
- if (type == null) {
- if (other.type != null)
- return false;
- } else if (!type.equals(other.type))
- return false;
- */
- return true;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/FaultException.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/FaultException.java
deleted file mode 100644
index 844b0af509..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/FaultException.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.util;
-
-import javax.xml.namespace.QName;
-
-/**
- * The generic java exception to wrap service faults
- *
- * @version $Rev$ $Date$
- */
-public class FaultException extends Exception {
- private static final long serialVersionUID = -8002583655240625792L;
- private transient Object faultInfo; // FIXME: How to serialize it?
- private QName faultName;
-
- /**
- * @param message
- * @param faultInfo
- */
- public FaultException(String message, Object faultInfo) {
- super(message);
- this.faultInfo = faultInfo;
- }
-
- /**
- * @param message
- * @param faultInfo
- * @param cause
- */
- public FaultException(String message, Object faultInfo, Throwable cause) {
- super(message, cause);
- this.faultInfo = faultInfo;
- }
-
- /**
- * @return the faultInfo
- */
- public Object getFaultInfo() {
- return faultInfo;
- }
-
- public QName getFaultName() {
- return faultName;
- }
-
- public void setFaultName(QName logical) {
- this.faultName = logical;
- }
-
- public boolean isMatchingType(Object type) {
- if (faultName == null) {
- return false;
- }
-
- if ((type instanceof QName) && faultName.equals(type)) {
- return true;
- }
- if (type instanceof XMLType && faultName.equals(((XMLType)type).getElementName())) {
- return true;
- }
- return false;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/JavaXMLMapper.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/JavaXMLMapper.java
deleted file mode 100644
index 54c0a3ec11..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/JavaXMLMapper.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.util;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-/**
- * Utility class that can be used to map XSD types to Java classes and Java classes to XSD types.
- *
- * @version $Rev$ $Date$
- */
-public final class JavaXMLMapper {
- public static final String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
- private static final Map<Class, QName> JAVA2XML = new HashMap<Class, QName>();
- private static final Map<String, Class> XML2JAVA = new HashMap<String, Class>();
-
- private JavaXMLMapper() {
- }
-
- static {
- JAVA2XML.put(boolean.class, getTypeName("boolean"));
- JAVA2XML.put(byte.class, getTypeName("byte"));
- JAVA2XML.put(short.class, getTypeName("short"));
- JAVA2XML.put(int.class, getTypeName("int"));
- JAVA2XML.put(long.class, getTypeName("long"));
- JAVA2XML.put(float.class, getTypeName("float"));
- JAVA2XML.put(double.class, getTypeName("double"));
- JAVA2XML.put(Boolean.class, getTypeName("boolean"));
- JAVA2XML.put(Byte.class, getTypeName("byte"));
- JAVA2XML.put(Short.class, getTypeName("short"));
- JAVA2XML.put(Integer.class, getTypeName("int"));
- JAVA2XML.put(Long.class, getTypeName("long"));
- JAVA2XML.put(Float.class, getTypeName("float"));
- JAVA2XML.put(Double.class, getTypeName("double"));
- JAVA2XML.put(java.lang.String.class, getTypeName("string"));
- JAVA2XML.put(java.math.BigInteger.class, getTypeName("integer"));
- JAVA2XML.put(java.math.BigDecimal.class, getTypeName("decimal"));
- JAVA2XML.put(java.util.Calendar.class, getTypeName("dateTime"));
- JAVA2XML.put(java.util.Date.class, getTypeName("dateTime"));
- JAVA2XML.put(javax.xml.namespace.QName.class, getTypeName("QName"));
- JAVA2XML.put(java.net.URI.class, getTypeName("string"));
- JAVA2XML.put(javax.xml.datatype.XMLGregorianCalendar.class, getTypeName("anySimpleType"));
- JAVA2XML.put(javax.xml.datatype.Duration.class, getTypeName("duration"));
- JAVA2XML.put(java.lang.Object.class, getTypeName("anyType"));
- JAVA2XML.put(java.awt.Image.class, getTypeName("base64Binary"));
- JAVA2XML.put(byte[].class, getTypeName("base64Binary"));
- // java2XSD.put(javax.activation.DataHandler.class, getTypeName("base64Binary"));
- JAVA2XML.put(javax.xml.transform.Source.class, getTypeName("base64Binary"));
- JAVA2XML.put(java.util.UUID.class, getTypeName("string"));
- }
-
- static {
- XML2JAVA.put("string", java.lang.String.class);
- XML2JAVA.put("integer", java.math.BigInteger.class);
- XML2JAVA.put("int", int.class);
- XML2JAVA.put("long", long.class);
- XML2JAVA.put("short", short.class);
- XML2JAVA.put("decimal", java.math.BigDecimal.class);
- XML2JAVA.put("float", float.class);
- XML2JAVA.put("double", double.class);
- XML2JAVA.put("boolean", boolean.class);
- XML2JAVA.put("byte", byte.class);
- XML2JAVA.put("QName", javax.xml.namespace.QName.class);
- XML2JAVA.put("dateTime", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("base64Binary", byte[].class);
- XML2JAVA.put("hexBinary", byte[].class);
- XML2JAVA.put("unsignedInt", long.class);
- XML2JAVA.put("unsignedShort", int.class);
- XML2JAVA.put("unsignedByte", short.class);
- XML2JAVA.put("time", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("date", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("gDay", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("gMonth", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("gYear", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("gYearMonth", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("gMonthDay", javax.xml.datatype.XMLGregorianCalendar.class);
- XML2JAVA.put("anySimpleType", java.lang.Object.class); // For elements
- // XML2JAVA.put("anySimpleType", java.lang.String.class); // For
- // attributes
- XML2JAVA.put("duration", javax.xml.datatype.Duration.class);
- XML2JAVA.put("NOTATION", javax.xml.namespace.QName.class);
- }
-
- public static Class getJavaType(QName xmlType) {
- if (URI_2001_SCHEMA_XSD.equals(xmlType.getNamespaceURI())) {
- return XML2JAVA.get(xmlType.getLocalPart());
- } else {
- return null;
- }
- }
-
- private static QName getTypeName(String name) {
- return new QName(URI_2001_SCHEMA_XSD, name);
- }
-
- public static QName getXMLType(Class javaType) {
- return JAVA2XML.get(javaType);
- }
-
- private static String getPackageName(Class<?> cls) {
- String name = cls.getName();
- int index = name.lastIndexOf('.');
- return index == -1 ? "" : name.substring(0, index);
- }
-
- public static String getNamespace(Class<?> cls) {
- String packageName = getPackageName(cls);
- if ("".equals(packageName)) {
- return "";
- }
- StringBuffer ns = new StringBuffer("http://");
- String[] names = packageName.split("\\.");
- for (int i = names.length - 1; i >= 0; i--) {
- ns.append(names[i]);
- if (i != 0) {
- ns.append('.');
- }
- }
- ns.append('/');
- return ns.toString();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/TypeInfo.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/TypeInfo.java
deleted file mode 100644
index 2598dc8545..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/TypeInfo.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.util;
-
-import javax.xml.namespace.QName;
-
-/**
- * An abstraction of XML schema types
- *
- * @version $Rev$ $Date$
- */
-public class TypeInfo {
- private QName name;
-
- private boolean isSimpleType;
-
- private TypeInfo baseType;
-
- /**
- * @param name
- * @param isSimpleType
- */
- public TypeInfo(QName name, boolean isSimpleType, TypeInfo baseType) {
- super();
- this.name = name;
- this.isSimpleType = isSimpleType;
- this.baseType = baseType;
- }
-
- /**
- * @return the isSimpleType
- */
- public boolean isSimpleType() {
- return isSimpleType;
- }
-
- /**
- * @return the name
- */
- public QName getQName() {
- return name;
- }
-
- /**
- * @return the baseType
- */
- public TypeInfo getBaseType() {
- return baseType;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("Type: ").append(name);
- return sb.toString();
- }
-
- @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 TypeInfo other = (TypeInfo)obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java
deleted file mode 100644
index 12db460959..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-
-/**
- * The "Wrapper Style" WSDL operation is defined by The Java API for XML-Based
- * Web Services (JAX-WS) 2.0 specification, section 2.3.1.2 Wrapper Style. <p/>
- * A WSDL operation qualifies for wrapper style mapping only if the following
- * criteria are met:
- * <ul>
- * <li>(i) The operation�s input and output messages (if present) each contain
- * only a single part
- * <li>(ii) The input message part refers to a global element declaration whose
- * localname is equal to the operation name
- * <li>(iii) The output message part refers to a global element declaration
- * <li>(iv) The elements referred to by the input and output message parts
- * (henceforth referred to as wrapper elements) are both complex types defined
- * using the xsd:sequence compositor
- * <li>(v) The wrapper elements only contain child elements, they must not
- * contain other structures such as wildcards (element or attribute),
- * xsd:choice, substitution groups (element references are not permitted) or
- * attributes; furthermore, they must not be nillable.
- * </ul>
- *
- * @version $Rev$ $Date$
- */
-public class WrapperInfo {
- private ElementInfo inputWrapperElement;
-
- private ElementInfo outputWrapperElement;
-
- private List<ElementInfo> inputChildElements;
-
- private List<ElementInfo> outputChildElements;
-
- // The data type of the unwrapped input child elements
- private DataType<List<DataType>> unwrappedInputType;
-
- // The data type of the unwrapped output child element (we only supports one child)
- private DataType<XMLType> unwrappedOutputType;
-
- // The data for the input/output wrappers
- private String dataBinding;
-
- // The data type for the input (request) wrapper bean
- private DataType<XMLType> inputWrapperType;
- // The data type for the output (response) wrapper bean
- private DataType<XMLType> outputWrapperType;
-
- public WrapperInfo(String dataBinding,
- ElementInfo inputWrapperElement,
- ElementInfo outputWrapperElement,
- List<ElementInfo> inputElements,
- List<ElementInfo> outputElements) {
- super();
- this.dataBinding = dataBinding;
- this.inputWrapperElement = inputWrapperElement;
- this.outputWrapperElement = outputWrapperElement;
- this.inputChildElements = inputElements;
- this.outputChildElements = outputElements;
- }
-
- /**
- * @return the inputElements
- */
- public List<ElementInfo> getInputChildElements() {
- return inputChildElements;
- }
-
- /**
- * @return the inputWrapperElement
- */
- public ElementInfo getInputWrapperElement() {
- return inputWrapperElement;
- }
-
- /**
- * @return the outputElements
- */
- public List<ElementInfo> getOutputChildElements() {
- return outputChildElements;
- }
-
- /**
- * @return the outputWrapperElement
- */
- public ElementInfo getOutputWrapperElement() {
- return outputWrapperElement;
- }
-
- /**
- * @return the unwrappedInputType
- */
- public DataType<List<DataType>> getUnwrappedInputType() {
- if (unwrappedInputType == null) {
- List<DataType> childTypes = new ArrayList<DataType>();
- for (ElementInfo element : getInputChildElements()) {
- DataType type = getDataType(element);
- childTypes.add(type);
- }
- unwrappedInputType = new DataTypeImpl<List<DataType>>("idl:unwrapped.input", Object[].class, childTypes);
- }
- return unwrappedInputType;
- }
-
- private DataType getDataType(ElementInfo element) {
- DataType type = null;
- if (element.isMany()) {
- DataType logical = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
- type = new DataTypeImpl<DataType>("java:array", Object[].class, logical);
- } else {
- type = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
- }
- return type;
- }
-
- /**
- * @return the unwrappedOutputType
- */
- public DataType getUnwrappedOutputType() {
- if (unwrappedOutputType == null) {
- List<ElementInfo> elements = getOutputChildElements();
- if (elements != null && elements.size() > 0) {
- if (elements.size() > 1) {
- // We don't support output with multiple parts
- // throw new IllegalArgumentException("Multi-part output is not supported");
- }
- ElementInfo element = elements.get(0);
-
- unwrappedOutputType = getDataType(element);
- }
- }
- return unwrappedOutputType;
- }
-
- public Class<?> getInputWrapperClass() {
- return inputWrapperType == null ? null : inputWrapperType.getPhysical();
- }
-
- public Class<?> getOutputWrapperClass() {
- return outputWrapperType == null ? null : outputWrapperType.getPhysical();
- }
-
- public String getDataBinding() {
- return dataBinding;
- }
-
- public void setDataBinding(String dataBinding) {
- this.dataBinding = dataBinding;
- }
-
- public DataType<XMLType> getInputWrapperType() {
- return inputWrapperType;
- }
-
- public void setInputWrapperType(DataType<XMLType> inputWrapperType) {
- this.inputWrapperType = inputWrapperType;
- }
-
- public DataType<XMLType> getOutputWrapperType() {
- return outputWrapperType;
- }
-
- public void setOutputWrapperType(DataType<XMLType> outputWrapperType) {
- this.outputWrapperType = outputWrapperType;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/XMLType.java b/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/XMLType.java
deleted file mode 100644
index 26ecf6e352..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/XMLType.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.util;
-
-import javax.xml.namespace.QName;
-
-/**
- * The metadata for an XML element or type.
- *
- * @version $Rev$ $Date$
- */
-public class XMLType {
- public static final XMLType UNKNOWN = new XMLType(null, null);
- protected QName element;
- protected QName type;
- protected boolean nillable = true;
- protected boolean many = false;
-
- /**
- * @param element
- */
- public XMLType(ElementInfo element) {
- super();
- this.element = element.getQName();
- if (element.getType() != null) {
- this.type = element.getType().getQName();
- }
- }
-
- /**
- * @param element
- */
- public XMLType(TypeInfo type) {
- this.element = null;
- this.type = type.getQName();
- }
-
- public XMLType(QName element, QName type) {
- this.element = element;
- this.type = type;
- }
-
- /**
- * @return the type
- */
- public QName getTypeName() {
- return type;
- }
-
- public boolean isElement() {
- return element != null;
- }
-
- public QName getElementName() {
- return element;
- }
-
- public void setElementName(QName element) {
- this.element = element;
- }
-
- public void setTypeName(QName type) {
- this.type = type;
- }
-
- public static XMLType getType(QName type) {
- return new XMLType(null, type);
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int PRIME = 31;
- int result = 1;
- result = PRIME * result + ((element == null) ? 0 : element.hashCode());
- result = PRIME * result + ((type == null) ? 0 : type.hashCode());
- return result;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final XMLType other = (XMLType)obj;
- if (element == null) {
- if (other.element != null) {
- return false;
- }
- } else if (!element.equals(other.element)) {
- return false;
- }
- if (type == null) {
- if (other.type != null) {
- return false;
- }
- } else if (!type.equals(other.type)) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- return "Element: " + element + " Type: " + type;
- }
-
- public boolean isNillable() {
- return nillable;
- }
-
- public void setNillable(boolean niable) {
- this.nillable = niable;
- }
-
- public boolean isMany() {
- return many;
- }
-
- public void setMany(boolean many) {
- this.many = many;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.InterfaceContractMapper b/tags/java/sca/2.0-M1/modules/interface/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.InterfaceContractMapper
deleted file mode 100644
index 821c58bde1..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.InterfaceContractMapper
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/test/java/org/apache/tuscany/sca/interfacedef/impl/ContractCompatibilityTestCase.java b/tags/java/sca/2.0-M1/modules/interface/src/test/java/org/apache/tuscany/sca/interfacedef/impl/ContractCompatibilityTestCase.java
deleted file mode 100644
index acdaae799e..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/test/java/org/apache/tuscany/sca/interfacedef/impl/ContractCompatibilityTestCase.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.impl;
-
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.IncompatibleInterfaceContractException;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * TODO some tests commented out due to DataType.equals() needing to be strict
- *
- * @version $Rev$ $Date$
- */
-public class ContractCompatibilityTestCase {
-
- private InterfaceContractMapper mapper;
-
- @Before
- public void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- mapper = utilities.getUtility(InterfaceContractMapper.class);
- }
-
- @Test
- public void testNoOperation() throws Exception {
- InterfaceContract source = new MockContract("FooContract");
- InterfaceContract target = new MockContract("FooContract");
- mapper.checkCompatibility(source, target, false, false);
- }
-
- @Test
- public void testBasic() throws Exception {
- InterfaceContract source = new MockContract("FooContract");
- Operation opSource1 = newOperation("op1");
- Map<String, Operation> sourceOperations = new HashMap<String, Operation>();
- sourceOperations.put("op1", opSource1);
- source.getInterface().getOperations().addAll(sourceOperations.values());
- InterfaceContract target = new MockContract("FooContract");
- Operation opSource2 = newOperation("op1");
- Map<String, Operation> targetOperations = new HashMap<String, Operation>();
- targetOperations.put("op1", opSource2);
- target.getInterface().getOperations().addAll(targetOperations.values());
- mapper.checkCompatibility(source, target, false, false);
- }
-
- @Test
- public void testBasicIncompatibleOperationNames() throws Exception {
- InterfaceContract source = new MockContract("FooContract");
- Operation opSource1 = newOperation("op1");
- Map<String, Operation> sourceOperations = new HashMap<String, Operation>();
- sourceOperations.put("op1", opSource1);
- source.getInterface().getOperations().addAll(sourceOperations.values());
- InterfaceContract target = new MockContract("FooContract");
- Operation opSource2 = newOperation("op2");
- Map<String, Operation> targetOperations = new HashMap<String, Operation>();
- targetOperations.put("op2", opSource2);
- target.getInterface().getOperations().addAll(targetOperations.values());
- try {
- mapper.checkCompatibility(source, target, false, false);
- fail();
- } catch (IncompatibleInterfaceContractException e) {
- // expected
- }
- }
-
- @Test
- public void testInputTypes() throws Exception {
- InterfaceContract source = new MockContract("FooContract");
- List<DataType> sourceInputTypes = new ArrayList<DataType>();
- sourceInputTypes.add(new DataTypeImpl<Type>(Object.class, Object.class));
- DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(String.class, sourceInputTypes);
- Operation opSource1 = newOperation("op1");
- opSource1.setInputType(inputType);
- Map<String, Operation> sourceOperations = new HashMap<String, Operation>();
- sourceOperations.put("op1", opSource1);
- source.getInterface().getOperations().addAll(sourceOperations.values());
-
- InterfaceContract target = new MockContract("FooContract");
- List<DataType> targetInputTypes = new ArrayList<DataType>();
- targetInputTypes.add(new DataTypeImpl<Type>(Object.class, Object.class));
- DataType<List<DataType>> targetInputType = new DataTypeImpl<List<DataType>>(String.class, targetInputTypes);
-
- Operation opTarget = newOperation("op1");
- opTarget.setInputType(targetInputType);
- Map<String, Operation> targetOperations = new HashMap<String, Operation>();
- targetOperations.put("op1", opTarget);
- target.getInterface().getOperations().addAll(targetOperations.values());
- mapper.checkCompatibility(source, target, false, false);
- }
-
- @Test
- public void testIncompatibleInputTypes() throws Exception {
- InterfaceContract source = new MockContract("FooContract");
- List<DataType> sourceInputTypes = new ArrayList<DataType>();
- sourceInputTypes.add(new DataTypeImpl<Type>(Integer.class, Integer.class));
- DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(String.class, sourceInputTypes);
- Operation opSource1 = newOperation("op1");
- opSource1.setInputType(inputType);
- Map<String, Operation> sourceOperations = new HashMap<String, Operation>();
- sourceOperations.put("op1", opSource1);
- source.getInterface().getOperations().addAll(sourceOperations.values());
-
- InterfaceContract target = new MockContract("FooContract");
- List<DataType> targetInputTypes = new ArrayList<DataType>();
- targetInputTypes.add(new DataTypeImpl<Type>(String.class, String.class));
- DataType<List<DataType>> targetInputType = new DataTypeImpl<List<DataType>>(String.class, targetInputTypes);
-
- Operation opTarget = newOperation("op1");
- opTarget.setInputType(targetInputType);
- Map<String, Operation> targetOperations = new HashMap<String, Operation>();
- targetOperations.put("op1", opTarget);
- target.getInterface().getOperations().addAll(targetOperations.values());
- try {
- mapper.checkCompatibility(source, target, false, false);
- fail();
- } catch (IncompatibleInterfaceContractException e) {
- // expected
- }
- }
-
- /**
- * Verifies source input types can be super types of the target
- */
- @Test
- public void testSourceSuperTypeInputCompatibility() throws Exception {
- // InterfaceContract source = new MockContract("FooContract");
- // List<DataType> sourceInputTypes = new ArrayList<DataType>();
- // sourceInputTypes.add(new DataTypeImpl<Type>(Object.class,
- // Object.class));
- // DataType<List<DataType>> inputType = new
- // DataTypeImpl<List<DataType>>(String.class, sourceInputTypes);
- // Operation opSource1 = newOperationImpl("op1", inputType, null, null,
- // false, null);
- // Map<String, Operation> sourceOperations = new HashMap<String,
- // Operation>();
- // sourceOperations.put("op1", opSource1);
- // source.getInterface().getOperations().addAll(sourceOperations.values());
- //
- // InterfaceContract target = new MockContract("FooContract");
- // List<DataType> targetInputTypes = new ArrayList<DataType>();
- // targetInputTypes.add(new DataTypeImpl<Type>(String.class,
- // String.class));
- // DataType<List<DataType>> targetInputType =
- // new DataTypeImpl<List<DataType>>(String.class, targetInputTypes);
- //
- // Operation opTarget = newOperationImpl("op1", targetInputType, null,
- // null, false, null);
- // Map<String, Operation> targetOperations = new HashMap<String,
- // Operation>();
- // targetOperations.put("op1", opTarget);
- // target.getInterface().getOperations().addAll(targetOperations.values());
- // wireService.checkCompatibility(source, target, false);
- }
-
- @Test
- public void testOutputTypes() throws Exception {
- InterfaceContract source = new MockContract("FooContract");
- DataType sourceOutputType = new DataTypeImpl<Type>(String.class, String.class);
- Operation opSource1 = newOperation("op1");
- opSource1.setOutputType(sourceOutputType);
- Map<String, Operation> sourceOperations = new HashMap<String, Operation>();
- sourceOperations.put("op1", opSource1);
- source.getInterface().getOperations().addAll(sourceOperations.values());
-
- InterfaceContract target = new MockContract("FooContract");
- DataType targetOutputType = new DataTypeImpl<Type>(String.class, String.class);
- Operation opTarget = newOperation("op1");
- opTarget.setOutputType(targetOutputType);
- Map<String, Operation> targetOperations = new HashMap<String, Operation>();
- targetOperations.put("op1", opTarget);
- target.getInterface().getOperations().addAll(targetOperations.values());
- mapper.checkCompatibility(source, target, false, false);
- }
-
- /**
- * Verifies a return type that is a supertype of of the target is compatible
- */
- @Test
- public void testSupertypeOutputTypes() throws Exception {
- // InterfaceContract source = new MockContract("FooContract");
- // DataType sourceOutputType = new DataTypeImpl<Type>(Object.class,
- // Object.class);
- // Operation opSource1 = newOperationImpl("op1", null,
- // sourceOutputType, null, false, null);
- // Map<String, Operation> sourceOperations = new HashMap<String,
- // Operation>();
- // sourceOperations.put("op1", opSource1);
- // source.getInterface().getOperations().addAll(sourceOperations.values());
- //
- // InterfaceContract target = new MockContract("FooContract");
- // DataType targetOutputType = new DataTypeImpl<Type>(String.class,
- // String.class);
- // Operation opTarget = newOperationImpl("op1", null, targetOutputType,
- // null, false, null);
- // Map<String, Operation> targetOperations = new HashMap<String,
- // Operation>();
- // targetOperations.put("op1", opTarget);
- // target.getInterface().getOperations().addAll(targetOperations.values());
- // wireService.checkCompatibility(source, target, false);
- }
-
- @Test
- public void testIncompatibleOutputTypes() throws Exception {
- InterfaceContract source = new MockContract("FooContract");
- DataType sourceOutputType = new DataTypeImpl<Type>(String.class, String.class);
- Operation opSource1 = newOperation("op1");
- opSource1.setOutputType(sourceOutputType);
- Map<String, Operation> sourceOperations = new HashMap<String, Operation>();
- sourceOperations.put("op1", opSource1);
- source.getInterface().getOperations().addAll(sourceOperations.values());
-
- InterfaceContract target = new MockContract("FooContract");
- DataType targetOutputType = new DataTypeImpl<Type>(Integer.class, Integer.class);
- Operation opTarget = newOperation("op1");
- opTarget.setOutputType(targetOutputType);
- Map<String, Operation> targetOperations = new HashMap<String, Operation>();
- targetOperations.put("op1", opTarget);
- target.getInterface().getOperations().addAll(targetOperations.values());
- try {
- mapper.checkCompatibility(source, target, false, false);
- fail();
- } catch (IncompatibleInterfaceContractException e) {
- // expected
- }
- }
-
- @Test
- public void testFaultTypes() throws Exception {
- InterfaceContract source = new MockContract("FooContract");
- DataType sourceFaultType = new DataTypeImpl<Type>(String.class, String.class);
- List<DataType> sourceFaultTypes = new ArrayList<DataType>();
- sourceFaultTypes.add(0, sourceFaultType);
- Operation opSource1 = newOperation("op1");
- opSource1.setFaultTypes(sourceFaultTypes);
- Map<String, Operation> sourceOperations = new HashMap<String, Operation>();
- sourceOperations.put("op1", opSource1);
- source.getInterface().getOperations().addAll(sourceOperations.values());
-
- InterfaceContract target = new MockContract("FooContract");
- DataType targetFaultType = new DataTypeImpl<Type>(String.class, String.class);
- List<DataType> targetFaultTypes = new ArrayList<DataType>();
- targetFaultTypes.add(0, targetFaultType);
-
- Operation opTarget = newOperation("op1");
- opTarget.setFaultTypes(targetFaultTypes);
- Map<String, Operation> targetOperations = new HashMap<String, Operation>();
- targetOperations.put("op1", opTarget);
- target.getInterface().getOperations().addAll(targetOperations.values());
- mapper.checkCompatibility(source, target, false, false);
- }
-
- @Test
- public void testSourceFaultTargetNoFaultCompatibility() throws Exception {
- InterfaceContract source = new MockContract("FooContract");
- DataType sourceFaultType = new DataTypeImpl<Type>(String.class, String.class);
- List<DataType> sourceFaultTypes = new ArrayList<DataType>();
- sourceFaultTypes.add(0, sourceFaultType);
- Operation opSource1 = newOperation("op1");
- opSource1.setFaultTypes(sourceFaultTypes);
- Map<String, Operation> sourceOperations = new HashMap<String, Operation>();
- sourceOperations.put("op1", opSource1);
- source.getInterface().getOperations().addAll(sourceOperations.values());
-
- InterfaceContract target = new MockContract("FooContract");
- Operation opTarget = newOperation("op1");
- Map<String, Operation> targetOperations = new HashMap<String, Operation>();
- targetOperations.put("op1", opTarget);
- target.getInterface().getOperations().addAll(targetOperations.values());
- mapper.checkCompatibility(source, target, false, false);
- }
-
- /**
- * Verifies a source's fault which is a supertype of the target's fault are
- * compatible
- *
- * @throws Exception
- */
- @Test
- public void testFaultSuperTypes() throws Exception {
- // InterfaceContract source = new MockContract("FooContract");
- // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,
- // Exception.class);
- // List<DataType> sourceFaultTypes = new ArrayList<DataType>();
- // sourceFaultTypes.add(0, sourceFaultType);
- // Operation opSource1 = newOperationImpl("op1", null, null,
- // sourceFaultTypes, false, null);
- // Map<String, Operation> sourceOperations = new HashMap<String,
- // Operation>();
- // sourceOperations.put("op1", opSource1);
- // source.getInterface().getOperations().addAll(sourceOperations.values());
- //
- // InterfaceContract target = new MockContract("FooContract");
- // DataType targetFaultType = new
- // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);
- // List<DataType> targetFaultTypes = new ArrayList<DataType>();
- // targetFaultTypes.add(0, targetFaultType);
- //
- // Operation opTarget = newOperationImpl("op1", null, null,
- // targetFaultTypes, false, null);
- // Map<String, Operation> targetOperations = new HashMap<String,
- // Operation>();
- // targetOperations.put("op1", opTarget);
- // target.getInterface().getOperations().addAll(targetOperations.values());
- // wireService.checkCompatibility(source, target, false);
- }
-
- /**
- * Verifies a source's faults which are supertypes and a superset of the
- * target's faults are compatible
- */
- @Test
- public void testFaultSuperTypesAndSuperset() throws Exception {
- // InterfaceContract source = new MockContract("FooContract");
- // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,
- // Exception.class);
- // DataType sourceFaultType2 = new
- // DataTypeImpl<Type>(RuntimeException.class, RuntimeException.class);
- // List<DataType> sourceFaultTypes = new ArrayList<DataType>();
- // sourceFaultTypes.add(0, sourceFaultType);
- // sourceFaultTypes.add(1, sourceFaultType2);
- // Operation opSource1 = newOperationImpl("op1", null, null,
- // sourceFaultTypes, false, null);
- // Map<String, Operation> sourceOperations = new HashMap<String,
- // Operation>();
- // sourceOperations.put("op1", opSource1);
- // source.getInterface().getOperations().addAll(sourceOperations.values());
- //
- // InterfaceContract target = new MockContract("FooContract");
- // DataType targetFaultType = new
- // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);
- // List<DataType> targetFaultTypes = new ArrayList<DataType>();
- // targetFaultTypes.add(0, targetFaultType);
- //
- // Operation opTarget = newOperationImpl("op1", null, null,
- // targetFaultTypes, false, null);
- // Map<String, Operation> targetOperations = new HashMap<String,
- // Operation>();
- // targetOperations.put("op1", opTarget);
- // target.getInterface().getOperations().addAll(targetOperations.values());
- // wireService.checkCompatibility(source, target, false);
- }
-
- private static class MockInterface extends InterfaceImpl {
-
- }
-
- private class MockContract<T> extends InterfaceContractImpl {
- public MockContract() {
- }
-
- public MockContract(String interfaceClass) {
- Interface jInterface = new MockInterface();
- setInterface(jInterface);
- }
- }
-
- private static Operation newOperation(String name) {
- Operation operation = new OperationImpl();
- operation.setName(name);
- return operation;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/interface/src/test/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractTestCase.java b/tags/java/sca/2.0-M1/modules/interface/src/test/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractTestCase.java
deleted file mode 100644
index c02b4657d3..0000000000
--- a/tags/java/sca/2.0-M1/modules/interface/src/test/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractTestCase.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.impl;
-
-
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class InterfaceContractTestCase {
- private InterfaceContract contract;
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- contract = new MockInterfaceContract();
- Interface i1 = new MockInterface();
- contract.setInterface(i1);
- Operation op1 = newOperation("op1");
- i1.getOperations().add(op1);
- Interface i2 = new MockInterface();
- contract.setCallbackInterface(i2);
- Operation callbackOp1 = newOperation("callbackOp1");
- i2.getOperations().add(callbackOp1);
- }
-
- @Test
- public void testClone() throws Exception {
- InterfaceContract copy = (InterfaceContract) contract.clone();
- Assert.assertEquals(contract, copy);
- }
-
- private static class MockInterfaceContract extends InterfaceContractImpl implements InterfaceContract {
- }
-
- private static class MockInterface extends InterfaceImpl implements Interface {
- }
-
- private static Operation newOperation(String name) {
- Operation operation = new OperationImpl();
- operation.setName(name);
- return operation;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/launcher/LICENSE b/tags/java/sca/2.0-M1/modules/launcher/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/launcher/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/launcher/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/launcher/META-INF/MANIFEST.MF
deleted file mode 100644
index cdf582c8da..0000000000
--- a/tags/java/sca/2.0-M1/modules/launcher/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,27 +0,0 @@
-Manifest-Version: 1.0
-Archiver-Version: Plexus Archiver
-Created-By: 1.6.0 (IBM Corporation)
-Built-By: gb000131
-Build-Jdk: 1.6.0
-Extension-Name: tuscany-launcher
-Implementation-Title: Apache Tuscany Launcher
-Implementation-Vendor: The Apache Software Foundation
-Implementation-Vendor-Id: org.apache
-Implementation-Version: 2.0-SNAPSHOT
-Specification-Title: Apache Tuscany Launcher
-Specification-Vendor: The Apache Software Foundation
-Specification-Version: 2.0-SNAPSHOT
-Bundle-DocURL: http://www.apache.org/
-Bundle-SymbolicName: org.apache.tuscany.sca.launcher
-Originally-Created-By: 1.6.0 (IBM Corporation)
-Bundle-Version: 2.0
-Bundle-Description: Apache Tuscany Launcher
-Bundle-Vendor: The Apache Software Foundation
-Bnd-LastModified: 1231166325921
-Bundle-Name: Apache Tuscany Launcher
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Tool: Bnd-0.0.255
-Bundle-ManifestVersion: 2
-Import-Package: org.apache.tuscany.sca.launcher;version="2.0"
-Export-Package: org.apache.tuscany.sca.launcher;version="2.0"
-Main-Class: org.apache.tuscany.sca.launcher.LauncherMain
diff --git a/tags/java/sca/2.0-M1/modules/launcher/NOTICE b/tags/java/sca/2.0-M1/modules/launcher/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/modules/launcher/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/launcher/pom.xml b/tags/java/sca/2.0-M1/modules/launcher/pom.xml
deleted file mode 100644
index cc396cef24..0000000000
--- a/tags/java/sca/2.0-M1/modules/launcher/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-launcher</artifactId>
- <name>Apache Tuscany SCA Launcher</name>
-
- <dependencies>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java b/tags/java/sca/2.0-M1/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
deleted file mode 100644
index 026ed04055..0000000000
--- a/tags/java/sca/2.0-M1/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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()) {
- 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/tags/java/sca/2.0-M1/modules/monitor/LICENSE b/tags/java/sca/2.0-M1/modules/monitor/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/monitor/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/monitor/META-INF/MANIFEST.MF
deleted file mode 100644
index 61652db813..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,16 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.monitor;version="2.0.0"
-Private-Package: org.apache.tuscany.sca.monitor.impl;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Monitor
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397090921
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Monitor
-Import-Package: org.apache.tuscany.sca.monitor;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.monitor
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/monitor/NOTICE b/tags/java/sca/2.0-M1/modules/monitor/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/monitor/pom.xml b/tags/java/sca/2.0-M1/modules/monitor/pom.xml
deleted file mode 100644
index 6af8285a14..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/pom.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-monitor</artifactId>
- <name>Apache Tuscany SCA Monitor</name>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/DefaultMonitorFactory.java b/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/DefaultMonitorFactory.java
deleted file mode 100644
index b38968caeb..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/DefaultMonitorFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.monitor;
-
-import org.apache.tuscany.sca.monitor.impl.MonitorImpl;
-
-
-/**
- * A factory for creating validation monitors
- *
- * @version $Rev$ $Date$
- */
-public class DefaultMonitorFactory implements MonitorFactory {
-
- private Monitor monitor = null;
-
- public Monitor createMonitor() {
- if (monitor == null) {
- monitor = new MonitorImpl();
- }
- return monitor ;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java b/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java
deleted file mode 100644
index f0ac8a6dbb..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Monitor.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.monitor;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * A monitor for the watching for validation problems
- *
- * @version $Rev$ $Date$
- */
-public interface Monitor {
- /**
- * Reports a build problem.
- *
- * @param problem
- */
- void problem(Problem problem);
-
- /**
- * Returns a list of reported problems.
- *
- * @return the list of problems. The list may be empty
- */
- List<Problem> getProblems();
-
- /**
- * Returns the last logged problem.
- *
- * @return
- */
- public Problem getLastProblem();
-
- /**
- * Create a new problem.
- *
- * @param sourceClassName the class name reporting the problem
- * @param bundleName the name of the message bundle to use
- * @param severity the severity of the problem
- * @param problemObject the model object for which the problem is being reported
- * @param messageId the id of the problem message
- * @param cause the exception which caused the problem
- * @return
- */
- Problem createProblem(String sourceClassName, String bundleName, Severity severity, Object problemObject, String messageId, Exception cause);
-
- /**
- * Create a new problem.
- *
- * @param sourceClassName the class name reporting the problem
- * @param bundleName the name of the message bundle to use
- * @param severity the severity of the problem
- * @param problemObject the model object for which the problem is being reported
- * @param messageId the id of the problem message
- * @param messageParams the parameters of the problem message
- * @return
- */
- Problem createProblem(String sourceClassName, String bundleName, Severity severity, Object problemObject, String messageId, Object... messageParams );
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/MonitorFactory.java b/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/MonitorFactory.java
deleted file mode 100644
index 3384626958..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/MonitorFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.monitor;
-
-
-/**
- * A factory for validation monitors
- *
- * @version $Rev$ $Date$
- */
-public interface MonitorFactory {
-
- /**
- * Create a new monitor.
- *
- * @return a new monitor
- */
- Monitor createMonitor();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Problem.java b/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Problem.java
deleted file mode 100644
index 83a2d63eae..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/Problem.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.monitor;
-
-
-/**
- * Records an validation problem.
- *
- * @version $Rev$ $Date$
- */
-public interface Problem {
-
- public enum Severity {
- INFO,
- WARNING,
- ERROR
- }
-
- String getSourceClassName();
-
- String getBundleName();
-
- Severity getSeverity();
-
- Object getProblemObject();
-
- String getMessageId();
-
- Exception getCause();
-
- Object[] getMessageParams();
-}
diff --git a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java b/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java
deleted file mode 100644
index fa562a5f23..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/MonitorImpl.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.monitor.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- * A monitor for the watching for validation problems
- *
- * @version $Rev$ $Date$
- */
-public class MonitorImpl implements Monitor {
- private static final Logger logger = Logger.getLogger(MonitorImpl.class.getName());
-
- // Cache all the problem reported to monitor for further analysis
- private List<Problem> problemCache = new ArrayList<Problem>();
-
- public void problem(Problem problem) {
-
- Logger problemLogger = Logger.getLogger(problem.getSourceClassName(), problem.getBundleName());
-
- if (problemLogger == null){
- logger.severe("Can't get logger " + problem.getSourceClassName()+ " with bundle " + problem.getBundleName());
- }
-
- if (problem.getSeverity() == Severity.INFO) {
- problemCache.add(problem);
- problemLogger.logp(Level.INFO, problem.getSourceClassName(), null,
- problem.getMessageId(), problem.getMessageParams());
- }
- else if (problem.getSeverity() == Severity.WARNING) {
- problemCache.add(problem);
- problemLogger.logp(Level.WARNING, problem.getSourceClassName(), null,
- problem.getMessageId(), problem.getMessageParams());
- }
- else if (problem.getSeverity() == Severity.ERROR) {
- if (problem.getCause() != null) {
- problemCache.add(problem);
- problemLogger.logp(Level.SEVERE, problem.getSourceClassName(),
- null, problem.getMessageId(), problem.getCause().toString());
-
- } else {
- problemCache.add(problem);
- problemLogger.logp(Level.SEVERE, problem.getSourceClassName(), null,
- problem.getMessageId(), problem.getMessageParams());
- }
- }
- }
-
- public List<Problem> getProblems(){
- return problemCache;
- }
-
- public Problem getLastProblem(){
- if (problemCache.isEmpty()) {
- return null;
- }
- return problemCache.get(problemCache.size() - 1);
- }
-
- public Problem createProblem(String sourceClassName, String bundleName, Severity severity, Object problemObject, String messageId, Exception cause) {
- return new ProblemImpl(sourceClassName, bundleName, severity, problemObject, messageId, cause);
- }
-
- public Problem createProblem(String sourceClassName, String bundleName, Severity severity, Object problemObject, String messageId, Object... messageParams) {
- return new ProblemImpl(sourceClassName, bundleName, severity, problemObject, messageId, messageParams);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/ProblemImpl.java b/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/ProblemImpl.java
deleted file mode 100644
index 5a0aaeddd0..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/src/main/java/org/apache/tuscany/sca/monitor/impl/ProblemImpl.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.monitor.impl;
-
-import java.util.logging.Formatter;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-import java.util.logging.SimpleFormatter;
-
-import org.apache.tuscany.sca.monitor.Problem;
-
-/**
- * Reports a composite assembly problem.
- *
- * @version $Rev$ $Date$
- */
-public class ProblemImpl implements Problem {
-
- private String sourceClassName;
- private String bundleName;
- private Severity severity;
- private Object problemObject;
- private String messageId;
- private Object[] messageParams;
- private Exception cause;
-
- /**
- * Construct a new problem
- *
- * @param sourceClassName the class name reporting the problem
- * @param bundleName the name of the message bundle to use
- * @param severity the severity of the problem
- * @param problemObject the model object for which the problem is being reported
- * @param messageId the id of the problem message
- * @param messageParams the parameters of the problem message
- */
- public ProblemImpl(String sourceClassName, String bundleName, Severity severity, Object problemObject, String messageId, Object... messageParams ) {
- this.sourceClassName = sourceClassName;
- this.bundleName = bundleName;
- this.severity = severity;
- this.problemObject = problemObject;
- this.messageId = messageId;
- this.messageParams = messageParams;
- }
-
- /**
- * Construct a new problem
- *
- * @param sourceClassName the class name reporting the problem
- * @param bundleName the name of the message bundle to use
- * @param severity the severity of the problem
- * @param problemObject the model object for which the problem is being reported
- * @param messageId the id of the problem message
- * @param cause the exception which caused the problem
- */
- public ProblemImpl(String sourceClassName, String bundleName, Severity severity, Object problemObject, String messageId, Exception cause) {
- this.sourceClassName = sourceClassName;
- this.bundleName = bundleName;
- this.severity = severity;
- this.problemObject = problemObject;
- this.messageId = messageId;
- this.cause = cause;
- }
-
- public String getSourceClassName() {
- return sourceClassName;
- }
-
- public String getBundleName() {
- return bundleName;
- }
-
- public Severity getSeverity() {
- return severity;
- }
-
- public Object getProblemObject() {
- return problemObject;
- }
-
- public String getMessageId() {
- return messageId;
- }
-
- public Object[] getMessageParams() {
- return messageParams;
- }
-
- public Exception getCause() {
- return cause;
- }
-
- @Override
- public String toString() {
- Logger logger = Logger.getLogger(sourceClassName, bundleName);
-
- LogRecord record = new LogRecord(Level.INFO, messageId);
-
- if (cause == null){
- record.setParameters(messageParams);
-
- } else {
- Object[] params = new String[1];
- params[0] = cause.toString();
- record.setParameters(params);
- }
- record.setResourceBundle(logger.getResourceBundle());
- record.setSourceClassName(sourceClassName);
-
- Formatter formatter = new SimpleFormatter();
-
- return formatter.formatMessage(record);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/monitor/src/main/resources/META-INF/services/org.apache.tuscany.sca.monitor.MonitorFactory b/tags/java/sca/2.0-M1/modules/monitor/src/main/resources/META-INF/services/org.apache.tuscany.sca.monitor.MonitorFactory
deleted file mode 100644
index ae81aef136..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/src/main/resources/META-INF/services/org.apache.tuscany.sca.monitor.MonitorFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.monitor.DefaultMonitorFactory
diff --git a/tags/java/sca/2.0-M1/modules/monitor/src/test/java/org/apache/tuscany/sca/monitor/MonitorTestCase.java b/tags/java/sca/2.0-M1/modules/monitor/src/test/java/org/apache/tuscany/sca/monitor/MonitorTestCase.java
deleted file mode 100644
index 4380e32f99..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/src/test/java/org/apache/tuscany/sca/monitor/MonitorTestCase.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.monitor;
-
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Loads a monitor and adds some problems to it.
- *
- * @version $Rev$ $Date$
- */
-public class MonitorTestCase {
-
- private static MonitorFactory monitorFactory;
-
- @BeforeClass
- public static void init() throws Exception {
- monitorFactory = new DefaultMonitorFactory();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- monitorFactory = null;
- }
-
- @Test
- public void testCreateProblem() throws Exception {
- String dummyModelObject = "DUMMY MODEL OBJECT";
-
- Monitor monitor = monitorFactory.createMonitor();
-
- Problem problem = null;
-
- problem = monitor.createProblem(this.getClass().getName(),
- "tuscany-monitor-test-messages",
- Severity.WARNING,
- dummyModelObject,
- "MESSAGE1" );
- monitor.problem(problem);
-
- String param = "Some Parameter";
-
- problem = monitor.createProblem(this.getClass().getName(),
- "tuscany-monitor-test-messages",
- Severity.WARNING,
- dummyModelObject,
- "MESSAGE2",
- param);
- monitor.problem(problem);
-
- problem = monitor.createProblem(this.getClass().getName(),
- "tuscany-monitor-test-messages",
- Severity.WARNING,
- dummyModelObject,
- "MESSAGE3",
- 8,
- 9,
- 4);
- monitor.problem(problem);
-
- Exception ex = new IllegalStateException("TEST_MESSAGE");
-
- problem = monitor.createProblem(this.getClass().getName(),
- "tuscany-monitor-test-messages",
- Severity.ERROR,
- dummyModelObject,
- "MESSAGE4",
- ex);
- monitor.problem(problem);
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/monitor/src/test/resources/tuscany-monitor-test-messages.properties b/tags/java/sca/2.0-M1/modules/monitor/src/test/resources/tuscany-monitor-test-messages.properties
deleted file mode 100644
index 523263da40..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/src/test/resources/tuscany-monitor-test-messages.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-MESSAGE1 = This is a test message with no params
-MESSAGE2 = This is a test message with a string param {0}
-MESSAGE3 = This is a test message with numbers {0}, {1}, {2}
-MESSAGE4 = This is a test message with exception
diff --git a/tags/java/sca/2.0-M1/modules/monitor/src/test/resources/tuscany-monitor-test-messages_it.properties b/tags/java/sca/2.0-M1/modules/monitor/src/test/resources/tuscany-monitor-test-messages_it.properties
deleted file mode 100644
index 523263da40..0000000000
--- a/tags/java/sca/2.0-M1/modules/monitor/src/test/resources/tuscany-monitor-test-messages_it.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-MESSAGE1 = This is a test message with no params
-MESSAGE2 = This is a test message with a string param {0}
-MESSAGE3 = This is a test message with numbers {0}, {1}, {2}
-MESSAGE4 = This is a test message with exception
diff --git a/tags/java/sca/2.0-M1/modules/node-api/LICENSE b/tags/java/sca/2.0-M1/modules/node-api/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-api/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/node-api/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/node-api/META-INF/MANIFEST.MF
deleted file mode 100644
index 386fbf4d9d..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-api/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.node;uses:="org.oasisopen.sca";versi
- on="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Node API
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-DynamicImport-Package: org.apache.tuscany.sca.node.impl,org.apache.tus
- cany.sca.extensibility
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397189093
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Node API
-Import-Package: org.apache.tuscany.sca.node;version="2.0.0",org.oasisopen.sca
- ;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.node.api
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/node-api/NOTICE b/tags/java/sca/2.0-M1/modules/node-api/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-api/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/node-api/pom.xml b/tags/java/sca/2.0-M1/modules/node-api/pom.xml
deleted file mode 100644
index 5fb96d81fd..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-api/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Client.java b/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Client.java
deleted file mode 100644
index 84c1e09126..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Client.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node;
-
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ServiceReference;
-
-
-/**
- * Provides client access to the services in a domain.
- *
- * @version $Rev$ $Date$
- */
-public interface Client {
-
- /**
- * Cast a type-safe reference to a CallableReference. Converts a type-safe
- * reference to an equivalent CallableReference; if the target refers to a
- * service then a ServiceReference will be returned, if the target refers to
- * a callback then a CallableReference will be returned.
- *
- * @param target a reference proxy provided by the SCA runtime
- * @param <B> the Java type of the business interface for the reference
- * @param <R> the type of reference to be returned
- * @return a CallableReference equivalent for the proxy
- * @throws IllegalArgumentException if the supplied instance is not a
- * reference supplied by the SCA runtime
- */
- <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException;
-
- /**
- * Returns a proxy for a service provided by a component in the SCA domain.
- *
- * @param businessInterface the interface that will be used to invoke the
- * service
- * @param serviceName the name of the service
- * @param <B> the Java type of the business interface for the service
- * @return an object that implements the business interface
- */
- <B> B getService(Class<B> businessInterface, String serviceName);
-
- /**
- * Returns a ServiceReference for a service provided by a component in the
- * SCA domain.
- *
- * @param businessInterface the interface that will be used to invoke the
- * service
- * @param serviceName the name of the service
- * @param <B> the Java type of the business interface for the service
- * @return a ServiceReference for the designated service
- */
- <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String serviceName);
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Contribution.java b/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Contribution.java
deleted file mode 100644
index f69e18dc63..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Contribution.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.node;
-
-/**
- * Represents an SCA contribution uri + location.
- */
-public final class Contribution {
- private String uri;
- private String location;
-
- /**
- * Constructs a new SCA contribution.
- *
- * @param uri The URI that uniquely identifies the contribution in the SCA domain
- * @param location The URL of the contribution archive
- */
- public Contribution(String uri, String location) {
- this.uri = uri;
- this.location = location;
- }
-
- /**
- * Get the URI of the contribution
- * @return The URI that uniquely identifies the contribution in the SCA domain
- */
- public String getURI() {
- return uri;
- }
-
- /**
- * The location of the contribution
- * @return The URL of the contribution archive
- */
- public String getLocation() {
- return location;
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/ContributionLocationHelper.java b/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/ContributionLocationHelper.java
deleted file mode 100644
index 96a25dfa63..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/ContributionLocationHelper.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node;
-
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * ContributionLocationHelper
- *
- * @version $Rev$ $Date$
- */
-public class ContributionLocationHelper {
-
- /**
- * Returns the location of the SCA contribution containing the given class.
- *
- * @param anchorClass
- * @return
- */
- public static String getContributionLocation(final Class<?> anchorClass) {
- URL url = AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- return anchorClass.getProtectionDomain().getCodeSource().getLocation();
- }
- });
- String uri = url.toString();
- return uri;
- }
-
- /**
- * Find the contribution location by seraching a resource on the classpath
- * @param resourceName
- * @return
- */
- public static String getContributionLocation(String resourceName) {
- return getContributionLocation(null, resourceName);
-
- }
-
- /**
- * Find the contribution location by seraching a resource using the given classloader
- * @param classLoader
- * @param resourceName
- * @return
- */
- public static String getContributionLocation(ClassLoader classLoader, String resourceName) {
- if (classLoader == null) {
- classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- return Thread.currentThread().getContextClassLoader();
- }
- });
- }
- URL resourceURL = getResource(classLoader, resourceName);
- if (resourceURL == null) {
- return null;
- }
- String location = null;
- // "jar:file://....../something.jar!/a/b/c/app.composite"
- String url = resourceURL.toExternalForm();
- String protocol = resourceURL.getProtocol();
- if ("file".equals(protocol)) {
- // directory contribution
- if (url.endsWith(resourceName)) {
- location = url.substring(0, url.lastIndexOf(resourceName));
- }
- } else if ("jar".equals(protocol) || "wsjar".equals(protocol) || "zip".equals(protocol)) {
- // jar contribution
- location = url.substring(protocol.length() + 1, url.lastIndexOf("!/"));
- }
- return location;
- }
-
- private static URL getResource(final ClassLoader classLoader, final String compositeURI) {
- return AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- return classLoader.getResource(compositeURI);
- }
- });
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java b/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java
deleted file mode 100644
index 3f4998bcc9..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node;
-
-
-
-/**
- * Represents an SCA processing node.
- * A node is loaded with an SCA composites. It can start and stop that composite.
- *
- * @version $Rev$ $Date$
- */
-public interface Node extends Client {
-
- /**
- * Start the composite loaded in the node.
- */
- void start();
-
- /**
- * Stop the composite loaded in the node.
- */
- void stop();
-
- /**
- * Destroy the node.
- */
- void destroy();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java b/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java
deleted file mode 100644
index 426c32bd49..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.lang.reflect.InvocationTargetException;
-
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * A factory for SCA processing nodes. An SCA processing node can be loaded
- * with an SCA composite and the SCA contributions required by the composite.
- *
- * @version $Rev$ $Date$
- */
-public abstract class NodeFactory {
-
- public static class NodeProxy implements Node, Client {
- private Object node;
-
- private NodeProxy(Object node) {
- super();
- this.node = node;
- }
-
- public static <T> T createProxy(Class<T> type, Object node) {
- try {
- return type.getDeclaredConstructor(Object.class).newInstance(node);
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
- try {
- return (R)node.getClass().getMethod("cast", Object.class).invoke(node, target);
- } catch (Throwable e) {
- handleException(e);
- return null;
- }
- }
-
- public <B> B getService(Class<B> businessInterface, String serviceName) {
- try {
- return (B)node.getClass().getMethod("getService", Class.class, String.class).invoke(node,
- businessInterface,
- serviceName);
- } catch (Throwable e) {
- handleException(e);
- return null;
- }
- }
-
- public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String serviceName) {
- try {
- return (ServiceReference<B>)node.getClass().getMethod("getServiceReference", Class.class, String.class)
- .invoke(node, businessInterface, serviceName);
- } catch (Throwable e) {
- handleException(e);
- return null;
- }
- }
-
- public void start() {
- try {
- node.getClass().getMethod("start").invoke(node);
- } catch (Throwable e) {
- handleException(e);
- }
- }
-
- public void stop() {
- try {
- node.getClass().getMethod("stop").invoke(node);
- } catch (Throwable e) {
- handleException(e);
- }
- }
-
- public void destroy() {
- try {
- node.getClass().getMethod("destroy").invoke(node);
- } catch (Throwable e) {
- handleException(e);
- }
- }
-
- private static void handleException(Throwable ex) {
- if (ex instanceof InvocationTargetException) {
- ex = ((InvocationTargetException)ex).getTargetException();
- }
- if (ex instanceof RuntimeException) {
- throw (RuntimeException)ex;
- }
- if (ex instanceof Error) {
- throw (Error)ex;
- } else {
- throw new RuntimeException(ex);
- }
- }
-
- }
-
- /**
- * Returns a new SCA node factory instance.
- *
- * @return a new SCA node factory
- */
- public static NodeFactory newInstance() {
- NodeFactory scaNodeFactory = null;
-
- try {
- // final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- // Use reflection APIs to call ServiceDiscovery to avoid hard dependency to tuscany-extensibility
- try {
- Class<?> discoveryClass = Class.forName("org.apache.tuscany.sca.extensibility.ServiceDiscovery");
- Object instance = discoveryClass.getMethod("getInstance").invoke(null);
- Object factoryDeclaration = discoveryClass.getMethod("getFirstServiceDeclaration", String.class).invoke(instance, NodeFactory.class.getName());
- if (factoryDeclaration != null) {
- Class<?> factoryImplClass = (Class<?>)factoryDeclaration.getClass().getMethod("loadClass").invoke(factoryDeclaration);
- scaNodeFactory = (NodeFactory)factoryImplClass.newInstance();
- return scaNodeFactory;
- }
- } catch (ClassNotFoundException e) {
- // Ignore
- }
-
- // Fail back to default impl
- String className = "org.apache.tuscany.sca.node.impl.NodeFactoryImpl";
-
- Class<?> cls = Class.forName(className);
- scaNodeFactory = (NodeFactory)cls.newInstance();
- return scaNodeFactory;
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * Creates a new SCA node using defaults for the contribution location and runnable composite
- *
- * @return a new SCA node.
- */
- public abstract Node createNode();
-
- /**
- * 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.
- */
- public abstract Node createNode(String configurationURL);
-
- /**
- * Creates a new SCA 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.
- */
- public abstract Node createNode(String compositeURI, Contribution... contributions);
-
- /**
- * Creates a new SCA 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.
- */
- public abstract Node createNode(String compositeURI,
- String compositeContent,
- Contribution... contributions);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java b/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java
deleted file mode 100644
index 6c26db5a25..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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(null, contributions);
- node.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();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/LICENSE b/tags/java/sca/2.0-M1/modules/node-impl/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/node-impl/META-INF/MANIFEST.MF
deleted file mode 100644
index 3970002180..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,48 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.node.impl;uses:="org.apache.tus
- cany.sca.runtime,org.apache.tuscany.sca.definitions,org.apache.tuscan
- y.sca.core,javax.xml.namespace,javax.xml.stream,org.apache.tuscany.sc
- a.core.assembly,org.apache.tuscany.sca.contribution.resolver,org.apac
- he.tuscany.sca.workspace,org.apache.tuscany.sca.core.invocation,org.o
- soa.sca,org.apache.tuscany.sca.assembly.builder,org.apache.tuscany.sc
- a.implementation.node,org.apache.tuscany.sca.assembly,org.apache.tusc
- any.sca.node,org.apache.tuscany.sca.workspace.builder,org.apache.tusc
- any.sca.contribution,org.apache.tuscany.sca.monitor,org.apache.tuscan
- y.sca.work,org.apache.tuscany.sca.contribution.processor";version="2.0.
- 0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Node Implementation
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397240796
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Node Implementation
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.builder;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.core.assembly;version="2.0.0",
- org.apache.tuscany.sca.core.invocation;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0",
- org.apache.tuscany.sca.definitions.util;version="2.0.0",
- org.apache.tuscany.sca.implementation.node;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.node;version="2.0.0",
- org.apache.tuscany.sca.node.impl;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.apache.tuscany.sca.work;version="2.0.0",
- org.apache.tuscany.sca.workspace;version="2.0.0",
- org.apache.tuscany.sca.workspace.builder;version="2.0.0",
- org.oasisopen.sca;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0";resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.node.impl
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/NOTICE b/tags/java/sca/2.0-M1/modules/node-impl/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/pom.xml b/tags/java/sca/2.0-M1/modules/node-impl/pom.xml
deleted file mode 100644
index a88edceea4..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/pom.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-node-impl</artifactId>
- <name>Apache Tuscany SCA Node Implementation</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace-impl</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions-xml</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca-xml</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xsd</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java b/tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
deleted file mode 100644
index 5ee68899a9..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.impl;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * Default implementation of an SCA node factory.
- *
- * @version $Rev$ $Date$
- */
-public class NodeFactoryImpl extends NodeFactory {
- public NodeFactoryImpl() {
- }
-
- @Override
- public Node createNode(String configurationURI) {
- return new NodeImpl(configurationURI);
- }
-
- @Override
- public Node createNode(String compositeURI, Contribution... contributions) {
- return new NodeImpl(compositeURI, contributions);
- }
-
- @Override
- public Node createNode(String compositeURI, String compositeContent, Contribution... contributions) {
- return new NodeImpl(compositeURI, compositeContent, contributions);
- }
-
- @Override
- public Node createNode() {
- return new NodeImpl();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
deleted file mode 100644
index 1be8937c2c..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
+++ /dev/null
@@ -1,713 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* 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 static java.lang.System.currentTimeMillis;
-import static org.apache.tuscany.sca.node.impl.NodeUtil.contribution;
-import static org.apache.tuscany.sca.node.impl.NodeUtil.createURI;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-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.CompositeService;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.DefaultImport;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-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.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.core.ModuleActivator;
-import org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.core.assembly.ActivationException;
-import org.apache.tuscany.sca.core.assembly.CompositeActivator;
-import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory;
-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.definitions.Definitions;
-import org.apache.tuscany.sca.definitions.DefinitionsFactory;
-import org.apache.tuscany.sca.definitions.util.DefinitionsUtil;
-import org.apache.tuscany.sca.implementation.node.ConfiguredNodeImplementation;
-import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-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.provider.DefinitionsProvider;
-import org.apache.tuscany.sca.provider.DefinitionsProviderException;
-import org.apache.tuscany.sca.provider.DefinitionsProviderExtensionPoint;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentContext;
-import org.apache.tuscany.sca.work.WorkScheduler;
-import org.apache.tuscany.sca.workspace.Workspace;
-import org.apache.tuscany.sca.workspace.WorkspaceFactory;
-import org.apache.tuscany.sca.workspace.builder.ContributionBuilder;
-import org.apache.tuscany.sca.workspace.builder.ContributionBuilderExtensionPoint;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * Represents an SCA runtime node.
- *
- * @version $Rev$ $Date$
- */
-public class NodeImpl implements Node, Client {
-
- private static final Logger logger = Logger.getLogger(NodeImpl.class.getName());
-
- // The node configuration name, used for logging
- private String configurationName;
-
- // The composite loaded into this node
- private Composite composite;
-
- private ExtensionPointRegistry extensionPoints;
- private Monitor monitor;
- private URLArtifactProcessor<Contribution> contributionProcessor;
- private ModelResolverExtensionPoint modelResolvers;
- private FactoryExtensionPoint modelFactories;
- private WorkspaceFactory workspaceFactory;
- private ContributionFactory contributionFactory;
- private AssemblyFactory assemblyFactory;
- private XMLInputFactory inputFactory;
- private ContributionBuilder contributionDependencyBuilder;
- private CompositeBuilder compositeBuilder;
- private StAXArtifactProcessorExtensionPoint xmlProcessors;
- private StAXArtifactProcessor<Composite> compositeProcessor;
- private ProxyFactory proxyFactory;
- private List<ModuleActivator> moduleActivators = new ArrayList<ModuleActivator>();
- private CompositeActivator compositeActivator;
- private WorkScheduler workScheduler;
- private Contribution systemContribution;
- private Definitions systemDefinitions;
-
- /**
- * Constructs a new SCA node.
- */
- NodeImpl() {
- configurationName = "default";
- logger.log(Level.INFO, "Creating node: " + configurationName);
-
- String root = ContributionLocationHelper.getContributionLocation("META-INF/sca-contribution.xml");
- if (root == null) {
- throw new ServiceRuntimeException("no META-INF/sca-contribution.xml found");
- }
-
- String compositeURI = null;
- org.apache.tuscany.sca.node.Contribution[] contributions = new org.apache.tuscany.sca.node.Contribution[]{new org.apache.tuscany.sca.node.Contribution(root, root)};
-
- try {
- // Initialize the runtime
- init();
-
- // Create a node configuration
- NodeImplementationFactory nodeImplementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
- ConfiguredNodeImplementation configuration = nodeImplementationFactory.createConfiguredNodeImplementation();
-
- if (compositeURI != null) {
- Composite composite = assemblyFactory.createComposite();
- composite.setURI(compositeURI);
- composite.setUnresolved(true);
- configuration.setComposite(composite);
- }
-
- // Create contribution models
- for (org.apache.tuscany.sca.node.Contribution c : contributions) {
- Contribution contribution = contribution(contributionFactory, c);
- configuration.getContributions().add(contribution);
- }
-
- // Configure the node
- configureNode(configuration);
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * Constructs a new SCA node.
- *
- * @param configurationURI the URI of the node configuration information.
- */
- NodeImpl(String configurationURI) {
- configurationName = configurationURI;
- logger.log(Level.INFO, "Creating node: " + configurationName);
-
- try {
- // Initialize the runtime
- init();
-
- // Read the node configuration feed
- StAXArtifactProcessor<ConfiguredNodeImplementation> configurationProcessor = xmlProcessors.getProcessor(ConfiguredNodeImplementation.class);
- URL configurationURL = new URL(configurationURI);
- InputStream is = configurationURL.openStream();
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- reader.nextTag();
- ConfiguredNodeImplementation configuration = configurationProcessor.read(reader);
- is.close();
-
- // Resolve contribution URLs
- for (Contribution contribution : configuration.getContributions()) {
- URL contributionURL = new URL(configurationURL, contribution.getLocation());
- contribution.setLocation(contributionURL.toString());
- }
-
- // Resolve composite URL
- URL compositeURL = new URL(configurationURL, configuration.getComposite().getURI());
- configuration.getComposite().setURI(compositeURL.toString());
-
- // Configure the node
- configureNode(configuration);
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * Constructs a new SCA node.
- *
- * @param compositeURI
- * @param contributions
- */
- NodeImpl(String compositeURI, org.apache.tuscany.sca.node.Contribution[] contributions) {
- configurationName = compositeURI;
- logger.log(Level.INFO, "Creating node: " + configurationName);
-
- try {
- // Initialize the runtime
- init();
-
- // Create a node configuration
- NodeImplementationFactory nodeImplementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
- ConfiguredNodeImplementation configuration = nodeImplementationFactory.createConfiguredNodeImplementation();
-
- if (compositeURI != null) {
- Composite composite = assemblyFactory.createComposite();
- composite.setURI(compositeURI);
- composite.setUnresolved(true);
- configuration.setComposite(composite);
- }
-
- // Create contribution models
- for (org.apache.tuscany.sca.node.Contribution c : contributions) {
- Contribution contribution = contribution(contributionFactory, c);
- configuration.getContributions().add(contribution);
- }
-
- // Configure the node
- configureNode(configuration);
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * Constructs a new SCA node.
- *
- * @param compositeURI
- * @param compositeContent
- * @param contributions
- */
- NodeImpl(String compositeURI, String compositeContent, org.apache.tuscany.sca.node.Contribution[] contributions) {
- configurationName = compositeURI;
- logger.log(Level.INFO, "Creating node: " + configurationName);
-
- try {
- // Initialize the runtime
- init();
-
- // Create a node configuration
- NodeImplementationFactory nodeImplementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
- ConfiguredNodeImplementation configuration = nodeImplementationFactory.createConfiguredNodeImplementation();
-
- // Read the composite model
- logger.log(Level.INFO, "Loading composite: " + compositeURI);
-
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new ByteArrayInputStream(compositeContent.getBytes("UTF-8")));
- reader.nextTag();
-
- // Read the composite model
- composite = (Composite)compositeProcessor.read(reader);
- if (composite != null) {
- composite.setURI(compositeURI);
- }
- analyzeProblems();
-
- configuration.setComposite(composite);
-
- // Create contribution models
- for (org.apache.tuscany.sca.node.Contribution c : contributions) {
- Contribution contribution = contribution(contributionFactory, c);
- configuration.getContributions().add(contribution);
- }
-
- // Configure the node
- configureNode(configuration);
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- }
-
- private void init() {
- long start = currentTimeMillis();
-
- // Create extension point registry
- extensionPoints = new DefaultExtensionPointRegistry();
-
- // Use the runtime-enabled assembly factory
- modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- assemblyFactory = new RuntimeAssemblyFactory();
- modelFactories.addFactory(assemblyFactory);
-
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- monitor = monitorFactory.createMonitor();
-
- // Initialize the Tuscany module activators
- ModuleActivatorExtensionPoint activators = extensionPoints.getExtensionPoint(ModuleActivatorExtensionPoint.class);
- for (ModuleActivator moduleActivator: activators.getModuleActivators()) {
- try {
- moduleActivator.start(extensionPoints);
- moduleActivators.add(moduleActivator);
- } catch (Throwable e) {
- // Ignore the failing module for now
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- }
-
- // Get XML input/output factories
- inputFactory = modelFactories.getFactory(XMLInputFactory.class);
-
- // Get contribution workspace and assembly model factories
- contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- workspaceFactory = modelFactories.getFactory(WorkspaceFactory.class);
-
- // Create XML artifact processors
- xmlProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- compositeProcessor = xmlProcessors.getProcessor(Composite.class);
-
- // Create contribution content processor
- URLArtifactProcessorExtensionPoint docProcessorExtensions = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- contributionProcessor = docProcessorExtensions.getProcessor(Contribution.class);
-
- // Get the model resolvers
- modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
-
- // Get a contribution dependency builder
- ContributionBuilderExtensionPoint contributionBuilders = extensionPoints.getExtensionPoint(ContributionBuilderExtensionPoint.class);
- contributionDependencyBuilder = contributionBuilders.getContributionBuilder("org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder");
-
- // Get composite builders
- CompositeBuilderExtensionPoint compositeBuilders = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class);
- compositeBuilder = compositeBuilders.getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
-
- // Initialize runtime
-
- // Get proxy factory
- ProxyFactoryExtensionPoint proxyFactories = extensionPoints.getExtensionPoint(ProxyFactoryExtensionPoint.class);
- proxyFactory = new ExtensibleProxyFactory(proxyFactories);
-
- // Get the composite activator
- compositeActivator = utilities.getUtility(CompositeActivator.class);
-
- workScheduler = utilities.getUtility(WorkScheduler.class);
-
- // Load the system definitions.xml from all of the loaded extension points
- DefinitionsProviderExtensionPoint definitionsProviders = extensionPoints.getExtensionPoint(DefinitionsProviderExtensionPoint.class);
- DefinitionsFactory definitionsFactory = modelFactories.getFactory(DefinitionsFactory.class);
- systemDefinitions = definitionsFactory.createDefinitions();
-
- // aggregate all the definitions into a single definitions model
- try {
- for (DefinitionsProvider definitionsProvider : definitionsProviders.getDefinitionsProviders()) {
- DefinitionsUtil.aggregate(definitionsProvider.getDefinitions(), systemDefinitions);
- }
- } catch (DefinitionsProviderException e) {
- throw new IllegalStateException(e);
- }
-
- // create a system contribution to hold the definitions. The contribution
- // will be extended later with definitions from application contributions
- systemContribution = contributionFactory.createContribution();
- systemContribution.setURI("http://tuscany.apache.org/SystemContribution");
- systemContribution.setLocation("Derived");
- ModelResolver modelResolver = new ExtensibleModelResolver(systemContribution, modelResolvers, modelFactories);
- systemContribution.setModelResolver(modelResolver);
- systemContribution.setUnresolved(true);
-
- // create an artifact to represent the system defintions and
- // add it to the contribution
- List<Artifact> artifacts = systemContribution.getArtifacts();
- Artifact artifact = contributionFactory.createArtifact();
- artifact.setURI("http://tuscany.apache.org/SystemContribution/Definitions");
- artifact.setLocation("Derived");
- artifact.setModel(systemDefinitions);
- artifacts.add(artifact);
-
- // don't resolve the system contribution until all the application
- // level definitions have been added
-
-
-//
-// // Configure a resolver for the system definitions
-// ModelResolver definitionsResolver = new DefaultModelResolver();
-// for (Intent intent : systemDefinitions.getPolicyIntents()) {
-// definitionsResolver.addModel(intent);
-// }
-// for (PolicySet policySet : systemDefinitions.getPolicySets()) {
-// definitionsResolver.addModel(policySet);
-// }
-// for (IntentAttachPointType bindingType : systemDefinitions.getBindingTypes()) {
-// definitionsResolver.addModel(bindingType);
-// }
-// for (IntentAttachPointType implementationType : systemDefinitions.getImplementationTypes()) {
-// definitionsResolver.addModel(implementationType);
-// }
-//
-// // Now that all system sca definitions have been read, let's resolve them
-// URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
-// URLArtifactProcessor<Definitions> definitionsProcessor = documentProcessors.getProcessor(Definitions.class);
-// try {
-// definitionsProcessor.resolve(systemDefinitions, definitionsResolver);
-// } catch (ContributionResolveException e) {
-// throw new IllegalStateException(e);
-// }
-
- if (logger.isLoggable(Level.FINE)) {
- long end = currentTimeMillis();
- logger.fine("The tuscany runtime started in " + (end - start) + " ms.");
- }
- }
-
- private void configureNode(ConfiguredNodeImplementation configuration) throws Exception {
-
- // Create workspace model
- Workspace workspace = workspaceFactory.createWorkspace();
- workspace.setModelResolver(new ExtensibleModelResolver(workspace, modelResolvers, modelFactories));
-
- // Load the specified contributions
- for (Contribution c : configuration.getContributions()) {
- URI contributionURI = URI.create(c.getURI());
-
- URI uri = createURI(c.getLocation());
- if (uri.getScheme() == null) {
- uri = new File(c.getLocation()).toURI();
- }
- URL contributionURL = uri.toURL();
-
- // Load the contribution
- logger.log(Level.INFO, "Loading contribution: " + contributionURL);
- Contribution contribution = contributionProcessor.read(null, contributionURI, contributionURL);
- workspace.getContributions().add(contribution);
- analyzeProblems();
- }
-
- // Build an aggregated SCA definitions model. Must be done before we try and
- // resolve any contributions or composites as they may depend on the full
- // definitions.xml picture
-
- // get all definitions.xml artifacts from contributions and aggregate
- // into the system contribution. In turn add a default import into
- // each contribution so that for unresolved items the resolution
- // processing will look in the system contribution
- for (Contribution contribution: workspace.getContributions()) {
- // aggregate definitions
- for (Artifact artifact : contribution.getArtifacts()) {
- Object model = artifact.getModel();
- if (model instanceof Definitions) {
- DefinitionsUtil.aggregate((Definitions)model, systemDefinitions);
- }
- }
-
- // create a default import and wire it up to the system contribution
- // model resolver. This is the trick that makes the resolution processing
- // skip over to the system contribution if resolution is unsuccessful
- // in the current contribution
- DefaultImport defaultImport = contributionFactory.createDefaultImport();
- defaultImport.setModelResolver(systemContribution.getModelResolver());
- contribution.getImports().add(defaultImport);
- }
-
- // now resolve the system contribution and add the contribution
- // to the workspace
- contributionProcessor.resolve(systemContribution, workspace.getModelResolver());
- workspace.getContributions().add(systemContribution);
-
- // TODO - Now we can calculate applicable policy sets for each composite
-
- // Build the contribution dependencies
- Set<Contribution> resolved = new HashSet<Contribution>();
- for (Contribution contribution: workspace.getContributions()) {
- contributionDependencyBuilder.build(contribution, workspace, monitor);
-
- // Resolve contributions
- for (Contribution dependency: contribution.getDependencies()) {
- if (!resolved.contains(dependency)) {
- resolved.add(dependency);
- contributionProcessor.resolve(dependency, workspace.getModelResolver());
- }
- }
- }
-
- composite = configuration.getComposite();
-
- if (composite == null) {
- setDefaultComposite(configuration, workspace);
- }
-
- // Find the composite in the given contributions
- boolean found = false;
- Artifact compositeFile = contributionFactory.createArtifact();
- compositeFile.setUnresolved(true);
- compositeFile.setURI(composite.getURI());
- for (Contribution contribution: workspace.getContributions()) {
- ModelResolver resolver = contribution.getModelResolver();
-// for (Artifact artifact : contribution.getArtifacts()){
-// logger.log(Level.INFO,"artifact - " + artifact.getURI());
-// }
- Artifact resolvedArtifact = resolver.resolveModel(Artifact.class, compositeFile);
- if (!resolvedArtifact.isUnresolved() && resolvedArtifact.getModel() instanceof Composite) {
-
- if (!composite.isUnresolved()) {
-
- // The composite content was passed into the node and read into a composite model,
- // don't use the composite found in the contribution, use that composite, but just resolve
- // it within the context of the contribution
- compositeProcessor.resolve(composite, resolver);
-
- } else {
-
- // Use the resolved composite we've found in the contribution
- composite = (Composite)resolvedArtifact.getModel();
- }
- found = true;
- break;
- }
- }
- if (!found) {
- throw new IllegalArgumentException("Composite not found: " + composite.getURI());
- }
-
- // Build the composite and wire the components included in it
- compositeBuilder.build(composite, systemDefinitions, monitor);
- analyzeProblems();
-
- // Create a top level composite to host our composite
- // This is temporary to make the activator happy
- Composite tempComposite = assemblyFactory.createComposite();
- tempComposite.setName(new QName("http://tempuri.org", "temp"));
- tempComposite.setURI("http://tempuri.org");
-
- // Include the node composite in the top-level composite
- tempComposite.getIncludes().add(composite);
-
- // Set the top level composite on the composite activator as
- // logic in callable reference resolution relies on this being
- // available
- compositeActivator.setDomainComposite(tempComposite);
- }
-
- public void start() {
- logger.log(Level.INFO, "Starting node: " + configurationName);
-
- try {
-
- // Activate the composite
- compositeActivator.activate(composite);
-
- // Start the composite
- compositeActivator.start(composite);
-
- } catch (ActivationException e) {
- throw new IllegalStateException(e);
- }
-
- }
-
- public void stop() {
- logger.log(Level.INFO, "Stopping node: " + configurationName);
-
- try {
-
- // Stop the composite
- compositeActivator.stop(composite);
-
- // Deactivate the composite
- compositeActivator.deactivate(composite);
-
- } catch (ActivationException e) {
- throw new IllegalStateException(e);
- }
-
- }
-
- public void destroy() {
- // Stop the runtime modules
- for (ModuleActivator moduleActivator: moduleActivators) {
- moduleActivator.stop(extensionPoints);
- }
-
- // Stop and destroy the work manager
- workScheduler.destroy();
- }
-
- public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
- return (R)proxyFactory.cast(target);
- }
-
- public <B> B getService(Class<B> businessInterface, String serviceName) {
-
- ServiceReference<B> serviceReference = getServiceReference(businessInterface, serviceName);
- if (serviceReference == null) {
- throw new ServiceRuntimeException("Service not found: " + serviceName);
- }
- return serviceReference.getService();
- }
-
- public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String name) {
-
- // Extract the component name
- String componentName;
- String serviceName;
- int i = name.indexOf('/');
- if (i != -1) {
- componentName = name.substring(0, i);
- serviceName = name.substring(i + 1);
-
- } else {
- componentName = name;
- serviceName = null;
- }
-
- // Lookup the component
- Component component = null;
-
- for (Component compositeComponent : composite.getComponents()) {
- if (compositeComponent.getName().equals(componentName)) {
- component = compositeComponent;
- }
- }
-
- if (component == null) {
- throw new ServiceRuntimeException("The service " + name + " has not been contributed to the domain");
- }
- RuntimeComponentContext componentContext = null;
-
- // If the component is a composite, then we need to find the
- // non-composite component that provides the requested service
- if (component.getImplementation() instanceof Composite) {
- for (ComponentService componentService : component.getServices()) {
- if (serviceName == null || serviceName.equals(componentService.getName())) {
- CompositeService compositeService = (CompositeService)componentService.getService();
- if (compositeService != null) {
- if (serviceName != null) {
- serviceName = "$promoted$" + component.getName() + "$slash$" + serviceName;
- }
- componentContext =
- ((RuntimeComponent)compositeService.getPromotedComponent()).getComponentContext();
- return componentContext.createSelfReference(businessInterface, compositeService
- .getPromotedService());
- }
- break;
- }
- }
- // No matching service found
- throw new ServiceRuntimeException("Composite service not found: " + name);
- } else {
- componentContext = ((RuntimeComponent)component).getComponentContext();
- if (serviceName != null) {
- return componentContext.createSelfReference(businessInterface, serviceName);
- } else {
- return componentContext.createSelfReference(businessInterface);
- }
- }
- }
-
- /**
- * Analyze problems reported by the artifact processors and builders.
- *
- * @throws Exception
- */
- private void analyzeProblems() throws Exception {
- for (Problem problem : monitor.getProblems()) {
- if ((problem.getSeverity() == Severity.ERROR) && (!problem.getMessageId().equals("SchemaError"))) {
- if (problem.getCause() != null) {
- throw problem.getCause();
- } else {
- throw new ServiceRuntimeException(problem.toString());
- }
- }
- }
- }
-
- /*
- * Sets a default composite by using any deployable one.
- */
- private void setDefaultComposite(ConfiguredNodeImplementation configuration, Workspace workspace) {
- // just use the first deployable composte
- for (Contribution contribution : workspace.getContributions()) {
- for (Composite c : contribution.getDeployables()) {
- composite = assemblyFactory.createComposite();
- composite.setURI(c.getURI());
- composite.setUnresolved(true);
- configuration.setComposite(composite);
- return;
- }
- }
- throw new ServiceRuntimeException("no deployable composite found");
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java b/tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java
deleted file mode 100644
index 396d77af66..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.impl;
-
-import java.net.URI;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-
-/**
- * NodeUtil
- *
- * @version $Rev: $ $Date: $
- */
-public class NodeUtil {
- private static final Logger logger = Logger.getLogger(NodeImpl.class.getName());
-
- static Contribution contribution(ContributionFactory contributionFactory, org.apache.tuscany.sca.node.Contribution c) {
- Contribution contribution = contributionFactory.createContribution();
- contribution.setURI(c.getURI());
- contribution.setLocation(c.getLocation());
- contribution.setUnresolved(true);
- return contribution;
- }
-
- /**
- * Escape the space in URL string
- * @param uri
- * @return
- */
- static URI createURI(String uri) {
- if (uri.indexOf(' ') != -1) {
- uri = uri.replace(" ", "%20");
- }
- return URI.create(uri);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory b/tags/java/sca/2.0-M1/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory
deleted file mode 100644
index 800bdd84cc..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT 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.tuscany.sca.node.impl.NodeFactoryImpl \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/src/test/java/hello/HelloWorld.java b/tags/java/sca/2.0-M1/modules/node-impl/src/test/java/hello/HelloWorld.java
deleted file mode 100644
index e3fcdfd25f..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/src/test/java/hello/HelloWorld.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package hello;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * HelloWorld interface
- */
-@Remotable
-public interface HelloWorld {
- String hello(String name);
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/src/test/java/hello/HelloWorldImpl.java b/tags/java/sca/2.0-M1/modules/node-impl/src/test/java/hello/HelloWorldImpl.java
deleted file mode 100644
index c9a7560b12..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/src/test/java/hello/HelloWorldImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package hello;
-
-/**
- * HelloWorldImpl
- */
-public class HelloWorldImpl implements HelloWorld {
- public String hello(String name) {
- System.out.println("Hello: " + name);
- return "Hello, " + name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java b/tags/java/sca/2.0-M1/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
deleted file mode 100644
index f35fa3fe6a..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * \"License\"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.impl;
-
-import hello.HelloWorld;
-
-import java.io.File;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Test case for NodeImpl
- */
-public class NodeImplTestCase {
- private static String composite =
- "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"" + " xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\""
- + " targetNamespace=\"http://sample/composite\""
- + " xmlns:sc=\"http://sample/composite\""
- + " name=\"HelloWorld\">"
- + " <component name=\"HelloWorld\">"
- + " <implementation.java class=\"hello.HelloWorldImpl\"/>"
- + " </component>"
- + " </composite>";
-
- @Test
- public void testNodeWithCompositeContent() {
- NodeFactory factory = new NodeFactoryImpl();
- Contribution contribution = new Contribution("c1", new File("target/test-classes").toURI().toString());
- String compositeURI = "HelloWorld.composite";
- Node node = factory.createNode(compositeURI, composite, contribution);
- testNode(node);
- }
-
- @Test
- public void testNodeWithRelativeCompositeURI() {
- NodeFactory factory = new NodeFactoryImpl();
- Contribution contribution = new Contribution("c1", new File("target/test-classes").toURI().toString());
- String compositeURI = "HelloWorld.composite";
- Node node = factory.createNode(compositeURI, contribution);
- testNode(node);
- }
-
- @Test
- public void testDefaultNode() {
- testNode(new NodeFactoryImpl().createNode());
- }
-
- private void testNode(Node node) {
- node.start();
- HelloWorld hw = node.getService(HelloWorld.class, "HelloWorld");
- Assert.assertEquals("Hello, Node", hw.hello("Node"));
- node.stop();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/src/test/resources/HelloWorld.composite b/tags/java/sca/2.0-M1/modules/node-impl/src/test/resources/HelloWorld.composite
deleted file mode 100644
index 9e3299d691..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/src/test/resources/HelloWorld.composite
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/composite"
- xmlns:sc="http://sample/composite"
- name="HelloWorld">
-
- <component name="HelloWorld">
- <implementation.java class="hello.HelloWorldImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/modules/node-impl/src/test/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M1/modules/node-impl/src/test/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 1d37bcebe0..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-impl/src/test/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT 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" xmlns:sc="http://sample/composite">
- <deployable composite="sc:HelloWorld" />
-</contribution>
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/LICENSE b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/META-INF/MANIFEST.MF
deleted file mode 100644
index 18e619c559..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.node.equinox.launcher;uses:="or
- g.osgi.framework,org.eclipse.core.runtime.adaptor";version="2.0.0"
-Eclipse-AutoStart: true
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Node Equinox OSGi Launcher
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397473703
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Node Equinox OSGi Launcher
-Import-Package: org.apache.commons.cli;resolution:=optional,
- org.apache.tuscany.sca.node.equinox.launcher;version="2.0.0",
- org.eclipse.core.runtime.adaptor,
- org.osgi.framework;version="1.4"
-Bundle-SymbolicName: org.apache.tuscany.sca.node.launcher.equinox
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/NOTICE b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/pom.xml b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/pom.xml
deleted file mode 100644
index 38f5bcb243..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/pom.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <name>Apache Tuscany SCA Node Equinox OSGi Launcher</name>
-
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- <version>3.3.0-v20070530</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>runtime</artifactId>
- <version>3.3.100-v20070530</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- <version>1.0.0-v20070606</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>1.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility-equinox</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <!-- dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-http-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency-->
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <mainClass>org.apache.tuscany.sca.node.equinox.launcher.NodeMain</mainClass>
- <addClasspath>true</addClasspath>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/Contribution.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/Contribution.java
deleted file mode 100644
index 892412b395..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/Contribution.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-/**
- * Represents an SCA contribution uri + location.
- *
- * @version $Rev$ $Date$
- */
-public final class Contribution {
- private String uri;
- private String location;
-
- /**
- * Constructs a new SCA contribution.
- *
- * @param uri
- * @param location
- */
- public Contribution(String uri, String location) {
- this.uri = uri;
- this.location = location;
- }
-
- public String getURI() {
- return uri;
- }
-
- public String getLocation() {
- return location;
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/ContributionLocationHelper.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/ContributionLocationHelper.java
deleted file mode 100644
index fd7aaed4c8..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/ContributionLocationHelper.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-import java.io.File;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import org.osgi.framework.Bundle;
-
-/**
- * ContributionLocationHelper
- *
- * @version $Rev: $ $Date: $
- */
-public class ContributionLocationHelper {
-
- /**
- * Returns the location of the SCA contribution containing the given class.
- *
- * @param anchorClass
- * @return
- */
- public static String getContributionLocation(final Class<?> anchorClass) {
- URL url = AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- return anchorClass.getProtectionDomain().getCodeSource().getLocation();
- }
- });
- String uri = url.toString();
- return uri;
- }
-
- /**
- * Returns the location of the SCA contribution represented by the given bundle.
- *
- * @param anchorClass
- * @return
- */
- public static String getContributionLocation(final Bundle bundle) {
- String uri = bundle.getLocation();
- uri = uri.substring(uri.indexOf("file:") + 5);
- File file = new File(uri);
- uri = file.toURI().toString();
- return uri;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/DomainManagerLauncher.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/DomainManagerLauncher.java
deleted file mode 100644
index e6f59e1b07..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/DomainManagerLauncher.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.domainManager;
-
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Simple launcher for the SCA domain manager.
- *
- * @version $Rev$ $Date$
- */
-public class DomainManagerLauncher {
-
- static final Logger logger = Logger.getLogger(DomainManagerLauncher.class.getName());
-
- /**
- * Constructs a new DomainManagerLauncher.
- */
- private DomainManagerLauncher() {
- }
-
- /**
- * Returns a new launcher instance.
- *
- * @return a new launcher instance
- */
- public static DomainManagerLauncher newInstance() {
- return new DomainManagerLauncher();
- }
-
- /**
- * Creates a new DomainManager.
- *
- * @return a new DomainManager
- * @throws LauncherException
- */
- public <T> T createDomainManager() throws LauncherException {
- return (T)domainManager(".");
- }
-
- /**
- * Creates a new DomainManager.
- *
- * @param rootDirectory the domain's root configuration directory
- *
- * @return a new DomainManager
- * @throws LauncherException
- */
- public <T> T createDomainManager(String rootDirectory) throws LauncherException {
- return (T)domainManager(rootDirectory);
- }
-
- public static void main(String[] args) throws Exception {
- logger.info("Apache Tuscany SCA Domain Manager is starting...");
-
- // Create a launcher
- DomainManagerLauncher launcher = newInstance();
-
- EquinoxHost equinox = null;
- Object domainManager = null;
- ShutdownThread shutdown = null;
- try {
-
- // Start the OSGi host
- equinox = new EquinoxHost();
- equinox.start();
-
- // Start the domain manager
- domainManager = launcher.createDomainManager();
- try {
- domainManager.getClass().getMethod("start").invoke(domainManager);
- } catch (Exception e) {
- logger.log(Level.SEVERE, "SCA Domain Manager could not be started", e);
- throw e;
- }
- logger.info("SCA Domain Manager is now started.");
-
- // Install a shutdown hook
- ShutdownThread hook = new ShutdownThread(domainManager, equinox);
- Runtime.getRuntime().addShutdownHook(hook);
-
- 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 domain manager and OSGi host
- if (domainManager != null) {
- stopDomainManager(domainManager);
- }
- if (equinox != null) {
- equinox.stop();
- }
- }
- }
-
-
- /**
- * Stop the given domain manager.
- *
- * @param domainManager
- * @throws Exception
- */
- private static void stopDomainManager(Object domainManager) throws Exception {
- try {
- domainManager.getClass().getMethod("stop").invoke(domainManager);
- logger.info("SCA Domain Manager is now stopped.");
- } catch (Exception e) {
- logger.log(Level.SEVERE, "SCA Domain Manager could not be stopped", e);
- throw e;
- }
- }
-
- private static class ShutdownThread extends Thread {
- private Object domainManager;
- private EquinoxHost equinox;
-
- public ShutdownThread(Object domainManager, EquinoxHost equinox) {
- super();
- this.domainManager = domainManager;
- this.equinox = equinox;
- }
-
- @Override
- public void run() {
- try {
- stopDomainManager(domainManager);
- } catch (Exception e) {
- // Ignore
- }
- try {
- equinox.stop();
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java
deleted file mode 100644
index bef3230181..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 java.lang.System.currentTimeMillis;
-import static java.lang.System.setProperty;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.LAUNCHER_EQUINOX_LIBRARIES;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.artifactId;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.bundleName;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.file;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.fixupBundle;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.jarVersion;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.runtimeClasspathEntries;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.string;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.thirdPartyLibraryBundle;
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.thisBundleLocation;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.UUID;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.eclipse.core.runtime.adaptor.EclipseStarter;
-import org.eclipse.core.runtime.adaptor.LocationManager;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-
-/**
- * Wraps the Equinox runtime.
- */
-public class EquinoxHost {
- private static Logger logger = Logger.getLogger(EquinoxHost.class.getName());
-
- static {
- if (getSystemProperty("osgi.debug") != null) {
- logger.setLevel(Level.FINE);
- }
- }
-
- private BundleContext bundleContext;
- private Bundle launcherBundle;
- private boolean startedEclipse;
- private List<URL> bundleFiles = new ArrayList<URL>();
- private List<String> bundleNames = new ArrayList<String>();
- private Collection<URL> jarFiles = new HashSet<URL>();
- private Map<String, Bundle> allBundles = new HashMap<String, Bundle>();
- private List<Bundle> installedBundles = new ArrayList<Bundle>();
-
- private Set<URL> bundleLocations;
- private boolean aggregateThirdPartyJars = false;
-
- public EquinoxHost() {
- super();
- }
-
- public EquinoxHost(Set<URL> urls) {
- super();
- this.bundleLocations = urls;
- }
-
- private static String getSystemProperty(final String name) {
- return AccessController.doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty(name);
- }
- });
- }
-
- private static Properties getSystemProperties() {
- return AccessController.doPrivileged(new PrivilegedAction<Properties>() {
- public Properties run() {
- Properties props = new Properties();
- for (Map.Entry<Object, Object> e : System.getProperties().entrySet()) {
- if (e.getKey() instanceof String) {
- String prop = (String)e.getKey();
- if (prop.startsWith("osgi.") || prop.startsWith("eclipse.")) {
- props.put(prop, e.getValue());
- }
- }
- }
- return props;
- }
- });
- }
-
- private static void put(Properties props, String key, String value) {
- if (!props.contains(key)) {
- props.put(key, value);
- }
- }
-
- /**
- * Start the Equinox host.
- *
- * @return
- */
- public BundleContext start() {
- try {
- if (!EclipseStarter.isRunning()) {
-
- String version = getSystemProperty("java.specification.version");
- String profile = "J2SE-1.5.profile";
- if (version.startsWith("1.6")) {
- profile = "JavaSE-1.6.profile";
- }
- Properties props = new Properties();
- InputStream is = getClass().getResourceAsStream(profile);
- if (is != null) {
- props.load(is);
- is.close();
- }
-
- props.putAll(getSystemProperties());
-
- // Configure Eclipse properties
-
- // Use the boot classloader as the parent classloader
- put(props, "osgi.contextClassLoaderParent", "app");
-
- // Set startup properties
- put(props, EclipseStarter.PROP_CLEAN, "true");
-
- // Set location properties
- // FIXME Use proper locations
- String tmpDir = getSystemProperty("java.io.tmpdir");
- File root = new File(tmpDir, ".tuscany/equinox/" + UUID.randomUUID().toString());
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Equinox location: " + root);
- }
-
- put(props, LocationManager.PROP_INSTANCE_AREA_DEFAULT, new File(root, "workspace").toURI().toString());
- put(props, LocationManager.PROP_INSTALL_AREA, new File(root, "install").toURI().toString());
- put(props, LocationManager.PROP_CONFIG_AREA_DEFAULT, new File(root, "config").toURI().toString());
- put(props, LocationManager.PROP_USER_AREA_DEFAULT, new File(root, "user").toURI().toString());
-
- EclipseStarter.setInitialProperties(props);
-
- // Test if the configuration/config.ini or osgi.bundles has been set
- // If yes, try to avoid discovery of bundles
- if (bundleLocations == null) {
- if (props.getProperty("osgi.bundles") != null) {
- bundleLocations = Collections.emptySet();
- } else {
- String config = props.getProperty(LocationManager.PROP_CONFIG_AREA);
- File ini = new File(config, "config.ini");
- if (ini.isFile()) {
- Properties iniProps = new Properties();
- iniProps.load(new FileInputStream(ini));
- if (iniProps.getProperty("osgi.bundles") != null) {
- bundleLocations = Collections.emptySet();
- }
- }
- }
- }
-
- // Start Eclipse
- bundleContext = EclipseStarter.startup(new String[] {}, null);
- startedEclipse = true;
-
- } else {
-
- // Get bundle context from the running Eclipse instance
- bundleContext = EclipseStarter.getSystemBundleContext();
- }
-
- // Determine the runtime classpath entries
- Set<URL> urls;
- urls = findBundleLocations();
-
- // Sort out which are bundles (and not already installed) and which are just
- // regular JARs
- for (URL url : urls) {
- File file = file(url);
- String bundleName = bundleName(file);
- if (bundleName != null) {
- bundleFiles.add(url);
- bundleNames.add(bundleName);
- } else {
- if (file.isFile()) {
- jarFiles.add(url);
- }
- }
- }
-
- // Get the already installed bundles
- for (Bundle bundle : bundleContext.getBundles()) {
- allBundles.put(bundle.getSymbolicName(), bundle);
- }
-
- // Install the launcher bundle if necessary
- String launcherBundleName = "org.apache.tuscany.sca.node.launcher.equinox";
- String launcherBundleLocation;
- launcherBundle = allBundles.get(launcherBundleName);
- if (launcherBundle == null) {
- launcherBundleLocation = thisBundleLocation();
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Installing launcher bundle: " + launcherBundleLocation);
- }
- fixupBundle(launcherBundleLocation);
- launcherBundle = bundleContext.installBundle(launcherBundleLocation);
- allBundles.put(launcherBundleName, launcherBundle);
- installedBundles.add(launcherBundle);
- } else {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Launcher bundle is already installed: " + string(launcherBundle, false));
- }
- // launcherBundleLocation = thisBundleLocation(launcherBundle);
- }
-
- // FIXME: SDO bundles dont have the correct dependencies
- setProperty("commonj.sdo.impl.HelperProvider", "org.apache.tuscany.sdo.helper.HelperProviderImpl");
-
- // Install the Tuscany bundles
- long start = currentTimeMillis();
-
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Generating third-party library bundle.");
- }
- long libraryStart = currentTimeMillis();
- if (!aggregateThirdPartyJars) {
- for (URL jarFile : jarFiles) {
- installAsBundle(jarFile, null);
- }
- } else {
- installAsBundle(jarFiles, LAUNCHER_EQUINOX_LIBRARIES);
- }
- if (logger.isLoggable(Level.FINE)) {
- logger
- .fine("Third-party library bundle installed in " + (currentTimeMillis() - libraryStart) + " ms: ");
- }
-
- // Install all the other bundles that are not already installed
- for (URL bundleFile: bundleFiles) {
- fixupBundle(bundleFile.toString());
- }
- for (int i = 0, n = bundleFiles.size(); i < n; i++) {
- URL bundleFile = bundleFiles.get(i);
- String bundleName = bundleNames.get(i);
- if (bundleName.contains("org.eclipse.jdt.junit")) {
- continue;
- }
- installBundle(bundleFile, bundleName);
- }
-
- long end = currentTimeMillis();
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Tuscany bundles are installed in " + (end - start) + " ms.");
- }
-
- // Start the extensiblity and launcher bundles
- String extensibilityBundleName = "org.apache.tuscany.sca.extensibility.equinox";
- Bundle extensibilityBundle = allBundles.get(extensibilityBundleName);
- if ((extensibilityBundle.getState() & Bundle.ACTIVE) == 0) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Starting bundle: " + string(extensibilityBundle, false));
- }
- extensibilityBundle.start();
- } else if (logger.isLoggable(Level.FINE)) {
- logger.fine("Bundle is already started: " + string(extensibilityBundle, false));
- }
- if ((launcherBundle.getState() & Bundle.ACTIVE) == 0) {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Starting bundle: " + string(launcherBundle, false));
- }
- launcherBundle.start();
- } else if (logger.isLoggable(Level.FINE)) {
- logger.fine("Bundle is already started: " + string(launcherBundle, false));
- }
-
- // Start all our bundles for now to help diagnose any class loading issues
- // for (Bundle bundle: bundleContext.getBundles()) {
- // if (bundle.getSymbolicName().startsWith("org.apache.tuscany.sca")) {
- // if ((bundle.getState() & Bundle.ACTIVE) == 0) {
- // if (logger.isLoggable(Level.FINE)) {
- // logger.fine("Starting bundle: " + string(bundle, false));
- // }
- // try {
- // //bundle.start();
- // } catch (Exception e) {
- // logger.log(Level.SEVERE, e.getMessage(), e);
- // // throw e;
- // }
- // if (logger.isLoggable(Level.FINE)) {
- // logger.fine("Bundle: " + string(bundle, false));
- // }
- // }
- // }
- // }
- // logger.fine("Tuscany bundles are started in " + (System.currentTimeMillis() - activateStart) + " ms.");
- return bundleContext;
-
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- public Bundle installAsBundle(Collection<URL> jarFiles, String libraryBundleName) throws IOException,
- BundleException {
- // Install a single 'library' bundle for the third-party JAR files
- Bundle libraryBundle = allBundles.get(libraryBundleName);
- if (libraryBundle == null) {
- InputStream library = thirdPartyLibraryBundle(jarFiles, libraryBundleName, null);
- libraryBundle = bundleContext.installBundle(libraryBundleName, library);
- allBundles.put(libraryBundleName, libraryBundle);
- installedBundles.add(libraryBundle);
- } else {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Third-party library bundle is already installed: " + string(libraryBundle, false));
- }
- }
- return libraryBundle;
- }
-
- public Collection<String> collectJarsFromManifestClassPath() {
- return null;
- }
-
- public void installBundle(URL bundleFile, String bundleName) throws MalformedURLException, BundleException {
- Bundle bundle = allBundles.get(bundleName);
- if (bundle == null) {
- long installStart = currentTimeMillis();
- String location = bundleFile.toString();
- if ("file".equals(bundleFile.getProtocol())) {
- File target = file(bundleFile);
- // Use a special "reference" scheme to install the bundle as a reference
- // instead of copying the bundle
- location = "reference:file:/" + target.getPath();
- }
- bundle = bundleContext.installBundle(location);
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Bundle installed in " + (currentTimeMillis() - installStart)
- + " ms: "
- + string(bundle, false));
- }
- allBundles.put(bundleName, bundle);
- installedBundles.add(bundle);
- }
- }
-
- public Bundle installAsBundle(URL jarFile, String symbolicName) throws IOException, BundleException {
- if (symbolicName == null) {
- symbolicName = LAUNCHER_EQUINOX_LIBRARIES + "." + artifactId(jarFile);
- }
- Bundle bundle = allBundles.get(symbolicName);
- if (bundle == null) {
- String version = jarVersion(jarFile);
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Installing third-party jar as bundle: " + jarFile);
- }
- InputStream is = thirdPartyLibraryBundle(Collections.singleton(jarFile), symbolicName, version);
- bundle = bundleContext.installBundle(symbolicName, is);
- allBundles.put(symbolicName, bundle);
- installedBundles.add(bundle);
- }
- return bundle;
- }
-
- private Set<URL> findBundleLocations() throws FileNotFoundException, URISyntaxException, MalformedURLException {
- if (bundleLocations == null) {
- if (!startedEclipse) {
-
- // Use classpath entries from a distribution if there is one and the modules
- // directories available in a dev environment for example
- bundleLocations = runtimeClasspathEntries(true, false, true);
- } else {
-
- // Use classpath entries from a distribution if there is one and the classpath
- // entries on the current application's classloader
- bundleLocations = runtimeClasspathEntries(true, true, false);
- }
- }
- return bundleLocations;
- }
-
- /**
- * Stop the Equinox host.
- */
- public void stop() {
- try {
-
- // Uninstall all the bundles we've installed
- for (int i = installedBundles.size() - 1; i >= 0; i--) {
- Bundle bundle = installedBundles.get(i);
- try {
- if (logger.isLoggable(Level.FINE)) {
- logger.fine("Uninstalling bundle: " + string(bundle, false));
- }
- bundle.uninstall();
- } catch (Exception e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- }
- installedBundles.clear();
-
- // Shutdown Eclipse if we started it ourselves
- if (startedEclipse) {
- startedEclipse = false;
- EclipseStarter.shutdown();
- }
-
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- public void setBundleLocations(Set<URL> bundleLocations) {
- this.bundleLocations = bundleLocations;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherException.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherException.java
deleted file mode 100644
index b9bb70b5d7..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-
-/**
- * Denotes an error launching an SCA domain manager or node.
- *
- * @version $Rev$ $Date$
- */
-public class LauncherException extends Exception {
- private static final long serialVersionUID = 4581189418849190567L;
-
- public LauncherException() {
- super();
- }
-
- /**
- * @param message
- * @param cause
- */
- public LauncherException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * @param message
- */
- public LauncherException(String message) {
- super(message);
- }
-
- /**
- * @param cause
- */
- public LauncherException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeDaemonLauncher.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeDaemonLauncher.java
deleted file mode 100644
index aeb29c0789..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeDaemonLauncher.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.nodeDaemon;
-
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A launcher for the SCA Node daemon.
- *
- * @version $Rev$ $Date$
- */
-public class NodeDaemonLauncher {
-
- static final Logger logger = Logger.getLogger(NodeDaemonLauncher.class.getName());
-
- /**
- * Constructs a new node daemon launcher.
- */
- private NodeDaemonLauncher() {
- }
-
- /**
- * Returns a new launcher instance.
- *
- * @return a new launcher instance
- */
- public static NodeDaemonLauncher newInstance() {
- return new NodeDaemonLauncher();
- }
-
- /**
- * Creates a new node daemon.
- *
- * @param
- * @return a new node daemon
- * @throws LauncherException
- */
- public <T> T createNodeDaemon() throws LauncherException {
- return (T)nodeDaemon();
- }
-
- public static void main(String[] args) throws Exception {
- logger.info("Apache Tuscany SCA Node Daemon is starting...");
-
- // Create a node launcher
- NodeDaemonLauncher launcher = newInstance();
-
- EquinoxHost equinox = null;
- Object node = null;
- ShutdownThread shutdown = null;
- try {
-
- // Start the OSGi host
- equinox = new EquinoxHost();
- equinox.start();
-
- // Start the node
- node = launcher.createNodeDaemon();
- try {
- node.getClass().getMethod("start").invoke(node);
- } catch (Exception e) {
- logger.log(Level.SEVERE, "SCA Node Daemon could not be started", e);
- throw e;
- }
- logger.info("SCA Node Daemon 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) {
- stopNode(node);
- }
- if (equinox != null) {
- equinox.stop();
- }
- }
- }
-
- /**
- * Stop the given node.
- *
- * @param node
- * @throws Exception
- */
- private static void stopNode(Object node) throws Exception {
- try {
- node.getClass().getMethod("stop").invoke(node);
- logger.info("SCA Node Daemon is now stopped.");
- } catch (Exception e) {
- logger.log(Level.SEVERE, "SCA Node Daemon 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 {
- stopNode(node);
- } catch (Exception e) {
- // Ignore
- }
- try {
- equinox.stop();
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
deleted file mode 100644
index 04d77bcdd5..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.PosixParser;
-import org.osgi.framework.BundleContext;
-
-/**
- * A launcher for SCA nodes.
- *
- * Agruments:
- * [-config <equinoxConfiguration>]: The configuration folder for Equinox
- * [-c <compositeURI>]: The composite URI
- * [-t <ttl>]: Time to live in milliseconds before the node is started
- * contribution1 ... contributionN: A list of contribution files or URLs
- *
- * @version $Rev$ $Date$
- */
-public class NodeLauncher {
-
- static final Logger logger = Logger.getLogger(NodeLauncher.class.getName());
- private EquinoxHost equinoxHost;
- private BundleContext bundleContext;
-
- /**
- * Constructs a new node launcher.
- */
- private NodeLauncher() {
- equinoxHost = new EquinoxHost();
- bundleContext = equinoxHost.start();
- }
-
- /**
- * Returns a new launcher instance.
- *
- * @return a new launcher instance
- */
- public static NodeLauncher newInstance() {
- return new NodeLauncher();
- }
-
- /**
- * 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 {
- CommandLineParser parser = new PosixParser();
- Options options = getCommandLineOptions();
- CommandLine cli = parser.parse(options, args);
-
- Object node = null;
- ShutdownThread shutdown = null;
- EquinoxHost equinox = null;
- try {
-
- if (cli.hasOption("config")) {
- System.setProperty("osgi.configuration.area", cli.getOptionValue("config"));
- }
- while (true) {
- if (cli.hasOption("node")) {
- // Create a node from a configuration URI
- String configurationURI = cli.getOptionValue("node");
- logger.info("SCA Node configuration: " + configurationURI);
-
- // Create a node launcher
- NodeLauncher launcher = newInstance();
- equinox = launcher.equinoxHost;
-
- node = launcher.createNode(configurationURI);
- } else {
- // Create a node from a composite URI and a contribution location
- String compositeURI = cli.getOptionValue("composite");
- List<String> contribs = cli.getArgList();
- Contribution[] contributions = null;
- if (!contribs.isEmpty()) {
- contributions = new Contribution[contribs.size()];
- int index = 0;
- for (String contrib : contribs) {
- logger.info("SCA contribution: " + contrib);
- URL url = null;
- try {
- url = new URL(contrib);
- } catch (MalformedURLException e) {
- url = new File(contrib).toURI().toURL();
- }
- contributions[index] = new Contribution("contribution-" + index, url.toString());
- index++;
- }
- } else {
- HelpFormatter formatter = new HelpFormatter();
- formatter.setSyntaxPrefix("Usage: ");
- formatter.printHelp("java " + NodeLauncher.class.getName()
- + " [-config <equinoxConfiguration>]"
- + " [-c <compositeURI>]"
- + " [-t <ttl>]"
- + " contribution1 ... contributionN", options);
- return;
- }
- // Create a node launcher
- logger.info("SCA composite: " + compositeURI);
- NodeLauncher launcher = newInstance();
- equinox = launcher.equinoxHost;
- node = launcher.createNode(compositeURI, contributions);
- }
-
- logger.info("Apache Tuscany SCA Node is starting...");
-
- // 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);
-
- long ttl = Long.parseLong(cli.getOptionValue("ttl", "-1"));
- if (ttl >= 0) {
- logger.info("Waiting for " + ttl + " milliseconds ...");
- Thread.sleep(ttl);
- break; // Exit
- }
-
- // Wait until the "Enter" is pressed
- logger.info("Press 'q' to quit, 'r' to restart.");
- int k = 0;
- try {
- while ((k != 'q') && (k != 'r')) {
- k = System.in.read();
- }
- } catch (IOException e) {
-
- // Wait forever
- Object lock = new Object();
- synchronized (lock) {
- lock.wait();
- }
- }
-
- // Stop the node
- if (node != null) {
- Object n = node;
- node = null;
- stopNode(n);
- }
-
- // Quit
- if (k == 'q') {
- break;
- }
-
- }
- } 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();
- }
- }
- }
-
- static Options getCommandLineOptions() {
- Options options = new Options();
- Option opt1 = new Option("c", "composite", true, "URI for the composite");
- opt1.setArgName("compositeURI");
- options.addOption(opt1);
- Option opt2 = new Option("n", "node", true, "URI for the node configuration");
- opt2.setArgName("nodeConfigurationURI");
- options.addOption(opt2);
- Option opt3 = new Option("config", "configuration", true, "Configuration");
- opt3.setArgName("equinoxConfiguration");
- options.addOption(opt3);
- Option opt4 = new Option("t", "ttl", true, "Time to live");
- opt4.setArgName("timeToLiveInMilliseconds");
- // opt4.setType(long.class);
- options.addOption(opt4);
-
- return options;
- }
-
- 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
- }
- }
- }
-
- /**
- * Stop the given node.
- *
- * @param node
- * @throws Exception
- */
- private static void stopNode(Object node) throws Exception {
- try {
- node.getClass().getMethod("stop").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;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher2.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher2.java
deleted file mode 100644
index fc299b3d53..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher2.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.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
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
deleted file mode 100644
index 45870dd183..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
+++ /dev/null
@@ -1,1100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.osgi.framework.Constants.BUNDLE_CLASSPATH;
-import static org.osgi.framework.Constants.BUNDLE_MANIFESTVERSION;
-import static org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME;
-import static org.osgi.framework.Constants.DYNAMICIMPORT_PACKAGE;
-import static org.osgi.framework.Constants.EXPORT_PACKAGE;
-import static org.osgi.framework.Constants.IMPORT_PACKAGE;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Constructor;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.JarInputStream;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-
-/**
- * Common functions and constants used by the admin components.
- *
- * @version $Rev$ $Date$
- */
-final class NodeLauncherUtil {
- private static final Logger logger = Logger.getLogger(NodeLauncherUtil.class.getName());
-
- static final String LAUNCHER_EQUINOX_LIBRARIES = "org.apache.tuscany.sca.node.launcher.equinox.libraries";
-
- private static final String NODE_FACTORY = "org.apache.tuscany.sca.node.NodeFactory";
-
- private static final String DOMAIN_MANAGER_LAUNCHER_BOOTSTRAP =
- "org.apache.tuscany.sca.domain.manager.launcher.DomainManagerLauncherBootstrap";
-
- private static final String NODE_IMPLEMENTATION_DAEMON_BOOTSTRAP =
- "org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationDaemonBootstrap";
-
- private static final String NODE_IMPLEMENTATION_LAUNCHER_BOOTSTRAP =
- "org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap";
-
- private static final String TUSCANY_HOME = "TUSCANY_HOME";
- private static final String TUSCANY_PATH = "TUSCANY_PATH";
-
- /**
- * Creates a new node.
- *
- * @param configurationURI
- * @param compositeURI
- * @param compositeContent
- * @param contributions
- * @param contributionClassLoader
- * @param bundleContext
- * @throws LauncherException
- */
- static Object node(String configurationURI,
- String compositeURI,
- String compositeContent,
- Contribution[] contributions,
- BundleContext bundleContext) throws LauncherException {
- try {
-
- // Get the node runtime bundle.
- Bundle bundle = null;
- for (Bundle b : bundleContext.getBundles()) {
- if ("org.apache.tuscany.sca.implementation.node.runtime".equals(b.getSymbolicName())) {
- bundle = b;
- break;
- }
- }
- if (bundle == null) {
- throw new IllegalStateException(
- "Bundle org.apache.tuscany.sca.implementation.node.runtime is not installed");
- }
-
- // Use Java reflection to create the node as only the runtime class
- // loader knows the runtime classes required by the node
- Class<?> bootstrapClass = bundle.loadClass(NODE_IMPLEMENTATION_LAUNCHER_BOOTSTRAP);
-
- Object bootstrap;
- if (configurationURI != null) {
-
- // Construct the node with a configuration URI
- bootstrap = bootstrapClass.getConstructor(String.class).newInstance(configurationURI);
-
- } else if (compositeContent != null) {
-
- // Construct the node with a composite URI, the composite content and
- // the URIs and locations of a list of contributions
- Constructor<?> constructor =
- bootstrapClass.getConstructor(String.class, String.class, String[].class, String[].class);
- String[] uris = new String[contributions.length];
- String[] locations = new String[contributions.length];
- for (int i = 0; i < contributions.length; i++) {
- uris[i] = contributions[i].getURI();
- locations[i] = contributions[i].getLocation();
- }
- bootstrap = constructor.newInstance(compositeURI, compositeContent, uris, locations);
-
- } else {
-
- // Construct the node with a composite URI and the URIs and
- // locations of a list of contributions
- Constructor<?> constructor =
- bootstrapClass.getConstructor(String.class, String[].class, String[].class);
- String[] uris = new String[contributions.length];
- String[] locations = new String[contributions.length];
- for (int i = 0; i < contributions.length; i++) {
- uris[i] = contributions[i].getURI();
- locations[i] = contributions[i].getLocation();
- }
- bootstrap = constructor.newInstance(compositeURI, uris, locations);
- }
-
- // Get the node instance
- Object node = bootstrapClass.getMethod("getNode").invoke(bootstrap);
-
- // If the SCANodeFactory interface is available in the current classloader, create
- // an SCANode proxy around the node we've just create
- try {
- Class<?> type = Class.forName(NODE_FACTORY);
- type = type.getDeclaredClasses()[0];
- return type.getMethod("createProxy", Class.class, Object.class).invoke(null, type, node);
- } catch (ClassNotFoundException e) {
- // Ignore
- }
- return node;
-
- } catch (Exception e) {
- NodeLauncher.logger.log(Level.SEVERE, "SCA Node could not be created", e);
- throw new LauncherException(e);
- }
- }
-
- /**
- * Creates a new node daemon.
- *
- * @throws LauncherException
- */
- static Object nodeDaemon() throws LauncherException {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
-
- // Use Java reflection to create the node daemon as only the runtime class
- // loader knows the runtime classes required by the node
- String className = NODE_IMPLEMENTATION_DAEMON_BOOTSTRAP;
- Class<?> bootstrapClass;
- bootstrapClass = Class.forName(className, false, tccl);
- Object bootstrap = bootstrapClass.getConstructor().newInstance();
-
- Object nodeDaemon = bootstrapClass.getMethod("getNode").invoke(bootstrap);
- return nodeDaemon;
-
- } catch (Exception e) {
- NodeDaemonLauncher.logger.log(Level.SEVERE, "SCA Node Daemon could not be created", e);
- throw new LauncherException(e);
- } finally {
- Thread.currentThread().setContextClassLoader(tccl);
- }
- }
-
- /**
- * Creates a new domain manager.
- *
- * @throws LauncherException
- */
- static Object domainManager(String rootDirectory) throws LauncherException {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
-
- // Use Java reflection to create the node daemon as only the runtime class
- // loader knows the runtime classes required by the node
- String className = DOMAIN_MANAGER_LAUNCHER_BOOTSTRAP;
- Class<?> bootstrapClass;
- bootstrapClass = Class.forName(className, false, tccl);
- Constructor<?> constructor = bootstrapClass.getConstructor(String.class);
- Object bootstrap = constructor.newInstance(rootDirectory);
-
- Object domainManager = bootstrapClass.getMethod("getNode").invoke(bootstrap);
- return domainManager;
-
- } catch (Exception e) {
- DomainManagerLauncher.logger.log(Level.SEVERE, "SCA Domain Manager could not be created", e);
- throw new LauncherException(e);
- } finally {
- Thread.currentThread().setContextClassLoader(tccl);
- }
- }
-
- /**
- * starting with -, then some digits, then . or - or _, then some digits again
- *
- */
- private static Pattern pattern = Pattern.compile("-(\\d)+((\\.|-|_)(\\d)+)*");
-
- /**
- * Returns the version number to use for the given JAR file.
- *
- * @param jarFile
- * @return
- */
- static String jarVersion(URL jarFile) {
- String name = jarFile.getFile();
- int index = name.lastIndexOf('/');
- if (index != -1) {
- // Find the last segment
- name = name.substring(index + 1);
- }
- index = name.lastIndexOf('.');
- if (index != -1) {
- // Trim the extension
- name = name.substring(0, index);
- }
-
- Matcher matcher = pattern.matcher(name);
- String version = "0.0.0";
- if (matcher.find()) {
- version = matcher.group();
- version = version.substring(1);
- }
- return version;
- }
-
- static String artifactId(URL jarFile) {
- String name = jarFile.getFile();
- int index = name.lastIndexOf('/');
- if (index != -1) {
- // Find the last segment
- name = name.substring(index + 1);
- }
- index = name.lastIndexOf('.');
- if (index != -1) {
- // Trim the extension
- name = name.substring(0, index);
- }
-
- Matcher matcher = pattern.matcher(name);
- if (matcher.find()) {
- return name.substring(0, matcher.start());
- } else {
- return name;
- }
- }
-
- /**
- * Add the packages found in the given JAR to a set.
- *
- * @param jarFile
- * @param packages
- * @throws IOException
- */
- private static void addPackages(URL jarFile, Set<String> packages, String version) throws IOException {
- if (version == null) {
- version = ";version=" + jarVersion(jarFile);
- } else {
- version = ";version=" + version;
- }
- File file = file(jarFile);
- if (file.isDirectory()) {
- List<String> classFiles = listClassFiles(file);
- for (String cls : classFiles) {
- int index = cls.lastIndexOf('/');
- if (index == -1) {
- // Default package cannot be exported
- continue;
- }
- String pkg = cls.substring(0, index);
- pkg = pkg.replace('/', '.') + version;
- packages.add(pkg);
- }
- } else if (file.isFile()) {
- ZipInputStream is = new ZipInputStream(new FileInputStream(file));
- ZipEntry entry;
- while ((entry = is.getNextEntry()) != null) {
- String entryName = entry.getName();
- if (!entry.isDirectory() && entryName != null
- && entryName.length() > 0
- && !entryName.startsWith(".")
- && entryName.endsWith(".class") // Exclude resources from Export-Package
- && entryName.lastIndexOf("/") > 0) {
- String pkg = entryName.substring(0, entryName.lastIndexOf("/")).replace('/', '.') + version;
- packages.add(pkg);
- }
- }
- is.close();
- }
- }
-
- private static List<String> listClassFiles(File directory) {
- List<String> artifacts = new ArrayList<String>();
- traverse(artifacts, directory, directory);
- return artifacts;
- }
-
- /**
- * Recursively traverse a root directory
- *
- * @param fileList
- * @param file
- * @param root
- * @throws IOException
- */
- private static void traverse(List<String> fileList, File file, File root) {
- if (file.isFile() && file.getName().endsWith(".class")) {
- fileList.add(root.toURI().relativize(file.toURI()).toString());
- } else if (file.isDirectory()) {
- String uri = root.toURI().relativize(file.toURI()).toString();
- if (uri.endsWith("/")) {
- uri = uri.substring(0, uri.length() - 1);
- }
- fileList.add(uri);
-
- File[] files = file.listFiles();
- for (File f : files) {
- if (!f.getName().startsWith(".")) {
- traverse(fileList, f, root);
- }
- }
- }
- }
-
- /**
- * Generate a manifest from a list of third-party JAR files.
- *
- * @param jarFiles
- * @param bundleSymbolicName The Bundle-SymbolicName
- * @param bundleVersion The Bundle-Version
- * @return
- * @throws IllegalStateException
- */
- static private Manifest thirdPartyLibraryBundleManifest(Collection<URL> jarFiles,
- String bundleSymbolicName,
- String bundleVersion) throws IllegalStateException {
- try {
-
- // List exported packages and bundle classpath entries
- StringBuffer classpath = new StringBuffer();
- StringBuffer exports = new StringBuffer();
- StringBuffer imports = new StringBuffer();
- Set<String> packages = new HashSet<String>();
-
- for (URL jarFile : jarFiles) {
- addPackages(jarFile, packages, bundleVersion);
- classpath.append("\"external:");
- classpath.append(file(jarFile).getPath().replace(File.separatorChar, '/'));
- classpath.append("\",");
- }
-
- Set<String> importPackages = new HashSet<String>();
- for (String pkg : packages) {
-
- String importPackage = pkg;
- int index = pkg.indexOf(';');
- if (index != -1) {
- importPackage = pkg.substring(0, index);
- }
- if (!importPackages.contains(importPackage)) {
- imports.append(importPackage);
- imports.append(',');
- importPackages.add(importPackage);
- exports.append(pkg);
- exports.append(',');
- } else {
- logger.warning("Duplicate package skipped: " + pkg);
- }
- }
-
- // Create a manifest
- Manifest manifest = new Manifest();
- Attributes attributes = manifest.getMainAttributes();
- attributes.putValue("Manifest-Version", "1.0");
- attributes.putValue(BUNDLE_MANIFESTVERSION, "2");
-
- if (bundleVersion == null) {
- bundleVersion = "0.0.0";
- }
- attributes.putValue(Constants.BUNDLE_VERSION, bundleVersion);
- if (bundleSymbolicName == null) {
- bundleSymbolicName = LAUNCHER_EQUINOX_LIBRARIES;
- }
- attributes.putValue(BUNDLE_SYMBOLICNAME, bundleSymbolicName);
- if (exports.length() > 0) {
- attributes.putValue(EXPORT_PACKAGE, exports.substring(0, exports.length() - 1));
- }
- if (imports.length() > 0) {
- attributes.putValue(IMPORT_PACKAGE, imports.substring(0, imports.length() - 1));
- }
- if (classpath.length() > 0) {
- attributes.putValue(BUNDLE_CLASSPATH, classpath.substring(0, classpath.length() - 1));
- }
- attributes.putValue(DYNAMICIMPORT_PACKAGE, "*");
-
- return manifest;
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- }
-
- /**
- * Generates a library bundle from a list of third-party JARs.
- *
- * @param jarFiles
- * @param bundleSymbolicName The Bundle-SymbolicName
- * @param bundleVersion The Bundle-Version
- * @return
- * @throws IOException
- */
- static InputStream thirdPartyLibraryBundle(Collection<URL> jarFiles,
- String bundleSymbolicName,
- String bundleVersion) throws IOException {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- Manifest mf = thirdPartyLibraryBundleManifest(jarFiles, bundleSymbolicName, bundleVersion);
- JarOutputStream jos = new JarOutputStream(bos, mf);
- jos.close();
- return new ByteArrayInputStream(bos.toByteArray());
- }
-
- /**
- * Returns the location of this bundle.
- *
- * @return
- * @throws IOException
- */
- static String thisBundleLocation() throws IOException, URISyntaxException {
- String resource = NodeLauncherUtil.class.getName().replace('.', '/') + ".class";
- URL url = NodeLauncherUtil.class.getClassLoader().getResource(resource);
- if (url == null) {
- throw new FileNotFoundException(resource);
- }
- URI uri = toURI(url);
-
- String scheme = uri.getScheme();
- if (scheme.equals("jar")) {
- String path = uri.toString().substring(4);
- int i = path.indexOf("!/");
- path = path.substring(0, i);
- return path;
- } else {
- String path = uri.toString();
- path = path.substring(0, path.length() - resource.length());
- return path;
- }
- }
-
- static URI toURI(URL url) {
- File file = file(url);
- if (file != null) {
- return file.toURI();
- } else {
- try {
- return url.toURI();
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException(e);
- }
- }
- }
-
- /**
- * Returns the location of this bundle.
- *
- * @param bundle
- * @return
- * @throws IOException
- */
- static String thisBundleLocation(Bundle bundle) throws IOException, URISyntaxException, ClassNotFoundException {
- String resource = NodeLauncherUtil.class.getName();
- Class<?> clazz = bundle.loadClass(NodeLauncherUtil.class.getName());
- URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
- if (url == null) {
- throw new FileNotFoundException(resource);
- }
- URI uri = toURI(url);
-
- String scheme = uri.getScheme();
- if (scheme.equals("jar")) {
- String path = uri.toString().substring(4);
- int i = path.indexOf("!/");
- path = path.substring(0, i);
- return path;
- } else {
- String path = uri.toString();
- //path = path.substring(0, path.length() - resource.length());
- return path;
- }
- }
-
- /**
- * Install the given bundle.
- *
- * @param bundleContext
- * @param location
- * @throws BundleException
- * @throws IOException
- */
- static void fixupBundle(String location) throws BundleException, IOException {
- File target = file(new URL(location));
- location = target.toURI().toString();
-
- // For development mode, copy the MANIFEST.MF file to the bundle location as it's
- // initially outside of target/classes, at the root of the project.
- if (location.endsWith("/target/classes/")) {
- File targetManifest = new File(target, "META-INF/MANIFEST.MF");
- File sourceManifest = new File(target.getParentFile().getParentFile(), "META-INF/MANIFEST.MF");
- targetManifest.getParentFile().mkdirs();
- OutputStream os = new FileOutputStream(targetManifest);
- InputStream is = new FileInputStream(sourceManifest);
- byte[] buf = new byte[2048];
- for (;;) {
- int l = is.read(buf);
- if (l == -1) {
- break;
- }
- os.write(buf, 0, l);
- }
- is.close();
- os.close();
- }
- }
-
- /**
- * Returns a string representation of the given bundle.
- *
- * @param b
- * @param verbose
- * @return
- */
- static String string(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();
- }
-
- /**
- * Returns the name of a bundle, or null if the given file is not a bundle.
- *
- * @param file
- * @return
- * @throws IOException
- */
- static String bundleName(File file) throws IOException {
- if (!file.exists()) {
- return null;
- }
- String bundleName = null;
- if (file.isDirectory()) {
- File mf = new File(file, "META-INF/MANIFEST.MF");
- if (mf.isFile()) {
- Manifest manifest = new Manifest(new FileInputStream(mf));
- bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- } else {
- if (file.toURI().getPath().endsWith("/target/classes/")) {
- // Development mode, MANIFEST.MF is outside the bundle location
- mf = new File(file.getParentFile().getParentFile(), "META-INF/MANIFEST.MF");
- if (mf.isFile()) {
- Manifest manifest = new Manifest(new FileInputStream(mf));
- bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- }
- }
- }
- } else {
- JarFile jar = new JarFile(file, false);
- Manifest manifest = jar.getManifest();
- if (manifest != null) {
- bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- }
- jar.close();
- }
- if (bundleName == null) {
- return bundleName;
- }
- int sc = bundleName.indexOf(';');
- if (sc != -1) {
- bundleName = bundleName.substring(0, sc);
- }
- return bundleName;
- }
-
- /**
- * Collect JAR files in the given directory.
- *
- * @param directory
- * @param urls
- * @param filter
- * @throws MalformedURLException
- */
- private static void collectClasspathEntries(File directory, Set<URL> urls, FilenameFilter filter, boolean recursive)
- throws MalformedURLException {
- File[] files = directory.listFiles(filter);
- if (files != null) {
- int count = 0;
- for (File file : files) {
- if (recursive && file.isDirectory()) {
- collectClasspathEntries(file, urls, filter, recursive);
- } else {
- urls.add(file.toURI().toURL());
- count++;
- }
- }
- if (count != 0) {
- logger.info("Runtime classpath: " + count
- + " JAR"
- + (count > 1 ? "s" : "")
- + " from "
- + directory.toString());
- }
- }
- }
-
- /**
- * Collect development .../ target/classes directories in the given directory.
- *
- * @param directory
- * @param urls
- * @param filter
- * @throws MalformedURLException
- */
- private static void collectTargetClassesClasspathEntries(File directory, Set<URL> urls, FilenameFilter filter)
- throws MalformedURLException {
- File[] files = directory.listFiles();
- if (files != null) {
- int count = 0;
- for (File file : files) {
- if (!file.isDirectory()) {
- continue;
- }
- File target = new File(file, "target");
- if (!target.isDirectory()) {
- continue;
- }
- File classes = new File(target, "classes");
- if (classes.isDirectory() && filter.accept(target, "classes")) {
- urls.add(classes.toURI().toURL());
- count++;
- }
- }
- if (count != 0) {
- logger.info("Runtime classpath: " + count
- + " classes folder"
- + (count > 1 ? "s" : "")
- + " from "
- + directory.toString());
- }
- }
- }
-
- /**
- * Collect JAR files under the given distribution directory.
- *
- * @param directory
- * @param jarDirectoryURLs
- * @param jarURLs
- * @param filter
- * @throws MalformedURLException
- */
- private static void collectDistributionClasspathEntries(String directory,
- Set<URL> jarDirectoryURLs,
- Set<URL> jarURLs,
- FilenameFilter filter) throws MalformedURLException {
- File directoryFile = new File(directory);
- URL directoryURL = directoryFile.toURI().toURL();
- if (!jarDirectoryURLs.contains(directoryURL) && directoryFile.exists()) {
-
- // Collect files under the given directory
- jarDirectoryURLs.add(directoryURL);
- collectClasspathEntries(directoryFile, jarURLs, filter, false);
-
- // Collect files under <directory>/modules
- File modulesDirectory = new File(directoryFile, "modules");
- URL modulesDirectoryURL = modulesDirectory.toURI().toURL();
- if (!jarDirectoryURLs.contains(modulesDirectoryURL) && modulesDirectory.exists()) {
- jarDirectoryURLs.add(modulesDirectoryURL);
- collectClasspathEntries(modulesDirectory, jarURLs, filter, true);
- }
-
- // Collect files under <directory>/lib
- File libDirectory = new File(directoryFile, "lib");
- URL libDirectoryURL = libDirectory.toURI().toURL();
- if (!jarDirectoryURLs.contains(libDirectoryURL) && libDirectory.exists()) {
- jarDirectoryURLs.add(libDirectoryURL);
- collectClasspathEntries(libDirectory, jarURLs, filter, true);
- }
- }
- }
-
- /**
- * Determine the Tuscany runtime classpath entries.
- *
- * @param useDistribution
- * @param useAppClasspath
- * @param useModulesDirectory
- * @return
- */
- static Set<URL> runtimeClasspathEntries(boolean useDistribution,
- boolean useAppClasspath,
- boolean useModulesDirectory) throws FileNotFoundException,
- URISyntaxException, MalformedURLException {
-
- // Build list of runtime JARs
- Set<URL> jarDirectoryURLs = new HashSet<URL>();
- Set<URL> jarURLs = new HashSet<URL>();
-
- // Determine the path to the launcher class
- URI uri;
- try {
- uri = codeLocation(NodeLauncherUtil.class);
- } catch (Exception e) {
- uri = URI.create("");
- }
-
- // If the launcher class is in a JAR, add all runtime JARs from directory containing
- // that JAR (e.g. the Tuscany modules directory) as well as the ../modules and
- // ../lib directories
- if (uri.getPath().endsWith(".jar")) {
- if (useDistribution) {
-
- File file = new File(uri);
- if (file.exists()) {
- File jarDirectory = file.getParentFile();
- if (jarDirectory != null && jarDirectory.exists()) {
-
- // Collect JAR files from the directory containing the input JAR
- // (e.g. the Tuscany modules directory)
- URL jarDirectoryURL = jarDirectory.toURI().toURL();
- jarDirectoryURLs.add(jarDirectoryURL);
- collectClasspathEntries(jarDirectory, jarURLs, new StandAloneJARFileNameFilter(), true);
-
- File homeDirectory = jarDirectory.getParentFile();
- if (homeDirectory != null && homeDirectory.exists()) {
- collectDistributionClasspathEntries(homeDirectory.getAbsolutePath(),
- jarDirectoryURLs,
- jarURLs,
- new StandAloneJARFileNameFilter());
- }
- }
- }
- }
- } else if (uri.getPath().endsWith("/target/classes/")) {
-
- // Development mode, we're running off classes in a workspace
- // and not from Maven surefire, collect all bundles in the workspace
- if (useModulesDirectory) {
- ClassLoader cl = NodeLauncherUtil.class.getClassLoader();
- if (!cl.getClass().getName().startsWith("org.apache.maven.surefire")) {
- File file = new File(uri);
- if (file.exists()) {
- File moduleDirectory = file.getParentFile().getParentFile();
- if (moduleDirectory != null) {
- File modulesDirectory = moduleDirectory.getParentFile();
- if (modulesDirectory != null && modulesDirectory.exists()
- && modulesDirectory.getName().equals("modules")) {
- collectDevelopmentClasspathEntries(modulesDirectory.getAbsolutePath(),
- jarDirectoryURLs,
- jarURLs,
- new StandAloneDevelopmentClassesFileNameFilter());
- }
- }
- }
- }
- }
- }
-
- // Look for a TUSCANY_HOME system property or environment variable
- // Add all the JARs found under $TUSCANY_HOME, $TUSCANY_HOME/modules
- // and $TUSCANY_HOME/lib
- if (useDistribution) {
- String home = getProperty(TUSCANY_HOME);
- if (home != null && home.length() != 0) {
- logger.info(TUSCANY_HOME + ": " + home);
- collectDistributionClasspathEntries(home, jarDirectoryURLs, jarURLs, new StandAloneJARFileNameFilter());
- }
-
- // Look for a TUSCANY_PATH system property or environment variable
- // Add all the JARs found under $TUSCANY_PATH, $TUSCANY_PATH/modules
- // and $TUSCANY_PATH/lib
- String ext = getProperty(TUSCANY_PATH);
- if (ext != null && ext.length() != 0) {
- logger.info(TUSCANY_PATH + ": " + ext);
- String separator = getProperty("path.separator");
- for (StringTokenizer tokens = new StringTokenizer(ext, separator); tokens.hasMoreTokens();) {
- collectDistributionClasspathEntries(tokens.nextToken(),
- jarDirectoryURLs,
- jarURLs,
- new StandAloneJARFileNameFilter());
- }
- }
- }
-
- // Add the classpath entries from the current classloader
- if (useAppClasspath) {
- collectClassLoaderClasspathEntries(jarURLs, NodeLauncherUtil.class.getClassLoader());
- }
-
- return jarURLs;
-
- }
-
- /**
- * Returns the JAR files on the classpath used by the given classloader.
- *
- * @param classLoader
- * @return
- */
- static List<URL> jarFilesOnClasspath(ClassLoader classLoader) {
- Set<URL> entries = new HashSet<URL>();
- collectClassLoaderClasspathEntries(entries, classLoader);
- return new ArrayList<URL>(entries);
- }
-
- private static String getProperty(final String prop) {
- return AccessController.doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- String value = System.getProperty(prop);
- if (value == null || value.length() == 0) {
- return System.getenv(prop);
- } else {
- return value;
- }
- }
- });
- }
-
- /**
- * Collect JARs on the classpath of a URLClassLoader.
- *
- * @param urls
- * @param cl
- */
- private static void collectClassLoaderClasspathEntries(Set<URL> urls, ClassLoader cl) {
- if (cl == null) {
- return;
- }
-
- int count = urls.size();
- // Collect JARs from the URLClassLoader's classpath
- if (cl instanceof URLClassLoader) {
- URL[] jarURLs = ((URLClassLoader)cl).getURLs();
- if (jarURLs != null) {
- for (URL jarURL : jarURLs) {
- urls.add(jarURL);
- try {
- urls.addAll(manifestClassPath(jarURL));
- } catch (Exception e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- }
- count = urls.size() - count;
-
- if (count != 0) {
- logger.info("Runtime classpath: " + count
- + " JAR"
- + (count > 1 ? "s" : "")
- + " from application classpath.");
- }
- }
- }
- }
-
- static Set<URL> manifestClassPath(URL jarFile) throws Exception {
- Set<URL> urls = new HashSet<URL>();
- if (jarFile != null) {
- JarInputStream jar = new JarInputStream(jarFile.openStream());
- Manifest mf = jar.getManifest();
- jar.close();
- if (mf != null) {
- String cp = mf.getMainAttributes().getValue("Class-Path");
- if (cp != null) {
- StringTokenizer st = new StringTokenizer(cp);
- while (st.hasMoreTokens()) {
- URL entry = new URL(jarFile.toURI().toURL(), st.nextToken()).toURI().toURL();
- urls.add(entry);
- }
- }
- }
- }
- return urls;
- }
-
- /**
- * A file name filter used to filter JAR files.
- */
- private static class StandAloneJARFileNameFilter implements FilenameFilter {
-
- public boolean accept(File dir, String name) {
- name = name.toLowerCase();
-
- if (new File(dir, name).isDirectory()) {
- return true;
- }
-
- // Filter out the Tomcat and Webapp hosts
- if (name.startsWith("tuscany-host-tomcat") || name.startsWith("tuscany-host-webapp")) {
- //FIXME This is temporary
- return false;
- }
-
- // Include JAR and MAR files
- if (name.endsWith(".jar")) {
- return true;
- }
- if (name.endsWith(".mar")) {
- return true;
- }
- return false;
- }
- }
-
- /**
- * A file name filter used to filter target/classes directories.
- */
- private static class StandAloneDevelopmentClassesFileNameFilter implements FilenameFilter {
-
- public boolean accept(File dir, String name) {
- name = name.toLowerCase();
- if (dir.getName().equals("target") && name.equals("classes")) {
-
- // Filter out the Tomcat and Webapp hosts
- String dirPath = dir.getAbsolutePath();
- if (dirPath.endsWith("host-tomcat/target") || dirPath.endsWith("host-webapp/target")) {
- //FIXME This is temporary
- return false;
- }
- return true;
- }
-
- // Filter out the Tomcat and Webapp hosts
- if (name.startsWith("tuscany-host-tomcat") || name.startsWith("tuscany-host-webapp")) {
- //FIXME This is temporary
- return false;
- }
-
- // Include JAR and MAR files
- if (name.endsWith(".jar")) {
- return true;
- }
- if (name.endsWith(".mar")) {
- return true;
- }
- return false;
- }
- }
-
- /**
- * A file name filter used to filter JAR files.
- */
- private static class WebAppJARFileNameFilter extends StandAloneJARFileNameFilter {
-
- @Override
- public boolean accept(File dir, String name) {
- if (!super.accept(dir, name)) {
- return false;
- }
- name = name.toLowerCase();
-
- // Exclude servlet-api JARs
- if (name.startsWith("servlet-api")) {
- return false;
- }
-
- // Exclude the Tomcat and Jetty hosts
- if (name.startsWith("tuscany-host-tomcat") || name.startsWith("tuscany-host-jetty")) {
- //FIXME This is temporary
- return false;
- }
-
- return true;
- }
- }
-
- /**
- * Returns the File object representing the given URL.
- *
- * @param url
- * @return
- */
- static File file(URL url) {
- if (url == null || !url.getProtocol().equals("file")) {
- return null;
- } else {
- String filename = url.getFile().replace('/', File.separatorChar);
- int pos = 0;
- while ((pos = filename.indexOf('%', pos)) >= 0) {
- if (pos + 2 < filename.length()) {
- String hexStr = filename.substring(pos + 1, pos + 3);
- char ch = (char)Integer.parseInt(hexStr, 16);
- filename = filename.substring(0, pos) + ch + filename.substring(pos + 3);
- }
- }
- return new File(filename);
- }
- }
-
- /**
- * Returns the location of the classpath entry, JAR, WAR etc. containing the given class.
- *
- * @param clazz
- * @return
- */
- static private URI codeLocation(Class<?> clazz) {
- URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
- return toURI(url);
- }
-
- /**
- * Collect JAR files under the given distribution directory.
- *
- * @param directory
- * @param jarDirectoryURLs
- * @param jarURLs
- * @param filter
- * @throws MalformedURLException
- */
- private static void collectDevelopmentClasspathEntries(String directory,
- Set<URL> jarDirectoryURLs,
- Set<URL> jarURLs,
- FilenameFilter filter) throws MalformedURLException {
- File directoryFile = new File(directory);
- URL directoryURL = directoryFile.toURI().toURL();
- if (!jarDirectoryURLs.contains(directoryURL) && directoryFile.exists()) {
-
- // Collect files under the given directory
- jarDirectoryURLs.add(directoryURL);
- collectTargetClassesClasspathEntries(directoryFile, jarURLs, filter);
-
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeMain.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeMain.java
deleted file mode 100644
index 4b4c4a8978..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeMain.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionGroup;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.PosixParser;
-
-
-/**
- * Main class for this JAR.
- * With a "-nodeDaemon or -nd" this class launches the SCA Node Daemon.
- * With a "-domainManager or -dm" argument it launches the SCA domain admin node.
- * With any other argument it launches an SCA Node.
- *
- * @version $Rev$ $Date$
- */
-public class NodeMain {
-
- public static void main(String[] args) throws Exception {
- CommandLineParser parser = new PosixParser();
- Options options = new Options();
- OptionGroup group = new OptionGroup();
- group.addOption(new Option("dm", "domainManager", false, "Domain Manager"));
- group.addOption(new Option("nd", "nodeDaemon", false, "Node Domain"));
- options.addOptionGroup(group);
-
- // Add options from NodeLauncher to avoid UnrecognizedOptionException
- for (Object o : NodeLauncher.getCommandLineOptions().getOptions()) {
- options.addOption((Option)o);
- }
-
- CommandLine cli = parser.parse(options, args);
- if (cli.hasOption("nd")) {
- NodeDaemonLauncher.main(args);
- } else if (cli.hasOption("dm")) {
- DomainManagerLauncher.main(args);
- } else {
- NodeLauncher.main(args);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/J2SE-1.5.profile b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/J2SE-1.5.profile
deleted file mode 100644
index 3814b42d00..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/J2SE-1.5.profile
+++ /dev/null
@@ -1,150 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-org.osgi.framework.system.packages = \
- javax.accessibility,\
- javax.activity,\
- javax.crypto,\
- javax.crypto.interfaces,\
- javax.crypto.spec,\
- javax.imageio,\
- javax.imageio.event,\
- javax.imageio.metadata,\
- javax.imageio.plugins.bmp,\
- javax.imageio.plugins.jpeg,\
- javax.imageio.spi,\
- javax.imageio.stream,\
- javax.management,\
- javax.management.loading,\
- javax.management.modelmbean,\
- javax.management.monitor,\
- javax.management.openmbean,\
- javax.management.relation,\
- javax.management.remote,\
- javax.management.remote.rmi,\
- javax.management.timer,\
- javax.naming,\
- javax.naming.directory,\
- javax.naming.event,\
- javax.naming.ldap,\
- javax.naming.spi,\
- javax.net,\
- javax.net.ssl,\
- javax.print,\
- javax.print.attribute,\
- javax.print.attribute.standard,\
- javax.print.event,\
- javax.rmi,\
- javax.rmi.CORBA,\
- javax.rmi.ssl,\
- javax.security.auth,\
- javax.security.auth.callback,\
- javax.security.auth.kerberos,\
- javax.security.auth.login,\
- javax.security.auth.spi,\
- javax.security.auth.x500,\
- javax.security.cert,\
- javax.security.sasl,\
- javax.sound.midi,\
- javax.sound.midi.spi,\
- javax.sound.sampled,\
- javax.sound.sampled.spi,\
- javax.sql,\
- javax.sql.rowset,\
- javax.sql.rowset.serial,\
- javax.sql.rowset.spi,\
- javax.swing,\
- javax.swing.border,\
- javax.swing.colorchooser,\
- javax.swing.event,\
- javax.swing.filechooser,\
- javax.swing.plaf,\
- javax.swing.plaf.basic,\
- javax.swing.plaf.metal,\
- javax.swing.plaf.multi,\
- javax.swing.plaf.synth,\
- javax.swing.table,\
- javax.swing.text,\
- javax.swing.text.html,\
- javax.swing.text.html.parser,\
- javax.swing.text.rtf,\
- javax.swing.tree,\
- javax.swing.undo,\
- javax.transaction,\
- javax.transaction.xa,\
- javax.xml,\
- javax.xml.datatype,\
- javax.xml.namespace,\
- javax.xml.parsers,\
- javax.xml.transform,\
- javax.xml.transform.dom,\
- javax.xml.transform.sax,\
- javax.xml.transform.stream,\
- javax.xml.validation,\
- javax.xml.xpath,\
- org.ietf.jgss,\
- org.omg.CORBA,\
- org.omg.CORBA_2_3,\
- org.omg.CORBA_2_3.portable,\
- org.omg.CORBA.DynAnyPackage,\
- org.omg.CORBA.ORBPackage,\
- org.omg.CORBA.portable,\
- org.omg.CORBA.TypeCodePackage,\
- org.omg.CosNaming,\
- org.omg.CosNaming.NamingContextExtPackage,\
- org.omg.CosNaming.NamingContextPackage,\
- org.omg.Dynamic,\
- org.omg.DynamicAny,\
- org.omg.DynamicAny.DynAnyFactoryPackage,\
- org.omg.DynamicAny.DynAnyPackage,\
- org.omg.IOP,\
- org.omg.IOP.CodecFactoryPackage,\
- org.omg.IOP.CodecPackage,\
- org.omg.Messaging,\
- org.omg.PortableInterceptor,\
- org.omg.PortableInterceptor.ORBInitInfoPackage,\
- org.omg.PortableServer,\
- org.omg.PortableServer.CurrentPackage,\
- org.omg.PortableServer.POAManagerPackage,\
- org.omg.PortableServer.POAPackage,\
- org.omg.PortableServer.portable,\
- org.omg.PortableServer.ServantLocatorPackage,\
- org.omg.SendingContext,\
- org.omg.stub.java.rmi,\
- org.w3c.dom,\
- org.w3c.dom.bootstrap,\
- org.w3c.dom.events,\
- org.w3c.dom.ls,\
- org.xml.sax,\
- org.xml.sax.ext,\
- org.xml.sax.helpers
-org.osgi.framework.bootdelegation = \
- javax.*,\
- org.ietf.jgss,\
- org.omg.*,\
- org.w3c.*,\
- org.xml.*,\
- sun.*,\
- com.sun.*
-org.osgi.framework.executionenvironment = \
- OSGi/Minimum-1.0,\
- OSGi/Minimum-1.1,\
- JRE-1.1,\
- J2SE-1.2,\
- J2SE-1.3,\
- J2SE-1.4,\
- J2SE-1.5
-osgi.java.profile.name = J2SE-1.5
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/JavaSE-1.6.profile b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/JavaSE-1.6.profile
deleted file mode 100644
index 816e7c44f4..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/JavaSE-1.6.profile
+++ /dev/null
@@ -1,185 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-org.osgi.framework.system.packages = \
- javax.accessibility,\
- javax.activation,\
- javax.activity,\
- javax.annotation,\
- javax.annotation.processing,\
- javax.crypto,\
- javax.crypto.interfaces,\
- javax.crypto.spec,\
- javax.imageio,\
- javax.imageio.event,\
- javax.imageio.metadata,\
- javax.imageio.plugins.bmp,\
- javax.imageio.plugins.jpeg,\
- javax.imageio.spi,\
- javax.imageio.stream,\
- javax.jws,\
- javax.jws.soap,\
- javax.lang.model,\
- javax.lang.model.element,\
- javax.lang.model.type,\
- javax.lang.model.util,\
- javax.management,\
- javax.management.loading,\
- javax.management.modelmbean,\
- javax.management.monitor,\
- javax.management.openmbean,\
- javax.management.relation,\
- javax.management.remote,\
- javax.management.remote.rmi,\
- javax.management.timer,\
- javax.naming,\
- javax.naming.directory,\
- javax.naming.event,\
- javax.naming.ldap,\
- javax.naming.spi,\
- javax.net,\
- javax.net.ssl,\
- javax.print,\
- javax.print.attribute,\
- javax.print.attribute.standard,\
- javax.print.event,\
- javax.rmi,\
- javax.rmi.CORBA,\
- javax.rmi.ssl,\
- javax.script,\
- javax.security.auth,\
- javax.security.auth.callback,\
- javax.security.auth.kerberos,\
- javax.security.auth.login,\
- javax.security.auth.spi,\
- javax.security.auth.x500,\
- javax.security.cert,\
- javax.security.sasl,\
- javax.sound.midi,\
- javax.sound.midi.spi,\
- javax.sound.sampled,\
- javax.sound.sampled.spi,\
- javax.sql,\
- javax.sql.rowset,\
- javax.sql.rowset.serial,\
- javax.sql.rowset.spi,\
- javax.swing,\
- javax.swing.border,\
- javax.swing.colorchooser,\
- javax.swing.event,\
- javax.swing.filechooser,\
- javax.swing.plaf,\
- javax.swing.plaf.basic,\
- javax.swing.plaf.metal,\
- javax.swing.plaf.multi,\
- javax.swing.plaf.synth,\
- javax.swing.table,\
- javax.swing.text,\
- javax.swing.text.html,\
- javax.swing.text.html.parser,\
- javax.swing.text.rtf,\
- javax.swing.tree,\
- javax.swing.undo,\
- javax.tools,\
- javax.transaction,\
- javax.transaction.xa,\
- javax.xml,\
- javax.xml.bind,\
- javax.xml.bind.annotation,\
- javax.xml.bind.annotation.adapters,\
- javax.xml.bind.attachment,\
- javax.xml.bind.helpers,\
- javax.xml.bind.util,\
- javax.xml.crypto,\
- javax.xml.crypto.dom,\
- javax.xml.crypto.dsig,\
- javax.xml.crypto.dsig.dom,\
- javax.xml.crypto.dsig.keyinfo,\
- javax.xml.crypto.dsig.spec,\
- javax.xml.datatype,\
- javax.xml.namespace,\
- javax.xml.parsers,\
- javax.xml.soap,\
- javax.xml.stream,\
- javax.xml.stream.events,\
- javax.xml.stream.util,\
- javax.xml.transform,\
- javax.xml.transform.dom,\
- javax.xml.transform.sax,\
- javax.xml.transform.stax,\
- javax.xml.transform.stream,\
- javax.xml.validation,\
- javax.xml.ws,\
- javax.xml.ws.handler,\
- javax.xml.ws.handler.soap,\
- javax.xml.ws.http,\
- javax.xml.ws.soap,\
- javax.xml.ws.spi,\
- javax.xml.xpath,\
- org.ietf.jgss,\
- org.omg.CORBA,\
- org.omg.CORBA_2_3,\
- org.omg.CORBA_2_3.portable,\
- org.omg.CORBA.DynAnyPackage,\
- org.omg.CORBA.ORBPackage,\
- org.omg.CORBA.portable,\
- org.omg.CORBA.TypeCodePackage,\
- org.omg.CosNaming,\
- org.omg.CosNaming.NamingContextExtPackage,\
- org.omg.CosNaming.NamingContextPackage,\
- org.omg.Dynamic,\
- org.omg.DynamicAny,\
- org.omg.DynamicAny.DynAnyFactoryPackage,\
- org.omg.DynamicAny.DynAnyPackage,\
- org.omg.IOP,\
- org.omg.IOP.CodecFactoryPackage,\
- org.omg.IOP.CodecPackage,\
- org.omg.Messaging,\
- org.omg.PortableInterceptor,\
- org.omg.PortableInterceptor.ORBInitInfoPackage,\
- org.omg.PortableServer,\
- org.omg.PortableServer.CurrentPackage,\
- org.omg.PortableServer.POAManagerPackage,\
- org.omg.PortableServer.POAPackage,\
- org.omg.PortableServer.portable,\
- org.omg.PortableServer.ServantLocatorPackage,\
- org.omg.SendingContext,\
- org.omg.stub.java.rmi,\
- org.w3c.dom,\
- org.w3c.dom.bootstrap,\
- org.w3c.dom.events,\
- org.w3c.dom.ls,\
- org.xml.sax,\
- org.xml.sax.ext,\
- org.xml.sax.helpers
-org.osgi.framework.bootdelegation = \
- javax.*,\
- org.ietf.jgss,\
- org.omg.*,\
- org.w3c.*,\
- org.xml.*,\
- sun.*,\
- com.sun.*
-org.osgi.framework.executionenvironment = \
- OSGi/Minimum-1.0,\
- OSGi/Minimum-1.1,\
- JRE-1.1,\
- J2SE-1.2,\
- J2SE-1.3,\
- J2SE-1.4,\
- J2SE-1.5,\
- JavaSE-1.6
-osgi.java.profile.name = JavaSE-1.6
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorld.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorld.java
deleted file mode 100644
index e3fcdfd25f..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorld.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package hello;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * HelloWorld interface
- */
-@Remotable
-public interface HelloWorld {
- String hello(String name);
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java
deleted file mode 100644
index 8232acb658..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package hello;
-
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-@Scope("COMPOSITE")
-@EagerInit
-public class HelloWorldClient {
-
- private HelloWorld hw;
-
- @Reference
- public void setHelloWorld(HelloWorld hw) {
- this.hw = hw;
- }
-
- @Init
- public void hello() {
- // Say hello
- System.out.println("Contribution ClassLoader: " + getClass().getClassLoader());
- System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader());
- System.out.println(hw.hello("Equinox"));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java
deleted file mode 100644
index e51d3c79d9..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package hello;
-
-/**
- * HelloWorldImpl
- */
-public class HelloWorldImpl implements HelloWorld {
- public String hello(String name) {
- System.out.println("Name: " + name);
- return "Hello, " + name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java
deleted file mode 100644
index 8988a91b34..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-
-/**
- *
- */
-public class EquinoxOSGiHostTestCase {
-
- @Test
- public void testStartThenStop() {
- EquinoxHost host = new EquinoxHost();
- BundleContext context = host.start();
- Assert.assertNotNull(context);
- for (Bundle b : context.getBundles()) {
- System.out.println(toString(b, false));
- }
- host.stop();
- }
-
- @Test
- public void testStartThenStopTwice() {
- EquinoxHost host = new EquinoxHost();
- BundleContext context = host.start();
- Assert.assertNotNull(context);
- for (Bundle b : context.getBundles()) {
- System.out.println(toString(b, false));
- }
- host.stop();
-
- host = new EquinoxHost();
- context = host.start();
- Assert.assertNotNull(context);
- for (Bundle b : context.getBundles()) {
- System.out.println(toString(b, false));
- }
- host.stop();
- }
-
- public static String toString(Bundle b, boolean verbose) {
- StringBuffer sb = new StringBuffer();
- sb.append(b.getBundleId()).append(" ").append(b.getSymbolicName());
- int s = b.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");
- }
-
- sb.append(" ").append(b.getLocation());
- if (verbose) {
- Dictionary<Object, Object> dict = b.getHeaders();
- Enumeration<Object> keys = dict.keys();
- while (keys.hasMoreElements()) {
- Object key = keys.nextElement();
- sb.append(" ").append(key).append("=").append(dict.get(key));
- }
- }
- return sb.toString();
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
deleted file mode 100644
index 5cc40ca77f..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-import org.apache.tuscany.sca.node.Node;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- *
- */
-public class NodeLauncherTestCase {
- private static NodeLauncher launcher;
-
- @BeforeClass
- public static void setUp() {
- System.setProperty("osgi.configuration.area", "target/equinox/configuration");
- try {
- launcher = NodeLauncher.newInstance();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void tearDown() {
- System.clearProperty("osgi.configuration.area");
- if (launcher != null) {
- launcher.destroy();
- }
-
- }
-
- @Test
- public void testLaunch() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation(getClass());
- Node node = launcher.createNode("HelloWorld.composite", new Contribution("test", location));
- node.start();
- node.stop();
- }
-
- @Test
- @Ignore("contribution-osgi issue")
- public void testLaunchDomain() throws Exception {
- DomainManagerLauncher.main(new String[] {});
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite b/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite
deleted file mode 100644
index 0608e70ca5..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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/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/tags/java/sca/2.0-M1/modules/node-launcher/LICENSE b/tags/java/sca/2.0-M1/modules/node-launcher/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/node-launcher/META-INF/MANIFEST.MF
deleted file mode 100644
index 19e42299b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,17 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.node.launcher;uses:="javax.serv
- let";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Node Launcher
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397407125
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Node Launcher
-Import-Package: javax.servlet,org.apache.tuscany.sca.node.launcher;ver
- sion="2.0.0",org.apache.commons.cli;resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.node.launcher
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/NOTICE b/tags/java/sca/2.0-M1/modules/node-launcher/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/pom.xml b/tags/java/sca/2.0-M1/modules/node-launcher/pom.xml
deleted file mode 100644
index 8b5adaa107..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-node-launcher</artifactId>
- <name>Apache Tuscany SCA Node Launcher</name>
-
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
-
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>1.1</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <mainClass>org.apache.tuscany.sca.node.launcher.NodeMain</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/Contribution.java b/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/Contribution.java
deleted file mode 100644
index 4f4f861e2f..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/Contribution.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.node.launcher;
-
-/**
- * Represents an SCA contribution uri + location.
- *
- * @version $Rev$ $Date$
- */
-public final class Contribution {
- private String uri;
- private String location;
-
- /**
- * Constructs a new SCA contribution.
- *
- * @param uri
- * @param location
- */
- public Contribution(String uri, String location) {
- this.uri = uri;
- this.location = location;
- }
-
- public String getURI() {
- return uri;
- }
-
- public String getLocation() {
- return location;
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/DomainManagerLauncher.java b/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/DomainManagerLauncher.java
deleted file mode 100644
index ba795216a9..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/DomainManagerLauncher.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.launcher;
-
-import static org.apache.tuscany.sca.node.launcher.NodeLauncherUtil.domainManager;
-
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Simple launcher for the SCA domain manager.
- *
- * @version $Rev$ $Date$
- */
-public class DomainManagerLauncher {
-
- static final Logger logger = Logger.getLogger(DomainManagerLauncher.class.getName());
-
- /**
- * Constructs a new DomainManagerLauncher.
- */
- private DomainManagerLauncher() {
- }
-
- /**
- * Returns a new launcher instance.
- *
- * @return a new launcher instance
- */
- public static DomainManagerLauncher newInstance() {
- return new DomainManagerLauncher();
- }
-
- /**
- * Creates a new DomainManager.
- *
- * @return a new DomainManager
- * @throws LauncherException
- */
- public <T> T createDomainManager() throws LauncherException {
- return (T)domainManager(".");
- }
-
- /**
- * Creates a new DomainManager.
- *
- * @param rootDirectory the domain's root configuration directory
- *
- * @return a new DomainManager
- * @throws LauncherException
- */
- public <T> T createDomainManager(String rootDirectory) throws LauncherException {
- return (T)domainManager(rootDirectory);
- }
-
- public static void main(String[] args) throws Exception {
- logger.info("Apache Tuscany SCA Domain Manager is starting...");
-
- // Create a launcher
- DomainManagerLauncher launcher = newInstance();
-
- Object domainManager = null;
- ShutdownThread shutdown = null;
- try {
- while (true) {
-
- // Start the domain manager
- domainManager = launcher.createDomainManager();
- try {
- domainManager.getClass().getMethod("start").invoke(domainManager);
- } catch (Exception e) {
- logger.log(Level.SEVERE, "SCA Domain Manager could not be started", e);
- throw e;
- }
- logger.info("SCA Domain Manager is now started.");
-
- // Install a shutdown hook
- shutdown = new ShutdownThread(domainManager);
- Runtime.getRuntime().addShutdownHook(shutdown);
-
- logger.info("Press 'q' to quit, 'r' to restart.");
- int k = 0;
- try {
- while ((k != 'q') && (k != 'r')) {
- k = System.in.read();
- }
- } catch (IOException e) {
-
- // Wait forever
- Object lock = new Object();
- synchronized(lock) {
- lock.wait();
- }
- }
-
- // Stop the domain manager
- if (domainManager != null) {
- Object dm = domainManager;
- domainManager = null;
- stopDomainManager(dm);
- }
-
- // Quit
- if (k == 'q' ) {
- break;
- }
- }
- } catch (Exception e) {
- // Stop the domain manager
- if (domainManager != null) {
- try {
- Object dm = domainManager;
- domainManager = null;
- stopDomainManager(dm);
- } catch (Exception e2) {
- }
- }
- throw e;
-
- } finally {
-
- // Remove the shutdown hook
- if (shutdown != null) {
- Runtime.getRuntime().removeShutdownHook(shutdown);
- }
- }
- }
-
- /**
- * Stop the given domain manager.
- *
- * @param domainManager
- * @throws Exception
- */
- private static void stopDomainManager(Object domainManager) throws Exception {
- try {
- domainManager.getClass().getMethod("stop").invoke(domainManager);
- logger.info("SCA Domain Manager is now stopped.");
- } catch (Exception e) {
- logger.log(Level.SEVERE, "SCA Domain Manager could not be stopped", e);
- throw e;
- }
- }
-
- private static class ShutdownThread extends Thread {
- private Object domainManager;
-
- public ShutdownThread(Object domainManager) {
- super();
- this.domainManager = domainManager;
- }
-
- @Override
- public void run() {
- try {
- stopDomainManager(domainManager);
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/LauncherException.java b/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/LauncherException.java
deleted file mode 100644
index 39e8d81139..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/LauncherException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.node.launcher;
-
-
-/**
- * Denotes an error launching an SCA domain manager or node.
- *
- * @version $Rev$ $Date$
- */
-public class LauncherException extends Exception {
- private static final long serialVersionUID = 4581189418849190567L;
-
- public LauncherException() {
- super();
- }
-
- /**
- * @param message
- * @param cause
- */
- public LauncherException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * @param message
- */
- public LauncherException(String message) {
- super(message);
- }
-
- /**
- * @param cause
- */
- public LauncherException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemonLauncher.java b/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemonLauncher.java
deleted file mode 100644
index 56be9f9921..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemonLauncher.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.launcher;
-
-import static org.apache.tuscany.sca.node.launcher.NodeLauncherUtil.nodeDaemon;
-
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A launcher for the SCA Node daemon.
- *
- * @version $Rev$ $Date$
- */
-public class NodeDaemonLauncher {
-
- static final Logger logger = Logger.getLogger(NodeDaemonLauncher.class.getName());
-
- /**
- * Constructs a new node daemon launcher.
- */
- private NodeDaemonLauncher() {
- }
-
- /**
- * Returns a new launcher instance.
- *
- * @return a new launcher instance
- */
- public static NodeDaemonLauncher newInstance() {
- return new NodeDaemonLauncher();
- }
-
- /**
- * Creates a new node daemon.
- *
- * @param
- * @return a new node daemon
- * @throws LauncherException
- */
- public <T> T createNodeDaemon() throws LauncherException {
- return (T)nodeDaemon();
- }
-
- public static void main(String[] args) throws Exception {
- logger.info("Apache Tuscany SCA Node Daemon is starting...");
-
- // Create a node launcher
- NodeDaemonLauncher launcher = newInstance();
-
- Object node = null;
- ShutdownThread shutdown = null;
- try {
- while (true) {
-
- // Start the node
- node = launcher.createNodeDaemon();
- try {
- node.getClass().getMethod("start").invoke(node);
- } catch (Exception e) {
- logger.log(Level.SEVERE, "SCA Node Daemon could not be started", e);
- throw e;
- }
- logger.info("SCA Node Daemon is now started.");
-
- // Install a shutdown hook
- shutdown = new ShutdownThread(node);
- Runtime.getRuntime().addShutdownHook(shutdown);
-
- logger.info("Press 'q' to quit, 'r' to restart.");
- int k = 0;
- try {
- while ((k != 'q') && (k != 'r')) {
- k = System.in.read();
- }
- } catch (IOException e) {
-
- // Wait forever
- Object lock = new Object();
- synchronized(lock) {
- lock.wait();
- }
- }
-
- // Stop the node
- if (node != null) {
- Object n = node;
- node = null;
- stopNode(n);
- }
-
- // Quit
- if (k == 'q' ) {
- break;
- }
- }
- } catch (Exception e) {
- // Stop the node
- if (node != null) {
- try {
- Object n = node;
- node = null;
- stopNode(n);
- } catch (Exception e2) {
- }
- }
- throw e;
-
- } finally {
-
- // Remove the shutdown hook
- if (shutdown != null) {
- Runtime.getRuntime().removeShutdownHook(shutdown);
- }
- }
- }
-
- /**
- * Stop the given node.
- *
- * @param node
- * @throws Exception
- */
- private static void stopNode(Object node) throws Exception {
- try {
- node.getClass().getMethod("stop").invoke(node);
- logger.info("SCA Node Daemon is now stopped.");
- } catch (Exception e) {
- logger.log(Level.SEVERE, "SCA Node Daemon could not be stopped", e);
- throw e;
- }
- }
-
- private static class ShutdownThread extends Thread {
- private Object node;
-
- public ShutdownThread(Object node) {
- super();
- this.node = node;
- }
-
- @Override
- public void run() {
- try {
- stopNode(node);
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java b/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java
deleted file mode 100644
index d8df30377b..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.launcher;
-
-import static org.apache.tuscany.sca.node.launcher.NodeLauncherUtil.node;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.PosixParser;
-
-/**
- * A launcher for SCA nodes in JSE.
- *
- * Agruments:
- * [-c <compositeURI>]: The composite URI
- * [-t <ttl>]: Time to live in milliseconds before the node is started
- * contribution1 ... contributionN: A list of contribution files or URLs
- *
- * @version $Rev$ $Date$
- */
-public class NodeLauncher {
-
- static final Logger logger = Logger.getLogger(NodeLauncher.class.getName());
-
- /**
- * Constructs a new node launcher.
- */
- private NodeLauncher() {
- }
-
- /**
- * Returns a new launcher instance.
- *
- * @return a new launcher instance
- */
- public static NodeLauncher newInstance() {
- return new NodeLauncher();
- }
-
- /**
- * 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 createNodeFromURL(String configurationURL) throws LauncherException {
- return (T)node(configurationURL, null, null, null, null);
- }
-
- /**
- * Creates a new SCA 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, null);
- }
-
- /**
- * Creates a new SCA 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, null);
- }
-
- /**
- * Create a SCA node based on the discovery of the contribution on the classpath for the
- * given classloader. This method should be treated a convenient shortcut with the following
- * assumptions:
- * <ul>
- * <li>This is a standalone application and there is a deployable composite file on the classpath.
- * <li>There is only one contribution which contains the deployable composite file physically in its packaging hierarchy.
- * </ul>
- *
- * @param compositeURI The URI of the composite file relative to the root of the enclosing contribution
- * @param classLoader The ClassLoader used to load the composite file as a resource. If the value is null,
- * then thread context classloader will be used
- * @return A newly created SCA node
- */
- public <T> T createNodeFromClassLoader(String compositeURI, ClassLoader classLoader) throws LauncherException {
- return (T)node(null, compositeURI, null, null, classLoader);
- }
-
- static Options getCommandLineOptions() {
- Options options = new Options();
- Option opt1 = new Option("c", "composite", true, "URI for the composite");
- opt1.setArgName("compositeURI");
- options.addOption(opt1);
- Option opt2 = new Option("n", "node", true, "URI for the node configuration");
- opt2.setArgName("nodeConfigurationURI");
- options.addOption(opt2);
- Option opt3 = new Option("t", "ttl", true, "Time to live");
- opt3.setArgName("timeToLiveInMilliseconds");
- // opt4.setType(long.class);
- options.addOption(opt3);
- return options;
- }
-
- public static void main(String[] args) throws Exception {
- CommandLineParser parser = new PosixParser();
- Options options = getCommandLineOptions();
- CommandLine cli = parser.parse(options, args);
-
- Object node = null;
- ShutdownThread shutdown = null;
- try {
- while (true) {
- if (cli.hasOption("node")) {
-
- // Create a node from a configuration URI
- String configurationURI = cli.getOptionValue("node");
- logger.info("SCA Node configuration: " + configurationURI);
- // Create a node launcher
- NodeLauncher launcher = newInstance();
- node = launcher.createNodeFromURL(configurationURI);
- } else {
-
- // Create a node from a composite URI and a contribution location
- String compositeURI = cli.getOptionValue("composite");
- List<String> contribs = cli.getArgList();
- Contribution[] contributions = null;
- if (!contribs.isEmpty()) {
- contributions = new Contribution[contribs.size()];
- int index = 0;
- for (String contrib : contribs) {
- logger.info("SCA contribution: " + contrib);
- URL url = null;
- try {
- url = new URL(contrib);
- } catch(MalformedURLException e) {
- url = new File(contrib).toURI().toURL();
- }
- contributions[index] = new Contribution("contribution-" + index, url.toString());
- index++;
- }
- } else {
- HelpFormatter formatter = new HelpFormatter();
- formatter.setSyntaxPrefix("Usage: ");
- formatter.printHelp("java " + NodeLauncher.class.getName()
- + " [-c <compositeURI>]"
- + " [-t <ttl>]"
- + " contribution1 ... contributionN", options); return;
- }
- // Create a node launcher
- logger.info("SCA composite: " + compositeURI);
- NodeLauncher launcher = newInstance();
-
- node = launcher.createNode(compositeURI, contributions);
- }
-
- logger.info("Apache Tuscany SCA Node is starting...");
-
- // 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);
- Runtime.getRuntime().addShutdownHook(shutdown);
-
- long ttl = Long.parseLong(cli.getOptionValue("ttl", "-1"));
- if (ttl >= 0) {
- logger.info("Waiting for " + ttl + " milliseconds ...");
- Thread.sleep(ttl);
- // Stop the node
- if (node != null) {
- Object n = node;
- node = null;
- stopNode(n);
- }
- break; // Exit
- }
-
- logger.info("Press 'q' to quit, 'r' to restart.");
- int k = 0;
- try {
- while ((k != 'q') && (k != 'r')) {
- k = System.in.read();
- }
- } catch (IOException e) {
-
- // Wait forever
- Object lock = new Object();
- synchronized(lock) {
- lock.wait();
- }
- }
-
- // Stop the node
- if (node != null) {
- Object n = node;
- node = null;
- stopNode(n);
- }
-
- // Quit
- if (k == 'q' ) {
- break;
- }
- }
- } catch (Exception e) {
- // Stop the node
- if (node != null) {
- try {
- Object n = node;
- node = null;
- stopNode(n);
- } catch (Exception e2) {
- }
- }
- throw e;
-
- } finally {
-
- // Remove the shutdown hook
- if (shutdown != null) {
- Runtime.getRuntime().removeShutdownHook(shutdown);
- }
- }
- }
-
- /**
- * Stop the given node.
- *
- * @param node
- * @throws Exception
- */
- private static void stopNode(Object node) throws Exception {
- try {
- node.getClass().getMethod("stop").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;
-
- public ShutdownThread(Object node) {
- super();
- this.node = node;
- }
-
- @Override
- public void run() {
- try {
- stopNode(node);
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java b/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java
deleted file mode 100644
index 0b641c1b84..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.launcher;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Common functions and constants used by the admin components.
- *
- * @version $Rev$ $Date$
- */
-final class NodeLauncherUtil {
- private static final String NODE_IMPLEMENTATION_LAUNCHER_BOOTSTRAP = "org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap";
-
- private static final Logger logger = Logger.getLogger(NodeLauncherUtil.class.getName());
-
- private static final String TUSCANY_HOME = "TUSCANY_HOME";
- private static final String TUSCANY_PATH = "TUSCANY_PATH";
-
-
- /**
- * Returns a ClassLoader for the Tuscany runtime JARs for use in a standalone
- * J2SE environment.
- *
- * @param parentClassLoader
- *
- * @return
- */
- static ClassLoader standAloneRuntimeClassLoader(ClassLoader parentClassLoader) throws FileNotFoundException, URISyntaxException, MalformedURLException {
- return runtimeClassLoader(parentClassLoader, new StandAloneJARFileNameFilter());
- }
-
- /**
- * Returns a ClassLoader for the Tuscany runtime JARs for use in a Webapp
- * environment.
- *
- * @param parentClassLoader
- *
- * @return
- */
- static ClassLoader webAppRuntimeClassLoader(ClassLoader parentClassLoader) throws FileNotFoundException, URISyntaxException, MalformedURLException {
- return runtimeClassLoader(parentClassLoader, new WebAppJARFileNameFilter());
- }
-
- /**
- * Returns a ClassLoader for the Tuscany runtime JARs.
- *
- * @param parentClassLoader
- * @param filter
- *
- * @return
- */
- private static ClassLoader runtimeClassLoader(ClassLoader parentClassLoader, FilenameFilter filter) throws FileNotFoundException, URISyntaxException, MalformedURLException {
- // First try to see if the runtime classes are already on the classpath
- // If yes, skip the discovery to avoid duplicate jars
- try {
- Class.forName(NODE_IMPLEMENTATION_LAUNCHER_BOOTSTRAP, false, parentClassLoader);
- return parentClassLoader;
- } catch (ClassNotFoundException e) {
- // Ignore;
- }
- // Build list of runtime JARs
- Set<URL> jarDirectoryURLs = new HashSet<URL>();
- Set<URL> jarURLs = new HashSet<URL>();
-
- // First determine the path to the launcher class
- String resource = NodeLauncherUtil.class.getName().replace('.', '/') + ".class";
- URL url = NodeLauncherUtil.class.getClassLoader().getResource(resource);
- if (url == null) {
- throw new FileNotFoundException(resource);
- }
- URI uri = url.toURI();
-
- // If the launcher class is in a JAR, add all runtime JARs from directory containing
- // that JAR (e.g. the Tuscany modules directory) as well as the ../modules and
- // ../lib directories
- String scheme = uri.getScheme();
- if (scheme.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()) {
- File homeDirectory = jarDirectory.getParentFile();
- if (homeDirectory != null && homeDirectory.exists()) {
- collectJARFiles(homeDirectory.getPath(), jarDirectoryURLs, jarURLs, filter);
- }
- }
- }
- }
-
- // Look for a TUSCANY_HOME system property or environment variable
- // Add all the JARs found under $TUSCANY_HOME, $TUSCANY_HOME/modules
- // and $TUSCANY_HOME/lib
- String home = System.getProperty(TUSCANY_HOME);
- if (home == null || home.length() == 0) {
- home = System.getenv(TUSCANY_HOME);
- }
- if (home != null && home.length() != 0) {
- logger.fine(TUSCANY_HOME + ": " + home);
- collectJARFiles(home, jarDirectoryURLs, jarURLs, filter);
- }
-
- // Look for a TUSCANY_PATH system property or environment variable
- // Add all the JARs found under $TUSCANY_PATH, $TUSCANY_PATH/modules
- // and $TUSCANY_PATH/lib
- String ext = System.getProperty(TUSCANY_PATH);
- if (ext == null || ext.length() == 0) {
- ext = System.getenv(TUSCANY_PATH);
- }
- if (ext != null && ext.length() != 0) {
- logger.fine(TUSCANY_PATH + ": " + ext);
- String separator = System.getProperty("path.separator");
- for (StringTokenizer tokens = new StringTokenizer(ext, separator); tokens.hasMoreTokens(); ) {
- collectJARFiles(tokens.nextToken(), jarDirectoryURLs, jarURLs, filter);
- }
- }
-
- // Return the runtime class loader
- if (!jarURLs.isEmpty()) {
- // Remove the URLs which are already in the parent classloader
- if (parentClassLoader instanceof URLClassLoader) {
- URLClassLoader cl = (URLClassLoader)parentClassLoader;
- jarURLs.removeAll(Arrays.asList(cl.getURLs()));
- }
-
- // Return a ClassLoader configured with the runtime JARs
- ClassLoader classLoader = new RuntimeClassLoader(jarURLs.toArray(new URL[jarURLs.size()]), parentClassLoader);
- return classLoader;
-
- } else {
- return null;
- }
- }
-
- /**
- * Collect JAR files under the given directory.
- *
- * @param directory
- * @param jarDirectoryURLs
- * @param jarURLs
- * @param filter
- * @throws MalformedURLException
- */
- private static void collectJARFiles(String directory, Set<URL> jarDirectoryURLs, Collection<URL> jarURLs, FilenameFilter filter)
- throws MalformedURLException {
- File directoryFile = new File(directory);
- URL directoryURL = directoryFile.toURI().toURL();
- if (!jarDirectoryURLs.contains(directoryURL) && directoryFile.exists()) {
-
- // Collect files under $TUSCANY_HOME
- jarDirectoryURLs.add(directoryURL);
- collectJARFiles(directoryFile, jarURLs, filter, false);
-
- // Collect files under $TUSCANY_HOME/modules
- File modulesDirectory = new File(directoryFile, "modules");
- URL modulesDirectoryURL = modulesDirectory.toURI().toURL();
- if (!jarDirectoryURLs.contains(modulesDirectoryURL) && modulesDirectory.exists()) {
- jarDirectoryURLs.add(modulesDirectoryURL);
- collectJARFiles(modulesDirectory, jarURLs, filter, true);
- }
-
- // Collect files under $TUSCANY_HOME/lib
- File libDirectory = new File(directoryFile, "lib");
- URL libDirectoryURL = libDirectory.toURI().toURL();
- if (!jarDirectoryURLs.contains(libDirectoryURL) && libDirectory.exists()) {
- jarDirectoryURLs.add(libDirectoryURL);
- collectJARFiles(libDirectory, jarURLs, filter, true);
- }
- }
- }
-
- /**
- * Collect JAR files in the given directory
- * @param directory
- * @param urls
- * @param filter
- * @param recursive
- * @throws MalformedURLException
- */
- private static void collectJARFiles(File directory, Collection<URL> urls, FilenameFilter filter, boolean recursive) throws MalformedURLException {
- File[] files = directory.listFiles(filter);
- if (files != null) {
- int count = 0;
- for (File file: files) {
- if (recursive && file.isDirectory()) {
- collectJARFiles(file, urls, filter, recursive);
- } else if (file.isFile()) {
- urls.add(file.toURI().toURL());
- count++;
- }
- }
- if (count != 0) {
- logger.fine("Runtime classpath: "+ count + " JAR" + (count > 1? "s":"")+ " from " + directory.toString());
- }
- }
- }
-
- /**
- * A file name filter used to filter JAR files.
- */
- private static class StandAloneJARFileNameFilter implements FilenameFilter {
-
- public boolean accept(File dir, String name) {
- if(new File(dir, name).isDirectory()) {
- return true;
- }
- name = name.toLowerCase();
-
- // Exclude tuscany-sca-all and tuscany-sca-manifest as they duplicate
- // code in the individual runtime module JARs
- if (name.startsWith("tuscany-sca-all")) {
- return false;
- }
- if (name.startsWith("tuscany-sca-manifest")) {
- return false;
- }
-
- if ("features".equals(dir.getName()) && name.startsWith("equinox-manifest")) {
- return false;
- }
-
- // Filter out the Tomcat and Webapp hosts
- if (name.startsWith("tuscany-host-tomcat") ||
- name.startsWith("tuscany-host-webapp")) {
- //FIXME This is temporary
- return false;
- }
-
- // Include JAR and MAR files
- if (name.endsWith(".jar")) {
- return true;
- }
- if (name.endsWith(".mar")) {
- return true;
- }
- return false;
- }
- }
-
- /**
- * A file name filter used to filter JAR files.
- */
- private static class WebAppJARFileNameFilter extends StandAloneJARFileNameFilter {
-
- @Override
- public boolean accept(File dir, String name) {
- if (!super.accept(dir, name)) {
- return false;
- }
- name = name.toLowerCase();
-
- // Exclude servlet-api JARs
- if (name.startsWith("servlet-api")) {
- return false;
- }
-
- // Exclude the Tomcat and Jetty hosts
- if (name.startsWith("tuscany-host-tomcat") || name.startsWith("tuscany-host-jetty")) {
- //FIXME This is temporary
- return false;
- }
-
- return true;
- }
- }
-
-
- /**
- * Creates a new node.
- *
- * @param compositeURI
- * @param contributions
- * @throws LauncherException
- */
- static Object node(String configurationURI, String compositeURI, String compositeContent, Contribution[] contributions, ClassLoader contributionClassLoader) throws LauncherException {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
-
- // Set up runtime ClassLoader
- ClassLoader runtimeClassLoader = runtimeClassLoader(Thread.currentThread().getContextClassLoader(),
- new StandAloneJARFileNameFilter());
- if (runtimeClassLoader != null) {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- }
-
- // Use Java reflection to create the node as only the runtime class
- // loader knows the runtime classes required by the node
- String className = NODE_IMPLEMENTATION_LAUNCHER_BOOTSTRAP;
- Class<?> bootstrapClass;
- if (runtimeClassLoader != null) {
- bootstrapClass = Class.forName(className, true, runtimeClassLoader);
- } else {
- bootstrapClass = Class.forName(className);
- }
-
- Object bootstrap;
- if (configurationURI != null) {
-
- // Construct the node with a configuration URI
- bootstrap = bootstrapClass.getConstructor(String.class).newInstance(configurationURI);
-
- } else if (contributionClassLoader != null) {
-
- // Construct the node with a compositeURI and a classloader
- Constructor<?> constructor = bootstrapClass.getConstructor(String.class, ClassLoader.class);
- bootstrap = constructor.newInstance(compositeURI, contributionClassLoader);
-
- } else if (compositeContent != null) {
-
- // Construct the node with a composite URI, the composite content and
- // the URIs and locations of a list of contributions
- Constructor<?> constructor = bootstrapClass.getConstructor(String.class, String.class, String[].class, String[].class);
- String[] uris = new String[contributions.length];
- String[] locations = new String[contributions.length];
- for (int i = 0; i < contributions.length; i++) {
- uris[i] = contributions[i].getURI();
- locations[i] = contributions[i].getLocation();
- }
- bootstrap = constructor.newInstance(compositeURI, compositeContent, uris, locations);
-
- } else {
-
- // Construct the node with a composite URI and the URIs and
- // locations of a list of contributions
- Constructor<?> constructor = bootstrapClass.getConstructor(String.class, String[].class, String[].class);
- String[] uris = new String[contributions.length];
- String[] locations = new String[contributions.length];
- for (int i = 0; i < contributions.length; i++) {
- uris[i] = contributions[i].getURI();
- locations[i] = contributions[i].getLocation();
- }
- bootstrap = constructor.newInstance(compositeURI, uris, locations);
- }
-
- Object node = bootstrapClass.getMethod("getNode").invoke(bootstrap);
- return node;
-
- } catch (Exception e) {
- NodeLauncher.logger.log(Level.SEVERE, "SCA Node could not be created", e);
- throw new LauncherException(e);
- } finally {
- Thread.currentThread().setContextClassLoader(tccl);
- }
- }
-
- /**
- * Creates a new node daemon.
- *
- * @throws LauncherException
- */
- static Object nodeDaemon() throws LauncherException {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- // Set up runtime ClassLoader
- ClassLoader runtimeClassLoader = runtimeClassLoader(Thread.currentThread().getContextClassLoader(),
- new StandAloneJARFileNameFilter());
- if (runtimeClassLoader != null) {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- }
-
- // Use Java reflection to create the node daemon as only the runtime class
- // loader knows the runtime classes required by the node
- String className = "org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationDaemonBootstrap";
- Class<?> bootstrapClass;
- if (runtimeClassLoader != null) {
- bootstrapClass = Class.forName(className, true, runtimeClassLoader);
- } else {
- bootstrapClass = Class.forName(className);
- }
- Object bootstrap = bootstrapClass.getConstructor().newInstance();
-
- Object nodeDaemon = bootstrapClass.getMethod("getNode").invoke(bootstrap);
- return nodeDaemon;
-
- } catch (Exception e) {
- NodeDaemonLauncher.logger.log(Level.SEVERE, "SCA Node Daemon could not be created", e);
- throw new LauncherException(e);
- } finally {
- Thread.currentThread().setContextClassLoader(tccl);
- }
- }
-
- /**
- * Creates a new domain manager.
- *
- * @throws LauncherException
- */
- static Object domainManager(String rootDirectory) throws LauncherException {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- // Set up runtime ClassLoader
- ClassLoader runtimeClassLoader = runtimeClassLoader(Thread.currentThread().getContextClassLoader(),
- new StandAloneJARFileNameFilter());
- if (runtimeClassLoader != null) {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- }
-
- // Use Java reflection to create the node daemon as only the runtime class
- // loader knows the runtime classes required by the node
- String className = "org.apache.tuscany.sca.domain.manager.launcher.DomainManagerLauncherBootstrap";
- Class<?> bootstrapClass;
- if (runtimeClassLoader != null) {
- bootstrapClass = Class.forName(className, true, runtimeClassLoader);
- } else {
- bootstrapClass = Class.forName(className);
- }
- Constructor<?> constructor = bootstrapClass.getConstructor(String.class);
- Object bootstrap = constructor.newInstance(rootDirectory);
-
- Object domainManager = bootstrapClass.getMethod("getNode").invoke(bootstrap);
- return domainManager;
-
- } catch (Exception e) {
- DomainManagerLauncher.logger.log(Level.SEVERE, "SCA Domain Manager could not be created", e);
- throw new LauncherException(e);
- } finally {
- Thread.currentThread().setContextClassLoader(tccl);
- }
- }
-
- /**
- * Simple URL class loader for the runtime JARs
- */
- private static class RuntimeClassLoader extends URLClassLoader {
- private static final ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
- private ClassLoader parent;
-
- /**
- * Constructs a new class loader.
- * @param urls
- * @param parent
- */
- private RuntimeClassLoader(URL[] urls, ClassLoader parent) {
- super(urls);
- this.parent = parent;
- }
-
- @Override
- public URL findResource(String name) {
- URL url = super.findResource(name);
- if (url == null) {
- url = parent.getResource(name);
- }
- return url;
- }
-
- @Override
- public Enumeration<URL> findResources(String name) throws IOException {
- Enumeration<URL> resources = super.findResources(name);
- Enumeration<URL> parentResources = parent.getResources(name);
- List<URL> allResources = new ArrayList<URL>();
- for (; resources.hasMoreElements(); ) {
- allResources.add(resources.nextElement());
- }
- for (; parentResources.hasMoreElements(); ) {
- allResources.add(parentResources.nextElement());
- }
- return Collections.enumeration(allResources);
- }
-
- @Override
- protected Class<?> findClass(String name) throws ClassNotFoundException {
- Class<?> cl;
-
- // First try to load the class using the parent classloader
- try {
- cl = parent.loadClass(name);
- ClassLoader loadedBy = cl.getClassLoader();
-
- // If the class was not loaded directly by the parent classloader
- // or the system classloader try to load a local version of the class
- // using our RuntimeClassloader instead
- if (loadedBy != parent &&
- loadedBy != systemClassLoader &&
- loadedBy != null) {
-
- try {
- cl = super.findClass(name);
- } catch (ClassNotFoundException e) {
- // No class alternative was found in our RuntimeClassloader,
- // use the class found in the parent classloader hierarchy
- }
- }
- } catch (ClassNotFoundException e) {
-
- // The class was not found by the parent class loader, try
- // to load it using our RuntimeClassloader
- cl = super.findClass(name);
- }
-
- return cl;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeMain.java b/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeMain.java
deleted file mode 100644
index 77751dcc47..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeMain.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.launcher;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionGroup;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.PosixParser;
-
-
-/**
- * Main class for this JAR.
- * With a "-nodeDaemon or -nd" this class launches the SCA Node Daemon.
- * With a "-domainManager or -dm" argument it launches the SCA domain admin node.
- * With any other argument it launches an SCA Node.
- *
- * @version $Rev$ $Date$
- */
-public class NodeMain {
-
- public static void main(String[] args) throws Exception {
- CommandLineParser parser = new PosixParser();
- Options options = new Options();
- OptionGroup group = new OptionGroup();
- group.addOption(new Option("dm", "domainManager", false, "Domain Manager"));
- group.addOption(new Option("nd", "nodeDaemon", false, "Node Domain"));
- options.addOptionGroup(group);
-
- // Add options from NodeLauncher to avoid UnrecognizedOptionException
- for (Object o : NodeLauncher.getCommandLineOptions().getOptions()) {
- options.addOption((Option)o);
- }
-
- CommandLine cli = parser.parse(options, args);
- if (cli.hasOption("nd")) {
- NodeDaemonLauncher.main(args);
- } else if (cli.hasOption("dm")) {
- DomainManagerLauncher.main(args);
- } else {
- NodeLauncher.main(args);
- }
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java b/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java
deleted file mode 100644
index 5345363031..0000000000
--- a/tags/java/sca/2.0-M1/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.launcher;
-
-import static org.apache.tuscany.sca.node.launcher.NodeLauncherUtil.webAppRuntimeClassLoader;
-
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-/**
- * A Servlet filter that forwards service requests to the Servlets registered with
- * the Tuscany ServletHost.
- *
- * @version $Rev$ $Date$
- */
-public class NodeServletFilter implements Filter {
- private static final long serialVersionUID = 1L;
-
- private static final String NODE_WEB_APP_SERVLET_HOST = "org.apache.tuscany.sca.implementation.node.webapp.NodeWebAppServletHost";
-
- private static final Logger logger = Logger.getLogger(NodeServletFilter.class.getName());
-
- private ClassLoader runtimeClassLoader;
- private Class<?> servletHostClass;
- private Object servletHost;
- private Filter filter;
-
- public void init(FilterConfig filterConfig) throws ServletException {
- logger.info("Apache Tuscany SCA WebApp Node is starting...");
-
- try {
- // Get the Tuscany runtime ClassLoader
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- runtimeClassLoader = webAppRuntimeClassLoader(getClass().getClassLoader());
-
- try {
- if (runtimeClassLoader != null) {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- }
-
- // Load the Tuscany WebApp Servlet host and get the host instance
- // for the current webapp
- String className = NODE_WEB_APP_SERVLET_HOST;
- if (runtimeClassLoader != null) {
- servletHostClass = Class.forName(className, true, runtimeClassLoader);
- } else {
- servletHostClass = Class.forName(className);
- }
- servletHost = servletHostClass.getMethod("servletHost").invoke(null);
-
- // Initialize the Servlet host
- servletHostClass.getMethod("init", FilterConfig.class).invoke(servletHost, filterConfig);
-
- // The Servlet host also implements the filter interface
- filter = (Filter)servletHost;
-
- } finally {
- Thread.currentThread().setContextClassLoader(tccl);
- }
-
- } catch (Exception e) {
- logger.log(Level.SEVERE, "Error Starting SCA WebApp Node", e);
- throw new ServletException(e);
- }
-
- logger.info("SCA WebApp Node started.");
- }
-
- public void destroy() {
- logger.info("Apache Tuscany WebApp Node stopping...");
- if (servletHost != null) {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- if (runtimeClassLoader != null) {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- }
-
- servletHostClass.getMethod("destroy").invoke(servletHost);
-
- } catch (Exception e) {
- logger.log(Level.SEVERE, "Error Stopping SCA WebApp Node", e);
- } finally {
- Thread.currentThread().setContextClassLoader(tccl);
- }
- }
- logger.info("SCA WebApp Node stopped.");
- }
-
- public void doFilter(ServletRequest request, ServletResponse response, javax.servlet.FilterChain chain)
- throws IOException, ServletException {
-
- // Delegate to the Servlet host filter
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- if (runtimeClassLoader != null) {
- Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- }
-
- filter.doFilter(request, response, chain);
-
- } finally {
- Thread.currentThread().setContextClassLoader(tccl);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/LICENSE b/tags/java/sca/2.0-M1/modules/policy-security/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/policy-security/META-INF/MANIFEST.MF
deleted file mode 100644
index 593060a130..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,64 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.policy.authorization;uses:="jav
- ax.xml.stream,org.apache.tuscany.sca.contribution.resolver,org.apache
- .tuscany.sca.contribution.processor,org.apache.tuscany.sca.core,org.a
- pache.tuscany.sca.monitor,org.apache.tuscany.sca.policy,javax.xml.nam
- espace";version="2.0.0",org.apache.tuscany.sca.policy.security.jaas;use
- s:="javax.security.auth.callback,org.apache.tuscany.sca.runtime,org.a
- pache.tuscany.sca.assembly,org.apache.tuscany.sca.provider,javax.secu
- rity.auth.login,org.apache.tuscany.sca.core,org.apache.tuscany.sca.mo
- nitor,org.apache.tuscany.sca.policy,org.apache.tuscany.sca.interfaced
- ef,javax.xml.namespace,org.apache.tuscany.sca.invocation,javax.xml.st
- ream,org.apache.tuscany.sca.contribution.resolver,org.apache.tuscany.
- sca.policy.util,org.apache.tuscany.sca.contribution.processor,org.oasisopen
- .sca";version="2.0.0",org.apache.tuscany.sca.policy.authentication.bas
- ic;uses:="org.apache.tuscany.sca.runtime,org.apache.tuscany.sca.assem
- bly,org.apache.tuscany.sca.provider,org.apache.tuscany.sca.core,org.a
- pache.tuscany.sca.policy,org.apache.tuscany.sca.monitor,org.apache.tu
- scany.sca.interfacedef,javax.xml.namespace,org.apache.tuscany.sca.inv
- ocation,javax.xml.stream,org.apache.tuscany.sca.contribution.resolver
- ,org.apache.tuscany.sca.contribution.processor";version="2.0.0",org.apa
- che.tuscany.sca.policy.security;uses:="org.apache.tuscany.sca.definit
- ions.util,org.apache.tuscany.sca.provider,org.apache.tuscany.sca.defi
- nitions,org.apache.tuscany.sca.contribution.processor,org.apache.tusc
- any.sca.core";version="2.0.0",org.apache.tuscany.sca.policy.identity;us
- es:="javax.xml.stream,org.apache.tuscany.sca.contribution.resolver,or
- g.apache.tuscany.sca.contribution.processor,org.apache.tuscany.sca.co
- re,org.apache.tuscany.sca.monitor,org.apache.tuscany.sca.policy,javax
- .xml.namespace";version="2.0.0",org.apache.tuscany.sca.policy.authentic
- ation.token;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany Security Policy Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397295515
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany Security Policy Model
-Import-Package: javax.security.auth.callback,
- javax.security.auth.login,
- javax.xml.namespace,
- javax.xml.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.definitions;version="2.0.0",
- org.apache.tuscany.sca.definitions.util;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.policy.authentication.basic;version="2.0.0",
- org.apache.tuscany.sca.policy.authorization;version="2.0.0",
- org.apache.tuscany.sca.policy.identity;version="2.0.0",
- org.apache.tuscany.sca.policy.security;version="2.0.0",
- org.apache.tuscany.sca.policy.security.jaas;version="2.0.0",
- org.apache.tuscany.sca.policy.util;version="2.0.0",
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.oasisopen.sca;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.policy.security
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/NOTICE b/tags/java/sca/2.0-M1/modules/policy-security/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/pom.xml b/tags/java/sca/2.0-M1/modules/policy-security/pom.xml
deleted file mode 100644
index af2d8926a0..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicy.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicy.java
deleted file mode 100644
index 152a8de6cc..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicy.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.authentication.basic;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * Implementation for policies that could be injected as parameter
- * into the axis2config.
- *
- * @version $Rev$ $Date$
- */
-public class BasicAuthenticationPolicy implements Policy {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
-
- public static final QName BASIC_AUTHENTICATION_POLICY_QNAME = new QName(SCA10_TUSCANY_NS, "basicAuthentication");
- public static final String BASIC_AUTHENTICATION_USERNAME = "userName";
- public static final String BASIC_AUTHENTICATION_PASSWORD = "password";
-
- private String userName;
- private String password;
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public QName getSchemaName() {
- return BASIC_AUTHENTICATION_POLICY_QNAME;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProcessor.java
deleted file mode 100644
index 43db3ec9be..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProcessor.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.authentication.basic;
-
-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.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;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class BasicAuthenticationPolicyProcessor implements StAXArtifactProcessor<BasicAuthenticationPolicy> {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
-
- public QName getArtifactType() {
- return BasicAuthenticationPolicy.BASIC_AUTHENTICATION_POLICY_QNAME;
- }
-
- public BasicAuthenticationPolicyProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- }
-
-
- public BasicAuthenticationPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- BasicAuthenticationPolicy policy = new BasicAuthenticationPolicy();
- 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()) ) {
- // no attributes at the moment
- } else if ( BasicAuthenticationPolicy.BASIC_AUTHENTICATION_USERNAME.equals(name.getLocalPart()) ) {
- policy.setUserName(reader.getElementText());
- } else if ( BasicAuthenticationPolicy.BASIC_AUTHENTICATION_PASSWORD.equals(name.getLocalPart()) ) {
- policy.setPassword(reader.getElementText());
- }
- 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(BasicAuthenticationPolicy policy, XMLStreamWriter writer)
- throws ContributionWriteException, XMLStreamException {
- String prefix = "tuscany";
- writer.writeStartElement(prefix,
- getArtifactType().getLocalPart(),
- getArtifactType().getNamespaceURI());
- writer.writeNamespace("tuscany", SCA10_TUSCANY_NS);
-
- if ( policy.getUserName() != null ) {
- writer.writeStartElement(prefix,
- BasicAuthenticationPolicy.BASIC_AUTHENTICATION_USERNAME,
- getArtifactType().getNamespaceURI());
- writer.writeCharacters(policy.getUserName());
- writer.writeEndElement();
- }
-
- if ( policy.getPassword() != null ) {
- writer.writeStartElement(prefix,
- BasicAuthenticationPolicy.BASIC_AUTHENTICATION_PASSWORD,
- getArtifactType().getNamespaceURI());
- writer.writeCharacters(policy.getPassword());
- writer.writeEndElement();
- }
-
- writer.writeEndElement();
- }
-
- public Class<BasicAuthenticationPolicy> getModelType() {
- return BasicAuthenticationPolicy.class;
- }
-
- public void resolve(BasicAuthenticationPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProviderFactory.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProviderFactory.java
deleted file mode 100644
index 348934bd6c..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPolicyProviderFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.authentication.basic;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Implementation;
-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;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BasicAuthenticationPolicyProviderFactory implements PolicyProviderFactory<BasicAuthenticationPolicy> {
- private ExtensionPointRegistry registry;
-
- public BasicAuthenticationPolicyProviderFactory(ExtensionPointRegistry registry) {
- super();
- this.registry = registry;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createImplementationPolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.assembly.Implementation)
- */
- public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
- return null;//new BasicAuthenticationImplementationPolicyProvider(component, implementation);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createReferencePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentReference, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- return new BasicAuthenticationReferencePolicyProvider(component, reference, binding);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createServicePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentService, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createServicePolicyProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding) {
- return new BasicAuthenticationServicePolicyProvider(component, service, binding);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class getModelType() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPrincipal.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPrincipal.java
deleted file mode 100644
index 3ab9cb656d..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationPrincipal.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.authentication.basic;
-
-import java.security.Principal;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class BasicAuthenticationPrincipal implements Principal {
-
- private String name;
- private String password;
-
- public BasicAuthenticationPrincipal(String name, String password){
- if (name == null) {
- throw new IllegalArgumentException("name cannot be null");
- }
-
- this.name = name;
- this.password = password;
- }
-
- public String getName() {
- return name;
- }
-
- public String getPassword() {
- return password;
- }
-
- @Override
- public int hashCode() {
- return name.hashCode();
- }
-
- @Override
- public String toString() {
- return name;
- }
-
-
- @Override
- public boolean equals(Object principal) {
- if (principal == null)
- return false;
- if (this == principal)
- return true;
- if (getClass() != principal.getClass())
- return false;
- final BasicAuthenticationPrincipal other = (BasicAuthenticationPrincipal)principal;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name)){
- return false;
- }
-
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyInterceptor.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyInterceptor.java
deleted file mode 100644
index 9d3b6e75f8..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyInterceptor.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.authentication.basic;
-
-import javax.security.auth.Subject;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.security.SecurityUtil;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class BasicAuthenticationReferencePolicyInterceptor implements Interceptor {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- public static final QName policySetQName = new QName(SCA10_TUSCANY_NS, "wsBasicAuthentication");
-
- private Invoker next;
- private Operation operation;
- private PolicySet policySet = null;
- private String context;
- private BasicAuthenticationPolicy policy;
-
- public BasicAuthenticationReferencePolicyInterceptor(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 BasicAuthenticationPolicy){
- policy = (BasicAuthenticationPolicy)policyObject;
- break;
- }
- }
- }
- }
-
- public Message invoke(Message msg) {
-
- // get the security context
- Subject subject = SecurityUtil.getSubject(msg);
- BasicAuthenticationPrincipal principal = SecurityUtil.getPrincipal(subject,
- BasicAuthenticationPrincipal.class);
-
- // if no credentials propogated from the reference then use
- // the ones from the policy
- if (principal == null &&
- policy.getUserName() != null &&
- !policy.getUserName().equals("")) {
- principal = new BasicAuthenticationPrincipal(policy.getUserName(),
- policy.getPassword());
- subject.getPrincipals().add(principal);
- }
-
- if (principal == null){
- // alternatively we could call out here to some 3rd party system to get credentials
- // or convert from some other security principal
- }
-
- return getNext().invoke(msg);
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyProvider.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyProvider.java
deleted file mode 100644
index 5aa36ecc89..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationReferencePolicyProvider.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.authentication.basic;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BasicAuthenticationReferencePolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private RuntimeComponentReference reference;
- private Binding binding;
-
- public BasicAuthenticationReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- super();
- this.component = component;
- this.reference = reference;
- this.binding = binding;
- }
-
- private PolicySet findPolicySet() {
- if (binding instanceof PolicySetAttachPoint) {
- List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (BasicAuthenticationPolicy.class.isInstance(p)) {
- return ps;
- }
- }
- }
- }
- return null;
- }
-
- private String getContext() {
- return "component.reference: " + component.getURI()
- + "#"
- + reference.getName()
- + "("
- + binding.getClass().getName()
- + ")";
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
- */
- public Interceptor createInterceptor(Operation operation) {
- PolicySet ps = findPolicySet();
- return ps == null ? null : new BasicAuthenticationReferencePolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.REFERENCE_POLICY;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyInterceptor.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyInterceptor.java
deleted file mode 100644
index 0d11825186..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyInterceptor.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.authentication.basic;
-
-
-import javax.security.auth.Subject;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.PolicySet;
-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.0/impl/java}LoggingPolicy
- *
- * @version $Rev$ $Date$
- */
-public class BasicAuthenticationServicePolicyInterceptor implements Interceptor {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- public static final QName policySetQName = new QName(SCA10_TUSCANY_NS, "wsBasicAuthentication");
-
- private Invoker next;
- private Operation operation;
- private PolicySet policySet = null;
- private String context;
- private BasicAuthenticationPolicy policy;
-
- public BasicAuthenticationServicePolicyInterceptor(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 BasicAuthenticationPolicy){
- policy = (BasicAuthenticationPolicy)policyObject;
- break;
- }
- }
- }
- }
-
- public Message invoke(Message msg) {
-
- Subject subject = SecurityUtil.getSubject(msg);
- BasicAuthenticationPrincipal principal = SecurityUtil.getPrincipal(subject,
- BasicAuthenticationPrincipal.class);
-
- if (principal != null){
-
- System.out.println("Username: " +
- principal.getName() +
- " Password: " +
- principal.getPassword());
-
- // could call out here to some 3rd party system to do whatever you
- // need to do do with username and password
-
- }
-
- return getNext().invoke(msg);
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyProvider.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyProvider.java
deleted file mode 100644
index aae0386589..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/basic/BasicAuthenticationServicePolicyProvider.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.authentication.basic;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BasicAuthenticationServicePolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private Binding binding;
-
- public BasicAuthenticationServicePolicyProvider(RuntimeComponent component, RuntimeComponentService service, Binding binding) {
- super();
- this.component = component;
- this.service = service;
- this.binding = binding;
- }
-
- private PolicySet findPolicySet() {
- if (binding instanceof PolicySetAttachPoint) {
- List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (BasicAuthenticationPolicy.class.isInstance(p)) {
- return ps;
- }
- }
- }
- }
- return null;
- }
-
- private String getContext() {
- return "component.service: " + component.getURI()
- + "#"
- + service.getName()
- + "("
- + binding.getClass().getName()
- + ")";
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
- */
- public Interceptor createInterceptor(Operation operation) {
- PolicySet ps = findPolicySet();
- return ps == null ? null : new BasicAuthenticationServicePolicyInterceptor(getContext(), operation, ps);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
- */
- public String getPhase() {
- return Phase.SERVICE_POLICY;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/token/TokenPrincipal.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/token/TokenPrincipal.java
deleted file mode 100644
index 147b863c01..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authentication/token/TokenPrincipal.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.authentication.token;
-
-import java.security.Principal;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class TokenPrincipal implements Principal {
-
- private String name;
-
- public TokenPrincipal(String name){
- if (name == null) {
- throw new IllegalArgumentException("name cannot be null");
- }
-
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- @Override
- public int hashCode() {
- return name.hashCode();
- }
-
- @Override
- public String toString() {
- return name;
- }
-
-
- @Override
- public boolean equals(Object principal) {
- if (principal == null)
- return false;
- if (this == principal)
- return true;
- if (getClass() != principal.getClass())
- return false;
- final TokenPrincipal other = (TokenPrincipal)principal;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name)){
- return false;
- }
-
- return true;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicy.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicy.java
deleted file mode 100644
index dfb6fee180..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicy.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.authorization;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * Models the SCA Implementation Security Policy Assertion for Authorization.
- *
- * @version $Rev$ $Date$
- */
-public class AuthorizationPolicy implements Policy {
- private final static String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- // private final static String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- public static final QName NAME = new QName(SCA10_NS, "authorization");
-
- public static enum AcessControl {
- permitAll, denyAll, allow
- };
-
- private List<String> roleNames = new ArrayList<String>();
-
- public AuthorizationPolicy() {
- }
-
- private AcessControl accessControl;
-
- public AcessControl getAccessControl() {
- return accessControl;
- }
-
- public void setAccessControl(AcessControl accessControl) {
- this.accessControl = accessControl;
- }
-
- public List<String> getRoleNames() {
- if (accessControl == AcessControl.allow) {
- return roleNames;
- } else {
- throw new IllegalArgumentException("Role names are only available for 'allow'");
- }
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-
- public QName getSchemaName() {
- return NAME;
- }
-
- @Override
- public String toString() {
- if (accessControl == AcessControl.allow) {
- return accessControl.name() + " " + roleNames;
- }
- return accessControl.name();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicyProcessor.java
deleted file mode 100644
index d78c0fc2e3..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/authorization/AuthorizationPolicyProcessor.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.authorization;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.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.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class AuthorizationPolicyProcessor implements StAXArtifactProcessor<AuthorizationPolicy> {
- private static final String ROLES = "roles";
- private Monitor monitor;
-
- public QName getArtifactType() {
- return AuthorizationPolicy.NAME;
- }
-
- public AuthorizationPolicyProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.monitor = monitor;
- }
-
- /**
- * 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(), "policy-security-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public AuthorizationPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- AuthorizationPolicy policy = new AuthorizationPolicy();
- int event = reader.getEventType();
- QName start = reader.getName();
- while (true) {
- switch (event) {
- case START_ELEMENT:
- String ac = reader.getName().getLocalPart();
- if ("allow".equals(ac)) {
- policy.setAccessControl(AuthorizationPolicy.AcessControl.allow);
- String roleNames = reader.getAttributeValue(null, ROLES);
- if (roleNames == null) {
- error("RequiredAttributeRolesMissing", reader);
- //throw new IllegalArgumentException("Required attribute 'roles' is missing.");
- } else {
- StringTokenizer st = new StringTokenizer(roleNames);
- while (st.hasMoreTokens()) {
- policy.getRoleNames().add(st.nextToken());
- }
- }
- } else if ("permitAll".equals(ac)) {
- policy.setAccessControl(AuthorizationPolicy.AcessControl.permitAll);
- } else if ("denyAll".endsWith(ac)) {
- policy.setAccessControl(AuthorizationPolicy.AcessControl.denyAll);
- }
- break;
- case END_ELEMENT:
- if (start.equals(reader.getName())) {
- if (reader.hasNext()) {
- reader.next();
- }
- return policy;
- }
-
- }
- if (reader.hasNext()) {
- event = reader.next();
- } else {
- return policy;
- }
- }
- }
-
- public void write(AuthorizationPolicy policy, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- writer.writeStartElement(AuthorizationPolicy.NAME.getLocalPart());
-
- writer.writeStartElement(policy.getAccessControl().name());
-
- if (policy.getAccessControl() == AuthorizationPolicy.AcessControl.allow) {
- StringBuffer sb = new StringBuffer();
- for (String role : policy.getRoleNames()) {
- sb.append(role);
- }
-
- if (sb.length() > 0) {
- writer.writeAttribute(ROLES, sb.toString());
- }
- }
-
- writer.writeEndElement();
- writer.writeEndElement();
- }
-
- public Class<AuthorizationPolicy> getModelType() {
- return AuthorizationPolicy.class;
- }
-
- public void resolve(AuthorizationPolicy policy, ModelResolver resolver) throws ContributionResolveException {
-
- if ((policy.getAccessControl() == AuthorizationPolicy.AcessControl.allow) &&
- (policy.getRoleNames().isEmpty())){
- // role names are required so leave policy unresolved
- return;
- }
-
- //right now nothing to resolve
- policy.setUnresolved(false);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityImplementationPolicyInterceptor.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityImplementationPolicyInterceptor.java
deleted file mode 100644
index 1f48b3b30a..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityImplementationPolicyInterceptor.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.identity;
-
-import java.util.List;
-
-import javax.security.auth.Subject;
-
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.security.SecurityUtil;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SecurityIdentityImplementationPolicyInterceptor implements Interceptor {
- private List<SecurityIdentityPolicy> securityIdentityPolicies;
- private Invoker next;
-
- public SecurityIdentityImplementationPolicyInterceptor(List<SecurityIdentityPolicy> securityIdentityPolicies) {
- super();
- this.securityIdentityPolicies = securityIdentityPolicies;
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Interceptor#getNext()
- */
- public Invoker getNext() {
- return next;
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Interceptor#setNext(org.apache.tuscany.sca.invocation.Invoker)
- */
- public void setNext(Invoker next) {
- this.next = next;
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Invoker#invoke(org.apache.tuscany.sca.invocation.Message)
- */
- public Message invoke(Message msg) {
- try {
-
- Subject subject = SecurityUtil.getSubject(msg);
-
- // May do some selection here based on runAs settings.
- // by default though there is nothing to do as the implementation
- // assumes the callers user credentials
-
-
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- return getNext().invoke(msg);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityImplementationPolicyProvider.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityImplementationPolicyProvider.java
deleted file mode 100644
index aa52e0bc41..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityImplementationPolicyProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.identity;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SecurityIdentityImplementationPolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private Implementation implementation;
-
- public SecurityIdentityImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
- super();
- this.component = component;
- this.implementation = implementation;
- }
-
- private List<SecurityIdentityPolicy> findPolicies(Operation op) {
- List<SecurityIdentityPolicy> polices = new ArrayList<SecurityIdentityPolicy>();
- // FIXME: How do we get a list of effective policySets for a given operation?
- if (implementation instanceof OperationsConfigurator) {
- OperationsConfigurator operationsConfigurator = (OperationsConfigurator)implementation;
- for (ConfiguredOperation cop : operationsConfigurator.getConfiguredOperations()) {
- if (cop.getName().equals(op.getName())) {
- for (PolicySet ps : cop.getPolicySets()) {
- for (Object p : ps.getPolicies()) {
- if (SecurityIdentityPolicy.class.isInstance(p)) {
- polices.add((SecurityIdentityPolicy)p);
- }
- }
- }
- }
- }
- }
-
- List<PolicySet> policySets = component.getPolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (SecurityIdentityPolicy.class.isInstance(p)) {
- polices.add((SecurityIdentityPolicy)p);
- }
- }
- }
- return polices;
- }
-
- public Interceptor createInterceptor(Operation operation) {
- List<SecurityIdentityPolicy> policies = findPolicies(operation);
- if (policies == null || policies.isEmpty()) {
- return null;
- } else {
- return new SecurityIdentityImplementationPolicyInterceptor(findPolicies(operation));
- }
- }
-
- public String getPhase() {
- return Phase.IMPLEMENTATION_POLICY;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicy.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicy.java
deleted file mode 100644
index e4c4794c52..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicy.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.identity;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- * Models the SCA Implementation Security Policy Assertion for Security Identity.
- *
- * @version $Rev$ $Date$
- */
-public class SecurityIdentityPolicy implements Policy {
- private final static String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- public static final QName NAME = new QName(SCA10_NS, "securityIdentity");
-
- private boolean useCallerIdentity;
-
- private String runAsRole;
-
- public SecurityIdentityPolicy() {
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-
- public QName getSchemaName() {
- return NAME;
- }
-
- public boolean isUseCallerIdentity() {
- return useCallerIdentity;
- }
-
- public void setUseCallerIdentity(boolean useCallerIdentity) {
- this.useCallerIdentity = useCallerIdentity;
- }
-
- public String getRunAsRole() {
- return runAsRole;
- }
-
- public void setRunAsRole(String runAsRole) {
- this.runAsRole = runAsRole;
- }
-
- @Override
- public String toString() {
- if (useCallerIdentity) {
- return "useCallerIdentity";
- }
- return "runAs " + runAsRole;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProcessor.java
deleted file mode 100644
index 0ccda91364..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProcessor.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.identity;
-
-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.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.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class SecurityIdentityPolicyProcessor implements StAXArtifactProcessor<SecurityIdentityPolicy> {
- private static final String ROLE = "role";
- private Monitor monitor;
-
- public QName getArtifactType() {
- return SecurityIdentityPolicy.NAME;
- }
-
- public SecurityIdentityPolicyProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.monitor = monitor;
- }
-
- /**
- * 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(), "policy-security-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public SecurityIdentityPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- SecurityIdentityPolicy policy = new SecurityIdentityPolicy();
- int event = reader.getEventType();
- QName start = reader.getName();
- while (true) {
- switch (event) {
- case START_ELEMENT:
- String ac = reader.getName().getLocalPart();
- if ("runAs".equals(ac)) {
- String roleName = reader.getAttributeValue(null, ROLE);
- if (roleName == null) {
- error("RequiredAttributeRolesMissing", reader);
- //throw new IllegalArgumentException("Required attribute 'roles' is missing.");
- } else {
- policy.setRunAsRole(roleName);
- }
- } else if ("useCallerIdentity".equals(ac)) {
- policy.setUseCallerIdentity(true);
- }
- break;
- case END_ELEMENT:
- if (start.equals(reader.getName())) {
- if (reader.hasNext()) {
- reader.next();
- }
- return policy;
- }
-
- }
- if (reader.hasNext()) {
- event = reader.next();
- } else {
- return policy;
- }
- }
- }
-
- public void write(SecurityIdentityPolicy policy, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- writer.writeStartElement(SecurityIdentityPolicy.NAME.getLocalPart());
-
- String child = policy.isUseCallerIdentity() ? "useCallerIdentity" : "runAs";
- writer.writeStartElement(child);
-
- if (!policy.isUseCallerIdentity()) {
- writer.writeAttribute(ROLE, policy.getRunAsRole());
- }
-
- writer.writeEndElement();
- writer.writeEndElement();
- }
-
- public Class<SecurityIdentityPolicy> getModelType() {
- return SecurityIdentityPolicy.class;
- }
-
- public void resolve(SecurityIdentityPolicy policy, ModelResolver resolver) throws ContributionResolveException {
-
- if (policy.getRunAsRole() != null)
- //right now nothing to resolve
- policy.setUnresolved(false);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProviderFactory.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProviderFactory.java
deleted file mode 100644
index a20f314a2a..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/identity/SecurityIdentityPolicyProviderFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.identity;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Implementation;
-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;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SecurityIdentityPolicyProviderFactory implements PolicyProviderFactory<SecurityIdentityPolicy> {
- private ExtensionPointRegistry registry;
-
- public SecurityIdentityPolicyProviderFactory(ExtensionPointRegistry registry) {
- super();
- this.registry = registry;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createImplementationPolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.assembly.Implementation)
- */
- public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
- return new SecurityIdentityImplementationPolicyProvider(component, implementation);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createReferencePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentReference, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createServicePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentService, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createServicePolicyProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding) {
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class getModelType() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityPolicyDefinitionsProvider.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityPolicyDefinitionsProvider.java
deleted file mode 100644
index b58b9bb874..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityPolicyDefinitionsProvider.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.security;
-
-import java.net.URI;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-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.definitions.util.DefinitionsUtil;
-import org.apache.tuscany.sca.provider.DefinitionsProvider;
-import org.apache.tuscany.sca.provider.DefinitionsProviderException;
-
-/**
- * Provider for Policy Intents and PolicySet definitions related to security
- *
- * @version $Rev$ $Date$
- */
-public class SecurityPolicyDefinitionsProvider implements DefinitionsProvider {
- private static final String tuscanyDefinitionsFile = "org/apache/tuscany/sca/policy/security/tuscany_definitions.xml";
- private String definitionsFile = "org/apache/tuscany/sca/policy/security/definitions.xml";
- URLArtifactProcessor urlArtifactProcessor = null;
-
- public SecurityPolicyDefinitionsProvider(ExtensionPointRegistry registry) {
- URLArtifactProcessorExtensionPoint documentProcessors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- urlArtifactProcessor = (URLArtifactProcessor)documentProcessors.getProcessor(Definitions.class);
- }
-
- public Definitions getDefinitions() throws DefinitionsProviderException {
- Definitions scaDefns = null;
- Definitions tuscanyDefns = null;
- try {
- // Allow privileged access to load resource. Requires RuntimePermssion in security policy.
- URL definitionsFileUrl = AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- return getClass().getClassLoader().getResource(definitionsFile);
- }
- });
-
- URI uri = new URI(definitionsFile);
-
- scaDefns = (Definitions)urlArtifactProcessor.read(null,
- uri,
- definitionsFileUrl);
-
- definitionsFileUrl = AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- return getClass().getClassLoader().getResource(tuscanyDefinitionsFile);
- }
- });
-
- uri = new URI(definitionsFile);
- tuscanyDefns = (Definitions)urlArtifactProcessor.read(null,
- uri,
- definitionsFileUrl);
-
- DefinitionsUtil.aggregate(tuscanyDefns, scaDefns);
- return scaDefns;
-
- } catch ( Exception e ) {
- throw new DefinitionsProviderException(e);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityUtil.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityUtil.java
deleted file mode 100644
index 1297b44b93..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityUtil.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.security;
-
-import java.security.Principal;
-
-import javax.security.auth.Subject;
-
-import org.apache.tuscany.sca.invocation.Message;
-
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class SecurityUtil {
-
- public static Subject getSubject(Message msg){
-
- Subject subject = null;
-
- for (Object header : msg.getHeaders()){
- if (header instanceof Subject){
- subject = (Subject)header;
- break;
- }
- }
-
- if (subject == null){
- subject = new Subject();
- msg.getHeaders().add(subject);
- }
-
- return subject;
- }
-
- public static <T> T getPrincipal(Subject subject, Class<T> clazz){
- for (Principal msgPrincipal : subject.getPrincipals() ){
- if (clazz.isInstance(msgPrincipal)){
- return clazz.cast(msgPrincipal);
- }
- }
-
- return null;
- }
-
- public static Principal getPrincipal(Message msg){
-
- Principal principal = null;
-
- for (Object header : msg.getHeaders()){
- if (header instanceof Principal){
- principal = (Principal)header;
- break;
- }
- }
-
- return principal;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationImplementationPolicyProvider.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationImplementationPolicyProvider.java
deleted file mode 100644
index 185982a749..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationImplementationPolicyProvider.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.security.jaas;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * Policy handler to handle PolicySet containing JaasAuthenticationPolicy instances
- *
- * @version $Rev$ $Date$
- */
-public class JaasAuthenticationImplementationPolicyProvider implements PolicyProvider {
- private RuntimeComponent component;
- private Implementation implementation;
-
- public JaasAuthenticationImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
- super();
- this.component = component;
- this.implementation = implementation;
- }
-
- private List<JaasAuthenticationPolicy> findPolicies(Operation op) {
- List<JaasAuthenticationPolicy> polices = new ArrayList<JaasAuthenticationPolicy>();
- // FIXME: How do we get a list of effective policySets for a given operation?
- if (implementation instanceof OperationsConfigurator) {
- OperationsConfigurator operationsConfigurator = (OperationsConfigurator)implementation;
- for (ConfiguredOperation cop : operationsConfigurator.getConfiguredOperations()) {
- if (cop.getName().equals(op.getName())) {
- for (PolicySet ps : cop.getPolicySets()) {
- for (Object p : ps.getPolicies()) {
- if (JaasAuthenticationPolicy.class.isInstance(p)) {
- polices.add((JaasAuthenticationPolicy)p);
- }
- }
- }
- }
- }
- }
-
- List<PolicySet> policySets = component.getPolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (JaasAuthenticationPolicy.class.isInstance(p)) {
- polices.add((JaasAuthenticationPolicy)p);
- }
- }
- }
- return polices;
- }
-
- public Interceptor createInterceptor(Operation operation) {
- List<JaasAuthenticationPolicy> policies = findPolicies(operation);
- if (policies == null || policies.isEmpty()) {
- return null;
- } else {
- return new JaasAuthenticationInterceptor(findPolicies(operation));
- }
- }
-
- public String getPhase() {
- return Phase.IMPLEMENTATION_POLICY;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationInterceptor.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationInterceptor.java
deleted file mode 100644
index 41a7b62772..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationInterceptor.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.security.jaas;
-
-import java.util.List;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.login.LoginContext;
-
-import org.apache.tuscany.sca.invocation.Interceptor;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JaasAuthenticationInterceptor implements Interceptor {
- private List<JaasAuthenticationPolicy> authenticationPolicies;
- private Invoker next;
-
- public JaasAuthenticationInterceptor(List<JaasAuthenticationPolicy> authenticationPolicies) {
- super();
- this.authenticationPolicies = authenticationPolicies;
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Interceptor#getNext()
- */
- public Invoker getNext() {
- return next;
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Interceptor#setNext(org.apache.tuscany.sca.invocation.Invoker)
- */
- public void setNext(Invoker next) {
- this.next = next;
- }
-
- /**
- * @see org.apache.tuscany.sca.invocation.Invoker#invoke(org.apache.tuscany.sca.invocation.Message)
- */
- public Message invoke(Message msg) {
- try {
- for (JaasAuthenticationPolicy policy : authenticationPolicies) {
- CallbackHandler callbackHandler =
- (CallbackHandler)policy.getCallbackHandlerClass().newInstance();
- LoginContext lc = new LoginContext(policy.getConfigurationName(), callbackHandler);
- lc.login();
- // Subject subject = lc.getSubject();
- }
- } catch (Exception e) {
- throw new ServiceRuntimeException(e);
- }
- return getNext().invoke(msg);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java
deleted file mode 100644
index e1ef32f36c..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.security.jaas;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Policy;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JaasAuthenticationPolicy implements Policy {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- 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/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java
deleted file mode 100644
index edff316700..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
-
-/**
- * Policy handler to handle PolicySet containing JaasAuthenticationPolicy instances
- *
- * @version $Rev$ $Date$
- */
-public class JaasAuthenticationPolicyHandler implements PolicyHandler {
- private static final String jaasPolicy = "JaasPolicy";
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- 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/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProcessor.java
deleted file mode 100644
index 209cb4c7b7..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProcessor.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 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.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.ClassReference;
-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.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JaasAuthenticationPolicyProcessor implements StAXArtifactProcessor<JaasAuthenticationPolicy> {
- private static final QName JAAS_AUTHENTICATION_POLICY_QNAME = JaasAuthenticationPolicy.NAME;
- private static final String callbackHandler = "callbackHandler";
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- public static final QName CALLBACK_HANDLER_QNAME = new QName(SCA10_TUSCANY_NS, callbackHandler);
- public static final QName CONFIGURATION_QNAME = new QName(SCA10_TUSCANY_NS, "configurationName");
- private Monitor monitor;
-
- public QName getArtifactType() {
- return JAAS_AUTHENTICATION_POLICY_QNAME;
- }
-
- public JaasAuthenticationPolicyProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.monitor = monitor;
- }
-
- /**
- * 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(), "policy-security-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public JaasAuthenticationPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- JaasAuthenticationPolicy policy = new JaasAuthenticationPolicy();
- int event = reader.getEventType();
- QName name = null;
-
- while (reader.hasNext()) {
- event = reader.getEventType();
- switch (event) {
- case START_ELEMENT : {
- name = reader.getName();
- if (name.equals(CALLBACK_HANDLER_QNAME)) {
- String callbackHandlerClassName = reader.getElementText();
- if (callbackHandlerClassName != null) {
- policy.setCallbackHandlerClassName(callbackHandlerClassName.trim());
- }
- }
- if (name.equals(CONFIGURATION_QNAME)) {
- String configurationName = reader.getElementText();
- if (configurationName != null) {
- policy.setConfigurationName(configurationName.trim());
- }
- }
-
- break;
- }
- }
-
- if ( event == END_ELEMENT ) {
- if ( JAAS_AUTHENTICATION_POLICY_QNAME.equals(reader.getName()) ) {
- break;
- }
- }
-
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
-
- return policy;
- }
-
- public void write(JaasAuthenticationPolicy policy, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- String prefix = "tuscany";
- writer.writeStartElement(prefix,
- JAAS_AUTHENTICATION_POLICY_QNAME.getLocalPart(),
- JAAS_AUTHENTICATION_POLICY_QNAME.getNamespaceURI());
- writer.writeNamespace("tuscany", SCA10_TUSCANY_NS);
-
-
- writer.writeEndElement();
- }
-
- public Class<JaasAuthenticationPolicy> getModelType() {
- return JaasAuthenticationPolicy.class;
- }
-
- public void resolve(JaasAuthenticationPolicy policy, ModelResolver resolver) throws ContributionResolveException {
-
- if (policy.getCallbackHandlerClassName() != null) {
- ClassReference classReference = new ClassReference(policy.getCallbackHandlerClassName());
- classReference = resolver.resolveModel(ClassReference.class, classReference);
- Class<?> callbackClass = classReference.getJavaClass();
- if (callbackClass == null) {
- error("ClassNotFoundException", resolver, policy.getCallbackHandlerClassName());
- //throw new ContributionResolveException(new ClassNotFoundException(policy.getCallbackHandlerClassName()));
- } else {
- policy.setCallbackHandlerClass(callbackClass);
- policy.setUnresolved(false);
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProviderFactory.java b/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProviderFactory.java
deleted file mode 100644
index 48a42eb711..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyProviderFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.security.jaas;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Implementation;
-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;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JaasAuthenticationPolicyProviderFactory implements PolicyProviderFactory<JaasAuthenticationPolicy> {
-
- public JaasAuthenticationPolicyProviderFactory(ExtensionPointRegistry registry) {
- super();
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createImplementationPolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.assembly.Implementation)
- */
- public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
- return new JaasAuthenticationImplementationPolicyProvider(component, implementation);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createReferencePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentReference, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createReferencePolicyProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- Binding binding) {
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createServicePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentService, org.apache.tuscany.sca.assembly.Binding)
- */
- public PolicyProvider createServicePolicyProvider(RuntimeComponent component,
- RuntimeComponentService service,
- Binding binding) {
- return null;
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class<JaasAuthenticationPolicy> getModelType() {
- return JaasAuthenticationPolicy.class;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index bf8e4d11b4..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,27 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.policy.authorization.AuthorizationPolicyProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#authorization,model=org.apache.tuscany.sca.policy.authorization.AuthorizationPolicy
-org.apache.tuscany.sca.policy.authorization.AuthorizationPolicyProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#allow,model=org.apache.tuscany.sca.policy.authorization.AuthorizationPolicy
-org.apache.tuscany.sca.policy.authorization.AuthorizationPolicyProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#permitAll,model=org.apache.tuscany.sca.policy.authorization.AuthorizationPolicy
-org.apache.tuscany.sca.policy.authorization.AuthorizationPolicyProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#denyAll,model=org.apache.tuscany.sca.policy.authorization.AuthorizationPolicy
-org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicyProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#runAs,model=org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicy
-org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicyProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#securityIdentity,model=org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicy
-org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#securityIdentity,model=org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicy
-org.apache.tuscany.sca.policy.security.jaas.JaasAuthenticationPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#jaasAuthentication,model=org.apache.tuscany.sca.policy.security.jaas.JaasAuthenticationPolicy
-org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#basicAuthentication,model=org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicy
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider b/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider
deleted file mode 100644
index 790424df6b..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.DefinitionsProvider
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for SCA Definitions Providers
-org.apache.tuscany.sca.policy.security.SecurityPolicyDefinitionsProvider \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory b/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
deleted file mode 100644
index 0363fbd981..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the policy extension
-org.apache.tuscany.sca.policy.security.jaas.JaasAuthenticationPolicyProviderFactory;model=org.apache.tuscany.sca.policy.security.jaas.JaasAuthenticationPolicy
-org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicyProviderFactory;model=org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicy
-org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicyProviderFactory;model=org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicy
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/definitions.xml b/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/definitions.xml
deleted file mode 100644
index f8f0634a9a..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/definitions.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
-
- <!-- POLICY SETS -->
- <policySet name="runAs" appliesTo="sca:implementation.java"/>
- <policySet name="allow" appliesTo="sca:implementation.java"/>
- <policySet name="rolesAllowed" appliesTo="sca:implementation.java"/>
- <policySet name="permitAll" appliesTo="sca:implementation.java"/>
- <policySet name="denyAll" appliesTo="sca:implementation.java"/>
-
- <!-- Policy Intents Defined by the SCA Runtime -->
- <intent name="authentication"
- constrains="sca:binding tuscany:binding">
- <description>
- Specifying this intent on references requires necessary authentication information
- to be sent along with outgoing messages. Specifying this intent on service requires
- incoming messages to be authenticated
- </description>
- </intent>
-
- <intent name="confidentiality"
- constrains="sca:binding tuscany:binding">
- <description>
- Specifying this intent requires message exchanged to be encrypted
- </description>
- </intent>
-
- <intent name="integrity"
- constrains="sca:binding tuscany:binding">
- <description>
- Specifying this intent requires message exchanged to be signed
- </description>
- </intent>
-</definitions>
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/tuscany_definitions.xml b/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/tuscany_definitions.xml
deleted file mode 100644
index 91383eaf6a..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/org/apache/tuscany/sca/policy/security/tuscany_definitions.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
-
- <intent name="identity" constrains="sca:implementation.java
- sca:implementation.spring">
- <description>All invocations are must have an identity set</description>
- </intent>
-
- <intent name="jaasAuthentication" constrains="sca:implementation.java
- sca:implementation.spring">
- <description>All invocations to be authenticated</description>
- </intent>
-</definitions> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/policy-security-validation-messages.properties b/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/policy-security-validation-messages.properties
deleted file mode 100644
index ebb47f2b60..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/main/resources/policy-security-validation-messages.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-RequiredAttributeRolesMissing = Required attribute 'roles' is missing.
-ClassNotFoundException = Class Not Found Exception: {0} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/test/java/org/apache/tuscany/sca/policy/security/PolicyProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/policy-security/src/test/java/org/apache/tuscany/sca/policy/security/PolicyProcessorTestCase.java
deleted file mode 100644
index 31b829556b..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/test/java/org/apache/tuscany/sca/policy/security/PolicyProcessorTestCase.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.security;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.policy.authorization.AuthorizationPolicy;
-import org.apache.tuscany.sca.policy.authorization.AuthorizationPolicyProcessor;
-import org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicy;
-import org.apache.tuscany.sca.policy.identity.SecurityIdentityPolicyProcessor;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PolicyProcessorTestCase {
- private final static String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- private final static List<String> SEQ =
- Arrays.asList("permitAll",
- "allow [r1, r2]",
- "denyAll",
- "runAs admin",
- "useCallerIdentity",
- "permitAll",
- "allow [r1, r2]",
- "denyAll",
- "runAs admin");
-
- @Test
- public void testRead() throws Exception {
- List<String> results = new ArrayList<String>();
- Map<QName, StAXArtifactProcessor> processors = new HashMap<QName, StAXArtifactProcessor>();
- processors.put(AuthorizationPolicy.NAME, new AuthorizationPolicyProcessor(null,null));
- processors.put(SecurityIdentityPolicy.NAME, new SecurityIdentityPolicyProcessor(null,null));
- processors.put(new QName(SCA10_NS, "allow"), new AuthorizationPolicyProcessor(null,null));
- processors.put(new QName(SCA10_NS, "permitAll"), new AuthorizationPolicyProcessor(null,null));
- processors.put(new QName(SCA10_NS, "denyAll"), new AuthorizationPolicyProcessor(null,null));
- processors.put(new QName(SCA10_NS, "runAs"), new SecurityIdentityPolicyProcessor(null,null));
- InputStream is = getClass().getResourceAsStream("mock_policy_definitions.xml");
- XMLInputFactory factory = XMLInputFactory.newInstance();
- XMLStreamReader reader = factory.createXMLStreamReader(is);
- while (true) {
- int event = reader.getEventType();
- if (event == XMLStreamConstants.START_ELEMENT) {
- if ("policySet".equals(reader.getName().getLocalPart())) {
- reader.nextTag();
- results.add(processors.get(reader.getName()).read(reader).toString());
- }
- }
- if (reader.hasNext()) {
- reader.next();
- } else {
- break;
- }
- }
- Assert.assertEquals(SEQ, results);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-security/src/test/resources/org/apache/tuscany/sca/policy/security/mock_policy_definitions.xml b/tags/java/sca/2.0-M1/modules/policy-security/src/test/resources/org/apache/tuscany/sca/policy/security/mock_policy_definitions.xml
deleted file mode 100644
index 53d1a581f0..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-security/src/test/resources/org/apache/tuscany/sca/policy/security/mock_policy_definitions.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
-
- <!-- POLICY SETS -->
- <policySet name="ps1" provides="authorization" appliesTo="sca:implementation">
- <authorization>
- <permitAll />
- </authorization>
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="ps2" provides="authorization" appliesTo="sca:implementation">
- <authorization>
- <allow roles="r1 r2" />
- </authorization>
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="ps3" provides="authorization" appliesTo="sca:implementation">
- <authorization>
- <denyAll />
- </authorization>
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="ps4" provides="securityIdentity" appliesTo="sca:implementation">
- <securityIdentity>
- <runAs role="admin" />
- </securityIdentity>
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="ps5" provides="securityIdentity" appliesTo="sca:implementation">
- <securityIdentity>
- <useCallerIdentity />
- </securityIdentity>
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="ps6" provides="authorization" appliesTo="sca:implementation">
- <permitAll />
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="ps7" provides="authorization" appliesTo="sca:implementation">
- <allow roles="r1 r2" />
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="ps8" provides="authorization" appliesTo="sca:implementation">
- <denyAll />
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="ps9" provides="securityIdentity" appliesTo="sca:implementation">
- <runAs role="admin" />
- </policySet>
-
-</definitions> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml-ws/LICENSE b/tags/java/sca/2.0-M1/modules/policy-xml-ws/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml-ws/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml-ws/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/policy-xml-ws/META-INF/MANIFEST.MF
deleted file mode 100644
index d11dc08764..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml-ws/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,31 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.policy.xml.ws;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Policy XML WS Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397120421
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Policy XML WS Model
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.axiom.om,
- org.apache.neethi,
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.policy.xml;version="2.0.0";resolution:=optional
-Bundle-SymbolicName: org.apache.tuscany.sca.policy.xml.ws
-Bundle-DocURL: http://www.apache.org/
-Export-Package: org.apache.tuscany.sca.policy.xml.ws;version="2.0.0";
- uses:="javax.xml.stream,
- junit.framework,
- org.apache.tuscany.sca.contribution.resolver,
- org.apache.tuscany.sca.contribution.processor,
- org.apache.tuscany.sca.policy,
- javax.xml.namespace"
-
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml-ws/NOTICE b/tags/java/sca/2.0-M1/modules/policy-xml-ws/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml-ws/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml-ws/pom.xml b/tags/java/sca/2.0-M1/modules/policy-xml-ws/pom.xml
deleted file mode 100644
index c1c9d6fa2b..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml-ws/pom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-policy-xml-ws</artifactId>
- <name>Apache Tuscany SCA Policy XML WS Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.7</version>
- <exclusions>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.neethi</groupId>
- <artifactId>neethi</artifactId>
- <version>2.0.4</version>
- <exclusions>
- <exclusion>
- <groupId>wsdl4j</groupId>
- <artifactId>wsdl4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.7</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </exclusion>
- </exclusions>
- </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>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/main/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/main/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessor.java
deleted file mode 100644
index 1b0813a0d8..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/main/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessor.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.xml.ws;
-
-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.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.neethi.PolicyEngine;
-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;
-
-
-/**
- * Processor for handling xml models of PolicySet definitions
- *
- * @version $Rev$ $Date$
- */
-public class WSPolicyProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<org.apache.neethi.Policy> {
- public final static String WS_POLICY_NS = "http://schemas.xmlsoap.org/ws/2004/09/policy";
- public final static String WS_POLICY = "Policy";
-
- public final static QName WS_POLICY_QNAME =new QName(WS_POLICY_NS, WS_POLICY);
-
- public WSPolicyProcessor() {
- System.out.println(">>>Initializing WSPolicyProcessor");
- }
-
- public WSPolicyProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- System.out.println(">>>Initializing WSPolicyProcessor");
- }
-
- public QName getArtifactType() {
- return WS_POLICY_QNAME;
- }
-
- public Class<org.apache.neethi.Policy> getModelType() {
- return org.apache.neethi.Policy.class;
- }
-
- public org.apache.neethi.Policy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- org.apache.neethi.Policy wsPolicy = null;
-
- int event = reader.getEventType();
- if (event == START_ELEMENT) {
- QName name = reader.getName();
- if (WS_POLICY_QNAME.equals(name)) {
- OMElement policyElement = loadElement(reader);
- wsPolicy = PolicyEngine.getPolicy(policyElement);
- }
- }
- return wsPolicy;
- }
-
- public void write(org.apache.neethi.Policy wsPolicy, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write an <sca:policySet>
- writer.writeStartElement(WS_POLICY_NS, WS_POLICY);
-
- //FIXME write proper ws-policy stuff here
-
- writer.writeEndElement();
- }
-
- public void resolve(org.apache.neethi.Policy wsPolicy, ModelResolver resolver) throws ContributionResolveException {
-
- }
-
-
- private OMElement loadElement(XMLStreamReader reader) throws XMLStreamException {
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMElement head = fac.createOMElement(reader.getName());
- OMElement current = head;
-
- while (true) {
- switch (reader.next()) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- OMElement child = fac.createOMElement(name, current);
-
- int count = reader.getNamespaceCount();
- for (int i = 0; i < count; i++) {
- String prefix = reader.getNamespacePrefix(i);
- String ns = reader.getNamespaceURI(i);
- child.declareNamespace(ns, prefix);
- }
-
- if(!"".equals(name.getNamespaceURI())) {
- child.declareNamespace(name.getNamespaceURI(), name.getPrefix());
- }
-
- // add the attributes for this element
- count = reader.getAttributeCount();
- for (int i = 0; i < count; i++) {
- OMNamespace omNs = null;
- String ns = reader.getAttributeNamespace(i);
- String prefix = reader.getAttributePrefix(i);
- String qname = reader.getAttributeLocalName(i);
- String value = reader.getAttributeValue(i);
-
- if ( ns != null ) {
- omNs = fac.createOMNamespace(ns, prefix);
- }
-
- child.addAttribute(qname, value, omNs);
- if (ns != null) {
- child.declareNamespace(ns, prefix);
- }
- }
- current = child;
- break;
- case XMLStreamConstants.CDATA:
- fac.createOMText(current, reader.getText());
- break;
- case XMLStreamConstants.CHARACTERS:
- fac.createOMText(current, reader.getText());
- break;
- case XMLStreamConstants.END_ELEMENT:
- if ( current == head ) {
- return head;
- } else {
- current = (OMElement)current.getParent();
- }
- }
- }
- }
-
-
- }
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 2e11e31fec..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.policy.xml.ws.WSPolicyProcessor;qname=http://schemas.xmlsoap.org/ws/2004/09/policy#Policy,model=org.apache.neethi.Policy
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/TestModelResolver.java b/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/TestModelResolver.java
deleted file mode 100644
index 57e3fe8d3a..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/TestModelResolver.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.xml.ws;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-
-/**
- * A default implementation of an artifact resolver, based on a map.
- *
- * @version $Rev$ $Date$
- */
-public class TestModelResolver implements ModelResolver {
- private static final long serialVersionUID = -7826976465762296634L;
-
- private Map<Object, Object> map = new HashMap<Object, Object>();
-
- public TestModelResolver() {
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- Object resolved = map.get(unresolved);
- if (resolved != null) {
-
- // Return the resolved object
- return modelClass.cast(resolved);
-
- } else {
-
- // Return the unresolved object
- return unresolved;
- }
- }
-
- public void addModel(Object resolved) {
- map.put(resolved, resolved);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(resolved);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/TestPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/TestPolicyProcessor.java
deleted file mode 100644
index cb5db57c15..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/TestPolicyProcessor.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.xml.ws;
-
-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.Policy;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class TestPolicyProcessor implements StAXArtifactProcessor<Policy> {
-
- public QName getArtifactType() {
- return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
- }
-
- public Policy read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
- return new MockPolicyImplOne();
- }
-
- public void write(Policy arg0, XMLStreamWriter arg1) throws ContributionWriteException,
- XMLStreamException {
- }
-
- public Class<Policy> getModelType() {
- // TODO Auto-generated method stub
- return Policy.class;
- }
-
- public void resolve(Policy arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
-
- public class MockPolicyImplOne implements Policy {
- public QName getSchemaName() {
- 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/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessorTestCase.java
deleted file mode 100644
index b0aa1ed905..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/java/org/apache/tuscany/sca/policy/xml/ws/WSPolicyProcessorTestCase.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.xml.ws;
-
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.io.StringReader;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.policy.xml.ws.WSPolicyProcessor;
-
-import junit.framework.TestCase;
-
-/**
- * Test reading SCA XML assembly documents.
- *
- * @version $Rev$ $Date$
- */
-public class WSPolicyProcessorTestCase extends TestCase {
-
- private static final String VALID_WS_POLICY =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
- + "<definitions xmlns=\"http://www.osoa.org/xmlns/sca/1.0\""
- + " targetNamespace=\"http://test\""
- + " xmlns:test=\"http://test\""
- + " xmlns:sca=\"http://www.osoa.org/xmlns/sca/1.0\">"
- + " "
- + " <policySet name=\"SecureWSPolicy\""
- + " provides=\"test:confidentiality\""
- + " appliesTo=\"sca:binding.ws\""
- + " xmlns=\"http://www.osoa.org/xmlns/sca/1.0\""
- + " 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>"
- + " </definitions>";
-
- private XMLInputFactory inputFactory;
-
- @Override
- public void setUp() throws Exception {
- inputFactory = XMLInputFactory.newInstance();
-
- }
-
- public void testReadWsPolicy() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_WS_POLICY));
- WSPolicyProcessor processor = new WSPolicyProcessor();
- Object artifact = null;
-
- QName name = null;
- reader.next();
- while ( true ) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT: {
- name = reader.getName();
-
- if(WSPolicyProcessor.WS_POLICY_QNAME.equals(name)) {
- artifact = processor.read(reader);
- }
-
- break;
- }
- }
-
- if ( reader.hasNext() ) {
- reader.next();
- } else {
- break;
- }
- }
- assertNotNull(artifact);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml b/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
deleted file mode 100644
index 814476b4f9..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml-ws/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://test"
- xmlns:test="http://test"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
-
-<policySet name="SecureWSPolicy"
- provides="test:confidentiality"
- appliesTo="sca:binding.ws"
- xmlns="http://www.osoa.org/xmlns/sca/1.0"
- 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>
- </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/tags/java/sca/2.0-M1/modules/policy-xml/LICENSE b/tags/java/sca/2.0-M1/modules/policy-xml/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/policy-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index 3e5ce44e75..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.policy.xml;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Policy XML Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397115375
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Policy XML Model
-Import-Package: javax.xml.namespace,javax.xml.stream,javax.xml.xpath,o
- rg.apache.tuscany.sca.contribution.processor;version="2.0.0",org.apache
- .tuscany.sca.contribution.resolver;version="2.0.0",org.apache.tuscany.s
- ca.core;version="2.0.0",org.apache.tuscany.sca.monitor;version="2.0.0",or
- g.apache.tuscany.sca.policy;version="2.0.0",org.apache.tuscany.sca.poli
- cy.impl;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.policy.xml
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/NOTICE b/tags/java/sca/2.0-M1/modules/policy-xml/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/pom.xml b/tags/java/sca/2.0-M1/modules/policy-xml/pom.xml
deleted file mode 100644
index 7ab513c6cc..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/BindingTypeProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/BindingTypeProcessor.java
deleted file mode 100644
index ae6805c832..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/BindingTypeProcessor.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.xml;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-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.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.impl.BindingTypeImpl;
-
-/**
- * Processor for handling XML models of BindingType meta data definitions
- *
- * @version $Rev$ $Date$
- */
-public class BindingTypeProcessor extends IntentAttachPointTypeProcessor {
-
- public BindingTypeProcessor(PolicyFactory policyFactory,
- IntentAttachPointTypeFactory intentAttachPointTypeFactory,
- StAXArtifactProcessor<Object> extensionProcessor,
- Monitor monitor) {
- super(policyFactory, intentAttachPointTypeFactory, extensionProcessor, monitor);
- }
-
- public BindingTypeProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor<Object> extensionProcessor,
- Monitor monitor) {
- super(modelFactories.getFactory(PolicyFactory.class), modelFactories
- .getFactory(IntentAttachPointTypeFactory.class), extensionProcessor, monitor);
- }
-
- public QName getArtifactType() {
- return BINDING_TYPE_QNAME;
- }
-
- @Override
- protected IntentAttachPointType resolveExtensionType(IntentAttachPointType extnType, ModelResolver resolver)
- throws ContributionResolveException {
- if (extnType instanceof BindingTypeImpl) {
- BindingTypeImpl bindingType = (BindingTypeImpl)extnType;
- return resolver.resolveModel(BindingTypeImpl.class, bindingType);
- } else {
- return extnType;
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ImplementationTypeProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ImplementationTypeProcessor.java
deleted file mode 100644
index e405da21c7..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ImplementationTypeProcessor.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.xml;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-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.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.impl.ImplementationTypeImpl;
-
-/**
- * Processor for handling XML models of ImplementationType meta data definitions
- *
- * @version $Rev$ $Date$
- */
-public class ImplementationTypeProcessor extends IntentAttachPointTypeProcessor {
-
- public ImplementationTypeProcessor(PolicyFactory policyFactory,
- IntentAttachPointTypeFactory intentAttachPointTypeFactory,
- StAXArtifactProcessor<Object> extensionProcessor,
- Monitor monitor) {
- super(policyFactory, intentAttachPointTypeFactory, extensionProcessor, monitor);
- }
-
- public ImplementationTypeProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor<Object> extensionProcessor,
- Monitor monitor) {
- super(modelFactories.getFactory(PolicyFactory.class), modelFactories
- .getFactory(IntentAttachPointTypeFactory.class), extensionProcessor, monitor);
- }
-
- public QName getArtifactType() {
- return IMPLEMENTATION_TYPE_QNAME;
- }
-
- @Override
- protected IntentAttachPointType resolveExtensionType(IntentAttachPointType extnType, ModelResolver resolver)
- throws ContributionResolveException {
- if (extnType instanceof ImplementationTypeImpl) {
- ImplementationTypeImpl implType = (ImplementationTypeImpl)extnType;
- return resolver.resolveModel(ImplementationTypeImpl.class, implType);
- } else {
- return extnType;
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentAttachPointTypeProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentAttachPointTypeProcessor.java
deleted file mode 100644
index a85ef28572..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentAttachPointTypeProcessor.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.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.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.impl.BindingTypeImpl;
-import org.apache.tuscany.sca.policy.impl.ImplementationTypeImpl;
-
-/**
- * Processor for handling XML models of ExtensionType meta data definitions
- *
- * @version $Rev$ $Date$
- */
-abstract class IntentAttachPointTypeProcessor extends BaseStAXArtifactProcessor implements
- StAXArtifactProcessor<IntentAttachPointType>, PolicyConstants {
-
- private IntentAttachPointTypeFactory attachPointTypeFactory;
- private PolicyFactory policyFactory;
- private Monitor monitor;
-
- protected abstract IntentAttachPointType resolveExtensionType(IntentAttachPointType extnType, ModelResolver resolver)
- throws ContributionResolveException;
-
- public IntentAttachPointTypeProcessor(PolicyFactory policyFactory,
- IntentAttachPointTypeFactory attachPointTypeFactory,
- StAXArtifactProcessor<Object> extensionProcessor,
- Monitor monitor) {
- this.policyFactory = policyFactory;
- this.attachPointTypeFactory = attachPointTypeFactory;
- this.monitor = monitor;
- }
-
- /**
- * 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(),
- "policy-xml-validation-messages",
- Severity.ERROR,
- model,
- message,
- (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public IntentAttachPointType read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- QName type = getQName(reader, TYPE);
-
- if (type != null) {
- if (type.getLocalPart().startsWith(BINDING)) {
- IntentAttachPointType bindingType = attachPointTypeFactory.createBindingType();
- bindingType.setName(type);
- bindingType.setUnresolved(true);
-
- readAlwaysProvidedIntents(bindingType, reader);
- readMayProvideIntents(bindingType, reader);
- return bindingType;
- } else if (type.getLocalPart().startsWith(IMPLEMENTATION)) {
- IntentAttachPointType implType = attachPointTypeFactory.createImplementationType();
- implType.setName(type);
- implType.setUnresolved(true);
-
- readAlwaysProvidedIntents(implType, reader);
- readMayProvideIntents(implType, reader);
- return implType;
- } else {
- error("UnrecognizedIntentAttachPointType", reader, type);
- //throw new ContributionReadException("Unrecognized IntentAttachPointType - " + type);
- }
- } else {
- error("RequiredAttributeMissing", reader, TYPE);
- //throw new ContributionReadException("Required attribute '" + TYPE +
- //"' missing from BindingType Definition");
- }
- return null;
- }
-
- private void readAlwaysProvidedIntents(IntentAttachPointType extnType, XMLStreamReader reader) {
- String value = reader.getAttributeValue(null, ALWAYS_PROVIDES);
- if (value != null) {
- List<Intent> alwaysProvided = extnType.getAlwaysProvidedIntents();
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- QName qname = getQNameValue(reader, tokens.nextToken());
- Intent intent = policyFactory.createIntent();
- intent.setName(qname);
- alwaysProvided.add(intent);
- }
- }
- }
-
- private void readMayProvideIntents(IntentAttachPointType extnType, XMLStreamReader reader) {
- String value = reader.getAttributeValue(null, MAY_PROVIDE);
- if (value != null) {
- List<Intent> mayProvide = extnType.getMayProvideIntents();
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- QName qname = getQNameValue(reader, tokens.nextToken());
- Intent intent = policyFactory.createIntent();
- intent.setName(qname);
- mayProvide.add(intent);
- }
- }
- }
-
- public void write(IntentAttachPointType extnType, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
-
- // Write an <sca:bindingType or sca:implementationType>
- if (extnType instanceof BindingTypeImpl) {
- writer.writeStartElement(SCA10_NS, BINDING_TYPE);
- } else if (extnType instanceof ImplementationTypeImpl) {
- writer.writeStartElement(SCA10_NS, IMPLEMENTATION_TYPE);
- }
-
- writeAlwaysProvidesIntentsAttribute(extnType, writer);
- writeMayProvideIntentsAttribute(extnType, writer);
-
- writer.writeEndElement();
- }
-
- private void writeMayProvideIntentsAttribute(IntentAttachPointType extnType, XMLStreamWriter writer)
- throws XMLStreamException {
- StringBuffer sb = new StringBuffer();
- for (Intent intent : extnType.getMayProvideIntents()) {
- writer.writeNamespace(intent.getName().getPrefix(), intent.getName().getNamespaceURI());
- sb.append(intent.getName().getPrefix() + COLON + intent.getName().getLocalPart());
- sb.append(WHITE_SPACE);
- }
-
- if (sb.length() > 0) {
- writer.writeAttribute(MAY_PROVIDE, sb.toString());
- }
- }
-
- private void writeAlwaysProvidesIntentsAttribute(IntentAttachPointType extnType, XMLStreamWriter writer)
- throws XMLStreamException {
- StringBuffer sb = new StringBuffer();
- for (Intent intent : extnType.getAlwaysProvidedIntents()) {
- writer.writeNamespace(intent.getName().getPrefix(), intent.getName().getNamespaceURI());
- sb.append(intent.getName().getPrefix() + COLON + intent.getName().getLocalPart());
- sb.append(WHITE_SPACE);
- }
-
- if (sb.length() > 0) {
- writer.writeAttribute(ALWAYS_PROVIDES, sb.toString());
-
- }
- }
-
- public void resolve(IntentAttachPointType extnType, ModelResolver resolver) throws ContributionResolveException {
-
- if (extnType != null && extnType.isUnresolved()) {
- resolveAlwaysProvidedIntents(extnType, resolver);
- resolveMayProvideIntents(extnType, resolver);
- extnType.setUnresolved(false);
- //resolveExtensionType(extnType, resolver);
- }
- }
-
- private void resolveAlwaysProvidedIntents(IntentAttachPointType extensionType, ModelResolver resolver)
- throws ContributionResolveException {
- if (extensionType != null) {
- // resolve all provided intents
- List<Intent> alwaysProvided = new ArrayList<Intent>();
- for (Intent providedIntent : extensionType.getAlwaysProvidedIntents()) {
- if (providedIntent.isUnresolved()) {
- providedIntent = resolver.resolveModel(Intent.class, providedIntent);
- if (!providedIntent.isUnresolved()) {
- alwaysProvided.add(providedIntent);
- } else {
- error("AlwaysProvidedIntentNotFound", resolver, providedIntent, extensionType);
- //throw new ContributionResolveException("Always Provided Intent - " + providedIntent
- //+ " not found for ExtensionType "
- //+ extensionType);
- }
- } else {
- alwaysProvided.add(providedIntent);
- }
- }
- extensionType.getAlwaysProvidedIntents().clear();
- extensionType.getAlwaysProvidedIntents().addAll(alwaysProvided);
- }
- }
-
- private void resolveMayProvideIntents(IntentAttachPointType extensionType, ModelResolver resolver)
- throws ContributionResolveException {
- if (extensionType != null) {
- // resolve all provided intents
- List<Intent> mayProvide = new ArrayList<Intent>();
- for (Intent providedIntent : extensionType.getMayProvideIntents()) {
- if (providedIntent.isUnresolved()) {
- providedIntent = resolver.resolveModel(Intent.class, providedIntent);
- if (!providedIntent.isUnresolved()) {
- mayProvide.add(providedIntent);
- } else {
- error("MayProvideIntentNotFound", resolver, providedIntent, extensionType);
- //throw new ContributionResolveException("May Provide Intent - " + providedIntent
- //+ " not found for ExtensionType "
- //+ extensionType);
- }
- } else {
- mayProvide.add(providedIntent);
- }
- }
- extensionType.getMayProvideIntents().clear();
- extensionType.getMayProvideIntents().addAll(mayProvide);
- }
- }
-
- public Class<IntentAttachPointType> getModelType() {
- return IntentAttachPointType.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java
deleted file mode 100644
index 3f69df05d8..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.xml;
-
-import javax.xml.namespace.QName;
-
-/**
- * constants related to policy framework
- *
- * @version $Rev$ $Date$
- */
-public interface PolicyConstants {
- String WHITE_SPACE = " ";
- String COLON = ":";
- String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- String TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- 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 ALWAYS_APPLIES_TO = "alwaysAppliesTo";
- String QUALIFIER = ".";
- String INTENT_MAP_QUALIFIER = "qualifier";
- String REQUIRES = "requires";
- String EXCLUDES = "excludes";
- String DEFAULT = "default";
-
- String ALWAYS_PROVIDES = "alwaysProvides";
- String MAY_PROVIDE = "mayProvide";
- String TYPE = "type";
- String IMPLEMENTATION_TYPE = "implementationType";
- String BINDING_TYPE = "bindingType";
- QName IMPLEMENTATION_TYPE_QNAME = new QName(SCA10_NS, IMPLEMENTATION_TYPE);
- QName BINDING_TYPE_QNAME = new QName(SCA10_NS, BINDING_TYPE);
- String BINDING = "binding";
- String IMPLEMENTATION = "implementation";
-
- QName POLICY_INTENT_QNAME = new QName(SCA10_NS, INTENT);
- QName POLICY_SET_QNAME = new QName(SCA10_NS, POLICY_SET);
- QName POLICY_INTENT_MAP_QNAME = new QName(SCA10_NS, INTENT_MAP);
- QName SCA_DEFINITIONS_QNAME = new QName(SCA10_NS, SCA_DEFINITIONS);
- QName DESCRIPTION_QNAME = new QName(SCA10_NS, DESCRIPTION);
- QName POLICY_INTENT_MAP_QUALIFIER_QNAME = new QName(SCA10_NS, INTENT_MAP_QUALIFIER);
- QName POLICY_SET_REFERENCE_QNAME = new QName(SCA10_NS, POLICY_SET_REFERENCE);
-
- String QUALIFIED_INTENT_CONSTRAINS_ERROR = " - Qualified Intents must not specify 'constrains' attribute";
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyIntentProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyIntentProcessor.java
deleted file mode 100644
index 03cd635596..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyIntentProcessor.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.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.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.ProfileIntent;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
-
-/**
- * Processor for handling XML models of PolicyIntent definitions
- *
- * @version $Rev$ $Date$
- */
-abstract class PolicyIntentProcessor<T extends Intent> extends BaseStAXArtifactProcessor implements
- StAXArtifactProcessor<T>, PolicyConstants {
-
- private PolicyFactory policyFactory;
- private Monitor monitor;
-
- public PolicyIntentProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.monitor = monitor;
- }
-
- public PolicyIntentProcessor(PolicyFactory policyFactory, Monitor monitor) {
- this.policyFactory = policyFactory;
- this.monitor = monitor;
- }
-
- /**
- * 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(),
- "policy-xml-validation-messages",
- Severity.ERROR,
- model,
- message,
- (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public T read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- Intent policyIntent = null;
- String policyIntentName = reader.getAttributeValue(null, NAME);
- if (policyIntentName == null) {
- error("IntentNameMissing", reader);
- return (T)policyIntent;
- }
-
- // Read an <sca:intent>
- if (reader.getAttributeValue(null, REQUIRES) != null) {
- policyIntent = policyFactory.createProfileIntent();
- } else if (policyIntentName != null && policyIntentName.indexOf(QUALIFIER) != -1) {
- policyIntent = policyFactory.createQualifiedIntent();
-
- int qualifierIndex = policyIntentName.lastIndexOf(QUALIFIER);
- Intent qualifiableIntent = policyFactory.createIntent();
- qualifiableIntent.setUnresolved(true);
- qualifiableIntent.setName(new QName(policyIntentName.substring(0, qualifierIndex)));
-
- ((QualifiedIntent)policyIntent).setQualifiableIntent(qualifiableIntent);
- } else {
- policyIntent = policyFactory.createIntent();
- }
- policyIntent.setName(new QName(policyIntentName));
-
- if (policyIntent instanceof ProfileIntent) {
- readRequiredIntents((ProfileIntent)policyIntent, reader);
- } else {
- readExcludedIntents(policyIntent, reader);
- }
-
- readConstrainedArtifacts(policyIntent, reader);
-
- int event = reader.getEventType();
- QName name = null;
- while (reader.hasNext()) {
- event = reader.getEventType();
- switch (event) {
- case START_ELEMENT: {
- name = reader.getName();
- if (DESCRIPTION_QNAME.equals(name)) {
- policyIntent.setDescription(reader.getElementText());
- }
- break;
- }
- }
- if (event == END_ELEMENT && POLICY_INTENT_QNAME.equals(reader.getName())) {
- break;
- }
-
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- return (T)policyIntent;
- }
-
- public void write(T policyIntent, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- // Write an <sca:intent>
- writer.writeStartElement(PolicyConstants.SCA10_NS, INTENT);
- writer.writeNamespace(policyIntent.getName().getPrefix(), policyIntent.getName().getNamespaceURI());
- writer.writeAttribute(PolicyConstants.NAME, policyIntent.getName().getPrefix() + COLON
- + policyIntent.getName().getLocalPart());
- if (policyIntent instanceof ProfileIntent) {
- ProfileIntent profileIntent = (ProfileIntent)policyIntent;
- if (profileIntent.getRequiredIntents() != null && profileIntent.getRequiredIntents().size() > 0) {
- StringBuffer sb = new StringBuffer();
- for (Intent requiredIntents : profileIntent.getRequiredIntents()) {
- sb.append(requiredIntents.getName());
- sb.append(" ");
- }
- writer.writeAttribute(PolicyConstants.REQUIRES, sb.toString());
- }
- } else {
- if (policyIntent.getExcludedIntents() != null && policyIntent.getExcludedIntents().size() > 0) {
- StringBuffer sb = new StringBuffer();
- for (Intent excludedIntents : policyIntent.getExcludedIntents()) {
- sb.append(excludedIntents.getName());
- sb.append(" ");
- }
- writer.writeAttribute(PolicyConstants.EXCLUDES, sb.toString());
- }
- }
-
- if (!(policyIntent instanceof QualifiedIntent)) {
- if (policyIntent.getConstrains() != null && policyIntent.getConstrains().size() > 0) {
- StringBuffer sb = new StringBuffer();
- for (QName contrainedArtifact : policyIntent.getConstrains()) {
- sb.append(contrainedArtifact.toString());
- sb.append(" ");
- }
- writer.writeAttribute(CONSTRAINS, sb.toString());
- } else {
- error("ContrainsAttributeMissing", policyIntent, policyIntent.getName());
- //throw new ContributionWriteException("Contrains attribute missing from " +
- //"Policy Intent Definition" + policyIntent.getName());
- }
- }
-
- if (policyIntent.getDescription() != null && policyIntent.getDescription().length() > 0) {
- writer.writeStartElement(PolicyConstants.SCA10_NS, DESCRIPTION);
- writer.writeCData(policyIntent.getDescription());
- writer.writeEndElement();
- }
-
- writer.writeEndElement();
- }
-
- //FIXME This method is never used
- // private Intent resolveRequiredIntents(ProfileIntent policyIntent, ModelResolver resolver) throws ContributionResolveException {
- // boolean isUnresolved = false;
- // //FIXME: Need to check for cyclic references first i.e an A requiring B and then B requiring A...
- // if (policyIntent != null && policyIntent.isUnresolved()) {
- //
- // //resolve all required intents
- // List<Intent> requiredIntents = new ArrayList<Intent>();
- // for (Intent requiredIntent : policyIntent.getRequiredIntents()) {
- // if ( requiredIntent.isUnresolved() ) {
- // //policyIntent.getRequiredIntents().remove(requiredIntent);
- // requiredIntent = resolver.resolveModel(Intent.class, requiredIntent);
- // requiredIntents.add(requiredIntent);
- // if (requiredIntent.isUnresolved()) {
- // isUnresolved = true;
- // }
- // }
- // }
- // policyIntent.getRequiredIntents().clear();
- // policyIntent.getRequiredIntents().addAll(requiredIntents);
- // }
- // policyIntent.setUnresolved(isUnresolved);
- //
- // return policyIntent;
- // }
-
- //FIXME This method is never used
- // private Intent resolveQualifiableIntent(QualifiedIntent policyIntent, ModelResolver resolver) throws ContributionResolveException {
- // boolean isUnresolved = false;
- //
- // if (policyIntent != null && policyIntent.isUnresolved()) {
- // //resolve the qualifiable intent
- // Intent qualifiableIntent =
- // resolver.resolveModel(Intent.class, policyIntent.getQualifiableIntent());
- // policyIntent.setQualifiableIntent(qualifiableIntent);
- // isUnresolved = qualifiableIntent.isUnresolved();
- // }
- // policyIntent.setUnresolved(isUnresolved);
- //
- // return policyIntent;
- // }
-
- private void resolveContrainedArtifacts(Intent policyIntent, ModelResolver resolver) {
- //FIXME : need to figure out this resolution.
- policyIntent.setUnresolved(false);
- }
-
- private void resolveProfileIntent(ProfileIntent policyIntent, ModelResolver resolver)
- throws ContributionResolveException {
- // 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 = resolver.resolveModel(Intent.class, requiredIntent);
- // At this point, when the required intent is not resolved, it does not mean
- // its undeclared, chances are that their dependency are not resolved yet.
- // Lets try to resolve them first.
- if (resolvedRequiredIntent.isUnresolved()) {
- if (resolvedRequiredIntent instanceof ProfileIntent) {
- if ((((ProfileIntent)resolvedRequiredIntent).getRequiredIntents()).contains(policyIntent)) {
- error("CyclicReferenceFound", resolver, requiredIntent, policyIntent);
- return;
- }
- resolveDependent(resolvedRequiredIntent, resolver);
- }
- }
-
- if (!resolvedRequiredIntent.isUnresolved()) {
- requiredIntents.add(resolvedRequiredIntent);
- } else {
- error("RequiredIntentNotFound", resolver, requiredIntent, policyIntent);
- return;
- //throw new ContributionResolveException("Required Intent - " + requiredIntent
- //+ " not found for ProfileIntent " + policyIntent);
- }
- } else {
- requiredIntents.add(requiredIntent);
- }
- }
- policyIntent.getRequiredIntents().clear();
- policyIntent.getRequiredIntents().addAll(requiredIntents);
- }
- }
-
- private void resolveQualifiedIntent(QualifiedIntent policyIntent, ModelResolver resolver)
- throws ContributionResolveException {
- if (policyIntent != null) {
- //resolve the qualifiable intent
- Intent qualifiableIntent = policyIntent.getQualifiableIntent();
- if (qualifiableIntent.isUnresolved()) {
- Intent resolvedQualifiableIntent = resolver.resolveModel(Intent.class, qualifiableIntent);
- // At this point, when the qualifiable intent is not resolved, it does not mean
- // its undeclared, chances are that their dependency are not resolved yet.
- // Lets try to resolve them first.
- if (resolvedQualifiableIntent.isUnresolved()) {
- if (resolvedQualifiableIntent instanceof QualifiedIntent) {
- resolveDependent(resolvedQualifiableIntent, resolver);
- }
- }
-
- if (!resolvedQualifiableIntent.isUnresolved()) {
- policyIntent.setQualifiableIntent(resolvedQualifiableIntent);
- } else {
- error("QualifiableIntentNotFound", resolver, qualifiableIntent, policyIntent);
- //throw new ContributionResolveException("Qualifiable Intent - " + qualifiableIntent
- //+ " not found for QualifiedIntent " + policyIntent);
- }
- }
- }
- }
-
- public void resolveDependent(Intent policyIntent, ModelResolver resolver) throws ContributionResolveException {
- if (policyIntent instanceof ProfileIntent)
- resolveProfileIntent((ProfileIntent)policyIntent, resolver);
-
- if (policyIntent instanceof QualifiedIntent)
- resolveQualifiedIntent((QualifiedIntent)policyIntent, resolver);
-
- resolveContrainedArtifacts(policyIntent, resolver);
- }
-
- public void resolve(T policyIntent, ModelResolver resolver) throws ContributionResolveException {
- if (policyIntent instanceof ProfileIntent) {
- resolveProfileIntent((ProfileIntent)policyIntent, resolver);
- } else {
- resolveExcludedIntents(policyIntent, resolver);
- }
-
- if (policyIntent instanceof QualifiedIntent) {
- resolveQualifiedIntent((QualifiedIntent)policyIntent, resolver);
- }
-
- resolveContrainedArtifacts(policyIntent, resolver);
-
- /* This is too late in the processing
- if ( !policyIntent.isUnresolved() ) {
- resolver.addModel(policyIntent);
- }
- */
- }
-
- public QName getArtifactType() {
- return POLICY_INTENT_QNAME;
- }
-
- private void readConstrainedArtifacts(Intent policyIntent, XMLStreamReader reader) throws ContributionReadException {
- String value = reader.getAttributeValue(null, CONSTRAINS);
- if (policyIntent instanceof QualifiedIntent && value != null) {
- error("ErrorInPolicyIntentDefinition",
- policyIntent,
- policyIntent.getName(),
- QUALIFIED_INTENT_CONSTRAINS_ERROR);
- //String errorMsg = "Error in PolicyIntent Definition - " + policyIntent.getName() + QUALIFIED_INTENT_CONSTRAINS_ERROR;
- //throw new ContributionReadException(errorMsg);
- } else {
- if (value != null) {
- List<QName> constrainedArtifacts = policyIntent.getConstrains();
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- QName qname = getQNameValue(reader, tokens.nextToken());
- constrainedArtifacts.add(qname);
- }
- }
- }
- }
-
- private void readRequiredIntents(ProfileIntent policyIntent, XMLStreamReader reader) {
- String value = reader.getAttributeValue(null, REQUIRES);
- if (value != null) {
- List<Intent> requiredIntents = policyIntent.getRequiredIntents();
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- QName qname = getQNameValue(reader, tokens.nextToken());
- Intent intent = policyFactory.createIntent();
- intent.setName(qname);
- intent.setUnresolved(true);
- requiredIntents.add(intent);
- }
- }
- }
-
- private void readExcludedIntents(Intent policyIntent, XMLStreamReader reader) {
- String value = reader.getAttributeValue(null, "excludes");
- if (value != null) {
- List<Intent> excludedIntents = policyIntent.getExcludedIntents();
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- QName qname = getQNameValue(reader, tokens.nextToken());
- Intent intent = policyFactory.createIntent();
- intent.setName(qname);
- intent.setUnresolved(true);
- excludedIntents.add(intent);
- }
- }
- }
-
- private void resolveExcludedIntents(Intent policyIntent, ModelResolver resolver)
- throws ContributionResolveException {
- if (policyIntent != null) {
- // resolve all excluded intents
- List<Intent> excludedIntents = new ArrayList<Intent>();
- for (Intent excludedIntent : policyIntent.getExcludedIntents()) {
- if (excludedIntent.isUnresolved()) {
- Intent resolvedExcludedIntent = resolver.resolveModel(Intent.class, excludedIntent);
- if (!resolvedExcludedIntent.isUnresolved()) {
- excludedIntents.add(resolvedExcludedIntent);
- } else {
- error("ExcludedIntentNotFound", resolver, excludedIntent, policyIntent);
- return;
- //throw new ContributionResolveException("Excluded Intent " + excludedIntent
- //+ " not found for intent " + policyIntent);
- }
- } else {
- excludedIntents.add(excludedIntent);
- }
- }
- policyIntent.getExcludedIntents().clear();
- policyIntent.getExcludedIntents().addAll(excludedIntents);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
deleted file mode 100644
index 93a8433d65..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-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.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Processor for handling XML models of PolicySet definitions
- *
- * @version $Rev$ $Date$
- */
-public class PolicySetProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<PolicySet>,
- PolicyConstants {
-
- private PolicyFactory policyFactory;
- private StAXArtifactProcessor<Object> extensionProcessor;
- private XPathFactory xpathFactory = XPathFactory.newInstance();
- private Monitor monitor;
-
- public PolicySetProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor<Object> extensionProcessor,
- Monitor monitor) {
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.extensionProcessor = extensionProcessor;
- this.monitor = monitor;
- }
-
- public PolicySetProcessor(PolicyFactory policyFactory,
- StAXArtifactProcessor<Object> extensionProcessor,
- Monitor monitor) {
- this.policyFactory = policyFactory;
- this.extensionProcessor = extensionProcessor;
- 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(),
- "policy-xml-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(),
- "policy-xml-validation-messages",
- Severity.ERROR,
- model,
- message,
- (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- public PolicySet read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- PolicySet policySet = null;
-
- String policySetName = reader.getAttributeValue(null, NAME);
- String appliesTo = reader.getAttributeValue(null, APPLIES_TO);
- if (policySetName == null || appliesTo == null) {
- if (policySetName == null)
- error("PolicySetNameMissing", reader);
- if (appliesTo == null)
- error("PolicySetAppliesToMissing", reader);
- return policySet;
- }
-
- policySet = policyFactory.createPolicySet();
- policySet.setName(new QName(policySetName));
- String alwaysAppliesTo = reader.getAttributeValue(TUSCANY_NS, ALWAYS_APPLIES_TO);
-
- //TODO: with 1.0 version of specs the applies to xpath is given related to the immediate
- //parent whereas the runtime evaluates the xpath aginst the composite element. What the runtime
- //is doing is what the future version of the specs could be tending towards. When that happens
- //this 'if' must be deleted
- if (appliesTo != null && !appliesTo.startsWith("/")) {
- appliesTo = "//" + appliesTo;
- }
-
- if (alwaysAppliesTo != null && !alwaysAppliesTo.startsWith("/")) {
- alwaysAppliesTo = "//" + alwaysAppliesTo;
- }
-
- policySet.setAppliesTo(appliesTo);
- policySet.setAlwaysAppliesTo(alwaysAppliesTo);
-
- XPath path = xpathFactory.newXPath();
- path.setNamespaceContext(reader.getNamespaceContext());
- try {
- if (appliesTo != null) {
- policySet.setAppliesToXPathExpression(path.compile(appliesTo));
- }
- if (alwaysAppliesTo != null) {
- policySet.setAlwaysAppliesToXPathExpression(path.compile(alwaysAppliesTo));
- }
- } catch (XPathExpressionException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", policySet, ce);
- //throw ce;
- }
-
- readProvidedIntents(policySet, reader);
-
- int event = reader.getEventType();
- QName name = null;
- reader.next();
- while (reader.hasNext()) {
- event = reader.getEventType();
- switch (event) {
- case START_ELEMENT: {
- name = reader.getName();
- if (POLICY_INTENT_MAP_QNAME.equals(name)) {
- Intent mappedIntent = policyFactory.createIntent();
- String provides = reader.getAttributeValue(null, PROVIDES);
- if (provides != null) {
- mappedIntent.setName(getQName(reader, PROVIDES));
- if (policySet.getProvidedIntents().contains(mappedIntent)) {
- readIntentMap(reader, policySet, mappedIntent);
- } else {
- error("IntentNotSpecified", policySet, policySetName);
- //throw new ContributionReadException("Intent Map provides for Intent not specified as provided by parent PolicySet - " + policySetName);
- }
- } else {
- error("IntentMapProvidesMissing", reader, policySetName);
- }
- } else if (POLICY_SET_REFERENCE_QNAME.equals(name)) {
- PolicySet referredPolicySet = policyFactory.createPolicySet();
- String referencename = reader.getAttributeValue(null, NAME);
- if (referencename != null) {
- referredPolicySet.setName(getQName(reader, NAME));
- policySet.getReferencedPolicySets().add(referredPolicySet);
- } else {
- error("PolicySetReferenceNameMissing", reader, policySetName);
- }
- } /*else if ( WS_POLICY_QNAME.equals(name) ) {
- OMElement policyElement = loadElement(reader);
- org.apache.neethi.Policy wsPolicy = PolicyEngine.getPolicy(policyElement);
- policySet.getPolicies().add(wsPolicy);
- } */else {
- Object extension = extensionProcessor.read(reader);
- if (extension != null) {
- policySet.getPolicies().add(extension);
- }
- }
- break;
- }
- }
- if (event == END_ELEMENT) {
- if (POLICY_SET_QNAME.equals(reader.getName())) {
- break;
- }
- }
-
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- return policySet;
- }
-
- public void readIntentMap(XMLStreamReader reader, PolicySet policySet, Intent mappedIntent)
- throws ContributionReadException {
- QName name = reader.getName();
- Map<Intent, List<Object>> mappedPolicies = policySet.getMappedPolicies();
- if (POLICY_INTENT_MAP_QNAME.equals(name)) {
- //Intent mappedIntent = policyFactory.createIntent();
- //mappedIntent.setName(getQName(reader, PROVIDES));
- String defaultQualifier = getString(reader, DEFAULT);
-
- String qualifierName = null;
- String qualfiedIntentName = null;
- Intent qualifiedIntent = null;
-
- int event = reader.getEventType();
- try {
- reader.next();
- while (reader.hasNext()) {
- event = reader.getEventType();
- switch (event) {
- case START_ELEMENT: {
- name = reader.getName();
- if (POLICY_INTENT_MAP_QUALIFIER_QNAME.equals(name)) {
- qualifierName = getString(reader, NAME);
- if (qualifierName != null) {
- qualfiedIntentName =
- mappedIntent.getName().getLocalPart() + QUALIFIER + qualifierName;
- qualifiedIntent = policyFactory.createIntent();
- qualifiedIntent.setName(new QName(mappedIntent.getName().getNamespaceURI(),
- qualfiedIntentName));
- } else {
- error("QualifierNameMissing", reader, policySet.getName());
- }
- } else if (POLICY_INTENT_MAP_QNAME.equals(name)) {
- QName providedIntent = getQName(reader, PROVIDES);
- if (qualifierName.equals(providedIntent.getLocalPart())) {
- readIntentMap(reader, policySet, qualifiedIntent);
- } else {
- error("IntentMapDoesNotMatch",
- providedIntent,
- providedIntent,
- qualifierName,
- policySet);
- //throw new ContributionReadException("Intent provided by IntentMap " +
- //providedIntent + " does not match parent qualifier " + qualifierName +
- //" in policyset - " + policySet);
- }
- }/* else if ( WS_POLICY_QNAME.equals(name) ) {
- OMElement policyElement = loadElement(reader);
- Policy wsPolicy = PolicyEngine.getPolicy(policyElement);
- policySet.getPolicies().add(wsPolicy);
-
- List<Object> policyList = mappedPolicies.get(qualifiedIntent);
- if ( policyList == null ) {
- policyList = new ArrayList<Object>();
- mappedPolicies.put(qualifiedIntent, policyList);
-
- if (qualifierName.equals(defaultQualifier)) {
- mappedPolicies.put(mappedIntent, policyList);
- }
- }
- policyList.add((Policy)wsPolicy);
- }*/else {
- Object extension = extensionProcessor.read(reader);
- if (extension != null && qualifiedIntent != null) {
- List<Object> policyList = mappedPolicies.get(qualifiedIntent);
- if (policyList == null) {
- policyList = new ArrayList<Object>();
- mappedPolicies.put(qualifiedIntent, policyList);
-
- if (qualifierName.equals(defaultQualifier)) {
- mappedPolicies.put(mappedIntent, policyList);
- }
- }
- policyList.add(extension);
- }
- }
- break;
- }
- case END_ELEMENT: {
- if (POLICY_INTENT_MAP_QNAME.equals(reader.getName())) {
- if (defaultQualifier != null) {
- String qualifiedIntentName =
- mappedIntent.getName().getLocalPart() + QUALIFIER + defaultQualifier;
- Intent defaultQualifiedIntent = policyFactory.createIntent();
- defaultQualifiedIntent.setName(new QName(mappedIntent.getName().getNamespaceURI(),
- qualifiedIntentName));
- List<Object> policyList = mappedPolicies.get(defaultQualifiedIntent);
- if (policyList != null) {
- mappedPolicies.put(mappedIntent, policyList);
- } else {
- error("UnableToMapPolicies", mappedPolicies, mappedIntent, policySet);
- //throw new ContributionReadException("Unable to map policies for default qualifier in IntentMap for - " +
- //mappedIntent + " in policy set - " + policySet);
- }
- defaultQualifier = null;
- }
- }
- break;
- }
- }
- if (event == END_ELEMENT && POLICY_INTENT_MAP_QNAME.equals(reader.getName())) {
- break;
- }
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- } catch (XMLStreamException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", reader, ce);
- throw ce;
- }
- }
- }
-
- public void write(PolicySet policySet, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
-
- // Write an <sca:policySet>
- writer.writeStartElement(SCA10_NS, POLICY_SET);
- writer.writeNamespace(policySet.getName().getPrefix(), policySet.getName().getNamespaceURI());
- writer.writeAttribute(NAME, policySet.getName().getPrefix() + COLON + policySet.getName().getLocalPart());
- writer.writeAttribute(APPLIES_TO, policySet.getAppliesTo());
- writer.writeAttribute(TUSCANY_NS, ALWAYS_APPLIES_TO, policySet.getAlwaysAppliesTo());
-
- writeProvidedIntents(policySet, writer);
-
- writer.writeEndElement();
- }
-
- private void readProvidedIntents(PolicySet policySet, XMLStreamReader reader) {
- String value = reader.getAttributeValue(null, PROVIDES);
- if (value != null) {
- List<Intent> providedIntents = policySet.getProvidedIntents();
- for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
- QName qname = getQNameValue(reader, tokens.nextToken());
- Intent intent = policyFactory.createIntent();
- intent.setName(qname);
- providedIntents.add(intent);
- }
- }
- }
-
- private void writeProvidedIntents(PolicySet policySet, XMLStreamWriter writer) throws XMLStreamException {
- if (policySet.getProvidedIntents() != null && policySet.getProvidedIntents().size() > 0) {
- StringBuffer sb = new StringBuffer();
- for (Intent providedIntents : policySet.getProvidedIntents()) {
- sb.append(providedIntents.getName());
- sb.append(" ");
- }
- writer.writeAttribute(PolicyConstants.PROVIDES, sb.toString());
- }
- }
-
- private void resolvePolicies(PolicySet policySet, ModelResolver resolver) throws ContributionResolveException {
- boolean unresolved = false;
- if (policySet != null) {
- for (Object o : policySet.getPolicies()) {
- extensionProcessor.resolve(o, resolver);
- /*if ( o instanceof Policy && ((Policy)o).isUnresolved() ) {
- unresolved = true;
- }*/
- }
- policySet.setUnresolved(unresolved);
- }
- }
-
- public QName getArtifactType() {
- return POLICY_SET_QNAME;
- }
-
- public Class<PolicySet> getModelType() {
- return PolicySet.class;
- }
-
- private void resolveProvidedIntents(PolicySet policySet, ModelResolver resolver)
- throws ContributionResolveException {
- if (policySet != null) {
- //resolve all provided intents
- List<Intent> providedIntents = new ArrayList<Intent>();
- for (Intent providedIntent : policySet.getProvidedIntents()) {
- if (providedIntent.isUnresolved()) {
- Intent resolvedProvidedIntent = resolver.resolveModel(Intent.class, providedIntent);
- if (!resolvedProvidedIntent.isUnresolved()) {
- providedIntents.add(resolvedProvidedIntent);
- } else {
- error("ProvidedIntentNotFound", policySet, providedIntent, policySet);
- return;
- //throw new ContributionResolveException("Provided Intent - " + providedIntent
- //+ " not found for PolicySet " + policySet);
- }
- } else {
- providedIntents.add(providedIntent);
- }
- }
- policySet.getProvidedIntents().clear();
- policySet.getProvidedIntents().addAll(providedIntents);
- }
- }
-
- private void resolveIntentsInMappedPolicies(PolicySet policySet, ModelResolver resolver)
- throws ContributionResolveException {
- Map<Intent, List<Object>> mappedPolicies = new Hashtable<Intent, List<Object>>();
- for (Map.Entry<Intent, List<Object>> entry : policySet.getMappedPolicies().entrySet()) {
- Intent mappedIntent = entry.getKey();
- if (mappedIntent.isUnresolved()) {
- Intent resolvedMappedIntent = resolver.resolveModel(Intent.class, mappedIntent);
- if (!resolvedMappedIntent.isUnresolved()) {
- mappedPolicies.put(resolvedMappedIntent, entry.getValue());
- } else {
- error("MappedIntentNotFound", policySet, mappedIntent, policySet);
- return;
- //throw new ContributionResolveException("Mapped Intent - " + mappedIntent
- //+ " not found for PolicySet " + policySet);
- }
- } else {
- mappedPolicies.put(mappedIntent, entry.getValue());
- }
- }
-
- policySet.getMappedPolicies().clear();
- policySet.getMappedPolicies().putAll(mappedPolicies);
- }
-
- private void resolveReferredPolicySets(PolicySet policySet, ModelResolver resolver)
- throws ContributionResolveException {
-
- List<PolicySet> referredPolicySets = new ArrayList<PolicySet>();
- for (PolicySet referredPolicySet : policySet.getReferencedPolicySets()) {
- if (referredPolicySet.isUnresolved()) {
- PolicySet resolvedReferredPolicySet = resolver.resolveModel(PolicySet.class, referredPolicySet);
- if (!resolvedReferredPolicySet.isUnresolved()) {
- referredPolicySets.add(resolvedReferredPolicySet);
- } else {
- error("ReferredPolicySetNotFound", policySet, referredPolicySet, policySet);
- return;
- //throw new ContributionResolveException("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.getMappedPolicies().putAll(referredPolicySet.getMappedPolicies());
- }
-
- public void resolve(PolicySet policySet, ModelResolver resolver) throws ContributionResolveException {
- resolveProvidedIntents(policySet, resolver);
- resolveIntentsInMappedPolicies(policySet, resolver);
- resolveReferredPolicySets(policySet, resolver);
-
- for (PolicySet referredPolicySet : policySet.getReferencedPolicySets()) {
- includeReferredPolicySets(policySet, referredPolicySet);
- }
-
- if (policySet.isUnresolved()) {
- //resolve the policy attachments
- resolvePolicies(policySet, resolver);
-
- /*if ( !policySet.isUnresolved() ) {
- resolver.addModel(policySet);
- }*/
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ProfileIntentProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ProfileIntentProcessor.java
deleted file mode 100644
index d0b19af129..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ProfileIntentProcessor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.xml;
-
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.ProfileIntent;
-
-/**
- * Processor for handling XML models of PolicyIntent definitions that are ProfileIntents
- *
- * @version $Rev$ $Date$
- */
-public class ProfileIntentProcessor extends PolicyIntentProcessor<ProfileIntent> {
-
- public ProfileIntentProcessor(PolicyFactory policyFactory, Monitor monitor) {
- super(policyFactory, monitor);
- }
-
- public ProfileIntentProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- super(modelFactories, monitor);
- }
-
- public Class<ProfileIntent> getModelType() {
- return ProfileIntent.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/QualifiedIntentProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/QualifiedIntentProcessor.java
deleted file mode 100644
index 50d8cb06e2..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/QualifiedIntentProcessor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.xml;
-
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
-
-/**
- * Processor for handling XML models of PolicyIntent definitions that are QualifiedIntents
- *
- * @version $Rev$ $Date$
- */
-public class QualifiedIntentProcessor extends PolicyIntentProcessor<QualifiedIntent> {
-
- public QualifiedIntentProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- super(modelFactories, monitor);
- }
-
- public QualifiedIntentProcessor(PolicyFactory policyFactory, Monitor monitor) {
- super(policyFactory, monitor);
- }
-
- public Class<QualifiedIntent> getModelType() {
- return QualifiedIntent.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/SimpleIntentProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/SimpleIntentProcessor.java
deleted file mode 100644
index e928ead4c6..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/SimpleIntentProcessor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.xml;
-
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * Processor for handling XML models of PolicyIntent definitions
- *
- * @version $Rev$ $Date$
- */
-public class SimpleIntentProcessor extends PolicyIntentProcessor<Intent> {
-
- public SimpleIntentProcessor(PolicyFactory policyFactory, Monitor monitor) {
- super(policyFactory, monitor);
- }
-
- public SimpleIntentProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- super(modelFactories, monitor);
- }
-
- public Class<Intent> getModelType() {
- return Intent.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index c41a0cd01f..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,24 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.policy.xml.BindingTypeProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#bindingType,model=org.apache.tuscany.sca.policy.IntentAttachPointType
-org.apache.tuscany.sca.policy.xml.ImplementationTypeProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#implementationType,model=org.apache.tuscany.sca.policy.IntentAttachPointType
-org.apache.tuscany.sca.policy.xml.SimpleIntentProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#intent,model=org.apache.tuscany.sca.policy.Intent
-org.apache.tuscany.sca.policy.xml.PolicySetProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#policySet,model=org.apache.tuscany.sca.policy.PolicySet
-org.apache.tuscany.sca.policy.xml.ProfileIntentProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#intent,model=org.apache.tuscany.sca.policy.ProfileIntent
-org.apache.tuscany.sca.policy.xml.QualifiedIntentProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#intent,model=org.apache.tuscany.sca.policy.QualifiedIntent
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
deleted file mode 100644
index 4daf46c790..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.contribution.resolver.DefaultModelResolver;model=org.apache.tuscany.sca.policy.Intent
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/policy-xml-validation-messages.properties b/tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/policy-xml-validation-messages.properties
deleted file mode 100644
index 40107bb11e..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/main/resources/policy-xml-validation-messages.properties
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-ReferredPolicySetNotFound = Referred PolicySet - {0} not found for PolicySet - {1}
-MappedIntentNotFound = Mapped Intent - {0} not found for PolicySet {1}
-ProvidedIntentNotFound = Provided Intent - {0} not found for PolicySet {1}
-UnableToMapPolicies = Unable to map policies for default qualifier in IntentMap for - {0} in policy set - {1}
-IntentMapDoesNotMatch = Intent provided by IntentMap {0} does not match parent qualifier {1} in policyset - {2}
-IntentNotSpecified = Intent Map provides for Intent not specified as provided by parent PolicySet - {0}
-ContrainsAttributeMissing = Constrains attribute missing from Policy Intent Definition {0}
-RequiredIntentNotFound = Required Intent - {0} not found for ProfileIntent {1}
-QualifiableIntentNotFound = Qualifiable Intent - {0} not found for QualifiedIntent {1}
-ErrorInPolicyIntentDefinition = Error in PolicyIntent Definition - {0} {1}
-ExcludedIntentNotFound = Excluded Intent {0} not found for intent {1}
-UnrecognizedIntentAttachPointType = Unrecognized IntentAttachPointType - {0}
-RequiredAttributeMissing = Required attribute {0} missing from BindingType Definition
-AlwaysProvidedIntentNotFound = Always Provided Intent - {0} not found for ExtensionType {1}
-MayProvideIntentNotFound = May Provide Intent - {0} not found for ExtensionType {1}
-ContributionReadException = ContributionReadException occurred due to: {0}
-CyclicReferenceFound = Cyclic reference detected in required attributes of ProfileIntents {0} and {1}
-IntentNameMissing = Required attribute "name" missing for Intent Definition
-PolicySetReferenceNameMissing = Required attribute "name" missing for PolicySetReference in PolicySet : {0}
-PolicySetNameMissing = Required attribute "name" missing for PolicySet Definition
-PolicySetAppliesToMissing = Required attribute "appliesTo" missing for PolicySet Definition
-IntentMapProvidesMissing = Required attribute "provides" missing for IntentMap in PolicySet : {0}
-QualifierNameMissing = Required attribute "name" missing for qualifier definition in PolicySet : {0}
-
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
deleted file mode 100644
index 72235812a1..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-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.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-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.DefaultModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
-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.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.ProfileIntent;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
-import org.apache.tuscany.sca.policy.impl.BindingTypeImpl;
-import org.apache.tuscany.sca.policy.impl.ImplementationTypeImpl;
-import org.junit.Before;
-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 ModelResolver resolver;
- private StAXArtifactProcessor<Object> staxProcessor;
- private Monitor monitor;
-
- private static final QName elementToProcess = new QName("http://www.osoa.org/xmlns/sca/1.0", "implementationType");
-
- private Map<QName, Intent> intentTable = new Hashtable<QName, Intent>();
- private Map<QName, PolicySet> policySetTable = new Hashtable<QName, PolicySet>();
- private Map<QName, IntentAttachPointType> bindingTypesTable = new Hashtable<QName, IntentAttachPointType>();
- private Map<QName, IntentAttachPointType> implTypesTable = new Hashtable<QName, IntentAttachPointType>();
- private static final String scaNamespace = "http://www.osoa.org/xmlns/sca/1.0";
- private static final String namespace = "http://test";
-
- 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");
-
- @Before
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- resolver = new DefaultModelResolver();
- XMLInputFactory inputFactory = XMLInputFactory.newInstance();
- // Create a monitor
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactory();
- if (monitorFactory != null) {
- monitor = monitorFactory.createMonitor();
- utilities.addUtility(monitorFactory);
- }
- StAXArtifactProcessorExtensionPoint staxProcessors =
- extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, monitor);
- staxProcessors.addArtifactProcessor(new TestPolicyProcessor());
-
- URL url = getClass().getResource("test_definitions.xml");
- InputStream urlStream = url.openStream();
- XMLStreamReader reader = inputFactory.createXMLStreamReader(urlStream);
- reader.next();
-
- //position on the right element qname to get processed
- while (reader.hasNext()) {
- reader.next();
- int event = reader.getEventType();
- if (event == START_ELEMENT && reader.getName().equals(elementToProcess)) {
- break;
- }
- }
- while (true) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT: {
- Object artifact = staxProcessor.read(reader);
- if (artifact instanceof PolicySet) {
- PolicySet policySet = (PolicySet)artifact;
- policySet.setName(new QName(namespace, policySet.getName().getLocalPart()));
- policySetTable.put(policySet.getName(), policySet);
- } else if (artifact instanceof Intent) {
- Intent intent = (Intent)artifact;
- intent.setName(new QName(namespace, intent.getName().getLocalPart()));
- if (intent instanceof QualifiedIntent) {
- ((QualifiedIntent)intent).getQualifiableIntent()
- .setName(new QName(namespace, ((QualifiedIntent)intent).getQualifiableIntent()
- .getName().getLocalPart()));
- }
- intentTable.put(intent.getName(), intent);
- } else if (artifact instanceof BindingTypeImpl) {
- IntentAttachPointType bindingType = (IntentAttachPointType)artifact;
- bindingTypesTable.put(bindingType.getName(), bindingType);
- } else if (artifact instanceof ImplementationTypeImpl) {
- IntentAttachPointType implType = (IntentAttachPointType)artifact;
- implTypesTable.put(implType.getName(), implType);
- }
-
- if (artifact != null) {
- resolver.addModel(artifact);
- }
-
- break;
- }
- }
- if (reader.hasNext()) {
- reader.next();
- } else {
- break;
- }
- }
- urlStream.close();
- }
-
- @Test
- public void testReadSCADefinitions() throws Exception {
- 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(policySetTable.get(secureMessagingPolicies).getMappedPolicies().size(), 3);
-
- assertEquals(bindingTypesTable.size(), 1);
- assertNotNull(bindingTypesTable.get(wsBinding));
- assertEquals(implTypesTable.size(), 1);
- assertNotNull(implTypesTable.get(javaImpl));
- }
-
- @Test
- public void testResolution() throws Exception {
- assertTrue(intentTable.get(messageProtection) instanceof ProfileIntent);
- ProfileIntent profileIntent = (ProfileIntent)intentTable.get(new QName(namespace, "messageProtection"));
- assertNull(profileIntent.getRequiredIntents().get(0).getDescription());
-
- QName confidentiality_transport = new QName(namespace, "confidentiality.transport");
- assertTrue(intentTable.get(confidentiality_transport) instanceof QualifiedIntent);
- QualifiedIntent qualifiedIntent =
- (QualifiedIntent)intentTable.get(new QName(namespace, "confidentiality.transport"));
- assertNull(qualifiedIntent.getQualifiableIntent().getDescription());
-
- 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(securityPolicySet.getMappedPolicies().size(), 5);
-
- //testing to ensure that inclusion of referred policy sets has not happened
- PolicySet basicAuthMsgProtSecurityPolicySet = policySetTable.get(basicAuthMsgProtSecurity);
- assertTrue(basicAuthMsgProtSecurityPolicySet.getPolicies().isEmpty());
- assertTrue(basicAuthMsgProtSecurityPolicySet.getMappedPolicies().isEmpty());
-
- IntentAttachPointType wsBindingType = bindingTypesTable.get(wsBinding);
- assertNull(wsBindingType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNull(wsBindingType.getMayProvideIntents().get(0).getDescription());
-
- IntentAttachPointType javaImplType = implTypesTable.get(javaImpl);
- assertNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNull(javaImplType.getMayProvideIntents().get(0).getDescription());
-
- List<Intent> simpleIntents = new ArrayList<Intent>();
- List<ProfileIntent> profileIntents = new ArrayList<ProfileIntent>();
- List<QualifiedIntent> qualifiedIntents = new ArrayList<QualifiedIntent>();
-
- for (Intent intent : intentTable.values()) {
- if (intent instanceof ProfileIntent)
- profileIntents.add((ProfileIntent)intent);
- else if (intent instanceof QualifiedIntent)
- qualifiedIntents.add((QualifiedIntent)intent);
- else
- simpleIntents.add(intent);
- }
-
- for (Intent intent : simpleIntents)
- staxProcessor.resolve(intent, resolver);
-
- for (ProfileIntent intent : profileIntents)
- staxProcessor.resolve(intent, resolver);
-
- for (QualifiedIntent intent : qualifiedIntents)
- staxProcessor.resolve(intent, resolver);
-
- for (PolicySet policySet : policySetTable.values()) {
- if (policySet.getReferencedPolicySets().isEmpty())
- staxProcessor.resolve(policySet, resolver);
- }
-
- for (PolicySet policySet : policySetTable.values()) {
- if (!policySet.getReferencedPolicySets().isEmpty())
- staxProcessor.resolve(policySet, resolver);
- }
-
- for (IntentAttachPointType bindingType : bindingTypesTable.values()) {
- staxProcessor.resolve(bindingType, resolver);
- }
-
- for (IntentAttachPointType implType : implTypesTable.values()) {
- staxProcessor.resolve(implType, resolver);
- }
-
- //testing if policy intents have been linked have property been linked up
- assertNotNull(profileIntent.getRequiredIntents().get(0).getDescription());
- assertNotNull(qualifiedIntent.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());
- assertNotNull(secureMessagingPolicySet.getMappedPolicies().get(intentTable.get(confidentiality)));
- assertNotNull(secureMessagingPolicySet.getMappedPolicies().get(intentTable.get(confidentiality_transport)));
-
- //testing if intent maps have been properly mapped to policies
- assertFalse(securityPolicySet.isUnresolved());
- assertNotNull(securityPolicySet.getMappedPolicies().get(intentTable.get(confidentiality)));
- assertNotNull(securityPolicySet.getMappedPolicies().get(intentTable.get(confidentiality_message)));
-
- //testing for inclusion of referred policysets
- assertFalse(basicAuthMsgProtSecurityPolicySet.getPolicies().isEmpty());
- assertFalse(basicAuthMsgProtSecurityPolicySet.getMappedPolicies().isEmpty());
- assertNotNull(basicAuthMsgProtSecurityPolicySet.getMappedPolicies().get(intentTable
- .get(confidentiality_transport)));
-
- assertNotNull(wsBindingType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNotNull(wsBindingType.getMayProvideIntents().get(0).getDescription());
-
- assertNotNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNotNull(javaImplType.getMayProvideIntents().get(0).getDescription());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java b/tags/java/sca/2.0-M1/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java
deleted file mode 100644
index 2dc8a1cdc7..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.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.Policy;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class TestPolicyProcessor implements StAXArtifactProcessor<Policy> {
-
- public QName getArtifactType() {
- return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
- }
-
- public Policy read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
- return new MockPolicyImplOne();
- }
-
- public void write(Policy arg0, XMLStreamWriter arg1) throws ContributionWriteException, XMLStreamException {
- }
-
- public Class<Policy> getModelType() {
- // TODO Auto-generated method stub
- return Policy.class;
- }
-
- public void resolve(Policy arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
- public class MockPolicyImplOne implements Policy {
- public QName getSchemaName() {
- 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/tags/java/sca/2.0-M1/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml b/tags/java/sca/2.0-M1/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
deleted file mode 100644
index b51a6fba98..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
+++ /dev/null
@@ -1,255 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://test"
- xmlns:test="http://test"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
-
-<!-- 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://www.osoa.org/xmlns/sca/1.0"
- 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>
-
-
- <!-- qualified intents -->
- <intent name="confidentiality.transport" />
- <intent name="confidentiality.message" />
- <intent name="confidentiality.message.whole" />
- <intent name="confidentiality.message.body" />
-
- <!-- POLICY SETS -->
- <policySet name="SecureReliablePolicy"
- provides="test:confidentiality.transport test:integrity"
- appliesTo="sca:binding.ws"
- xmlns="http://www.osoa.org/xmlns/sca/1.0"
- 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://www.osoa.org/xmlns/sca/1.0"
- 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" >
- <intentMap provides="test:confidentiality" default="message">
- <qualifier name="message">
- <intentMap provides="message" default="whole">
- <qualifier name="body">
- <wsp:PolicyAttachment>
- <!-- policy attachment for body encryption -->
- </wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="whole">
- <wsp:PolicyAttachment>
- <!-- policy attachment for whole message encryption -->
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </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://www.osoa.org/xmlns/sca/1.0">
- <policySetReference name="test:AuthenticationPolicies"/>
- <policySetReference name="test:ConfidentialityPolicies"/>
-</policySet>
-
-<policySet name="AuthenticationPolicies"
- provides="test:authentication"
- appliesTo="binding.ws"
- xmlns="http://www.osoa.org/xmlns/sca/1.0"
- 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://www.osoa.org/xmlns/sca/1.0"
- 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://www.osoa.org/xmlns/sca/1.0"
- 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>
- </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/tags/java/sca/2.0-M1/modules/policy/LICENSE b/tags/java/sca/2.0-M1/modules/policy/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/policy/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/policy/META-INF/MANIFEST.MF
deleted file mode 100644
index ce038e7d05..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,32 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.policy.util;uses:="javax.xml.pa
- rsers,javax.xml.transform.dom,org.apache.tuscany.sca.policy,org.apach
- e.tuscany.sca.extensibility,org.w3c.dom,javax.xml.namespace,javax.xml
- .xpath,javax.xml.transform,javax.xml.transform.stream";version="2.0.0",
- org.apache.tuscany.sca.policy.impl;uses:="javax.xml.xpath,org.apache.
- tuscany.sca.policy,javax.xml.namespace";version="2.0.0",org.apache.tusc
- any.sca.policy;uses:="javax.xml.xpath,org.apache.tuscany.sca.policy.i
- mpl,javax.xml.namespace";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Policy Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397083703
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Policy Model
-Import-Package: javax.xml.namespace,
- javax.xml.parsers,
- javax.xml.transform,
- javax.xml.transform.dom,
- javax.xml.transform.stream,
- javax.xml.xpath,
- org.apache.tuscany.sca.extensibility;version="2.0.0",
- org.apache.tuscany.sca.policy;version="2.0.0",
- org.apache.tuscany.sca.policy.impl;version="2.0.0",
- org.apache.tuscany.sca.policy.util;version="2.0.0",
- org.w3c.dom
-Bundle-SymbolicName: org.apache.tuscany.sca.policy
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/policy/NOTICE b/tags/java/sca/2.0-M1/modules/policy/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/policy/pom.xml b/tags/java/sca/2.0-M1/modules/policy/pom.xml
deleted file mode 100644
index 554877d893..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/pom.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-policy</artifactId>
- <name>Apache Tuscany SCA Policy Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/DefaultIntentAttachPointTypeFactory.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/DefaultIntentAttachPointTypeFactory.java
deleted file mode 100644
index 6ca4fe72ec..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/DefaultIntentAttachPointTypeFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import org.apache.tuscany.sca.policy.impl.IntentAttachPointTypeFactoryImpl;
-
-/**
- * Default implementation for IntentAttachPointTypeFactory
- *
- * @version $Rev$ $Date$
- */
-public class DefaultIntentAttachPointTypeFactory extends IntentAttachPointTypeFactoryImpl implements IntentAttachPointTypeFactory{
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/DefaultPolicyFactory.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/DefaultPolicyFactory.java
deleted file mode 100644
index 2da41675a1..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/DefaultPolicyFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import org.apache.tuscany.sca.policy.impl.PolicyFactoryImpl;
-
-/**
- * A factory for the policy model.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultPolicyFactory extends PolicyFactoryImpl implements PolicyFactory {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/Intent.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/Intent.java
deleted file mode 100644
index 22f328f643..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/Intent.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-/**
- * Represents a policy intent. See the Policy Framework specification for a
- * description of this element.
- *
- * @version $Rev$ $Date$
- */
-public interface Intent {
-
- /**
- * Returns the intent name.
- *
- * @return the intent name
- */
- QName getName();
-
- /**
- * Sets the intent name
- *
- * @param name the intent name
- */
- void setName(QName name);
-
- /**
- * Get the intent domain (the root intent name before any qualifiers)
- * @return the domain
- */
- String getDomain();
-
- /**
- * Get the intent qualifiers
- * @return the domain
- */
- String[] getQualifiedNames();
-
- /**
- * Returns the list of operations that this intent applies to.
- *
- * @return
- */
- //List<Operation> getOperations();
-
- /**
- * Returns the list of SCA constructs that this intent is meant to
- * configure.
- *
- * @return the list of SCA constructs that this intent is meant to configure
- */
- List<QName> getConstrains();
-
- /**
- * Returns the list of intents which are mutually exclusive with this intent.
- *
- * @return the list of mutually exclusive intents.
- */
- List<Intent> getExcludedIntents();
-
- /**
- * Returns the list of children qualified intents.
- *
- * @return the list of children qualified intents.
- */
- List<Intent> getQualifiedIntents();
-
- /**
- * Returns the intent description.
- *
- * @return the intent description
- */
- String getDescription();
-
- /**
- * Sets the intent description.
- *
- * @param description the intent description
- */
- void setDescription(String description);
-
- /**
- * Returns true if the model element is unresolved.
- *
- * @return true if the model element is unresolved.
- */
- boolean isUnresolved();
-
- /**
- * Sets whether the model element is unresolved.
- *
- * @param unresolved whether the model element is unresolved
- */
- void setUnresolved(boolean unresolved);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPoint.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPoint.java
deleted file mode 100644
index bf2cfca924..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPoint.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import java.util.List;
-
-/**
- * Base interface for all assembly model objects that can be have policy intents
- * attached to them.
- *
- * @version $Rev$ $Date$
- */
-public interface IntentAttachPoint {
-
- /**
- * Returns a list of policy intents. See the Policy Framework specification
- * for a description of this attribute.
- *
- * @return a list of policy intents.
- */
- List<Intent> getRequiredIntents();
-
-
- /**
- * Returns the type of the attach point such as a BindingType or an ImplementationType and so on
- * @return
- */
- IntentAttachPointType getType();
-
- /**
- *
- * Sets the type of the attach point such as a BindingType or an ImplementationType and so on
- * @param type
- */
- void setType(IntentAttachPointType type);
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPointType.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPointType.java
deleted file mode 100644
index 6db529c7f0..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPointType.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-/**
- * Base interface for representing the model type of assembly model objects that can be have policy intents
- * attached to them.
- *
- * @version $Rev$ $Date$
- */
-public interface IntentAttachPointType {
-
- /**
- * Returns the name of the extension type defined by this instance e.g. implementation.java, binding.ws
- * @return the extension type QName
- */
- QName getName();
-
- /**
- * Sets the name of the extension type
- * @param type the name of the extension type
- */
- void setName(QName type);
-
- /**
- * Returns the list of names of policy intents that will always be provided by this Extension Type
- * @return list of Policy Intent names
- */
- List<Intent> getAlwaysProvidedIntents();
-
- /**
- * Returns the list of names of policy intents that may be provided by this Extension Type thro
- * appropriate configuration
- * @return list of Policy Intent names
- */
- List<Intent> getMayProvideIntents();
-
- /**
- * Returns true if the model element is unresolved.
- *
- * @return true if the model element is unresolved.
- */
- boolean isUnresolved();
-
- /**
- * Sets whether the model element is unresolved.
- *
- * @param unresolved whether the model element is unresolved
- */
- void setUnresolved(boolean unresolved);
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPointTypeFactory.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPointTypeFactory.java
deleted file mode 100644
index ee67006875..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPointTypeFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-/**
- * Factory interface for creating extension types meta data
- *
- * @version $Rev$ $Date$
- */
-public interface IntentAttachPointTypeFactory {
-
- /**
- * Creates an ImplementationTypeImpl instance to hold metadata related to
- * a particular implementation extension in the SCA Domain
- *
- * @return an instance of IntentAttachPointType
- */
- IntentAttachPointType createImplementationType();
-
- /**
- * Creates an BindingTypeImpl instance to hold metadata related to
- * a particular binding extension in the SCA Domain
- *
- * @return an instance of IntentAttachPointType
- */
- IntentAttachPointType createBindingType();
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentMap.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentMap.java
deleted file mode 100644
index 1b225bc918..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentMap.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import java.util.List;
-
-/**
- * Represents a policy intent map. See the Policy Framework specification for a
- * description of this element.
- *
- * @version $Rev$ $Date$
- */
-public interface IntentMap {
-
- /**
- * Returns the intent realized by this intent map.
- *
- * @return the intent realized by this intent map
- */
- Intent getProvidedIntent();
-
- /**
- * Sets the intent realized by this intent map.
- *
- * @param providedIntent the intent realized by this intent map
- */
- void setProvidedIntent(Intent providedIntent);
-
- /**
- * Returns the default qualified intent map.
- *
- * @return the default qualified intent map
- */
- IntentMap getDefaultQualifiedIntentMap();
-
- /**
- * Sets the default qualified intent map.
- *
- * @param defaultQualifiedIntentMap the default qualified intent map
- */
- void setDefaultQualifiedIntentMap(IntentMap defaultQualifiedIntentMap);
-
- /**
- * Returns the list of children qualified intent maps.
- *
- * @return
- */
- List<IntentMap> getQualifiedIntentMaps();
-
- /**
- * Returns the list of concrete policies, either WS-Policy policy
- * attachments, policy references, or policies expressed in another policy
- * language.
- *
- * @return the list of concrete policies
- */
- List<Object> getPolicies();
-
- /**
- * Returns true if the model element is unresolved.
- *
- * @return true if the model element is unresolved.
- */
- boolean isUnresolved();
-
- /**
- * Sets whether the model element is unresolved.
- *
- * @param unresolved whether the model element is unresolved
- */
- void setUnresolved(boolean unresolved);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/Policy.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/Policy.java
deleted file mode 100644
index c6393e2ada..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/Policy.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import javax.xml.namespace.QName;
-
-/**
- * Interface that will abstract various types of policy specifications
- * and attachments for example WS-Policy
- *
- * @version $Rev$ $Date$
- */
-public interface Policy {
- QName getSchemaName();
- void setUnresolved(boolean unresolved);
- boolean isUnresolved();
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicyContext.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicyContext.java
deleted file mode 100644
index 65c39803d2..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicyContext.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy;
-
-import java.util.List;
-
-/**
- * A context container for policies.
- *
- * @version $Rev$ $Date$
- */
-public interface PolicyContext {
- List<Intent> getIntents(Object key);
- List<PolicySet> getPolicySets(Object key);
- void addIntents(Object key, List<Intent> intents);
- void addPolicySets(Object key, List<PolicySet> policySets);
- void addIntent(Object key, Intent intent);
- void addPolicySet(Object key, PolicySet policySet);
- void clearIntents(Object key);
- void clearPolicySets(Object key);
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java
deleted file mode 100644
index 49bcbae1ae..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-/**
- * A factory for the policy model.
- *
- * @version $Rev$ $Date$
- */
-public interface PolicyFactory {
-
- /**
- * Create a new intent.
- *
- * @return a new intent
- */
- Intent createIntent();
-
- /**
- * Create a new policy set.
- *
- * @return a new policy set
- */
- PolicySet createPolicySet();
-
- /**
- * Create a new intent map.
- *
- * @return a new intent map
- */
- IntentMap createIntentMap();
-
- /**
- * create a new Profile Intent
- *
- * @return a ProfileIntent instance
- */
- ProfileIntent createProfileIntent();
-
- /**
- * create a new QualifiedIntent
- *
- * @return a QualifiedIntent instance
- */
- QualifiedIntent createQualifiedIntent();
-
- /**
- * create a new PolicySetReference
- *
- * @return a PolicySetReference instance
- */
- PolicySetReference createPolicySetReference();
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java
deleted file mode 100644
index b16072c214..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathExpression;
-
-/**
- * Represents a policy set. See the Policy Framework specification for a
- * description of this element.
- *
- * @version $Rev$ $Date$
- */
-public interface PolicySet {
-
- /**
- * Returns the intent name.
- *
- * @return the intent name
- */
- QName getName();
-
- /**
- * Sets the intent name
- *
- * @param name the intent name
- */
- void setName(QName name);
-
- /**
- * Returns the list of operations that this policy set applies to.
- *
- * @return
- */
- //List<Operation> getOperations();
- /**
- * Returns the list of
- *
- * @return
- */
- List<PolicySet> getReferencedPolicySets();
-
- /**
- * Returns the list of provided intents
- *
- * @return
- */
- List<Intent> getProvidedIntents();
-
- /**
- * Returns the list of concrete policies, either WS-Policy policy
- * attachments, policy references, or policies expressed in another policy
- * language.
- *
- * @return the list of concrete policies
- */
- List<Object> getPolicies();
-
- /**
- * Returns true if the model element is unresolved.
- *
- * @return true if the model element is unresolved.
- */
- boolean isUnresolved();
-
- /**
- * Sets whether the model element is unresolved.
- *
- * @param unresolved whether the model element is unresolved
- */
- void setUnresolved(boolean unresolved);
-
- /**
- * Returns the XPath expression that is to be used to evaluate
- * if this PolicySet applies to specific attachment point
- *
- * @return the XPath expression
- */
- String getAppliesTo();
-
- /**
- * Sets the XPath expression that is to be used to evaluate
- * if this PolicySet applies to specific attachment point
- *
- */
- void setAppliesTo(String xpath);
-
- /**
- * Returns the policies / policy attachments provided thro intent maps
- *
- * @return
- */
- Map<Intent, List<Object>> getMappedPolicies();
-
- /**
- * Gets the XPath expression that is to be used to evaluate
- * the SCA Artifacts that this policyset will always apply to
- * immaterial of an intent declared on the SCA Artifact
- *
- * @return the XPath expression
- */
- String getAlwaysAppliesTo();
-
- /**
- * Sets the XPath expression that is to be used to evaluate
- * the SCA Artifacts that this policyset will always apply to
- * immaterial of an intent declared on the SCA Artifact
- *
- */
- void setAlwaysAppliesTo(String xpath);
-
- /**
- * Get the XPath expression for the appliesTo attribute
- * @return the XPath expression for the appliesTo attribute
- */
- XPathExpression getAppliesToXPathExpression();
-
- /**
- * Set the XPath expression for the appliesTo attribute
- * @param xpathExpression the XPath expression for the appliesTo attribute
- */
- void setAppliesToXPathExpression(XPathExpression xpathExpression);
-
- /**
- * Get the XPath expression for the alwaysAppliesTo attribute
- * @return the XPath expression for the alwaysAppliesTo attribute
- */
- XPathExpression getAlwaysAppliesToXPathExpression();
-
- /**
- * Set the XPath expression for the alwaysAppliesTo attribute
- * @param xpathExpression the XPath expression for the alwaysAppliesTo attribute
- */
- void setAlwaysAppliesToXPathExpression(XPathExpression xpathExpression);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySetAttachPoint.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySetAttachPoint.java
deleted file mode 100644
index f4156fc2e6..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySetAttachPoint.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import java.util.List;
-
-/**
- * Base interface for all assembly model objects that can have policy sets
- * attached to them.
- *
- * @version $Rev$ $Date$
- */
-public interface PolicySetAttachPoint extends IntentAttachPoint {
-
- /**
- * Returns a list of policy sets. See the Policy Framework specification for
- * a description of this attribute.
- *
- * @return a list of policy sets.
- */
- List<PolicySet> getPolicySets();
-
-
- /**
- * Returns a list of policy sets defined in the domain, that are applicable to this
- * PolicySetAttachPoint. An applicable PolicySet is one that include this PolicySetAttachPoint
- * as part of its 'appliesTo' XPath attribute.
- *
- * @return a list of policy sets applicable to this PolicySetAttachPoint
- */
- List<PolicySet> getApplicablePolicySets();
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySetReference.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySetReference.java
deleted file mode 100644
index caa0d04fe3..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySetReference.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import javax.xml.namespace.QName;
-
-/**
- * Interface that abstracts a PolicySet Reference
- *
- * @version $Rev$ $Date$
- */
-public interface PolicySetReference {
-
- /**
- * Returns the name of the policyset being referred to
- *
- * @return the QName of the referred policyset
- */
- QName getReferredPolicySetName();
-
- /**
- * @param refPolicySetName the name of the policyset being referred to
- *
- */
- void setReferredPolicySetName(QName refPolicySetName);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ProfileIntent.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ProfileIntent.java
deleted file mode 100644
index 28ff9d09d3..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ProfileIntent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import java.util.List;
-
-/**
- * Interface that abstracts a profile intent
- *
- * @version $Rev$ $Date$
- */
-public interface ProfileIntent extends Intent {
- /**
- * Returns the list of required intents.
- *
- * @return the list of required intents
- */
- List<Intent> getRequiredIntents();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/QualifiedIntent.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/QualifiedIntent.java
deleted file mode 100644
index 0f43221dd6..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/QualifiedIntent.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-/**
- * Abstracts a qualified policy intent
- *
- * @version $Rev$ $Date$
- */
-public interface QualifiedIntent extends Intent {
-
- /**
- * Returns the intent qualified by this intent
- *
- * @return
- */
- Intent getQualifiableIntent();
-
- /**
- * sets the qualifiable intent for this Qualified intent instance
- *
- * @param qualifiableIntent
- */
- void setQualifiableIntent(Intent qualifiableIntent);
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java
deleted file mode 100644
index 0f8b1ae00a..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-
-/**
- * Concrete implementation for a BindingType
- *
- * @version $Rev$ $Date$
- */
-public class BindingTypeImpl implements IntentAttachPointType {
-
- private List<Intent> alwaysProvides = new ArrayList<Intent>();
- private List<Intent> mayProvides = new ArrayList<Intent>();
- private QName typeName;
- private boolean unResolved = true;
-
- public List<Intent> getAlwaysProvidedIntents() {
- return alwaysProvides;
- }
-
- public List<Intent> getMayProvideIntents() {
- return mayProvides;
- }
-
- public QName getName() {
- return typeName;
- }
-
- public void setName(QName type) {
- this.typeName = type;
- }
-
- public boolean isUnresolved() {
- return unResolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unResolved = unresolved;
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(getName()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof BindingTypeImpl ) {
- if (getName() != null) {
- return getName().equals(((BindingTypeImpl)obj).getName());
- } else {
- return ((BindingTypeImpl)obj).getName() == null;
- }
- } else {
- return false;
- }
- }
-
- @Override
- public String toString() {
- return ( this.typeName != null ) ? getName().toString() : "null";
- }
-}
-; \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java
deleted file mode 100644
index 7861fd79f9..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-
-/**
- * Concrete implementation for a Implementation Type
- *
- * @version $Rev$ $Date$
- */
-public class ImplementationTypeImpl implements IntentAttachPointType {
- private List<Intent> alwaysProvides = new ArrayList<Intent>();
- private List<Intent> mayProvides = new ArrayList<Intent>();
- private QName typeName;
- private boolean unResolved = true;
-
- public List<Intent> getAlwaysProvidedIntents() {
- return alwaysProvides;
- }
-
- public List<Intent> getMayProvideIntents() {
- return mayProvides;
- }
-
- public QName getName() {
- return typeName;
- }
-
- public void setName(QName type) {
- this.typeName = type;
- }
-
- public boolean isUnresolved() {
- return unResolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unResolved = unresolved;
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(getName()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof ImplementationTypeImpl ) {
- if (getName() != null) {
- return getName().equals(((ImplementationTypeImpl)obj).getName());
- } else {
- return ((ImplementationTypeImpl)obj).getName() == null;
- }
- } else {
- return false;
- }
- }
-
- @Override
- public String toString() {
- return ( this.typeName != null ) ? getName().toString() : "null";
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentAttachPointTypeFactoryImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentAttachPointTypeFactoryImpl.java
deleted file mode 100644
index aa6e27c240..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentAttachPointTypeFactoryImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-
-/**
- * Default implementation for IntentAttachPointTypeFactory
- *
- * @version $Rev$ $Date$
- */
-public class IntentAttachPointTypeFactoryImpl implements IntentAttachPointTypeFactory {
-
- public IntentAttachPointType createBindingType() {
- return new BindingTypeImpl();
- }
-
- public IntentAttachPointType createImplementationType() {
- return new ImplementationTypeImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentImpl.java
deleted file mode 100644
index 2d6bd0eb6f..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentImpl.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Intent;
-
-/**
- * Represents a policy intent.
- *
- * @version $Rev$ $Date$
- */
-public class IntentImpl implements Intent {
-
- private static final String QUALIFIED_SEPARATOR = ".";
- private static final String DOMAIN_SEPARATOR = ".";
- private QName name;
- //private List<Operation> operations = new ArrayList<Operation>();
- private List<QName> constrains = new ArrayList<QName>();
- private String description;
- private List<Intent> qualifiedIntents = new ArrayList<Intent>();
- // private List<Intent> requiredIntents = new ArrayList<Intent>();
- private List<Intent> excludedIntents = new ArrayList<Intent>();
- private boolean unresolved = true;
- private String domain;
- private String[] qualifiedNames;
-
- protected IntentImpl() {
- }
-
- public QName getName() {
- return name;
- }
-
- public void setName(QName name) {
- this.name = name;
- String iname = name.getLocalPart();
- int domainIdx = iname.indexOf(DOMAIN_SEPARATOR);
- if (domainIdx > -1) {
- domain = iname.substring(0, domainIdx);
- String qualifNamesStr = iname.substring(domainIdx + 1);
- String pattern = "\\" + QUALIFIED_SEPARATOR;
- qualifiedNames = qualifNamesStr.split(pattern);
- } else
- domain = iname;
- }
-
- public String getDomain() {
- return domain;
- }
-
- public String[] getQualifiedNames() {
- String[] results = new String[qualifiedNames.length];
- System.arraycopy(qualifiedNames, 0, results, 0, qualifiedNames.length);
- return results;
- }
-
- /*public List<Operation> getOperations() {
- return operations;
- }*/
-
- public List<QName> getConstrains() {
- return constrains;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public List<Intent> getQualifiedIntents() {
- return qualifiedIntents;
- }
-
- public List<Intent> getExcludedIntents() {
- return excludedIntents;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- QName intentName = getName();
- result = prime * result + ((intentName == null) ? 0 : intentName.hashCode());
- return result;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IntentImpl)) {
- return false;
- }
- final IntentImpl other = (IntentImpl)obj;
- if (getName() == null) {
- if (other.getName() != null) {
- return false;
- }
- } else if (!getName().equals(other.getName())) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- return String.valueOf(getName());
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentMapImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentMapImpl.java
deleted file mode 100644
index aab03281ba..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentMapImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentMap;
-
-/**
- * Represents an intent map.
- *
- * @version $Rev$ $Date$
- */
-public class IntentMapImpl implements IntentMap {
-
- private boolean unresolved;
- private IntentMap defaultQualifiedIntentMap;
- private List<Object> policies;
- private Intent providedIntent;
- private List<IntentMap> qualifiedIntentMaps;
-
- protected IntentMapImpl() {
- }
-
- public IntentMap getDefaultQualifiedIntentMap() {
- return defaultQualifiedIntentMap;
- }
-
- public List<Object> getPolicies() {
- return policies;
- }
-
- public Intent getProvidedIntent() {
- return providedIntent;
- }
-
- public List<IntentMap> getQualifiedIntentMaps() {
- return qualifiedIntentMaps;
- }
-
- public void setDefaultQualifiedIntentMap(IntentMap defaultQualifiedIntentMap) {
- this.defaultQualifiedIntentMap = defaultQualifiedIntentMap;
- }
-
- public void setProvidedIntent(Intent providedIntent) {
- this.providedIntent = providedIntent;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyContextImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyContextImpl.java
deleted file mode 100644
index a0e2f10f56..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyContextImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.impl;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicyContext;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class PolicyContextImpl implements PolicyContext {
- private Map<Object, List<Intent>> intents = new Hashtable<Object , List<Intent>>();
- private Map<Object, List<PolicySet>> policySets = new Hashtable<Object, List<PolicySet>>();
-
- public void addIntent(Object key, Intent intent) {
- if ( intents.get(key) == null ) {
- intents.put(key, new ArrayList<Intent>());
- }
- intents.get(key).add(intent);
- }
-
- public void addIntents(Object key, List<Intent> intents) {
- if ( this.intents.get(key) == null ) {
- this.intents.put(key, new ArrayList<Intent>());
- }
- this.intents.get(key).addAll(intents);
- }
-
- public void addPolicySet(Object key, PolicySet policySet) {
- if ( policySets.get(key) == null ) {
- policySets.put(key, new ArrayList<PolicySet>());
- }
- policySets.get(key).add(policySet);
- }
-
- public void addPolicySets(Object key, List<PolicySet> policySets) {
- if ( this.policySets.get(key) == null ) {
- this.policySets.put(key, new ArrayList<PolicySet>());
- }
- this.policySets.get(key).addAll(policySets);
- }
-
- public List<Intent> getIntents(Object key) {
- if ( intents.get(key) == null ) {
- intents.put(key, new ArrayList<Intent>());
- }
- return intents.get(key);
- }
-
- public List<PolicySet> getPolicySets(Object key) {
- if ( policySets.get(key) == null ) {
- policySets.put(key, new ArrayList<PolicySet>());
- }
- return policySets.get(key);
- }
-
- public void clearIntents(Object key) {
- if ( intents.get(key) != null ) {
- intents.clear();
- }
- }
-
- public void clearPolicySets(Object key) {
- if ( policySets.get(key) != null ) {
- policySets.clear();
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java
deleted file mode 100644
index 1db29b835e..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentMap;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetReference;
-import org.apache.tuscany.sca.policy.ProfileIntent;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
-
-/**
- * A factory for the policy model.
- *
- * @version $Rev$ $Date$
- */
-public abstract class PolicyFactoryImpl implements PolicyFactory {
-
- public Intent createIntent() {
- return new IntentImpl();
- }
-
- public PolicySetReference createPolicySetReference() {
- return new PolicySetReferenceImpl();
- }
-
- public PolicySet createPolicySet() {
- return new PolicySetImpl();
- }
-
- public IntentMap createIntentMap() {
- return new IntentMapImpl();
- }
-
- public ProfileIntent createProfileIntent() {
- return new ProfileIntentImpl();
- }
-
- public QualifiedIntent createQualifiedIntent() {
- return new QualifiedIntentImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java
deleted file mode 100644
index 179a10cc1a..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathExpression;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Represents a policy set.
- *
- * @version $Rev$ $Date$
- */
-public class PolicySetImpl implements PolicySet {
-
- private QName name;
- //private List<Operation> operations = new ArrayList<Operation>();
- //private List<QName> appliesTo;
- private String appliesTo;
- private List<Intent> providedIntents = new ArrayList<Intent>();
- private List<PolicySet> referencedPolicySets = new ArrayList<PolicySet>();
- private List<Object> policies = new ArrayList<Object>();
- Map<Intent, List<Object>> mappedPolicies = new Hashtable<Intent, List<Object>>();
- private boolean unresolved = true;
- private String alwaysAppliesTo;
-
- private XPathExpression appliesToXPathExpression;
- private XPathExpression alwaysAppliesToXPathExpression;
-
- public String getAlwaysAppliesTo() {
- return alwaysAppliesTo;
- }
-
- public void setAlwaysAppliesTo(String alwaysAppliesTo) {
- this.alwaysAppliesTo = alwaysAppliesTo;
- }
-
- protected PolicySetImpl() {
- }
-
- public QName getName() {
- return name;
- }
-
- public void setName(QName name) {
- this.name = name;
- }
-
- /*public List<Operation> getOperations() {
- return operations;
- }*/
-
- public String getAppliesTo() {
- return appliesTo;
- }
-
- public void setAppliesTo(String appliesTo) {
- this.appliesTo = appliesTo;
- }
-
- public List<Intent> getProvidedIntents() {
- return providedIntents;
- }
-
- public List<PolicySet> getReferencedPolicySets() {
- return referencedPolicySets;
- }
-
- public List<Object> getPolicies() {
- return policies;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public Map<Intent, List<Object>> getMappedPolicies() {
- return mappedPolicies;
- }
-
- @Override
- public int hashCode() {
- return String.valueOf(getName()).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else if (obj instanceof PolicySet) {
- if (getName() != null) {
- return getName().equals(((PolicySet)obj).getName());
- } else {
- return ((PolicySet)obj).getName() == null;
- }
- } else {
- return false;
- }
- }
-
- @Override
- public String toString() {
- return ( this.name != null ) ? getName().toString() : "null";
- }
-
- public XPathExpression getAppliesToXPathExpression() {
- return appliesToXPathExpression;
- }
-
- public void setAppliesToXPathExpression(XPathExpression appliesToXPathExpression) {
- this.appliesToXPathExpression = appliesToXPathExpression;
- }
-
- public XPathExpression getAlwaysAppliesToXPathExpression() {
- return alwaysAppliesToXPathExpression;
- }
-
- public void setAlwaysAppliesToXPathExpression(XPathExpression alwaysAppliesToXPathExpression) {
- this.alwaysAppliesToXPathExpression = alwaysAppliesToXPathExpression;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetReferenceImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetReferenceImpl.java
deleted file mode 100644
index 98a116fe7b..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetReferenceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.PolicySetReference;
-
-/**
- * Concrete implementation for a PolicySetReference
- *
- * @version $Rev$ $Date$
- */
-public class PolicySetReferenceImpl implements PolicySetReference {
-
- private QName referredPolicySetName = null;
-
- /*
- * @see org.apache.tuscany.sca.policy.PolicySetReference#getReferredPolicySetName()
- */
- public QName getReferredPolicySetName() {
- return referredPolicySetName;
- }
-
- /*
- * @see org.apache.tuscany.sca.policy.PolicySetReference#setReferredPolicySetName(javax.xml.namespace.QName)
- */
- public void setReferredPolicySetName(QName refPolicySetName) {
- referredPolicySetName = refPolicySetName;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ProfileIntentImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ProfileIntentImpl.java
deleted file mode 100644
index e5002d2cdc..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ProfileIntentImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.ProfileIntent;
-
-/**
- * Concrete implementation for Profile Intent
- *
- * @version $Rev$ $Date$
- */
-public class ProfileIntentImpl extends IntentImpl implements ProfileIntent {
- private List<Intent> requiredIntents = new ArrayList<Intent>();
-
- public List<Intent> getRequiredIntents() {
- return requiredIntents;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/QualifiedIntentImpl.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/QualifiedIntentImpl.java
deleted file mode 100644
index d6f65b1788..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/QualifiedIntentImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
-
-/**
- * Models a concrete implementation of a Qualified Intent
- *
- * @version $Rev$ $Date$
- */
-public class QualifiedIntentImpl extends IntentImpl implements QualifiedIntent {
- private Intent qualifiableIntent = null;
-
- public Intent getQualifiableIntent() {
- return qualifiableIntent;
- }
-
- public void setQualifiableIntent(Intent qualifiableIntent) {
- this.qualifiableIntent = qualifiableIntent;
- }
-
- @Override
- public List<QName> getConstrains() {
- return getQualifiableIntent().getConstrains();
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyComputationUtils.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyComputationUtils.java
deleted file mode 100644
index 2e4c6a9d78..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyComputationUtils.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 static javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
-
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.ProfileIntent;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Utility methods used during computation of PolicyIntents and PolicySets sets
- *
- * @version $Rev$ $Date$
- */
-public class PolicyComputationUtils {
- private static final String POLICYSET_PREFIX = "tp_";
- private static final String APPLICABLE_POLICYSET_ATTR_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- private static final String APPLICABLE_POLICYSET_ATTR = "applicablePolicySets";
- private static final String POLICY_SETS_ATTR = "policySets";
- private static final String APPLICABLE_POLICYSET_ATTR_PREFIX = "tuscany";
- private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
-
- /**
- * This method unconditionally adds intents from the source list to the target list.
- * It is used for intermediate intent inheritance between promotion levels
- * (e.g. between a composite service and a component service). It does not check
- * whether there are conflicting (mutually exclusive) intents. This is because
- * promotion cannot override intents. If the resulting target list has conflicting
- * intents, this will be detected later during policy computation.
- */
- public static void addInheritedIntents(List<Intent> sourceList, List<Intent> targetList) {
- if (sourceList != null) {
- targetList.addAll(sourceList);
- }
- }
-
- public static void addInheritedPolicySets(List<PolicySet> sourceList,
- List<PolicySet> targetList,
- boolean checkOverrides) {
- // check overrides is true when policysets are to be copied from
- // componentType to component level
- if (checkOverrides) {
- // aggregate all the provided intents present in the target
- List<Intent> targetProvidedIntents = new ArrayList<Intent>();
- for (PolicySet policySet : targetList) {
- targetProvidedIntents.addAll(policySet.getProvidedIntents());
- }
-
- // for every policy set in the source check if it provides one of
- // the intents that is
- // already provided by the policysets in the destination and do not
- // copy them.
- for (PolicySet policySet : sourceList) {
- for (Intent sourceProvidedIntent : policySet.getProvidedIntents()) {
- if (!targetProvidedIntents.contains(sourceProvidedIntent)) {
- targetList.add(policySet);
- }
- }
- }
- } else {
- targetList.addAll(sourceList);
- }
- }
-
- /**
- * This method is used to inherit intents and policy sets between hierarchical levels
- * within the same composite (e.g. between a component and its services and references).
- * In this case the source intents and policy sets provide defaults which are inherited
- * into the target lists only when there is no conflict. For example consider a component
- * with 3 references. The component level requires intent 'propagatesTransaction'.
- * Reference 1 and 2 do not specify an intent, but reference 3 requires 'suspendsTransaction'.
- * In this case the 'propagatesTransaction' intent is inherited by reference 1 and 2
- * but not by reference 3.
- */
- public static void addDefaultPolicies(List<Intent> sourceIntents,
- List<PolicySet> sourcePolicySets,
- List<Intent> targetIntents,
- List<PolicySet> targetPolicySets)
- {
- // form a list of all intents required by the target
- List<Intent> combinedTargetIntents = new ArrayList<Intent>();
- combinedTargetIntents.addAll(findAndExpandProfileIntents(targetIntents));
- for (PolicySet targetPolicySet : targetPolicySets) {
- combinedTargetIntents.addAll(findAndExpandProfileIntents(targetPolicySet.getProvidedIntents()));
- }
-
- // inherit intents in the source list that do not conflict with intents already in the target list
- for (Intent sourceIntent : findAndExpandProfileIntents(sourceIntents)) {
- boolean conflict = false;
- for (Intent excluded : sourceIntent.getExcludedIntents()) {
- if (combinedTargetIntents.contains(excluded)) {
- conflict = true;
- break;
- }
- }
- if (!conflict) {
- targetIntents.add(sourceIntent);
- }
- }
-
- // inherit policy sets in the source list that do not conflict with policy sets or intents
- // in the target list
- for (PolicySet sourcePolicySet : sourcePolicySets) {
- boolean conflict = false;
- List<Intent> providedIntents = findAndExpandProfileIntents(sourcePolicySet.getProvidedIntents());
- checkConflict: for (Intent intent : providedIntents) {
- for (Intent excluded : intent.getExcludedIntents()) {
- if (combinedTargetIntents.contains(excluded)) {
- conflict = true;
- break checkConflict;
- }
- }
- }
- if (!conflict)
- targetPolicySets.add(sourcePolicySet);
- }
-
- }
-
- public static void checkForMutuallyExclusiveIntents(
- List<Intent> intents,
- List<PolicySet> policySets,
- IntentAttachPointType intentAttachPointType,
- String id) throws PolicyValidationException
- {
- // gather all intents (keeping track of where they come from)
- Map<Intent, PolicySet> combinedIntents = new HashMap<Intent,PolicySet>();
- for (PolicySet policySet : policySets) {
- for (Intent providedIntent : findAndExpandProfileIntents(policySet.getProvidedIntents())) {
- combinedIntents.put(providedIntent, policySet);
- }
- }
- for (Intent intent : intents) {
- combinedIntents.put(intent, null);
- }
-
- // check for conflicts
- for (Intent intent : combinedIntents.keySet()) {
- for (Intent excluded : intent.getExcludedIntents()) {
- if (combinedIntents.keySet().contains(excluded)) {
- String sIntent1, sIntent2;
- if (combinedIntents.get(intent) == null)
- sIntent1 = intent.getName().toString();
- else
- sIntent1 = intent.getName().toString() + " in policy set " + combinedIntents.get(intent).getName().toString();
- if (combinedIntents.get(excluded) == null)
- sIntent2 = excluded.getName().toString();
- else
- sIntent2 = excluded.getName().toString() + " in policy set " + combinedIntents.get(excluded).getName().toString();
- throw new PolicyValidationException(
- intentAttachPointType.getName() + " for " + id +
- " uses mutually-exclusive intents " + sIntent1 + " and " + sIntent2);
- }
- }
- }
- }
-
- public static void expandProfileIntents(List<Intent> intents) {
- List<Intent> expandedIntents = null;
- if ( intents.size() > 0 ) {
- expandedIntents = findAndExpandProfileIntents(intents);
- intents.clear();
- intents.addAll(expandedIntents);
- }
- }
-
- public static List<Intent> findAndExpandProfileIntents(List<Intent> intents) {
- List<Intent> expandedIntents = new ArrayList<Intent>();
- for ( Intent intent : intents ) {
- if ( intent instanceof ProfileIntent ) {
- ProfileIntent profileIntent = (ProfileIntent)intent;
- List<Intent> requiredIntents = profileIntent.getRequiredIntents();
- expandedIntents.addAll(findAndExpandProfileIntents(requiredIntents));
- } else {
- expandedIntents.add(intent);
- }
- }
- return expandedIntents;
- }
-
- private static byte[] addApplicablePolicySets(Document doc, Collection<PolicySet> policySets)
- throws XPathExpressionException, TransformerConfigurationException, TransformerException {
-
- for (PolicySet policySet : policySets) {
- if (policySet.getAppliesTo() != null) {
- addApplicablePolicySets(policySet, doc);
- }
-
- if (policySet.getAlwaysAppliesTo() != null) {
- addAlwaysApplicablePolicySets(policySet, doc);
- }
- }
-
- StringWriter sw = new StringWriter();
- final Source domSource = new DOMSource(doc);
- final Result finalResult = new StreamResult(sw);
- final Transformer transformer = TransformerFactory.newInstance().newTransformer();
- // transformer.setOutputProperty("omit-xml-declaration", "yes");
- // Allow priviledged access to let transformers read property files. Requires
- // PropertyPermission in security policy.
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
- public Object run() throws TransformerException {
- transformer.transform(domSource, finalResult);
- return null;
- }
- });
- } catch (PrivilegedActionException e) {
- throw (TransformerException)e.getException();
- }
-
- return sw.toString().getBytes();
- }
-
- private static void addAlwaysApplicablePolicySets(PolicySet policySet,
- Document doc) throws XPathExpressionException {
- XPathExpression expression = policySet.getAlwaysAppliesToXPathExpression();
- NodeList result = (NodeList)expression.evaluate(doc, XPathConstants.NODESET);
-
- if (result != null) {
- for (int counter = 0; counter < result.getLength(); ++counter) {
- Node aResultNode = result.item(counter);
-
- String alwaysApplicablePolicySets = null;
-
- String policySetPrefix =
- declareNamespace((Element)aResultNode, policySet.getName().getNamespaceURI());
- String policySetsAttrPrefix =
- declareNamespace((Element)aResultNode, SCA10_NS);
- if (aResultNode.getAttributes().getNamedItem(POLICY_SETS_ATTR) != null) {
- alwaysApplicablePolicySets =
- aResultNode.getAttributes().getNamedItem(POLICY_SETS_ATTR).getNodeValue();
- }
-
- if (alwaysApplicablePolicySets != null && alwaysApplicablePolicySets.length() > 0) {
- alwaysApplicablePolicySets =
- alwaysApplicablePolicySets + " "
- + policySetPrefix
- + ":"
- + policySet.getName().getLocalPart();
- } else {
- alwaysApplicablePolicySets =
- policySetPrefix + ":" + policySet.getName().getLocalPart();
- }
-
- ((Element)aResultNode).setAttribute(POLICY_SETS_ATTR, alwaysApplicablePolicySets);
- }
- }
- }
-
- private static void addApplicablePolicySets(PolicySet policySet,
- Document doc) throws XPathExpressionException {
- XPathExpression expression = policySet.getAppliesToXPathExpression();
- NodeList result = (NodeList)expression.evaluate(doc, XPathConstants.NODESET);
-
- if (result != null) {
- for (int counter = 0; counter < result.getLength(); ++counter) {
- Node aResultNode = result.item(counter);
-
- String applicablePolicySets = null;
-
- String policySetPrefix =
- declareNamespace((Element)aResultNode, policySet.getName().getNamespaceURI());
- String appPolicyAttrPrefix =
- declareNamespace((Element)aResultNode,
- APPLICABLE_POLICYSET_ATTR_NS);
- if (aResultNode.getAttributes().getNamedItemNS(APPLICABLE_POLICYSET_ATTR_NS,
- APPLICABLE_POLICYSET_ATTR) != null) {
- applicablePolicySets =
- aResultNode.getAttributes().getNamedItemNS(APPLICABLE_POLICYSET_ATTR_NS,
- APPLICABLE_POLICYSET_ATTR)
- .getNodeValue();
- }
-
- if (applicablePolicySets != null && applicablePolicySets.length() > 0) {
- applicablePolicySets =
- applicablePolicySets + " "
- + policySetPrefix
- + ":"
- + policySet.getName().getLocalPart();
- } else {
- applicablePolicySets =
- policySetPrefix + ":" + policySet.getName().getLocalPart();
- }
-
- ((Element)aResultNode).setAttributeNS(APPLICABLE_POLICYSET_ATTR_NS,
- appPolicyAttrPrefix + ":"
- + APPLICABLE_POLICYSET_ATTR,
- applicablePolicySets);
- }
- }
- }
-
- public static byte[] addApplicablePolicySets(InputStream is, Collection<PolicySet> domainPolicySets, DocumentBuilderFactory documentBuilderFactory) throws Exception {
- documentBuilderFactory.setNamespaceAware(true);
- DocumentBuilder db = documentBuilderFactory.newDocumentBuilder();
- Document doc = db.parse(is);
- is.close();
- return addApplicablePolicySets(doc, domainPolicySets);
- }
-
- private static class DOMNamespaceContext implements NamespaceContext {
- private Node node;
-
- /**
- * @param node
- */
- public DOMNamespaceContext(Node node) {
- super();
- this.node = node;
- }
-
- public String getNamespaceURI(String prefix) {
- return node.lookupNamespaceURI(prefix);
- }
-
- public String getPrefix(String namespaceURI) {
- return node.lookupPrefix(namespaceURI);
- }
-
- public Iterator<?> getPrefixes(String namespaceURI) {
- return null;
- }
-
- }
-
- private static String declareNamespace(Element element, String ns) {
- if (ns == null) {
- ns = "";
- }
- Node node = element;
- String prefix = "";
- boolean declared = false;
- while (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
- if ( node.lookupPrefix(ns) != null ) {
- prefix = node.lookupPrefix(ns);
- declared = true;
- break;
- } else {
- /*NamedNodeMap attrs = node.getAttributes();
- if (attrs == null) {
- break;
- }
- Node attr = attrs.getNamedItem(qname);
- if (attr != null) {
- declared = ns.equals(attr.getNodeValue());
- break;
- }*/
- node = node.getParentNode();
- }
- }
- if (!declared) {
- // Find an available prefix
- for (int i=1; ; i++) {
- prefix = POLICYSET_PREFIX + i;
- if (element.lookupNamespaceURI(prefix) == null) {
- break;
- }
- }
- String qname = "xmlns:" + prefix;
- org.w3c.dom.Attr attr = element.getOwnerDocument().createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, qname);
- attr.setValue(ns);
- element.setAttributeNodeNS(attr);
- }
- return prefix;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandler.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandler.java
deleted file mode 100644
index 1f91710f95..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.util;
-
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * @deprecated This interface is replaced by PolicyProviderFactory/PolicyProvider SPIs
- * Handler interface for handling policies defined in policysets
- *
- * @version $Rev$ $Date$
- */
-@Deprecated
-public interface PolicyHandler {
- PolicySet getApplicablePolicySet();
- void setApplicablePolicySet(PolicySet policySet);
- void setUp(Object... context);
- void cleanUp(Object... context);
- void beforeInvoke(Object... context);
- void afterInvoke(Object... context);
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerDefinitionsLoader.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerDefinitionsLoader.java
deleted file mode 100644
index e9af4912a3..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerDefinitionsLoader.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.util;
-
-import java.io.IOException;
-import java.util.ArrayList;
-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.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * Utility class for loading policy handler definitions from META-INF/services directories
- *
- * @version $Rev$ $Date$
- */
-public class PolicyHandlerDefinitionsLoader {
-
- public static List<PolicyHandlerTuple> loadPolicyHandlerClassnames() {
- // Get the processor service declarations
- Set<ServiceDeclaration> sds;
- try {
- sds = ServiceDiscovery.getInstance().getServiceDeclarations(PolicyHandler.class.getName());
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
-
- List<PolicyHandlerTuple> handlerTupleList = new ArrayList<PolicyHandlerTuple>();
-
- Map<Object, List<PolicyHandlerTuple>> handlerTuples = new Hashtable<Object, List<PolicyHandlerTuple>>();
- for (ServiceDeclaration sd : sds) {
- Map<String, String> attributes = sd.getAttributes();
- String intentName = attributes.get("intent");
- QName intentQName = getQName(intentName);
- String policyModelClassName = attributes.get("model");
- String appliesTo = attributes.get("appliesTo");
- if ( appliesTo != null && !appliesTo.startsWith("/") ) {
- appliesTo = "//" + appliesTo;
- }
- handlerTupleList.add(new PolicyHandlerTuple(sd, sd.getClassName(), intentQName, policyModelClassName, appliesTo));
- }
-
- return handlerTupleList;
- }
-
- private static QName getQName(String qname) {
- if (qname == null) {
- return null;
- }
- qname = qname.trim();
- if (qname.startsWith("{")) {
- int h = qname.indexOf('}');
- if (h != -1) {
- return new QName(qname.substring(1, h), qname.substring(h + 1));
- }
- } else {
- int h = qname.indexOf('#');
- if (h != -1) {
- return new QName(qname.substring(0, h), qname.substring(h + 1));
- }
- }
- throw new IllegalArgumentException("Invalid qname: " + qname);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerTuple.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerTuple.java
deleted file mode 100644
index c80e68a0be..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerTuple.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.util;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-
-/**
- * PolicyHanlder tuples stored in policy handler services files
- *
- * @version $Rev$ $Date$
- */
-public class PolicyHandlerTuple {
- private ServiceDeclaration declaration;
- private String policyHandlerClassName;
- private QName providedIntentName;
- private String policyModelClassName;
- private String appliesTo;
-
- public PolicyHandlerTuple(ServiceDeclaration declaration,
- String handlerClassName,
- QName providedIntentName,
- String policyModelClassName,
- String appliesTo) {
- this.declaration = declaration;
- this.policyHandlerClassName = handlerClassName;
- this.providedIntentName = providedIntentName;
- this.policyModelClassName = policyModelClassName;
- this.appliesTo = appliesTo;
- }
-
- public ServiceDeclaration getDeclaration() {
- return declaration;
- }
-
- public void setDeclaration(ServiceDeclaration declaration) {
- this.declaration = declaration;
- }
-
- public String getAppliesTo() {
- return appliesTo;
- }
-
- public void setAppliesTo(String appliesTo) {
- this.appliesTo = appliesTo;
- }
-
-
- public String getPolicyHandlerClassName() {
- return policyHandlerClassName;
- }
- public void setPolicyHandlerClassName(String policyHandlerClassName) {
- this.policyHandlerClassName = policyHandlerClassName;
- }
- public String getPolicyModelClassName() {
- return policyModelClassName;
- }
- public void setPolicyModelClassName(String policyModelClassName) {
- this.policyModelClassName = policyModelClassName;
- }
- public QName getProvidedIntentName() {
- return providedIntentName;
- }
- public void setProvidedIntentName(QName providedIntentName) {
- this.providedIntentName = providedIntentName;
- }
-
- @Override
- public String toString() {
- return policyHandlerClassName + ", " + providedIntentName + ", " + policyModelClassName + ", " + appliesTo;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerUtils.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerUtils.java
deleted file mode 100644
index 6d6420017f..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyHandlerUtils.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.util;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Utility methods to deal with PolicyHandlers
- *
- * @version $Rev$ $Date$
- */
-public class PolicyHandlerUtils {
- public static PolicyHandler findPolicyHandler(PolicySet policySet, List<PolicyHandlerTuple> policyHandlerClassNames)
- throws IllegalAccessException, ClassNotFoundException, InstantiationException {
-
- PolicyHandler handler = null;
-
- for (PolicyHandlerTuple handlerTuple : policyHandlerClassNames) {
- //System.out.println(handlerTuple);
- for (Intent intent : policySet.getProvidedIntents()) {
- if (intent.getName().equals(handlerTuple.getProvidedIntentName())) {
- for (Object policy : policySet.getPolicies()) {
- if (policy.getClass().getName().equals(handlerTuple.getPolicyModelClassName())) {
- if (handlerTuple.getAppliesTo() != null) {
- if (handlerTuple.getAppliesTo().equals(policySet.getAppliesTo())) {
- handler = (PolicyHandler)handlerTuple.getDeclaration().loadClass().newInstance();
- handler.setApplicablePolicySet(policySet);
- return handler;
- }
- } else {
- handler = (PolicyHandler)handlerTuple.getDeclaration().loadClass().newInstance();
- handler.setApplicablePolicySet(policySet);
- return handler;
- }
- }
- }
- }
- }
- }
-
- return handler;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java
deleted file mode 100644
index eb97818042..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.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/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java b/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java
deleted file mode 100644
index afb3c035ae..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.util;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PolicyValidationUtils {
-
- public static boolean isConstrained(QName constrained, IntentAttachPointType attachPointType) {
- return (attachPointType != null && attachPointType.getName().getNamespaceURI()
- .equals(constrained.getNamespaceURI()) && attachPointType.getName().getLocalPart()
- .startsWith(constrained.getLocalPart()));
- }
-
- public static void validateIntents(IntentAttachPoint attachPoint,
- IntentAttachPointType 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 (QName constrained : intent.getConstrains()) {
- if (isConstrained(constrained, attachPointType)) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- throw new PolicyValidationException("Policy Intent '" + intent.getName()
- + "' does not constrain extension type "
- + attachPointType.getName());
- }
- } else {
- throw new PolicyValidationException("Policy Intent '" + intent.getName()
- + "' is not defined in this domain ");
- }
- }
- }
- }
-
- public static void validatePolicySets(PolicySetAttachPoint policySetAttachPoint)
- throws PolicyValidationException {
- validatePolicySets(policySetAttachPoint,
- policySetAttachPoint.getType(),
- policySetAttachPoint.getApplicablePolicySets());
- }
-
- public static void validatePolicySets(PolicySetAttachPoint policySetAttachPoint,
- IntentAttachPointType attachPointType)
- throws PolicyValidationException {
- validatePolicySets(policySetAttachPoint,
- attachPointType,
- policySetAttachPoint.getApplicablePolicySets());
- }
-
- public static void validatePolicySets(PolicySetAttachPoint policySetAttachPoint,
- IntentAttachPointType attachPointType,
- List<PolicySet> applicablePolicySets)
- throws PolicyValidationException {
- // Since the applicablePolicySets in a policySetAttachPoint 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 : policySetAttachPoint.getPolicySets()) {
- if (!definedPolicySet.isUnresolved()) {
- if (!applicablePolicySets.contains(definedPolicySet)) {
- throw new PolicyValidationException("Policy Set '" + definedPolicySet
- .getName()
- + "' does not apply to extension type "
- + attachPointType.getName());
- }
- } else {
- throw new PolicyValidationException("Policy Set '" + definedPolicySet.getName()
- + "' is not defined in this domain ");
-
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory b/tags/java/sca/2.0-M1/modules/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory
deleted file mode 100644
index a0e56c1822..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.policy.DefaultIntentAttachPointTypeFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.PolicyFactory b/tags/java/sca/2.0-M1/modules/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.PolicyFactory
deleted file mode 100644
index 846b3b24a4..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.PolicyFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.policy.DefaultPolicyFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/policy/src/test/java/org/apache/tuscany/sca/policy/PolicyFactoryTestCase.java b/tags/java/sca/2.0-M1/modules/policy/src/test/java/org/apache/tuscany/sca/policy/PolicyFactoryTestCase.java
deleted file mode 100644
index 2775c4ac71..0000000000
--- a/tags/java/sca/2.0-M1/modules/policy/src/test/java/org/apache/tuscany/sca/policy/PolicyFactoryTestCase.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy;
-
-import static org.junit.Assert.assertEquals;
-
-import javax.xml.namespace.QName;
-
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test building of policy model instances using the policy factory.
- *
- * @version $Rev$ $Date$
- */
-public class PolicyFactoryTestCase {
-
- PolicyFactory factory;
-
- @Before
- public void setUp() throws Exception {
- factory = new DefaultPolicyFactory();
- }
-
- @Test
- public void testCreateIntent() {
- Intent intent = factory.createIntent();
- intent.setName(new QName("http://test", "reliability"));
- assertEquals(intent.getName(), new QName("http://test", "reliability"));
- }
-
- @Test
- public void testCreatePolicySet() {
- PolicySet policySet = factory.createPolicySet();
- policySet.setName(new QName("http://test", "reliability"));
- assertEquals(policySet.getName(), new QName("http://test", "reliability"));
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/pom.xml b/tags/java/sca/2.0-M1/modules/pom.xml
deleted file mode 100644
index 307a5a36af..0000000000
--- a/tags/java/sca/2.0-M1/modules/pom.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-modules</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Implementation Modules</name>
-
- <modules>
- <module>assembly</module>
- <module>assembly-xml</module>
- <module>assembly-xsd</module>
- <module>binding-rmi</module>
- <module>binding-rmi-runtime</module>
- <module>binding-sca</module>
- <module>binding-sca-xml</module>
- <module>binding-ws</module>
- <module>binding-ws-axis2</module>
- <module>binding-ws-axis2-policy</module>
- <module>binding-ws-wsdlgen</module>
- <module>binding-ws-xml</module>
- <module>contribution</module>
- <module>contribution-java</module>
- <module>contribution-namespace</module>
- <module>contribution-xml</module>
- <module>core</module>
- <module>core-databinding</module>
- <module>core-spi</module>
- <module>databinding</module>
- <module>databinding-axiom</module>
- <module>databinding-jaxb</module>
- <module>databinding-jaxb-axiom</module>
- <module>definitions</module>
- <module>definitions-xml</module>
- <module>endpoint</module>
- <module>extensibility</module>
- <module>extensibility-equinox</module>
- <module>host-http</module>
- <module>host-jetty</module>
- <module>host-rmi</module>
- <module>host-webapp</module>
- <module>implementation-java</module>
- <module>implementation-java-runtime</module>
- <module>implementation-java-xml</module>
- <module>implementation-node</module>
- <module>implementation-node-runtime</module>
- <module>interface</module>
- <module>interface-java</module>
- <module>interface-java-jaxws</module>
- <module>interface-java-xml</module>
- <module>interface-wsdl</module>
- <module>interface-wsdl-xml</module>
- <module>launcher</module>
- <module>monitor</module>
- <module>node-api</module>
- <module>node-impl</module>
- <module>node-launcher</module>
- <module>node-launcher-equinox</module>
- <module>policy</module>
- <module>policy-security</module>
- <module>policy-xml</module>
- <module>policy-xml-ws</module>
- <module>sca-api</module>
- <module>workspace</module>
- <module>workspace-impl</module>
- <module>workspace-xml</module>
- <module>xsd</module>
- <module>xsd-xml</module>
- </modules>
-
- <profiles>
- <profile>
- <id>ws</id>
- <modules>
- <module>binding-ws</module>
- <module>binding-ws-axis2</module>
- <module>binding-ws-axis2-policy</module>
- <module>binding-ws-wsdlgen</module>
- <module>binding-ws-xml</module>
- <module>databinding-axiom</module>
- <module>databinding-jaxb-axiom</module>
- <module>policy-xml-ws</module>
- </modules>
- </profile>
-
- <profile>
- <id>eclipse</id>
- <build>
-<!--
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-bundle-plugin</artifactId>
- <version>2.0-M1</version>
- <extensions>true</extensions>
- <executions>
- <execution>
- <id>generate-pde</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>eclipse</goal>
- </goals>
- <configuration>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
--->
-
- <defaultGoal>org.apache.tuscany.sca:tuscany-maven-bundle-plugin:eclipse</defaultGoal>
-
- </build>
- </profile>
- </profiles>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/LICENSE b/tags/java/sca/2.0-M1/modules/sca-api/LICENSE
deleted file mode 100644
index 617c69079b..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/LICENSE
+++ /dev/null
@@ -1,243 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-===============================================================================
-
-Apache Tuscany SCA for Java Subcomponents
-=========================================:
-
-The Tuscany SCA for Java release includes a number of subcomponents with
-separate copyright notices and license terms. Your use of the source
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses.
-
-===============================================================================
-The module sca-api includes a number of files under the following license:
-
-Permission to copy, display and distribute the Service Component Architecture Specification and/or
-portions thereof, without modification, in any medium without fee or royalty is hereby granted, provided
-that you include the following on ALL copies of the Service Component Architecture Specification, or
-portions thereof, that you make:
-
-1. A link or URL to the Service Component Architecture Specification at this location:
- http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
-
-2. The full text of the copyright notice as shown in the Service Component Architecture Specification.
-
-BEA, Cape Clear, IBM, Interface21, IONA, Oracle, Primeton, Progress Software, Red Hat, Rogue Wave,
-SAP, Siemens, Software AG., Sun, Sybase, TIBCO (collectively, the "Authors") agree to grant you a
-royalty-free license, under reasonable, non-discriminatory terms and conditions to patents that they deem
-necessary to implement the Service Component Architecture Specification.
-THE Service Component Architecture SPECIFICATION IS PROVIDED "AS IS," AND THE
-AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
-REGARDING THIS SPECIFICATION AND THE IMPLEMENTATION OF ITS CONTENTS,
-INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE, NON-INFRINGEMENT OR TITLE.
-THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL
-OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR
-DISTRIBUTION OF THE Service Components Architecture SPECIFICATION.
-The name and trademarks of the Authors may NOT be used in any manner, including advertising or
-publicity pertaining to the Service Component Architecture Specification or its contents without specific,
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/sca-api/META-INF/MANIFEST.MF
deleted file mode 100644
index ca64e30235..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,17 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.oasisopen.sca.annotation;version="2.0.0",org.oasisopen.sca;us
- es:="javax.security.auth";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA API
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397105046
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: API classes for the Service Component Architecture
-Import-Package: javax.security.auth,org.oasisopen.sca;version="2.0.0",org.oas
- isopen.sca.annotation;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.api
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/NOTICE b/tags/java/sca/2.0-M1/modules/sca-api/NOTICE
deleted file mode 100644
index 12fdd031e7..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/NOTICE
+++ /dev/null
@@ -1,13 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software under the Service Component Architecture specification license
-(see the LICENSE file contained in this distribution) with the following copyright
-
-(c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
-37 Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
-38 Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
-
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/pom.xml b/tags/java/sca/2.0-M1/modules/sca-api/pom.xml
deleted file mode 100644
index 8c18e934ed..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <name>Apache Tuscany SCA API</name>
-
- <description>API classes for the Service Component Architecture</description>
- <packaging>jar</packaging>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/CallableReference.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/CallableReference.java
deleted file mode 100644
index cdfaded693..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/CallableReference.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca;
-
-/**
- * Common superclass for references that can be passed between components.
- *
- * @version $Rev$ $Date$
- * @param <B> the Java interface associated with this reference
- */
-public interface CallableReference<B> {
- /**
- * Returns a type-safe reference to the target of this reference.
- * The instance returned is guaranteed to implement the business interface for this reference
- * but may not be a proxy as defined by java.lang.reflect.Proxy.
- *
- * @return a proxy to the target that implements the business interface associated with this reference
- */
- B getService();
-
- /**
- * Returns the Java class for the business interface associated with this reference.
- *
- * @return the Class for the business interface associated with this reference
- */
- Class<B> getBusinessInterface();
-
- /**
- * Returns true if this reference is conversational.
- *
- * @return true if this reference is conversational
- */
- boolean isConversational();
-
- /**
- * Returns the conversation associated with this reference.
- * Returns null if no conversation is currently active.
- *
- * @return the conversation associated with this reference; may be null
- */
- Conversation getConversation();
-
- /**
- * Returns the callback ID.
- *
- * @return the callback ID
- */
- Object getCallbackID();
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ComponentContext.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ComponentContext.java
deleted file mode 100644
index 7e1a2e6b2e..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ComponentContext.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca;
-
-import java.util.Collection;
-
-/**
- * Interface providing programmatic access to a component's SCA context as an alternative to injection.
- * It provides access to reference and property values for the component and provides a mechanism for
- * obtaining a reference to a service that can be passed to other components.
- * <p/>
- * SCA components obtain an instance of this interface through injection. Non-SCA client code may also
- * obtain an instance through runtime-specific mechanisms.
- *
- * @version $Rev$ $Date$
- */
-public interface ComponentContext {
- /**
- * Returns the absolute URI of the component within the SCA Domain.
- *
- * @return the absolute URI of the component
- */
- String getURI();
-
- /**
- * Cast a type-safe reference to a CallableReference.
- * Converts a type-safe reference to an equivalent CallableReference; if the target refers to a service
- * then a ServiceReference will be returned, if the target refers to a callback then a CallableReference
- * will be returned.
- *
- * @param target a reference proxy provided by the SCA runtime
- * @param <B> the Java type of the business interface for the reference
- * @param <R> the type of reference to be returned
- * @return a CallableReference equivalent for the proxy
- * @throws IllegalArgumentException if the supplied instance is not a reference supplied by the SCA runtime
- */
- <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException;
-
- /**
- * Returns a proxy for a reference defined by this component.
- *
- * @param businessInterface the interface that will be used to invoke the service
- * @param referenceName the name of the reference
- * @param <B> the Java type of the business interface for the reference
- * @return an object that implements the business interface
- */
- <B> B getService(Class<B> businessInterface, String referenceName);
-
- /**
- * Returns a ServiceReference for a reference defined by this component.
- *
- * @param businessInterface the interface that will be used to invoke the service
- * @param referenceName the name of the reference
- * @param <B> the Java type of the business interface for the reference
- * @return a ServiceReference for the designated reference
- */
- <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName);
-
- /**
- * Returns the value of an SCA property defined by this component.
- *
- * @param type the Java type to be returned for the property
- * @param propertyName the name of the property whose value should be returned
- * @param <B> the Java type of the property
- * @return the property value
- */
- <B> B getProperty(Class<B> type, String propertyName);
-
- /**
- * Returns a ServiceReference that can be used to invoke this component over the default service.
- *
- * @param businessInterface the interface that will be used to invoke the service
- * @param <B> the Java type of the business interface for the reference
- * @return a ServiceReference that will invoke this component
- */
- <B> ServiceReference<B> createSelfReference(Class<B> businessInterface);
-
- /**
- * Returns a ServiceReference that can be used to invoke this component over the designated service.
- *
- * @param businessInterface the interface that will be used to invoke the service
- * @param serviceName the name of the service to invoke
- * @param <B> the Java type of the business interface for the reference
- * @return a ServiceReference that will invoke this component
- */
- <B> ServiceReference<B> createSelfReference(Class<B> businessInterface, String serviceName);
-
- /**
- * Returns the context for the current SCA service request, or null if there is no current request
- * or if the context is unavailable.
- *
- * @return the SCA request context; may be null
- */
- RequestContext getRequestContext();
-
-
- /* ******************** Contribution for issue TUSCANY-2281 ******************** */
-
- /**
- * Returns a Collection of typed service proxies for a business interface type and a reference name.
- * @param businessInterface the interface that will be used to invoke the service
- * @param referenceName the name of the reference
- * @param <B> the Java type of the business interface for the reference
- * @return a Collection of objects that implements the business interface
- */
- <B> Collection<B> getServices(Class<B> businessInterface, String referenceName);
-
-
- /**
- * Returns a Collection of typed service reference for a business interface type and a reference name.
- * @param businessInterface the interface that will be used to invoke the service
- * @param referenceName the name of the reference
- * @param <B> the Java type of the business interface for the reference
- * @return a Collection of objects that implements the business interface
- */
- <B> Collection<ServiceReference<B>> getServiceReferences(Class<B> businessInterface, String referenceName);
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/Constants.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/Constants.java
deleted file mode 100644
index f3cbbf32cc..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/Constants.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface Constants {
- /**
- * Namespace for intents.
- */
- String SCA_NS = "http://www.osoa.org/xmlns/sca/1.0";
-
- /**
- * Prefix form of the namespace that can be prepended to intent declarations.
- */
- String SCA_PREFIX = '{' + SCA_NS + '}';
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/Conversation.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/Conversation.java
deleted file mode 100644
index d4e4034eed..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/Conversation.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca;
-
-/**
- * Interface representing a Conversation providing access to the conversation id and and a mechanism
- * to terminate the conversation.
- *
- * @version $Rev$ $Date$
- */
-public interface Conversation {
- /**
- * Returns the identifier for this conversation.
- * If a user-defined identity had been supplied for this reference then its value will be returned;
- * otherwise the identity generated by the system when the conversation was initiated will be returned.
- *
- * @return the identifier for this conversation
- */
- Object getConversationID();
-
- /**
- * End this conversation.
- */
- void end();
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ConversationEndedException.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ConversationEndedException.java
deleted file mode 100644
index 72944d6dfc..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ConversationEndedException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca;
-
-/**
- * Exception thrown to indicate the conversation being used for a stateful interaction has been ended.
- *
- * @version $Rev$ $Date$
- */
-public class ConversationEndedException extends ServiceRuntimeException {
- private static final long serialVersionUID = 3734864942222558406L;
-
- /**
- * Override constructor from ServiceRuntimeException.
- *
- * @see ServiceRuntimeException
- */
- public ConversationEndedException() {
- }
-
- /**
- * Override constructor from ServiceRuntimeException.
- *
- * @param message passed to ServiceRuntimeException
- * @see ServiceRuntimeException
- */
- public ConversationEndedException(String message) {
- super(message);
- }
-
- /**
- * Override constructor from ServiceRuntimeException.
- *
- * @param message passed to ServiceRuntimeException
- * @param cause passed to ServiceRuntimeException
- * @see ServiceRuntimeException
- */
- public ConversationEndedException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Override constructor from ServiceRuntimeException.
- *
- * @param cause passed to ServiceRuntimeException
- * @see ServiceRuntimeException
- */
- public ConversationEndedException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/NoRegisteredCallbackException.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/NoRegisteredCallbackException.java
deleted file mode 100644
index fcf88f75c1..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/NoRegisteredCallbackException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca;
-
-/**
- * Exception thrown to indicate that no callback has been registered
- * when interacting with a service.
- *
- * @version $Rev$ $Date$
- */
-public class NoRegisteredCallbackException extends ServiceRuntimeException {
- private static final long serialVersionUID = 3734864942222558406L;
-
- /**
- * Override constructor from ServiceRuntimeException.
- *
- * @see ServiceRuntimeException
- */
- public NoRegisteredCallbackException() {
- }
-
- /**
- * Override constructor from ServiceRuntimeException.
- *
- * @param message passed to ServiceRuntimeException
- * @see ServiceRuntimeException
- */
- public NoRegisteredCallbackException(String message) {
- super(message);
- }
-
- /**
- * Override constructor from ServiceRuntimeException.
- *
- * @param message passed to ServiceRuntimeException
- * @param cause passed to ServiceRuntimeException
- * @see ServiceRuntimeException
- */
- public NoRegisteredCallbackException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Override constructor from ServiceRuntimeException.
- *
- * @param cause passed to ServiceRuntimeException
- * @see ServiceRuntimeException
- */
- public NoRegisteredCallbackException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/RequestContext.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/RequestContext.java
deleted file mode 100644
index 5c8fe61073..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/RequestContext.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca;
-
-import javax.security.auth.Subject;
-
-/**
- * Interface that provides information on the current request.
- *
- * @version $Rev$ $Date$
- */
-public interface RequestContext {
- /**
- * Returns the JAAS Subject of the current request.
- *
- * @return the Subject of the current request
- */
- Subject getSecuritySubject();
-
- /**
- * Returns the name of the service that was invoked.
- *
- * @return the name of the service that was invoked
- */
- String getServiceName();
-
- /**
- * Returns a CallableReference for the service that was invoked by the caller.
- *
- * @param <B> the Java type of the business interface for the reference
- * @return a CallableReference for the service that was invoked by the caller
- */
- <B> CallableReference<B> getServiceReference();
-
- /**
- * Returns a type-safe reference to the callback provided by the caller.
- *
- * @param <CB> the Java type of the business interface for the callback
- * @return a type-safe reference to the callback provided by the caller
- */
- <CB> CB getCallback();
-
- /**
- * Returns a CallableReference to the callback provided by the caller.
- *
- * @param <CB> the Java type of the business interface for the callback
- * @return a CallableReference to the callback provided by the caller
- */
- <CB> CallableReference<CB> getCallbackReference();
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceReference.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceReference.java
deleted file mode 100644
index 55d875a5f3..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceReference.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca;
-
-
-/**
- * A ServiceReference represents a client's perspective of a reference to another service.
- *
- * @version $Rev$ $Date$
- * @param <B> the Java interface associated with this reference
- */
-public interface ServiceReference<B> extends CallableReference<B> {
- /**
- * Returns the id supplied by the user that will be associated with conversations initiated through this reference.
- *
- * @return the id to associated with any conversation initiated through this reference
- */
- Object getConversationID();
-
- /**
- * Set the id to associate with any conversation started through this reference.
- * If the value supplied is null then the id will be generated by the implementation.
- *
- * @param conversationId the user-defined id to associated with a conversation
- * @throws IllegalStateException if a conversation is currently associated with this reference
- */
- void setConversationID(Object conversationId) throws IllegalStateException;
-
- /**
- * Sets the callback ID.
- *
- * @param callbackID the callback ID
- */
- void setCallbackID(Object callbackID);
-
- /**
- * Returns the callback object.
- *
- * @return the callback object
- */
- Object getCallback();
-
- /**
- * Sets the callback object.
- *
- * @param callback the callback object
- */
- void setCallback(Object callback);
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceRuntimeException.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceRuntimeException.java
deleted file mode 100644
index d11c1904c5..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceRuntimeException.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca;
-
-
-/**
- * Base for Exceptions that may be raised by an SCA runtime and which typical
- * application code is not expected to be able to handle.
- *
- * @version $Rev$ $Date$
- */
-public class ServiceRuntimeException extends RuntimeException {
- private static final long serialVersionUID = -3876058842262557092L;
-
- /**
- * Override constructor from RuntimeException.
- *
- * @see RuntimeException
- */
- public ServiceRuntimeException() {
- }
-
- /**
- * Override constructor from RuntimeException.
- *
- * @param message passed to RuntimeException
- * @see RuntimeException
- */
- public ServiceRuntimeException(String message) {
- super(message);
- }
-
- /**
- * Override constructor from RuntimeException.
- *
- * @param message passed to RuntimeException
- * @param cause passed to RuntimeException
- * @see RuntimeException
- */
- public ServiceRuntimeException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Override constructor from RuntimeException.
- *
- * @param cause passed to RuntimeException
- * @see RuntimeException
- */
- public ServiceRuntimeException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceUnavailableException.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceUnavailableException.java
deleted file mode 100644
index 5d8e4af6ff..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/ServiceUnavailableException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca;
-
-/**
- * Exception used to indicate that a runtime exception occurred during the invocation of and external service.
- *
- * @version $Rev$ $Date$
- */
-public class ServiceUnavailableException extends ServiceRuntimeException {
-
- private static final long serialVersionUID = -5869397223249401047L;
-
- /**
- * Constructs a new ServiceUnavailableException.
- */
- public ServiceUnavailableException() {
- super((Throwable) null);
- }
-
- /**
- * Constructs a new ServiceUnavailableException with the specified detail message.
- *
- * @param message The detail message (which is saved to later retrieval by the getMessage() method).
- */
- public ServiceUnavailableException(String message) {
- super(message);
- }
-
- /**
- * Constructs a new ServiceUnavailableException with the specified cause.
- *
- * @param cause The cause (which is saved to later retrieval by the getCause() method).
- */
- public ServiceUnavailableException(Throwable cause) {
- super(cause);
- }
-
- /**
- * Constructs a new ServiceUnavailableException with the specified detail message and cause.
- *
- * @param message The message (which is saved to later retrieval by the getMessage() method).
- * @param cause The cause (which is saved to later retrieval by the getCause() method).
- */
- public ServiceUnavailableException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/AllowsPassByReference.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/AllowsPassByReference.java
deleted file mode 100644
index dbc08a7655..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/AllowsPassByReference.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation on a method that indicates that its parameters may safely
- * be passed by reference. The annotation may also be placed on an interface
- * or class to indicate that all declared methods support this optimization.
- *
- * @version $Rev$ $Date$
- */
-@Target({TYPE, METHOD})
-@Retention(RUNTIME)
-public @interface AllowsPassByReference {
-}
-
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Authentication.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Authentication.java
deleted file mode 100644
index cfc0af0318..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Authentication.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static org.oasisopen.sca.Constants.SCA_PREFIX;
-
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation denoting the intent that service operations require authentication.
- * <p/>
- * Applied to the injection site (field, method or constructor parameter) for a reference,
- * it indicates that all invocations through that reference require authentication.
- * <p/>
- * Applied to a interface method on a service contract, it indicates that all invocations
- * of that service operation require authentication; applied to the type of a service contract,
- * it indicates that all service operations on that interface require authentication.
- * <p/>
- * Applied to a method on an implementation class, it indicates that all invocations that
- * are dispatched to that implementation method (through any service) require authentication.
- * Applied to a interface implemented by an implementation class, it indicates that all
- * invocations that are dispatched to the implementation method for that interface operation
- * require authentication.
- * <p/>
- * Applied to an implementation class, it indicates that all invocations of that implementation
- * and that all invocations made by that implementation require authentication.
- *
- * @version $Rev$ $Date$
- */
-@Inherited
-@Target({TYPE, FIELD, METHOD, PARAMETER})
-@Retention(RUNTIME)
-@Intent(Authentication.AUTHENTICATION)
-public @interface Authentication {
- String AUTHENTICATION = SCA_PREFIX + "authentication";
- String AUTHENTICATION_MESSAGE = AUTHENTICATION + "message";
- String AUTHENTICATION_TRANSPORT = AUTHENTICATION + "transport";
-
- /**
- * List of authentication qualifiers (such as "message" or "transport").
- *
- * @return authentication qualifiers
- */
- @Qualifier
- String[] value() default "";
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Callback.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Callback.java
deleted file mode 100644
index b8d71dac05..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Callback.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * When placed on a service interface, this annotation specifies the interface
- * to be used for callbacks.
- * <p/>
- * When placed on a method or field, this annotation denotes the injection
- * site to be used for a callback reference.
- * <p/>
- * There is a error in the 1.00 draft spec in the declaration of this interface.
- * The form defined here is a proposed correction for that error.
- *
- * @version $Rev$ $Date$
- */
-@Target({TYPE, METHOD, FIELD})
-@Retention(RUNTIME)
-public @interface Callback {
- /**
- * The Class of the associated callback interface.
- *
- * @return the associated callback interface
- */
- Class<?> value() default Void.class;
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ComponentName.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ComponentName.java
deleted file mode 100644
index 8fc3cd4013..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ComponentName.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a field or method that is used to inject the component's name.
- *
- * @version $Rev$ $Date$
- */
-@Target({METHOD, FIELD})
-@Retention(RUNTIME)
-public @interface ComponentName {
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Confidentiality.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Confidentiality.java
deleted file mode 100644
index 5c594bc7d3..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Confidentiality.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static org.oasisopen.sca.Constants.SCA_PREFIX;
-
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation denoting the intent that service operations require confidentiality.
- * <p/>
- * Applied to the injection site (field, method or constructor parameter) for a reference,
- * it indicates that all invocations through that reference require confidentiality.
- * <p/>
- * Applied to a interface method on a service contract, it indicates that all invocations
- * of that service operation require confidentiality; applied to the type of a service contract,
- * it indicates that all service operations on that interface require confidentiality.
- * <p/>
- * Applied to a method on an implementation class, it indicates that all invocations that
- * are dispatched to that implementation method (through any service) require confidentiality.
- * Applied to a interface implemented by an implementation class, it indicates that all
- * invocations that are dispatched to the implementation method for that interface operation
- * require confidentiality.
- * <p/>
- * Applied to an implementation class, it indicates that all invocations of that implementation
- * and that all invocations made by that implementation require confidentiality.
- *
- * @version $Rev$ $Date$
- */
-@Inherited
-@Target({TYPE, FIELD, METHOD, PARAMETER})
-@Retention(RUNTIME)
-@Intent(Confidentiality.CONFIDENTIALITY)
-public @interface Confidentiality {
- String CONFIDENTIALITY = SCA_PREFIX + "confidentiality";
- String CONFIDENTIALITY_MESSAGE = CONFIDENTIALITY + ".message";
- String CONFIDENTIALITY_TRANSPORT = CONFIDENTIALITY + ".transport";
-
- /**
- * List of confidentiality qualifiers (such as "message" or "transport").
- *
- * @return confidentiality qualifiers
- */
- @Qualifier
- String[] value() default "";
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Constructor.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Constructor.java
deleted file mode 100644
index a5728e51d4..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Constructor.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.CONSTRUCTOR;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Used to indicate the constructor the runtime is to use when instantiating a component implementation instance
- *
- * @version $Rev$ $Date$
- */
-@Target(CONSTRUCTOR)
-@Retention(RUNTIME)
-public @interface Constructor {
- String[] value() default "";
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Context.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Context.java
deleted file mode 100644
index e7f7aef069..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Context.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a field or setter method that is used to inject an SCA context.
- * The type of context injected is determined by the type of the field or the parameter
- * to the setter method and is typically a ComponentContext or RequestContext.
- *
- * @version $Rev$ $Date$
- */
-@Target({METHOD, FIELD})
-@Retention(RUNTIME)
-public @interface Context {
-}
-
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ConversationAttributes.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ConversationAttributes.java
deleted file mode 100644
index 498cc3eea3..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ConversationAttributes.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate the characteristics of a conversation.
- *
- * @version $Rev$ $Date$
- */
-@Target(ElementType.TYPE)
-@Retention(RUNTIME)
-public @interface ConversationAttributes {
- /**
- * The maximum time that can pass between operations in a single conversation. If this time is exceeded the
- * container may end the conversation.
- *
- * @return the maximum time that can pass between operations in a single conversation
- */
- String maxIdleTime() default "";
-
- /**
- * The maximum time that a conversation may remain active. If this time is exceeded the container may end the
- * conversation.
- *
- * @return the maximum time that a conversation may remain active
- */
- String maxAge() default "";
-
- /**
- * If true, indicates that only the user that initiated the conversation has the authority to continue it.
- *
- * @return true if only the user that initiated the conversation has the authority to continue it
- */
- boolean singlePrincipal() default false;
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ConversationID.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ConversationID.java
deleted file mode 100644
index 2cc62afdbf..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ConversationID.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a field or method that is used to inject the conversation ID.
- *
- * @version $Rev$ $Date$
- */
-@Target({METHOD, FIELD})
-@Retention(RUNTIME)
-public @interface ConversationID {
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Conversational.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Conversational.java
deleted file mode 100644
index 6a406f2acc..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Conversational.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Used on a Java interface to denote a conversational service contract.
- * <p/>
- * The draft spec erroneously defines the targets for this as {TYPE, METHOD, FIELD}
- * but this annotation is only applicable to interfaces.
- *
- * @version $Rev$ $Date$
- */
-@Target({TYPE})
-@Retention(RUNTIME)
-public @interface Conversational {
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Destroy.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Destroy.java
deleted file mode 100644
index 2ad6fdc892..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Destroy.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a method that will be called by the container when the
- * scope defined for the local service ends.
- *
- * @version $Rev$ $Date$
- */
-@Target(METHOD)
-@Retention(RUNTIME)
-public @interface Destroy {
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/EagerInit.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/EagerInit.java
deleted file mode 100644
index d53e9e4fc4..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/EagerInit.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate an instance should be eagerly initialized.
- *
- * @version $Rev$ $Date$
- */
-@Target({TYPE})
-@Retention(RUNTIME)
-public @interface EagerInit {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/EndsConversation.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/EndsConversation.java
deleted file mode 100644
index 4f58c50802..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/EndsConversation.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a method ends a conversation.
- *
- * @version $Rev$ $Date$
- */
-@Target({METHOD})
-@Retention(RUNTIME)
-public @interface EndsConversation {
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Init.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Init.java
deleted file mode 100644
index 3fe9bf585f..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Init.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a method that will be called by the container when the scope defined for the local
- * service begins.
- *
- * @version $Rev$ $Date$
- */
-@Target(METHOD)
-@Retention(RUNTIME)
-public @interface Init {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Integrity.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Integrity.java
deleted file mode 100644
index 0c196f1ce5..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Integrity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static org.oasisopen.sca.Constants.SCA_PREFIX;
-
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation denoting the intent that service operations require integrity.
- * <p/>
- * Applied to the injection site (field, method or constructor parameter) for a reference,
- * it indicates that all invocations through that reference require integrity.
- * <p/>
- * Applied to a interface method on a service contract, it indicates that all invocations
- * of that service operation require integrity; applied to the type of a service contract,
- * it indicates that all service operations on that interface require integrity.
- * <p/>
- * Applied to a method on an implementation class, it indicates that all invocations that
- * are dispatched to that implementation method (through any service) require integrity.
- * Applied to a interface implemented by an implementation class, it indicates that all
- * invocations that are dispatched to the implementation method for that interface operation
- * require integrity.
- * <p/>
- * Applied to an implementation class, it indicates that all invocations of that implementation
- * and that all invocations made by that implementation require integrity.
- *
- * @version $Rev$ $Date$
- */
-@Inherited
-@Target({TYPE, FIELD, METHOD, PARAMETER})
-@Retention(RUNTIME)
-@Intent(Integrity.INTEGRITY)
-public @interface Integrity {
- String INTEGRITY = SCA_PREFIX + "integrity";
- String INTEGRITY_MESSAGE = INTEGRITY + "message";
- String INTEGRITY_TRANSPORT = INTEGRITY + "transport";
-
- /**
- * List of integrity qualifiers (such as "message" or "transport").
- *
- * @return integrity qualifiers
- */
- @Qualifier
- String[] value() default "";
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Intent.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Intent.java
deleted file mode 100644
index c3e9914f23..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Intent.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation that can be applied to annotations that describe SCA intents.
- * Adding this annotation allows SCA runtimes to automatically detect user-defined intents.
- * <p/>
- * Applications must specify a value, a pairing of targetNamespace and localPort, or both.
- * If both value and pairing are supplied they must define the name qualified name.
- *
- * @version $Rev$ $Date$
- */
-@Target({ANNOTATION_TYPE})
-@Retention(RUNTIME)
-public @interface Intent {
- /**
- * The qualified name of the intent, in the form defined by {@link javax.xml.namespace.QName#toString}.
- *
- * @return the qualified name of the intent
- */
- String value() default "";
-
- /**
- * The XML namespace for the intent.
- *
- * @return the XML namespace for the intent
- */
- String targetNamespace() default "";
-
- /**
- * The name of the intent within its namespace.
- *
- * @return name of the intent within its namespace
- */
- String localPart() default "";
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/OneWay.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/OneWay.java
deleted file mode 100644
index 458d05cc92..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/OneWay.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation on a method that indicates that the method is non-blocking and communication
- * with the service provider may use buffer the requests and send them at some later time.
- *
- * @version $Rev$ $Date$
- */
-@Target({METHOD})
-@Retention(RUNTIME)
-public @interface OneWay {
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/PolicySets.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/PolicySets.java
deleted file mode 100644
index 150d8dabc8..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/PolicySets.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation that allows application of SCA Policy Sets.
- * <p/>
- * Each policy set is specified using its XML QName in the form defined by {@link javax.xml.namespace.QName#toString()}.
- *
- * @version $Rev$ $Date$
- */
-@Target({TYPE, FIELD, METHOD, PARAMETER})
-@Retention(RUNTIME)
-public @interface PolicySets {
- /**
- * Returns the policy sets to be applied.
- *
- * @return the policy sets to be applied
- */
- String[] value() default "";
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Property.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Property.java
deleted file mode 100644
index 0ab54ef6e4..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Property.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a constructor parameter, field or method that is
- * used to inject a configuration property value.
- *
- * @version $Rev$ $Date$
- */
-@Target({METHOD, FIELD, PARAMETER})
-@Retention(RUNTIME)
-public @interface Property {
- /**
- * The name of the property. If not specified then the name will be derived
- * from the annotated field or method.
- *
- * @return the name of the property
- */
- String name() default "";
-
- /**
- * Indicates whether a value for the property must be provided.
- *
- * @return true if a value must be provided
- */
- boolean required() default false;
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Qualifier.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Qualifier.java
deleted file mode 100644
index a5fd102859..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Qualifier.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation that can be applied to an attribute of an @Intent annotation to indicate the
- * attribute provides qualifiers for the intent.
- *
- * @version $Rev$ $Date$
- */
-@Target(METHOD)
-@Retention(RUNTIME)
-public @interface Qualifier {
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Reference.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Reference.java
deleted file mode 100644
index 9a7154fcf3..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Reference.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a constructor parameter, field or method that is used to inject a reference.
- *
- * @version $Rev$ $Date$
- */
-@Target({METHOD, FIELD, PARAMETER})
-@Retention(RUNTIME)
-public @interface Reference {
- /**
- * The name of the reference. If not specified then the name will be derived from the annotated field or method.
- *
- * @return the name of the reference
- */
- String name() default "";
-
- /**
- * Indicates if a reference must be specified.
- *
- * @return true if a reference must be specified
- */
- boolean required() default true;
-}
-
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Remotable.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Remotable.java
deleted file mode 100644
index 77ff4e26f9..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Remotable.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a Java interface as remotable.
- * Remotable interfaces use pass-by-value semantics, can be published as entry points
- * and used for external services.
- *
- * @version $Rev$ $Date$
- */
-@Target(TYPE)
-@Retention(RUNTIME)
-public @interface Remotable {
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Requires.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Requires.java
deleted file mode 100644
index e44775398e..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Requires.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation that allows the attachment of any intent to a Java Class or interface or to members of that
- * class such as methods, fields or constructor parameters.
- * <p/>
- * Intents are specified as XML QNames in the representation defined by
- * {@link javax.xml.namespace.QName#toString()}. Intents may be qualified with one or more
- * suffixes separated by a "." such as:
- * <ul>
- * <li>{http://www.osoa.org/xmlns/sca/1.0}confidentiality</li>
- * <li>{http://www.osoa.org/xmlns/sca/1.0}confidentiality.message</li>
- * </ul>
- * This annotation supports general purpose intents specified as strings. Users may also define
- * specific intents using the {@link @org.oasisopen.sca.annotation.Intent} annotation.
- *
- * @version $Rev$ $Date$
- */
-@Inherited
-@Retention(RUNTIME)
-@Target({TYPE, METHOD, FIELD, PARAMETER})
-public @interface Requires {
- /**
- * Returns the attached intents.
- *
- * @return the attached intents
- */
- String[] value() default "";
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Scope.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Scope.java
deleted file mode 100644
index d7cfaab3f5..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Scope.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate a scoped service.
- * <p/>
- * The spec refers to but does not describe an eager() attribute; this is an error in the draft.
- *
- * @version $Rev$ $Date$
- */
-@Target(TYPE)
-@Retention(RUNTIME)
-public @interface Scope {
- /**
- * The name of the scope. Values currently defined by the specification are:
- * <ul>
- * <li>STATELESS (default)</li>
- * <li>REQUEST</li>
- * <li>CONVERSATION</li>
- * <li>COMPOSITE</li>
- * </ul>
- *
- * @return the name of the scope
- */
- String value() default "STATELESS";
-}
diff --git a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Service.java b/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Service.java
deleted file mode 100644
index 36c5bff5e9..0000000000
--- a/tags/java/sca/2.0-M1/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Service.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * (c) Copyright BEA Systems, Inc., Cape Clear Software, International Business Machines Corp, Interface21, IONA Technologies,
- * Oracle, Primeton Technologies, Progress Software, Red Hat, Rogue Wave Software, SAP AG., Siemens AG., Software AG., Sybase
- * Inc., TIBCO Software Inc., 2005, 2007. All rights reserved.
- *
- * see http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
- */
-package org.oasisopen.sca.annotation;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotation used to indicate the service interfaces exposed by a Java class.
- *
- * @version $Rev$ $Date$
- */
-@Target({TYPE})
-@Retention(RUNTIME)
-public @interface Service {
- /**
- * Array of interfaces that should be exposed as services.
- *
- * @return a list of interfaces that should be exposed as services
- */
- Class<?>[] interfaces() default {};
-
- /**
- * Shortcut allowing a single interface to be exposed.
- *
- * @return a single service interfaces to be exposed
- */
- Class<?> value() default Void.class;
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/LICENSE b/tags/java/sca/2.0-M1/modules/workspace-impl/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/workspace-impl/META-INF/MANIFEST.MF
deleted file mode 100644
index aa61a89d61..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,26 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.workspace.builder.impl;version
- ="2.0.0",org.apache.tuscany.sca.workspace.processor.impl;version="2.0.0",
- org.apache.tuscany.sca.workspace.scanner.impl;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Domain Workspace Implementation
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397201562
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Domain Workspace Implementation
-Import-Package:
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.contribution.scanner;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.workspace;version="2.0.0",
- org.apache.tuscany.sca.workspace.builder;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.workspace.impl
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/NOTICE b/tags/java/sca/2.0-M1/modules/workspace-impl/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/pom.xml b/tags/java/sca/2.0-M1/modules/workspace-impl/pom.xml
deleted file mode 100644
index bbd5e9d398..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/pom.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-workspace-impl</artifactId>
- <name>Apache Tuscany SCA Domain Workspace Implementation</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java b/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java
deleted file mode 100644
index bdfd244293..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderImpl.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.builder.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.DefaultImport;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.resolver.DefaultImportModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-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.workspace.Workspace;
-import org.apache.tuscany.sca.workspace.builder.ContributionBuilder;
-import org.apache.tuscany.sca.workspace.builder.ContributionBuilderException;
-
-/**
- * A contribution dependency builder.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionDependencyBuilderImpl implements ContributionBuilder {
- private static final Logger logger = Logger.getLogger(ContributionDependencyBuilderImpl.class.getName());
-
- /**
- * Constructs a new ContributionDependencyBuilder.
- */
- public ContributionDependencyBuilderImpl(FactoryExtensionPoint factories) {
- }
-
- public String getID() {
- return "org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder";
- }
-
- public void build(Contribution contribution, Workspace workspace, Monitor monitor) throws ContributionBuilderException{
- contribution.getDependencies().clear();
-
- List<Contribution> dependencies = new ArrayList<Contribution>();
- Set<Contribution> set = new HashSet<Contribution>();
-
- dependencies.add(contribution);
- set.add(contribution);
- addContributionDependencies(contribution, workspace, dependencies, set, monitor);
-
- Collections.reverse(dependencies);
-
- contribution.getDependencies().addAll(dependencies);
- }
-
- /**
- * Analyze a contribution and add its dependencies to the given dependency set.
- * @param contribution
- * @param workspace
- * @param dependencies
- * @param set
- * @param monitor
- */
- private void addContributionDependencies(Contribution contribution, Workspace workspace, List<Contribution> dependencies, Set<Contribution> set, Monitor monitor) {
-
- // Go through the contribution imports
- for (Import import_: contribution.getImports()) {
- boolean resolved = false;
-
- // Go through all contribution candidates and their exports
- List<Export> matchingExports = new ArrayList<Export>();
- for (Contribution dependency: workspace.getContributions()) {
- if (dependency == contribution) {
- // Do not self import
- continue;
- }
- for (Export export: dependency.getExports()) {
-
- // If an export from a contribution matches the import in hand
- // add that contribution to the dependency set
- if (import_.match(export)) {
- resolved = true;
- matchingExports.add(export);
-
- if (!set.contains(dependency)) {
- set.add(dependency);
- dependencies.add(dependency);
-
- // Now add the dependencies of that contribution
- addContributionDependencies(dependency, workspace, dependencies, set, monitor);
- }
- }
- }
- }
-
- if (resolved) {
-
- // Initialize the import's model resolver with a delegating model
- // resolver which will delegate to the matching exports
- import_.setModelResolver(new DefaultImportModelResolver(matchingExports));
-
- } else {
- // Record import resolution issue
- if (!(import_ instanceof DefaultImport)) {
- warning(monitor, "UnresolvedImport", import_, import_);
- }
- }
- }
- }
-
- /**
- * Report a warning.
- *
- * @param problems
- * @param message
- * @param model
- */
- private static void warning(Monitor monitor, String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(ContributionDependencyBuilderImpl.class.getName(), "workspace-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java b/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java
deleted file mode 100644
index e81856df26..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionContentProcessor.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.workspace.processor.impl;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.ContributionMetadata;
-import org.apache.tuscany.sca.contribution.DefaultExport;
-import org.apache.tuscany.sca.contribution.DefaultImport;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.DefaultModelResolver;
-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.contribution.scanner.ContributionScanner;
-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.monitor.Monitor;
-import org.apache.tuscany.sca.workspace.scanner.impl.DirectoryContributionScanner;
-import org.apache.tuscany.sca.workspace.scanner.impl.JarContributionScanner;
-
-/**
- * URLArtifactProcessor that handles contribution files and the artifacts they contain
- * and returns a contribution model.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionContentProcessor implements URLArtifactProcessor<Contribution>{
- private ContributionFactory contributionFactory;
- private ModelResolverExtensionPoint modelResolvers;
- private FactoryExtensionPoint modelFactories;
- private URLArtifactProcessor<Object> artifactProcessor;
- private StAXArtifactProcessor<Object> extensionProcessor;
- private UtilityExtensionPoint utilities;
- private Monitor monitor = null;
-
- public ContributionContentProcessor(ExtensionPointRegistry extensionPoints, StAXArtifactProcessor<Object> extensionProcessor, Monitor monitor) {
- this.modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- this.modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
- hackResolvers(modelResolvers);
- this.monitor = monitor;
- URLArtifactProcessorExtensionPoint artifactProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- this.artifactProcessor = new ExtensibleURLArtifactProcessor(artifactProcessors, this.monitor);
- this.extensionProcessor = extensionProcessor;
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- }
-
- public ContributionContentProcessor(FactoryExtensionPoint modelFactories, ModelResolverExtensionPoint modelResolvers,
- URLArtifactProcessor<Object> artifactProcessor, StAXArtifactProcessor<Object> extensionProcessor, Monitor monitor) {
- this.modelFactories = modelFactories;
- this.modelResolvers = modelResolvers;
- hackResolvers(modelResolvers);
- this.artifactProcessor = artifactProcessor;
- this.extensionProcessor = extensionProcessor;
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- this.monitor = monitor;
- }
-
- public String getArtifactType() {
- return ".contribution/content";
- }
-
- public Class<Contribution> getModelType() {
- return Contribution.class;
- }
-
- public Contribution read(URL parentURL, URI contributionURI, URL contributionURL) throws ContributionReadException {
-
- // Create contribution model
- Contribution contribution = contributionFactory.createContribution();
- contribution.setURI(contributionURI.toString());
- contribution.setLocation(contributionURL.toString());
- ModelResolver modelResolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
- contribution.setModelResolver(modelResolver);
- contribution.setUnresolved(true);
-
- // Create a contribution scanner
- ContributionScanner scanner;
- if ("file".equals(contributionURL.getProtocol()) && new File(contributionURL.getFile()).isDirectory()) {
- scanner = new DirectoryContributionScanner();
- } else {
- scanner = new JarContributionScanner();
- }
-
- // Scan the contribution and list the artifacts contained in it
- List<Artifact> artifacts = contribution.getArtifacts();
- boolean contributionMetadata = false;
- List<String> artifactURIs = scanner.getArtifacts(contributionURL);
- for (String artifactURI: artifactURIs) {
- URL artifactURL = scanner.getArtifactURL(contributionURL, artifactURI);
-
- // Add the deployed artifact model to the contribution
- Artifact artifact = this.contributionFactory.createArtifact();
- artifact.setURI(artifactURI);
- artifact.setLocation(artifactURL.toString());
- artifacts.add(artifact);
- modelResolver.addModel(artifact);
-
- // Read each artifact
- Object model = artifactProcessor.read(contributionURL, URI.create(artifactURI), artifactURL);
- if (model != null) {
- artifact.setModel(model);
-
- // Add the loaded model to the model resolver
- modelResolver.addModel(model);
-
- // Merge contribution metadata into the contribution model
- if (model instanceof ContributionMetadata) {
- contributionMetadata = true;
- ContributionMetadata c = (ContributionMetadata)model;
- contribution.getImports().addAll(c.getImports());
- contribution.getExports().addAll(c.getExports());
- contribution.getDeployables().addAll(c.getDeployables());
- }
- }
- }
-
- // If no sca-contribution.xml file was provided then just consider
- // all composites in the contribution as deployables
- if (!contributionMetadata) {
- for (Artifact artifact: artifacts) {
- if (artifact.getModel() instanceof Composite) {
- contribution.getDeployables().add((Composite)artifact.getModel());
- }
- }
-
- // Add default contribution import and export
- DefaultImport defaultImport = contributionFactory.createDefaultImport();
- defaultImport.setModelResolver(new DefaultModelResolver());
- contribution.getImports().add(defaultImport);
- DefaultExport defaultExport = contributionFactory.createDefaultExport();
- contribution.getExports().add(defaultExport);
- }
-
- return contribution;
- }
-
- public void resolve(Contribution contribution, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve the contribution model itself
- ModelResolver contributionResolver = contribution.getModelResolver();
- contribution.setUnresolved(false);
- contributionResolver.addModel(contribution);
-
- // Resolve imports and exports
- for (Export export: contribution.getExports()) {
- if (export instanceof DefaultExport) {
-
- // Initialize the default export's resolver
- export.setModelResolver(contributionResolver);
-
- } else {
- extensionProcessor.resolve(export, contributionResolver);
- }
- }
- for (Import import_: contribution.getImports()) {
- extensionProcessor.resolve(import_, contributionResolver);
- }
-
- // Resolve all artifact models
- for (Artifact artifact : contribution.getArtifacts()) {
- Object model = artifact.getModel();
- if (model != null) {
- try {
- artifactProcessor.resolve(model, contributionResolver);
- } catch (Exception e) {
- //FIXME this shouldn't happen
- }
- }
- }
-
- // Resolve deployable composites
- List<Composite> deployables = contribution.getDeployables();
- for (int i = 0, n = deployables.size(); i < n; i++) {
- Composite deployable = deployables.get(i);
- Composite resolved = (Composite)contributionResolver.resolveModel(Composite.class, deployable);
- if (resolved != deployable) {
- deployables.set(i, resolved);
- }
- }
- }
-
- /**
- * FIXME Temporary hack for testing the ClassLoaderModelResolver.
- *
- * @param modelResolvers
- */
- private static void hackResolvers(ModelResolverExtensionPoint modelResolvers) {
- Class<?> resolverClass = modelResolvers.getResolver(ClassReference.class);
- if (resolverClass==null || !resolverClass.getName().equals("org.apache.tuscany.sca.contribution.java.impl.ClassLoaderModelResolver")) {
- try {
- Class<?> loaderResolverClass = Class.forName("org.apache.tuscany.sca.contribution.java.impl.ClassLoaderModelResolver", true, ContributionContentProcessor.class.getClassLoader());
- modelResolvers.addResolver(ClassReference.class, (Class<? extends ModelResolver>)loaderResolverClass);
- } catch (ClassNotFoundException e) {
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java b/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java
deleted file mode 100644
index 6b7fc2f259..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/processor/impl/ContributionInfoProcessor.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.workspace.processor.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.ContributionMetadata;
-import org.apache.tuscany.sca.contribution.DefaultExport;
-import org.apache.tuscany.sca.contribution.DefaultImport;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.DefaultModelResolver;
-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.contribution.scanner.ContributionScanner;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.workspace.scanner.impl.DirectoryContributionScanner;
-import org.apache.tuscany.sca.workspace.scanner.impl.JarContributionScanner;
-
-/**
- * URLArtifactProcessor that handles contribution files and returns a contribution
- * info model.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionInfoProcessor implements URLArtifactProcessor<Contribution>{
- private ContributionFactory contributionFactory;
- private ModelResolverExtensionPoint modelResolvers;
- private FactoryExtensionPoint modelFactories;
- private URLArtifactProcessorExtensionPoint artifactProcessors;
- private URLArtifactProcessor<Object> artifactProcessor;
- private StAXArtifactProcessor<Object> extensionProcessor;
-
- public ContributionInfoProcessor(ExtensionPointRegistry extensionPoints, StAXArtifactProcessor<Object> extensionProcessor, Monitor monitor) {
- this.modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- this.modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
- hackResolvers(modelResolvers);
- URLArtifactProcessorExtensionPoint artifactProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- this.artifactProcessors = artifactProcessors;
- this.artifactProcessor = new ExtensibleURLArtifactProcessor(artifactProcessors, monitor);
- this.extensionProcessor = extensionProcessor;
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- }
-
- public ContributionInfoProcessor(FactoryExtensionPoint modelFactories, ModelResolverExtensionPoint modelResolvers, URLArtifactProcessor<Object> artifactProcessor) {
- this.modelFactories = modelFactories;
- this.modelResolvers = modelResolvers;
- hackResolvers(modelResolvers);
- this.artifactProcessor = artifactProcessor;
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- }
-
- public String getArtifactType() {
- return ".contribution/info";
- }
-
- public Class<Contribution> getModelType() {
- return null;
- }
-
- public Contribution read(URL parentURL, URI contributionURI, URL contributionURL) throws ContributionReadException {
-
- // Create contribution model
- Contribution contribution = contributionFactory.createContribution();
- contribution.setURI(contributionURI.toString());
- contribution.setLocation(contributionURL.toString());
- ModelResolver modelResolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
- contribution.setModelResolver(modelResolver);
- contribution.setUnresolved(true);
-
- // Create a contribution scanner
- ContributionScanner scanner;
- if ("file".equals(contributionURL.getProtocol()) && new File(contributionURL.getFile()).isDirectory()) {
- scanner = new DirectoryContributionScanner();
- } else {
- scanner = new JarContributionScanner();
- }
-
- // Read generated and user sca-contribution.xml files
- boolean contributionMetadata = false;
- for (String path: new String[]{
- Contribution.SCA_CONTRIBUTION_GENERATED_META,
- Contribution.SCA_CONTRIBUTION_META}) {
- URL url = scanner.getArtifactURL(contributionURL, path);
- try {
- // Check if the file actually exists before trying to read it
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- InputStream is = connection.getInputStream();
- is.close();
- } catch (IOException e) {
- continue;
- }
- contributionMetadata = true;
-
- // Read the sca-contribution.xml file
- ContributionMetadata c = (ContributionMetadata)artifactProcessor.read(contributionURL, URI.create(path), url);
- contribution.getImports().addAll(c.getImports());
- contribution.getExports().addAll(c.getExports());
- contribution.getDeployables().addAll(c.getDeployables());
- }
-
- // If no sca-contribution.xml file was provided then consider
- // all composites in the contribution as deployables, and also
- // read any files that are explicitly asssigned artifact processors
- // as they are likely to provide relevant metadata info
- if (!contributionMetadata) {
- List<String> artifactURIs;
- try {
- artifactURIs = scanner.getArtifacts(contributionURL);
- } catch (ContributionReadException e) {
- artifactURIs = null;
- }
- if (artifactURIs != null) {
- for (String artifactURI: artifactURIs) {
- boolean read = false;
- if (artifactURI.endsWith(".composite")) {
- read = true;
- } else {
- int s= artifactURI.lastIndexOf("/");
- String fileName = artifactURI.substring(s + 1);
- if (artifactProcessors.getProcessor(fileName) != null) {
- read = true;
- }
- }
- if (read) {
- URL artifactURL = scanner.getArtifactURL(contributionURL, artifactURI);
-
- // Read each artifact
- Object model = artifactProcessor.read(contributionURL, URI.create(artifactURI), artifactURL);
-
- // In the absence of more info, consider all composites as deployable
- if (model instanceof Composite) {
- contribution.getDeployables().add((Composite)model);
- }
- }
- }
- }
-
- // Add default contribution import and export
- DefaultImport defaultImport = contributionFactory.createDefaultImport();
- defaultImport.setModelResolver(new DefaultModelResolver());
- contribution.getImports().add(defaultImport);
- DefaultExport defaultExport = contributionFactory.createDefaultExport();
- contribution.getExports().add(defaultExport);
- }
-
- return contribution;
- }
-
- public void resolve(Contribution contribution, ModelResolver resolver) throws ContributionResolveException {
-
- // Mark the contribution model resolved
- ModelResolver contributionResolver = contribution.getModelResolver();
- contribution.setUnresolved(false);
- contributionResolver.addModel(contribution);
-
- // Resolve imports and exports
- for (Export export: contribution.getExports()) {
- if (export instanceof DefaultExport) {
-
- // Initialize the default export's resolver
- export.setModelResolver(contributionResolver);
-
- } else {
- extensionProcessor.resolve(export, contributionResolver);
- }
- }
- for (Import import_: contribution.getImports()) {
- extensionProcessor.resolve(import_, contributionResolver);
- }
-
- }
-
- /**
- * FIXME Temporary hack for testing the ClassLoaderModelResolver.
- *
- * @param modelResolvers
- */
- private static void hackResolvers(ModelResolverExtensionPoint modelResolvers) {
- Class<?> resolverClass = modelResolvers.getResolver(ClassReference.class);
- if (resolverClass==null || !resolverClass.getName().equals("org.apache.tuscany.sca.contribution.java.impl.ClassLoaderModelResolver")) {
- try {
- Class<?> loaderResolverClass = Class.forName("org.apache.tuscany.sca.contribution.java.impl.ClassLoaderModelResolver", true, ContributionContentProcessor.class.getClassLoader());
- modelResolvers.addResolver(ClassReference.class, (Class<? extends ModelResolver>)loaderResolverClass);
- } catch (ClassNotFoundException e) {
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/DirectoryContributionScanner.java b/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/DirectoryContributionScanner.java
deleted file mode 100644
index cc51ff5823..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/DirectoryContributionScanner.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.scanner.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.scanner.ContributionScanner;
-
-/**
- * Folder contribution processor.
- *
- * @version $Rev$ $Date$
- */
-public class DirectoryContributionScanner implements ContributionScanner {
-
- public DirectoryContributionScanner() {
- }
-
- public String getContributionType() {
- return "application/vnd.tuscany.folder";
- }
-
- public URL getArtifactURL(URL contributionURL, String artifact) throws ContributionReadException {
- File directory = directory(contributionURL);
- File file = new File(directory, artifact);
- try {
- return file.toURI().toURL();
- } catch (MalformedURLException e) {
- throw new ContributionReadException(e);
- }
- }
-
- public List<String> getArtifacts(URL contributionURL) throws ContributionReadException {
- File directory = directory(contributionURL);
- List<String> artifacts = new ArrayList<String>();
- try {
- traverse(artifacts, directory, directory);
- } catch (IOException e) {
- throw new ContributionReadException(e);
- }
- return artifacts;
- }
-
- /**
- * Recursively traverse a root directory
- *
- * @param fileList
- * @param file
- * @param root
- * @throws IOException
- */
- private static void traverse(List<String> fileList, File file, File root) throws IOException {
- if (file.isFile()) {
- fileList.add(root.toURI().relativize(file.toURI()).toString());
- } else if (file.isDirectory()) {
- String uri = root.toURI().relativize(file.toURI()).toString();
- if (uri.endsWith("/")) {
- uri = uri.substring(0, uri.length() - 1);
- }
- fileList.add(uri);
-
- File[] files = file.listFiles();
- for (File f: files) {
- if (!f.getName().startsWith(".")) {
- traverse(fileList, f, root);
- }
- }
- }
- }
-
- private static File directory(URL url) throws ContributionReadException {
- File file;
- try {
- file = new File(url.toURI());
- } catch (URISyntaxException e) {
- throw new ContributionReadException(e);
- }
- if (!file.exists() || !file.isDirectory()) {
- throw new ContributionReadException(url.toString());
- }
- return file;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/JarContributionScanner.java b/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/JarContributionScanner.java
deleted file mode 100644
index 71bd9d760d..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/java/org/apache/tuscany/sca/workspace/scanner/impl/JarContributionScanner.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.scanner.impl;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.ArrayList;
-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.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.scanner.ContributionScanner;
-
-/**
- * JAR Contribution processor.
- *
- * @version $Rev$ $Date$
- */
-public class JarContributionScanner implements ContributionScanner {
-
- public JarContributionScanner() {
- }
-
- public String getContributionType() {
- return "application/x-compressed";
- }
-
- public URL getArtifactURL(URL contributionURL, String artifact) throws ContributionReadException {
- try {
- URL url;
- if (contributionURL.toString().startsWith("jar:")) {
- url = new URL(contributionURL, artifact.toString());
- } else {
- url = new URL("jar:" + contributionURL.toExternalForm() + "!/" + artifact);
- }
- return url;
- } catch (MalformedURLException e) {
- throw new ContributionReadException(e);
- }
- }
-
- public List<String> getArtifacts(URL contributionURL) throws ContributionReadException {
-
- // Assume the URL references a JAR file
- try {
- URLConnection connection = contributionURL.openConnection();
- connection.setUseCaches(false);
- JarInputStream jar = new JarInputStream(connection.getInputStream());
- try {
- Set<String> names = new HashSet<String>();
- while (true) {
- JarEntry entry = jar.getNextJarEntry();
- if (entry == null) {
- // EOF
- break;
- }
-
- String name = entry.getName();
- if (name.length() != 0 && !name.startsWith(".")) {
-
- // Trim trailing /
- if (name.endsWith("/")) {
- name = name.substring(0, name.length() - 1);
- }
-
- // Add the entry name
- if (!names.contains(name)) {
- names.add(name);
-
- // Add parent folder names to the list too
- for (;;) {
- int s = name.lastIndexOf('/');
- if (s == -1) {
- name = "";
- } else {
- name = name.substring(0, s);
- }
- if (name.length() != 0 && !names.contains(name)) {
- names.add(name);
- } else {
- break;
- }
- }
- }
- }
- }
-
- // Return list of URIs
- List<String> artifacts = new ArrayList<String>(names);
- return artifacts;
-
- } finally {
- jar.close();
- }
- } catch (IOException e) {
- throw new ContributionReadException(e);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
deleted file mode 100644
index 41d0ebe27d..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProcessor;type=.contribution/content,model=org.apache.tuscany.sca.contribution.Contribution
-org.apache.tuscany.sca.workspace.processor.impl.ContributionInfoProcessor;type=.contribution/info
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.builder.ContributionBuilder b/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.builder.ContributionBuilder
deleted file mode 100644
index 379d0a017e..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.builder.ContributionBuilder
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.workspace.builder.impl.ContributionDependencyBuilderImpl;id=org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/workspace-validation-messages.properties b/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/workspace-validation-messages.properties
deleted file mode 100644
index 0c07a3a30f..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/workspace-validation-messages.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-UnresolvedImport = Unresolved import: Import = {0}
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/workspace-validation-messages_it.properties b/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/workspace-validation-messages_it.properties
deleted file mode 100644
index 2e8326c062..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/src/main/resources/workspace-validation-messages_it.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
diff --git a/tags/java/sca/2.0-M1/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java b/tags/java/sca/2.0-M1/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java
deleted file mode 100644
index be64c65c45..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.builder.impl;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.DefaultContributionFactory;
-import org.apache.tuscany.sca.contribution.namespace.DefaultNamespaceImportExportFactory;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceExport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
-import org.apache.tuscany.sca.workspace.DefaultWorkspaceFactory;
-import org.apache.tuscany.sca.workspace.Workspace;
-import org.apache.tuscany.sca.workspace.WorkspaceFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test the contribution dependency analyzer.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionDependencyBuilderTestCase {
-
- private ContributionFactory contributionFactory;
- private WorkspaceFactory workspaceFactory;
- private NamespaceImportExportFactory importExportFactory;
-
- @Before
- public void setUp() throws Exception {
- contributionFactory = new DefaultContributionFactory();
- workspaceFactory = new DefaultWorkspaceFactory();
- importExportFactory = new DefaultNamespaceImportExportFactory();
- }
-
- @Test
- public void testAnalyze() throws Exception {
- Workspace workspace = workspaceFactory.createWorkspace();
- Contribution importer = contributionFactory.createContribution();
- importer.setURI("importer");
- workspace.getContributions().add(importer);
- NamespaceImport import_ = importExportFactory.createNamespaceImport();
- import_.setNamespace("http://foo");
- importer.getImports().add(import_);
-
- Contribution imported = contributionFactory.createContribution();
- imported.setURI("imported");
- workspace.getContributions().add(imported);
- NamespaceExport export = importExportFactory.createNamespaceExport();
- export.setNamespace("http://foo");
- imported.getExports().add(export);
- import_ = importExportFactory.createNamespaceImport();
- import_.setNamespace("http://bar");
- imported.getImports().add(import_);
-
- Contribution imported2 = contributionFactory.createContribution();
- imported2.setURI("imported2");
- workspace.getContributions().add(imported2);
- export = importExportFactory.createNamespaceExport();
- export.setNamespace("http://bar");
- imported2.getExports().add(export);
-
- Contribution another = contributionFactory.createContribution();
- another.setURI("another");
- workspace.getContributions().add(another);
- export = importExportFactory.createNamespaceExport();
- export.setNamespace("http://another");
- another.getExports().add(export);
-
- ContributionDependencyBuilderImpl builder = new ContributionDependencyBuilderImpl(null);
- builder.build(importer, workspace, null);
- List<Contribution> dependencies = importer.getDependencies();
- assertTrue(dependencies.size() == 3);
- assertTrue(dependencies.contains(importer));
- assertTrue(dependencies.contains(imported));
- assertTrue(dependencies.contains(imported2));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace-xml/LICENSE b/tags/java/sca/2.0-M1/modules/workspace-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/workspace-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/workspace-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index cc2a960421..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: org.apache.tuscany.sca.workspace.xml;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Domain Workspace XML Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397197140
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Domain Workspace XML Model
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.workspace;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.workspace.xml
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/workspace-xml/NOTICE b/tags/java/sca/2.0-M1/modules/workspace-xml/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/workspace-xml/pom.xml b/tags/java/sca/2.0-M1/modules/workspace-xml/pom.xml
deleted file mode 100644
index 0d1b6efc2e..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-xml/pom.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-workspace-xml</artifactId>
- <name>Apache Tuscany SCA Domain Workspace XML Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceDocumentProcessor.java b/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceDocumentProcessor.java
deleted file mode 100644
index 91a6b8dcea..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceDocumentProcessor.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.xml;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-
-import javax.xml.stream.XMLInputFactory;
-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.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-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.workspace.Workspace;
-
-/**
- * A contribution workspace document processor.
- *
- * @version $Rev$ $Date$
- */
-public class WorkspaceDocumentProcessor implements URLArtifactProcessor<Workspace> {
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private Monitor monitor;
-
- /**
- * Constructs a new componentType processor.
- * @param factory
- * @param policyFactory
- * @param registry
- */
- public WorkspaceDocumentProcessor(StAXArtifactProcessor<Object> staxProcessor,
- XMLInputFactory inputFactory,
- Monitor monitor) {
- this.staxProcessor = staxProcessor;
- this.inputFactory = inputFactory;
- 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(), "workspace-xml-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- public Workspace read(URL contributionURL, URI uri, URL url) throws ContributionReadException {
- InputStream urlStream = null;
- try {
-
- // Create a stream reader
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- urlStream = connection.getInputStream();
- XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
- reader.nextTag();
-
- // Read the workspace model
- Workspace workspace = (Workspace)staxProcessor.read(reader);
- if (workspace != null) {
- workspace.setURI(uri.toString());
- }
-
- return workspace;
-
- } catch (XMLStreamException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", inputFactory, ce);
- throw ce;
- } catch (IOException e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", staxProcessor, ce);
- throw ce;
- } finally {
- try {
- if (urlStream != null) {
- urlStream.close();
- urlStream = null;
- }
- } catch (IOException ioe) {
- //ignore
- }
- }
- }
-
- public void resolve(Workspace workspace, ModelResolver resolver) throws ContributionResolveException {
- staxProcessor.resolve(workspace, resolver);
- }
-
- public String getArtifactType() {
- return ".workspace";
- }
-
- public Class<Workspace> getModelType() {
- return Workspace.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceProcessor.java b/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceProcessor.java
deleted file mode 100644
index ccdc2dce8c..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/java/org/apache/tuscany/sca/workspace/xml/WorkspaceProcessor.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-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.workspace.Workspace;
-import org.apache.tuscany.sca.workspace.WorkspaceFactory;
-
-/**
- * A contribution workspace processor.
- *
- * @version $Rev$ $Date$
- */
-public class WorkspaceProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<Workspace> {
-
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- private static final QName WORKSPACE_QNAME = new QName(SCA10_TUSCANY_NS, "workspace");
- private static final QName CONTRIBUTION_QNAME = new QName(SCA10_TUSCANY_NS, "contribution");
- private static final String URI = "uri";
- private static final String LOCATION = "location";
-
- private WorkspaceFactory workspaceFactory;
- private ContributionFactory contributionFactory;
-
- /**
- * Constructs a new contribution workspace processor.
- *
- * @param contributionFactory
- * @param extensionProcessor
- */
- public WorkspaceProcessor(WorkspaceFactory workspaceFactory, ContributionFactory contributionFactory, StAXArtifactProcessor<Object> extensionProcessor) {
- this.workspaceFactory = workspaceFactory;
- this.contributionFactory = contributionFactory;
- }
-
- /**
- * Constructs a new contribution workspace processor.
- *
- * @param modelFactories
- * @param extensionProcessor
- */
- public WorkspaceProcessor(FactoryExtensionPoint modelFactories, StAXArtifactProcessor<Object> extensionProcessor, Monitor monitor) {
- this.workspaceFactory = modelFactories.getFactory(WorkspaceFactory.class);
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- }
-
- public Workspace read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- Workspace workspace = null;
- Contribution contribution = null;
-
- // Read the workspace document
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- QName name = reader.getName();
-
- if (WORKSPACE_QNAME.equals(name)) {
-
- // Read a <workspace>
- workspace = workspaceFactory.createWorkspace();
- workspace.setUnresolved(true);
-
- } else if (CONTRIBUTION_QNAME.equals(name)) {
-
- // Read a <contribution>
- contribution = contributionFactory.createContribution();
- contribution.setURI(getString(reader, URI));
- contribution.setLocation(getString(reader, LOCATION));
- contribution.setUnresolved(true);
- workspace.getContributions().add(contribution);
- }
- break;
-
- case END_ELEMENT:
- name = reader.getName();
-
- // Clear current state when reading reaching end element
- if (CONTRIBUTION_QNAME.equals(name)) {
- contribution = null;
- }
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- return workspace;
- }
-
- public void write(Workspace workspace, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <workspace> element
- writeStartDocument(writer, WORKSPACE_QNAME);
-
- // Write <contribution> elements
- for (Contribution contribution: workspace.getContributions()) {
- writeStart(writer, CONTRIBUTION_QNAME,
- new XAttr(URI, contribution.getURI()), new XAttr(LOCATION, contribution.getLocation()));
- writeEnd(writer);
- }
-
- writeEndDocument(writer);
- }
-
- public void resolve(Workspace workspace, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve the contributions referenced by the workspace
- List<Contribution> contributions = workspace.getContributions();
- for (int i = 0, n = contributions.size(); i < n; i++) {
- Contribution contribution = contributions.get(i);
- Contribution resolved = resolver.resolveModel(Contribution.class, contribution);
- if (resolved != contribution) {
- contributions.set(i, resolved);
- }
- }
-
- workspace.setUnresolved(false);
- }
-
- public QName getArtifactType() {
- return WORKSPACE_QNAME;
- }
-
- public Class<Workspace> getModelType() {
- return Workspace.class;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index 9ea7874b52..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.workspace.xml.WorkspaceProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#workspace,model=org.apache.tuscany.sca.workspace.Workspace
diff --git a/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/resources/workspace-xml-validation-messages.properties b/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/resources/workspace-xml-validation-messages.properties
deleted file mode 100644
index e054591a31..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-xml/src/main/resources/workspace-xml-validation-messages.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-ContributionReadException = ContributionReadException occured due to :
-ContributionResolveException = ContributionResolveException occured due to : \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/workspace-xml/src/test/java/org/apache/tuscany/sca/workspace/xml/ContributionWorkspaceProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/workspace-xml/src/test/java/org/apache/tuscany/sca/workspace/xml/ContributionWorkspaceProcessorTestCase.java
deleted file mode 100644
index 8e37465039..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace-xml/src/test/java/org/apache/tuscany/sca/workspace/xml/ContributionWorkspaceProcessorTestCase.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-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.workspace.Workspace;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test the workspace processor.
- *
- * @version $Rev$ $Date$
- */
-
-public class ContributionWorkspaceProcessorTestCase {
-
- private static final String VALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>" + "<workspace xmlns=\"http://tuscany.apache.org/xmlns/sca/1.0\">"
- + "<contribution uri=\"uri1\" location=\"location1\"/>"
- + "<contribution uri=\"uri2\" location=\"location2\"/>"
- + "</workspace>";
-
- private static final String INVALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>" + "<workspace xmlns=\"http://tuscany.apache.org/xmlns/sca/1.0\">"
- + "<contribution uri=\"uri1\" location=\"location1\"/>"
- + "<contribution uri=\"uri2\" location=\"location2\"/>"
- + "</contribution>"
- + "</workspace>";
-
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors =
- new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
- }
-
- @Test
- public void testRead() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
- Workspace workspace = (Workspace)staxProcessor.read(reader);
- assertNotNull(workspace);
- assertEquals(2, workspace.getContributions().size());
- assertEquals("uri2", workspace.getContributions().get(1).getURI());
- assertEquals("location2", workspace.getContributions().get(1).getLocation());
- }
-
- @Test
- public void testReadInvalid() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(INVALID_XML));
- try {
- staxProcessor.read(reader);
- fail("InvalidException should have been thrown");
- } catch (XMLStreamException e) {
- assertTrue(true);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace/LICENSE b/tags/java/sca/2.0-M1/modules/workspace/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/workspace/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/workspace/META-INF/MANIFEST.MF
deleted file mode 100644
index edc45295b6..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,28 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.workspace;uses:="org.apache.tus
- cany.sca.contribution";version="2.0.0",org.apache.tuscany.sca.workspace
- .builder;uses:="org.apache.tuscany.sca.workspace,org.apache.tuscany.s
- ca.core,org.apache.tuscany.sca.contribution,org.apache.tuscany.sca.mo
- nitor,org.apache.tuscany.sca.extensibility";version="2.0.0"
-Private-Package: org.apache.tuscany.sca.workspace.impl;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Domain Workspace Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397195718
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Domain Workspace Model
-Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.extensibility;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.workspace;version="2.0.0",
- org.apache.tuscany.sca.workspace.builder;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.workspace
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/workspace/NOTICE b/tags/java/sca/2.0-M1/modules/workspace/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/workspace/pom.xml b/tags/java/sca/2.0-M1/modules/workspace/pom.xml
deleted file mode 100644
index c5510ebeb1..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-workspace</artifactId>
- <name>Apache Tuscany SCA Domain Workspace Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/DefaultWorkspaceFactory.java b/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/DefaultWorkspaceFactory.java
deleted file mode 100644
index e895669d23..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/DefaultWorkspaceFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace;
-
-import org.apache.tuscany.sca.workspace.impl.WorkspaceFactoryImpl;
-
-
-/**
- * Default implementation of a contribution workspace model factory.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultWorkspaceFactory extends WorkspaceFactoryImpl {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/Workspace.java b/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/Workspace.java
deleted file mode 100644
index 66f38afec7..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/Workspace.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-
-/**
- * A workspace containing contributions.
- *
- * @version $Rev$ $Date$
- */
-public interface Workspace extends Contribution {
-
- /**
- * Returns the list of contributions in the workspace.
- * @return the list of contributions
- */
- List<Contribution> getContributions();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/WorkspaceFactory.java b/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/WorkspaceFactory.java
deleted file mode 100644
index 2656068bea..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/WorkspaceFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace;
-
-
-
-/**
- * A factory for the contribution workspace model.
- *
- * @version $Rev$ $Date$
- */
-public interface WorkspaceFactory {
-
- /**
- * Create a new contribution workspace model object.
- * @return
- */
- Workspace createWorkspace();
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilder.java b/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilder.java
deleted file mode 100644
index b7c11f769b..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilder.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.builder;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.workspace.Workspace;
-
-/**
- * A contribution builder.
- *
- * @version $Rev$ $Date$
- */
-public interface ContributionBuilder {
-
- /**
- * Returns the ID of the builder.
- *
- * @return
- */
- String getID();
-
- /**
- * Build a contribution.
- *
- * @param contribution
- * @param workspace
- * @param monitor
- */
- void build(Contribution contribution, Workspace workspace, Monitor monitor) throws ContributionBuilderException;
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilderException.java b/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilderException.java
deleted file mode 100644
index 10c18def10..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilderException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.builder;
-
-/**
- * Reports a contribution builder exception.
- *
- * @version $Rev$ $Date$
- */
-public class ContributionBuilderException extends Exception {
- private static final long serialVersionUID = -1198817287971778953L;
-
- public ContributionBuilderException() {
- }
-
- public ContributionBuilderException(String message) {
- super(message);
- }
-
- public ContributionBuilderException(Throwable cause) {
- super(cause);
- }
-
- public ContributionBuilderException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilderExtensionPoint.java b/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilderExtensionPoint.java
deleted file mode 100644
index 8200321eec..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/ContributionBuilderExtensionPoint.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.builder;
-
-/**
- * An extension point for Contribution builders.
- *
- * @version $Rev: $ $Date: $
- */
-public interface ContributionBuilderExtensionPoint {
-
- /**
- * Adds a contribution builder.
- *
- * @param contributionBuilder
- */
- void addContributionBuilder(ContributionBuilder contributionBuilder);
-
- /**
- * Removes a contribution builder.
- *
- * @param contributionBuilder
- */
- void removeContributionBuilder(ContributionBuilder contributionBuilder);
-
- /**
- * Returns the contribution builder with the given id.
- *
- * @param id
- * @return
- */
- ContributionBuilder getContributionBuilder(String id);
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/DefaultContributionBuilderExtensionPoint.java b/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/DefaultContributionBuilderExtensionPoint.java
deleted file mode 100644
index 490eae9dad..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/builder/DefaultContributionBuilderExtensionPoint.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.builder;
-
-import java.lang.reflect.Constructor;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.workspace.Workspace;
-
-/**
- * Default implementation of a provider factory extension point.
- *
- * @version $Rev$ $Date$
- */
-public class DefaultContributionBuilderExtensionPoint implements ContributionBuilderExtensionPoint {
-
- private ExtensionPointRegistry registry;
- private final Map<String, ContributionBuilder> builders = new HashMap<String, ContributionBuilder>();
- private boolean loaded;
-
- public DefaultContributionBuilderExtensionPoint(ExtensionPointRegistry registry) {
- this.registry = registry;
- }
-
- public void addContributionBuilder(ContributionBuilder builder) {
- builders.put(builder.getID(), builder);
- }
-
- public void removeContributionBuilder(ContributionBuilder builder) {
- builders.remove(builder.getID());
- }
-
- public ContributionBuilder getContributionBuilder(String id) {
- loadBuilders();
- return builders.get(id);
- }
-
- /**
- * Load builders declared under META-INF/services.
- */
- private void loadBuilders() {
- if (loaded)
- return;
-
- FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
-
- // Get the provider factory service declarations
- Set<ServiceDeclaration> builderDeclarations;
- ServiceDiscovery serviceDiscovery = ServiceDiscovery.getInstance();
- try {
- builderDeclarations = serviceDiscovery.getServiceDeclarations(ContributionBuilder.class.getName());
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
-
- for (ServiceDeclaration builderDeclaration : builderDeclarations) {
- Map<String, String> attributes = builderDeclaration.getAttributes();
- String id = attributes.get("id");
-
- ContributionBuilder builder = new LazyContributionBuilder(id, builderDeclaration, this, factories);
- builders.put(id, builder);
- }
- }
-
- /**
- * A wrapper around a contribution builder allowing lazy
- * loading and initialization of implementation providers.
- */
- private static class LazyContributionBuilder implements ContributionBuilder {
-
- private FactoryExtensionPoint factories;
- private String id;
- private ServiceDeclaration builderDeclaration;
- private ContributionBuilder builder;
- private ContributionBuilderExtensionPoint builders;
-
- private LazyContributionBuilder(String id, ServiceDeclaration factoryDeclaration,
- ContributionBuilderExtensionPoint builders, FactoryExtensionPoint factories) {
- this.id = id;
- this.builderDeclaration = factoryDeclaration;
- this.builders = builders;
- this.factories = factories;
- }
-
- public String getID() {
- return id;
- }
-
- public void build(Contribution contribution, Workspace workspace, Monitor monitor) throws ContributionBuilderException {
- getBuilder().build(contribution, workspace, monitor);
- }
-
- private ContributionBuilder getBuilder() {
- if (builder == null) {
- try {
- Class<ContributionBuilder> builderClass = (Class<ContributionBuilder>)builderDeclaration.loadClass();
- try {
- Constructor<ContributionBuilder> constructor = builderClass.getConstructor(FactoryExtensionPoint.class);
- builder = constructor.newInstance(factories);
- } catch (NoSuchMethodException e) {
- Constructor<ContributionBuilder> constructor = builderClass.getConstructor(ContributionBuilderExtensionPoint.class, FactoryExtensionPoint.class);
- builder = constructor.newInstance(builders, factories);
- }
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return builder;
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceFactoryImpl.java b/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceFactoryImpl.java
deleted file mode 100644
index e41cc3ea83..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceFactoryImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.impl;
-
-import org.apache.tuscany.sca.workspace.Workspace;
-import org.apache.tuscany.sca.workspace.WorkspaceFactory;
-
-
-/**
- * Default implementation of a contribution workspace model factory.
- *
- * @version $Rev$ $Date$
- */
-public class WorkspaceFactoryImpl implements WorkspaceFactory {
-
- protected WorkspaceFactoryImpl() {
- }
-
- public Workspace createWorkspace() {
- return new WorkspaceImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java b/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java
deleted file mode 100644
index 8c2e119493..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/java/org/apache/tuscany/sca/workspace/impl/WorkspaceImpl.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.workspace.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-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;
-import org.apache.tuscany.sca.workspace.Workspace;
-
-/**
- * WorkspaceImpl
- *
- * @version $Rev$ $Date$
- */
-class WorkspaceImpl implements Workspace {
-
- 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>();
-
- /**
- * Constructs a new workspace.
- */
- WorkspaceImpl() {
- }
-
- 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;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.WorkspaceFactory b/tags/java/sca/2.0-M1/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.WorkspaceFactory
deleted file mode 100644
index d390d29d90..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.WorkspaceFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.workspace.DefaultWorkspaceFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.builder.ContributionBuilderExtensionPoint b/tags/java/sca/2.0-M1/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.builder.ContributionBuilderExtensionPoint
deleted file mode 100644
index 98ad0b72b0..0000000000
--- a/tags/java/sca/2.0-M1/modules/workspace/src/main/resources/META-INF/services/org.apache.tuscany.sca.workspace.builder.ContributionBuilderExtensionPoint
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.workspace.builder.DefaultContributionBuilderExtensionPoint \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/LICENSE b/tags/java/sca/2.0-M1/modules/xsd-xml/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/xsd-xml/META-INF/MANIFEST.MF
deleted file mode 100644
index 40b5d79e03..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,37 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.xsd.xml;uses:="org.apache.ws.co
- mmons.schema,org.apache.ws.commons.schema.resolver,org.apache.tuscany
- .sca.contribution,org.apache.tuscany.sca.core,org.apache.tuscany.sca.
- monitor,org.w3c.dom,org.apache.tuscany.sca.contribution.namespace,jav
- ax.xml.namespace,org.xml.sax,javax.xml.stream,org.apache.tuscany.sca.
- contribution.resolver,org.apache.tuscany.sca.contribution.processor,o
- rg.apache.tuscany.sca.xsd";version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA XSD XML Processor
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397288437
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA XSD XML Processor
-Import-Package: javax.xml.namespace,
- javax.xml.stream,
-
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.contribution;version="2.0.0",
- org.apache.tuscany.sca.contribution.namespace;version="2.0.0",
- org.apache.tuscany.sca.contribution.processor;version="2.0.0",
- org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.monitor;version="2.0.0",
- org.apache.tuscany.sca.xsd;version="2.0.0",
- org.apache.tuscany.sca.xsd.xml;version="2.0.0",
- org.apache.ws.commons.schema,
- org.apache.ws.commons.schema.resolver,
-
- org.w3c.dom,
- org.xml.sax
-Bundle-SymbolicName: org.apache.tuscany.sca.xsd.xml
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/NOTICE b/tags/java/sca/2.0-M1/modules/xsd-xml/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/pom.xml b/tags/java/sca/2.0-M1/modules/xsd-xml/pom.xml
deleted file mode 100644
index ee462c2403..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-xsd-xml</artifactId>
- <name>Apache Tuscany SCA XSD XML Processor</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-namespace</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelper.java b/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelper.java
deleted file mode 100644
index a057bbe155..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelper.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.xsd.xml;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLConnection;
-
-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.xml.sax.InputSource;
-
-/**
- * @version $Rev$ $Date$
- */
-public class XMLDocumentHelper {
- public static final QName WSDL11 = new QName("http://schemas.xmlsoap.org/wsdl/", "definitions");
- public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema");
- public static final QName WSDL20 = new QName("http://www.w3.org/ns/wsdl", "description");
-
- protected static final int BUFFER_SIZE = 256;
-
- /**
- * Detect the XML encoding of the document
- *
- * @param is The input stream
- * @return The encoding
- * @throws IOException
- */
- public static String getEncoding(InputStream is) throws IOException {
- if (!is.markSupported())
- is = new BufferedInputStream(is);
-
- byte[] buffer = readBuffer(is);
- return getXMLEncoding(buffer);
- }
-
- /**
- * Searches the array of bytes to determine the XML encoding.
- */
- protected static String getXMLEncoding(byte[] bytes) {
- String javaEncoding = null;
-
- if (bytes.length >= 4) {
- if (((bytes[0] == -2) && (bytes[1] == -1)) || ((bytes[0] == 0) && (bytes[1] == 60)))
- javaEncoding = "UnicodeBig";
- else if (((bytes[0] == -1) && (bytes[1] == -2)) || ((bytes[0] == 60) && (bytes[1] == 0)))
- javaEncoding = "UnicodeLittle";
- else if ((bytes[0] == -17) && (bytes[1] == -69) && (bytes[2] == -65))
- javaEncoding = "UTF8";
- }
-
- String header = null;
-
- try {
- if (javaEncoding != null)
- header = new String(bytes, 0, bytes.length, javaEncoding);
- else
- header = new String(bytes, 0, bytes.length);
- } catch (UnsupportedEncodingException e) {
- return null;
- }
-
- if (!header.startsWith("<?xml"))
- return "UTF-8";
-
- int endOfXMLPI = header.indexOf("?>");
- int encodingIndex = header.indexOf("encoding", 6);
-
- if ((encodingIndex == -1) || (encodingIndex > endOfXMLPI))
- return "UTF-8";
-
- int firstQuoteIndex = header.indexOf("\"", encodingIndex);
- int lastQuoteIndex;
-
- if ((firstQuoteIndex == -1) || (firstQuoteIndex > endOfXMLPI)) {
- firstQuoteIndex = header.indexOf("'", encodingIndex);
- lastQuoteIndex = header.indexOf("'", firstQuoteIndex + 1);
- } else
- lastQuoteIndex = header.indexOf("\"", firstQuoteIndex + 1);
-
- return header.substring(firstQuoteIndex + 1, lastQuoteIndex);
- }
-
- protected static byte[] readBuffer(InputStream is) throws IOException {
- if (is.available() == 0) {
- return new byte[0];
- }
-
- byte[] buffer = new byte[BUFFER_SIZE];
- is.mark(BUFFER_SIZE);
- int bytesRead = is.read(buffer, 0, BUFFER_SIZE);
- int totalBytesRead = bytesRead;
-
- while (bytesRead != -1 && (totalBytesRead < BUFFER_SIZE)) {
- bytesRead = is.read(buffer, totalBytesRead, BUFFER_SIZE - totalBytesRead);
-
- if (bytesRead != -1)
- totalBytesRead += bytesRead;
- }
-
- if (totalBytesRead < BUFFER_SIZE) {
- byte[] smallerBuffer = new byte[totalBytesRead];
- System.arraycopy(buffer, 0, smallerBuffer, 0, totalBytesRead);
- smallerBuffer = buffer;
- }
-
- is.reset();
- return buffer;
- }
-
- public static InputSource getInputSource(URL url) throws IOException {
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- InputStream is = connection.getInputStream();
- return getInputSource(url, is);
- }
-
- public static InputSource getInputSource(URL url, InputStream is) throws IOException {
- is = new BufferedInputStream(is);
- String encoding = getEncoding(is);
- InputSource inputSource = new InputSource(is);
- inputSource.setEncoding(encoding);
- // [rfeng] Make sure we set the system id as it will be used as the base URI for nested import/include
- inputSource.setSystemId(url.toString());
- return inputSource;
- }
-
- public static String readTargetNamespace(URL doc, QName element, boolean rootOnly, String attribute, XMLInputFactory inputFactory)
- throws IOException, XMLStreamException {
- if (attribute == null) {
- attribute = "targetNamespace";
- }
- URLConnection connection = doc.openConnection();
- connection.setUseCaches(false);
- InputStream is = connection.getInputStream();
- try {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- int eventType = reader.getEventType();
- while (true) {
- if (eventType == XMLStreamConstants.START_ELEMENT) {
- if (element.equals(reader.getName())) {
- return reader.getAttributeValue(null, attribute);
- } else if (rootOnly) {
- return null;
- }
- }
- if (reader.hasNext()) {
- eventType = reader.next();
- } else {
- break;
- }
- }
- return null;
- } finally {
- is.close();
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessor.java b/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessor.java
deleted file mode 100644
index 1d84b6c0a0..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessor.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.xsd.xml;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-
-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.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 XSD documents.
- *
- * @version $Rev$ $Date$
- */
-public class XSDDocumentProcessor implements URLArtifactProcessor<XSDefinition> {
-
- private XSDFactory factory;
- private XMLInputFactory inputFactory;
- private Monitor monitor;
-
- public XSDDocumentProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.factory = 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(), "xsd-xml-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- public XSDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
- try {
- return indexRead(artifactURL);
- } catch (Exception e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", artifactURL, ce);
- throw ce;
- }
- }
-
- public void resolve(XSDefinition model, ModelResolver resolver) throws ContributionResolveException {
- }
-
- public String getArtifactType() {
- return ".xsd";
- }
-
- public Class<XSDefinition> getModelType() {
- return XSDefinition.class;
- }
-
- public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema");
-
- protected XSDefinition indexRead(URL doc) throws Exception {
- XSDefinition xsd = factory.createXSDefinition();
- xsd.setUnresolved(true);
- xsd.setNamespace(XMLDocumentHelper.readTargetNamespace(doc, XSD, true, "targetNamespace", inputFactory));
- xsd.setLocation(doc.toURI());
- xsd.setUnresolved(false);
- return xsd;
- }
-}
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java b/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
deleted file mode 100644
index c30d3ebbd6..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.xsd.xml;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.DefaultImport;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.processor.ContributionRuntimeException;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.xsd.DefaultXSDFactory;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.ws.commons.schema.XmlSchemaInclude;
-import org.apache.ws.commons.schema.resolver.URIResolver;
-import org.xml.sax.InputSource;
-
-/**
- * A Model Resolver for XSD models.
- *
- * @version $Rev$ $Date$
- */
-public class XSDModelResolver implements ModelResolver {
- private static final String AGGREGATED_XSD = "http://tuscany.apache.org/aggregated.xsd";
- private XSDFactory factory;
- private Contribution contribution;
- private Map<String, List<XSDefinition>> map = new HashMap<String, List<XSDefinition>>();
- private XmlSchemaCollection schemaCollection;
-
- public XSDModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- this.schemaCollection = new XmlSchemaCollection();
- schemaCollection.setSchemaResolver(new URIResolverImpl(contribution));
- this.factory = new DefaultXSDFactory();
- }
-
- public void addModel(Object resolved) {
- XSDefinition definition = (XSDefinition)resolved;
- List<XSDefinition> list = map.get(definition.getNamespace());
- if (list == null) {
- list = new ArrayList<XSDefinition>();
- map.put(definition.getNamespace(), list);
- }
- list.add(definition);
- }
-
- public Object removeModel(Object resolved) {
- XSDefinition definition = (XSDefinition)resolved;
- List<XSDefinition> list = map.get(definition.getNamespace());
- if (list == null) {
- return null;
- } else {
- return list.remove(definition);
- }
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
-
- XSDefinition definition = (XSDefinition)unresolved;
- // Lookup a definition for the given namespace
- String namespace = definition.getNamespace();
- List<XSDefinition> list = map.get(namespace);
- XSDefinition modelXSD = null;
- if (list != null && definition.getDocument() != null) {
- // Set the document for the inline schema
- int index = list.indexOf(definition);
- if (index != -1) { // a matching (not identical) document was found
- modelXSD = list.get(index);
- modelXSD.setDocument(definition.getDocument());
- }
- }
- if (list == null && definition.getDocument() != null) {
- // Hit for the 1st time
- list = new ArrayList<XSDefinition>();
- list.add(definition);
- map.put(namespace, list);
- }
- XSDefinition resolved = null;
- try {
- resolved = aggregate(list);
- } catch (IOException e) {
- throw new ContributionRuntimeException(e);
- }
- if (resolved != null && !resolved.isUnresolved()) {
- if (definition.isUnresolved() && definition.getSchema() == null && modelXSD != null) {
- // Update the unresolved model with schema information and mark it
- // resolved. This information in the unresolved model is needed when
- // this method is called by WSDLModelResolver.readInlineSchemas().
- definition.setSchema(modelXSD.getSchema());
- definition.setSchemaCollection(modelXSD.getSchemaCollection());
- definition.setUnresolved(false);
- }
- return modelClass.cast(resolved);
- }
-
- // No definition found, delegate the resolution to the imports
- for (Import import_ : this.contribution.getImports()) {
- if (import_ instanceof NamespaceImport) {
- NamespaceImport namespaceImport = (NamespaceImport)import_;
- if (namespaceImport.getNamespace().equals(namespace)) {
-
- // Delegate the resolution to the namespace import resolver
- resolved =
- namespaceImport.getModelResolver().resolveModel(XSDefinition.class, (XSDefinition)unresolved);
- if (!resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- } else if (import_ instanceof DefaultImport) {
-
- // Delegate the resolution to the default import resolver
- resolved =
- import_.getModelResolver().resolveModel(XSDefinition.class, (XSDefinition)unresolved);
- if (!resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- }
- return modelClass.cast(unresolved);
- }
-
- private void loadOnDemand(XSDefinition definition) throws IOException {
- if (definition.getSchema() != null) {
- return;
- }
- if (definition.getDocument() != null) {
- String uri = null;
- if (definition.getLocation() != null) {
- uri = definition.getLocation().toString();
- }
- XmlSchema schema = schemaCollection.read(definition.getDocument(), uri, null);
- definition.setSchemaCollection(schemaCollection);
- definition.setSchema(schema);
- definition.setUnresolved(false);
- } else if (definition.getLocation() != null) {
- if (definition.getLocation().getFragment() != null) {
- // It's an inline schema
- return;
- }
- // Read an XSD document
- InputSource xsd = XMLDocumentHelper.getInputSource(definition.getLocation().toURL());
- for (XmlSchema d : schemaCollection.getXmlSchemas()) {
- if (d.getTargetNamespace().equals(definition.getNamespace())) {
- if (d.getSourceURI().equals(definition.getLocation().toString()))
- return;
- }
- }
- XmlSchema schema = schemaCollection.read(xsd, null);
- definition.setSchemaCollection(schemaCollection);
- definition.setSchema(schema);
- }
- }
-
- /**
- * Create a facade XmlSchema which includes all the definitions
- *
- * @param definitions A list of the XmlSchema under the same target
- * namespace
- * @return The aggregated XmlSchema
- */
- private XSDefinition aggregate(List<XSDefinition> definitions) throws IOException {
- if (definitions == null || definitions.size() == 0) {
- return null;
- }
- if (definitions.size() == 1) {
- XSDefinition d = definitions.get(0);
- loadOnDemand(d);
- return d;
- }
- XSDefinition aggregated = factory.createXSDefinition();
- for (XSDefinition d : definitions) {
- loadOnDemand(d);
- }
- String ns = definitions.get(0).getNamespace();
-
- XmlSchema facade = null;
- // Check if the facade XSD is already in the collection
- for (XmlSchema s : schemaCollection.getXmlSchema(AGGREGATED_XSD)) {
- if (ns.equals(s.getTargetNamespace())) {
- facade = s;
- break;
- }
- }
- if (facade == null) {
- // This will add the facade into the collection
- facade = new XmlSchema(ns, AGGREGATED_XSD, schemaCollection);
- }
-
- for (XmlSchema d : schemaCollection.getXmlSchemas()) {
- if (ns.equals(d.getTargetNamespace())) {
- if (d == facade) {
- continue;
- }
- XmlSchemaInclude include = new XmlSchemaInclude();
- include.setSchema(d);
- include.setSourceURI(d.getSourceURI());
- include.setSchemaLocation(d.getSourceURI());
- facade.getIncludes().add(include);
- facade.getItems().add(include);
- }
- }
- aggregated.setUnresolved(true);
- aggregated.setSchema(facade);
- aggregated.setNamespace(ns);
- aggregated.setAggregatedDefinitions(definitions);
- aggregated.setUnresolved(false);
-
- // FIXME: [rfeng] This is hacky
- //definitions.clear();
- //definitions.add(aggregated);
- return aggregated;
- }
-
- /**
- * URI resolver implementation for XML schema
- */
- public static class URIResolverImpl implements URIResolver {
- private Contribution contribution;
-
- public URIResolverImpl(Contribution contribution) {
- this.contribution = contribution;
- }
-
- public org.xml.sax.InputSource resolveEntity(java.lang.String targetNamespace,
- java.lang.String schemaLocation,
- java.lang.String baseUri) {
- try {
- if (schemaLocation == null) {
- return null;
- }
- URL url = null;
- if (schemaLocation.startsWith("/")) {
- // The URI is relative to the contribution
- String uri = schemaLocation.substring(1);
- for (Artifact a : contribution.getArtifacts()) {
- if (a.getURI().equals(uri)) {
- url = new URL(a.getLocation());
- break;
- }
- }
- } else {
- url = new URL(new URL(baseUri), schemaLocation);
- }
- return XMLDocumentHelper.getInputSource(url);
- } catch (IOException e) {
- return null;
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
deleted file mode 100644
index 1ec3d27200..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.xsd.xml.XSDDocumentProcessor;type=.xsd,model=org.apache.tuscany.sca.xsd.XSDefinition
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
deleted file mode 100644
index a67ecf063a..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.xsd.xml.XSDModelResolver;model=org.apache.tuscany.sca.xsd.XSDefinition
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/xsd-xml-validation-messages.properties b/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/xsd-xml-validation-messages.properties
deleted file mode 100644
index ab50456510..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/src/main/resources/xsd-xml-validation-messages.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-ContributionReadException = ContributionReadException occured due to : {0}
-
-
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelperTestCase.java b/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelperTestCase.java
deleted file mode 100644
index 56831e23d3..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XMLDocumentHelperTestCase.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.xsd.xml;
-
-import java.net.URL;
-
-import javax.xml.stream.XMLInputFactory;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class XMLDocumentHelperTestCase {
- private URL xsd;
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- xsd = getClass().getResource("/xsd/greeting.xsd");
- }
-
- @Test
- public void testReadTNS() throws Exception {
- String tns = XMLDocumentHelper.readTargetNamespace(xsd, XMLDocumentHelper.XSD, true, null, XMLInputFactory.newInstance());
- Assert.assertEquals("http://greeting", tns);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessorTestCase.java b/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessorTestCase.java
deleted file mode 100644
index a20d5f6f58..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/java/org/apache/tuscany/sca/xsd/xml/XSDDocumentProcessorTestCase.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.xsd.xml;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-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.ModelResolver;
-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.xsd.XSDefinition;
-import org.apache.ws.commons.schema.XmlSchemaInclude;
-import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
-import org.apache.ws.commons.schema.XmlSchemaType;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev$ $Date$
- */
-public class XSDDocumentProcessorTestCase {
- private URLArtifactProcessor<Object> documentProcessor;
- private ModelResolver resolver;
-
- /**
- * @throws java.lang.Exception
- */
- @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);
- resolver = new XSDModelResolver(null, modelFactories);
- }
-
- @Test
- public void testXSD() throws Exception {
- URL url = getClass().getResource("/xsd/greeting.xsd");
- XSDefinition definition = (XSDefinition)documentProcessor.read(null, URI.create("xsd/greeting.xsd"), url);
- Assert.assertNull(definition.getSchema());
- Assert.assertEquals("http://greeting", definition.getNamespace());
- URL url1 = getClass().getResource("/xsd/name.xsd");
- XSDefinition definition1 = (XSDefinition)documentProcessor.read(null, URI.create("xsd/name.xsd"), url1);
- Assert.assertNull(definition1.getSchema());
- Assert.assertEquals("http://greeting", definition1.getNamespace());
- resolver.addModel(definition);
- XSDefinition resolved = resolver.resolveModel(XSDefinition.class, definition);
- XmlSchemaObjectCollection collection = resolved.getSchema().getIncludes();
- Assert.assertTrue(collection.getCount() == 1);
- XmlSchemaType type =
- ((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name"));
- Assert.assertNotNull(type);
- resolver.addModel(definition1);
- resolved = resolver.resolveModel(XSDefinition.class, definition);
- collection = resolved.getSchema().getIncludes();
- Assert.assertTrue(collection.getCount() == 2);
- XmlSchemaType type1 =
- ((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name"));
- XmlSchemaType type2 =
- ((XmlSchemaInclude)collection.getItem(1)).getSchema().getTypeByName(new QName("http://greeting", "Name"));
- Assert.assertTrue(type1 != null || type2 != null);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/resources/xsd/greeting.xsd b/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/resources/xsd/greeting.xsd
deleted file mode 100644
index 635ca25bfc..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/resources/xsd/greeting.xsd
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/resources/xsd/name.xsd b/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/resources/xsd/name.xsd
deleted file mode 100644
index 300de931ec..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd-xml/src/test/resources/xsd/name.xsd
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT 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/tags/java/sca/2.0-M1/modules/xsd/LICENSE b/tags/java/sca/2.0-M1/modules/xsd/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/modules/xsd/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/modules/xsd/META-INF/MANIFEST.MF
deleted file mode 100644
index f1607529d1..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.xsd;uses:="org.apache.ws.common
- s.schema,org.apache.tuscany.sca.assembly,org.w3c.dom,javax.xml.namesp
- ace";version="2.0.0"
-Private-Package: org.apache.tuscany.sca.xsd.impl;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA XSD Model
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1225397174343
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA XSD Model
-Import-Package: javax.xml.namespace,org.apache.tuscany.sca.assembly;ve
- rsion="2.0.0",org.apache.tuscany.sca.xsd;version="2.0.0",org.apache.ws.co
- mmons.schema,org.w3c.dom
-Bundle-SymbolicName: org.apache.tuscany.sca.xsd
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/modules/xsd/NOTICE b/tags/java/sca/2.0-M1/modules/xsd/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/modules/xsd/pom.xml b/tags/java/sca/2.0-M1/modules/xsd/pom.xml
deleted file mode 100644
index dea7c6b658..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</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-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- <version>1.4.2</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/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/DefaultXSDFactory.java b/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/DefaultXSDFactory.java
deleted file mode 100644
index 92dce98fa1..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/DefaultXSDFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.xsd;
-
-import org.apache.tuscany.sca.xsd.impl.XSDFactoryImpl;
-
-/**
- * A factory for XSD definitions
- *
- * @version $Rev$ $Date$
- */
-public class DefaultXSDFactory extends XSDFactoryImpl implements XSDFactory {
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDFactory.java b/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDFactory.java
deleted file mode 100644
index 08a1c8dd63..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.xsd;
-
-/**
- * Factory for XSD definitions
- *
- * @version $Rev$ $Date$
- */
-public interface XSDFactory {
-
- /**
- * Creates a new XML Schema definition.
- *
- * @return a new XML Schema definition
- */
- XSDefinition createXSDefinition();
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java b/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java
deleted file mode 100644
index 9a973cd095..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.xsd;
-
-import java.net.URI;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Base;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaType;
-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) $
- */
-public interface XSDefinition extends Base {
- XmlSchemaCollection getSchemaCollection();
-
- void setSchemaCollection(XmlSchemaCollection schemaCollection);
-
- /**
- * Returns the XmlSchema definition model
- * @return the XmlSchema definition model
- */
- XmlSchema getSchema();
-
- /**
- * Sets the XmlSchema definition model
- * @param definition the XmlSchema definition model
- */
- void setSchema(XmlSchema definition);
-
- /**
- * Returns the namespace of this XmlSchema definition.
- * @return the namespace of this XmlSchema definition
- */
- String getNamespace();
-
- /**
- * Sets the namespace of this XmlSchema definition.
- * @param namespace the namespace of this XmlSchema definition
- */
- void setNamespace(String namespace);
-
- /**
- * Get the location of the XSD
- * @return
- */
- URI getLocation();
-
- /**
- * Set the location of the XSD
- * @param uri
- */
- void setLocation(URI uri);
-
- /**
- * Get the DOM representation of the XSD
- * @return
- */
- Document getDocument();
-
- /**
- * Set the DOM representation of the XSD
- * @param document
- */
- void setDocument(Document document);
-
- /**
- * Get an XSD element by QName
- * @param name The element name
- * @return The XSD element
- */
- XmlSchemaElement getXmlSchemaElement(QName name);
-
- /**
- * Get an XSD type by QName
- * @param name The type name
- * @return The XSD type
- */
- XmlSchemaType getXmlSchemaType(QName name);
-
- /**
- * Get the aggregated definitions for a facade XSDefinition
- * @return The aggregated definitions, or null if not a facade
- */
- List<XSDefinition> getAggregatedDefinitions();
-
- /**
- * Set the aggregated definitions for a facade XSDefinition
- * @param name The aggregated definitions
- */
- void setAggregatedDefinitions(List<XSDefinition> definitions);
-}
diff --git a/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDFactoryImpl.java b/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDFactoryImpl.java
deleted file mode 100644
index 60ff6b6fd9..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDFactoryImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.xsd.impl;
-
-import org.apache.tuscany.sca.xsd.XSDefinition;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-
-/**
- * A factory for XSD definitions
- *
- * @version $Rev$ $Date$
- */
-public abstract class XSDFactoryImpl implements XSDFactory {
-
- public XSDefinition createXSDefinition() {
- return new XSDefinitionImpl();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java b/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java
deleted file mode 100644
index 5a2b4ec8e6..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.xsd.impl;
-
-import java.net.URI;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.xsd.XSDefinition;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaImport;
-import org.apache.ws.commons.schema.XmlSchemaInclude;
-import org.apache.ws.commons.schema.XmlSchemaObject;
-import org.apache.ws.commons.schema.XmlSchemaType;
-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) $
- */
-public class XSDefinitionImpl implements XSDefinition {
- private XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
- private XmlSchema schema;
- private String namespace;
- private URI location;
- private Document document;
- private boolean unresolved;
- private List<XSDefinition> definitions;
-
- public XSDefinitionImpl() {
- }
-
- public XmlSchema getSchema() {
- return schema;
- }
-
- public void setSchema(XmlSchema definition) {
- this.schema = definition;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean undefined) {
- this.unresolved = undefined;
- }
-
- public String getNamespace() {
- if (isUnresolved()) {
- return namespace;
- } else if (schema != null) {
- return schema.getTargetNamespace();
- } else {
- return namespace;
- }
- }
-
- public void setNamespace(String namespace) {
- if (!isUnresolved()) {
- throw new IllegalStateException();
- } else {
- this.namespace = namespace;
- }
- }
-
- /**
- * @return the location
- */
- public URI getLocation() {
- return location;
- }
-
- /**
- * @param location the location to set
- */
- public void setLocation(URI location) {
- this.location = location;
- }
-
- /**
- * @return the document
- */
- public Document getDocument() {
- return document;
- }
-
- /**
- * @param document the document to set
- */
- public void setDocument(Document document) {
- this.document = document;
- }
-
- /**
- * @return the schemaCollection
- */
- public XmlSchemaCollection getSchemaCollection() {
- return schemaCollection;
- }
-
- /**
- * @param schemaCollection the schemaCollection to set
- */
- public void setSchemaCollection(XmlSchemaCollection schemaCollection) {
- this.schemaCollection = schemaCollection;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((location == null) ? 0 : location.hashCode());
- result = prime * result + ((namespace == null) ? 0 : namespace.hashCode());
- return result;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof XSDefinitionImpl))
- return false;
- final XSDefinitionImpl other = (XSDefinitionImpl)obj;
- if (location == null) {
- if (other.location != null)
- return false;
- } else if (!location.equals(other.location))
- return false;
- if (namespace == null) {
- if (other.namespace != null)
- return false;
- } else if (!namespace.equals(other.namespace))
- return false;
- return true;
- }
-
- private static <T extends XmlSchemaObject> T getXmlSchemaObject(XmlSchema schema, QName name, Class<T> type) {
- if (schema != null) {
- XmlSchemaObject object = null;
- if (type == XmlSchemaElement.class) {
- object = schema.getElementByName(name);
- } else if (type == XmlSchemaType.class) {
- object = schema.getTypeByName(name);
- }
- if (object != null) {
- return type.cast(object);
- }
- for (Iterator i = schema.getIncludes().getIterator(); i.hasNext();) {
- XmlSchemaObject obj = (XmlSchemaObject)i.next();
- XmlSchema ext = null;
- if (obj instanceof XmlSchemaInclude) {
- ext = ((XmlSchemaInclude)obj).getSchema();
- }
- if (obj instanceof XmlSchemaImport) {
- ext = ((XmlSchemaImport)obj).getSchema();
- }
- object = getXmlSchemaObject(ext, name, type);
- if (object != null) {
- return type.cast(object);
- }
- }
- }
- return null;
- }
-
- public XmlSchemaElement getXmlSchemaElement(QName name) {
- if (schema != null) {
- XmlSchemaElement element = getXmlSchemaObject(schema, name, XmlSchemaElement.class);
- if (element != null) {
- return element;
- }
- }
-
- if (schemaCollection != null) {
- return schemaCollection.getElementByQName(name);
- }
- return null;
- }
-
- public XmlSchemaType getXmlSchemaType(QName name) {
- if (schema != null) {
- XmlSchemaType type = getXmlSchemaObject(schema, name, XmlSchemaType.class);
- if (type != null) {
- return type;
- }
- }
- if (schemaCollection != null) {
- return schemaCollection.getTypeByQName(name);
- }
- return null;
- }
-
- public List<XSDefinition> getAggregatedDefinitions() {
- return definitions;
- }
-
- public void setAggregatedDefinitions(List<XSDefinition> definitions) {
- this.definitions = definitions;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/modules/xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.xsd.XSDFactory b/tags/java/sca/2.0-M1/modules/xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.xsd.XSDFactory
deleted file mode 100644
index ca06127c06..0000000000
--- a/tags/java/sca/2.0-M1/modules/xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.xsd.XSDFactory
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-org.apache.tuscany.sca.xsd.DefaultXSDFactory \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/pom.xml b/tags/java/sca/2.0-M1/pom.xml
deleted file mode 100644
index cddf3eb579..0000000000
--- a/tags/java/sca/2.0-M1/pom.xml
+++ /dev/null
@@ -1,535 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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</groupId>
- <artifactId>apache</artifactId>
- <version>4</version>
- </parent>
-
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Implementation Project</name>
- <url>http://tuscany.apache.org</url>
- <version>2.0-M1</version>
-
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/tuscany/java/sca</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/tuscany/java/sca</developerConnection>
- <url>http://svn.apache.org/repos/asf/tuscany/java/sca</url>
- </scm>
-
- <prerequisites>
- <maven>2.0.6</maven>
- </prerequisites>
-
- <properties>
- <notice.dir>.</notice.dir>
- </properties>
-
- <issueManagement>
- <system>jira</system>
- <url>http://issues.apache.org/jira/browse/TUSCANY</url>
- </issueManagement>
-
- <repositories>
- <repository>
- <id>apache.incubator</id>
- <url>http://people.apache.org/repo/m2-incubating-repository</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <!-- Apache SNAPSHOT repository for unreleased artifacts -->
- <repository>
- <id>apache.snapshots</id>
- <name>Apache SNAPSHOT Repository</name>
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- <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>
- <repository>
- <id>indiana</id>
- <url>http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/maven2/</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>osuosl.org</id>
- <url>http://ftp.osuosl.org/pub/eclipse/tools/emf/maven2</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <!-- Apache repository for artifacts released by Apache TLP projects -->
- <pluginRepository>
- <id>apache</id>
- <name>Apache Repository</name>
- <url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
-
- <!-- Apache Incubator repository for artifacts released by Incubator projects -->
- <pluginRepository>
- <id>apache.incubator</id>
- <name>Apache Incubator Repository</name>
- <url>http://people.apache.org/repo/m2-incubating-repository</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
-
- <!-- Apache SNAPSHOT repository for unreleased artifacts -->
- <pluginRepository>
- <id>apache.snapshots</id>
- <name>Apache SNAPSHOT Repository</name>
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
-
- <!-- Codehaus SNAPSHOT repository -->
- <pluginRepository>
- <id>codehaus-snapshot</id>
- <name>Codehaus Snapshot Repository</name>
- <url>http://snapshots.repository.codehaus.org</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
-
- <distributionManagement>
- <repository>
- <id>apache.releases</id>
- <name>Apache Release Distribution Repository</name>
- <url>scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository</url>
- </repository>
- <snapshotRepository>
- <id>apache.snapshots</id>
- <name>Apache Development Snapshot Repository</name>
- <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
- </snapshotRepository>
- </distributionManagement>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>modules</module>
- <module>tools</module>
- <module>samples</module>
- <module>itest</module>
- <module>features</module>
- <module>distribution</module>
-<!--
- <module>stest</module>
- <module>vtest</module>
- <module>tutorials</module>
--->
- </modules>
- </profile>
-
- <profile>
- <id>setup</id>
- <modules>
- <module>tools/maven/maven-eclipse-compiler</module>
- <!--module>tools/maven/maven-bundle-plugin</module-->
- </modules>
- </profile>
-
- <profile>
- <id>distribution</id>
- <modules>
- <module>modules</module>
- <module>tools</module>
- <module>samples</module>
- <module>itest</module>
-<!--
- <module>vtest</module>
- <module>tutorials</module>
- <module>demos</module>
--->
- <module>features</module>
- <module>distribution</module>
- </modules>
- </profile>
-
- <profile>
- <id>sources</id>
- <modules>
- <module>modules</module>
- <module>tools</module>
- <module>samples</module>
- <module>itest</module>
- <module>vtest</module>
- <module>tutorials</module>
- </modules>
- <properties>
- <maven.test.skip>true</maven.test.skip>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <configuration>
- <attach>true</attach>
- </configuration>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>eclipse</id>
-<!--
- <properties>
- <notice.dir>src/main/resources</notice.dir>
- </properties>
--->
- <modules>
- <module>modules</module>
- <module>tools</module>
- <module>samples</module>
- <module>itest</module>
- <!--module>vtest</module-->
- <!--module>tutorials</module-->
- <!--module>demos</module-->
- <module>features</module>
- <module>distribution</module>
- </modules>
- <build>
- <defaultGoal>org.apache.tuscany.sca:tuscany-maven-bundle-plugin:eclipse</defaultGoal>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-bundle-plugin</artifactId>
- <version>2.0-SNAPSHOT</version>
- <extensions>true</extensions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- </profile>
- <profile>
- <id>osgi</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <modules>
- <module>samples</module>
- </modules>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-osgi-junit</artifactId>
- <version>2.0-M1</version>
- <executions>
- <execution>
- <id>osgi-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>dependencies</id>
- <modules>
- <module>modules</module>
- <!--module>samples</module>
- <module>tutorials</module>
- <module>demos</module-->
- </modules>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-dependency-lister</artifactId>
- <version>2.0-M1</version>
- <executions>
- <execution>
- <phase>process-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>security</id>
- <modules>
- <!-- <module>demos</module> -->
- <module>itest</module>
- <module>vtest</module>
- </modules>
- <activation>
- <property>
- <name>tuscany.policy.file</name>
- </property>
- </activation>
- <properties>
- <tuscany.policy.file>file:///${java.home}/lib/security/tuscany.policy</tuscany.policy.file>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <includes>
- <include>**/*TestCase.java</include>
- </includes>
- <reportFormat>brief</reportFormat>
- <useFile>false</useFile>
- <forkMode>once</forkMode>
- <!-- Place tuscany.policy in your Java home security directory. Alternatively, hardcode the file location here. -->
- <argLine>-Djava.security.manager -Djava.security.policy=${tuscany.policy.file} -Dpolicy.allowSystemProperty=true -Djava.security.debug=policy</argLine>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!-- profile for verifying source code correctness -->
- <profile>
- <id>sourcecheck</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-pmd-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <showDeprecation>true</showDeprecation>
- <compilerArgument>-Xlint:unchecked,deprecation,fallthrough,finally</compilerArgument>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- </profiles>
-
-
- <build>
- <defaultGoal>install</defaultGoal>
-
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>${notice.dir}</directory>
- <targetPath>META-INF</targetPath>
- <filtering>true</filtering>
- <includes>
- <include>LICENSE</include>
- <include>NOTICE</include>
- <include>MANIFEST.MF</include>
- </includes>
- </resource>
- </resources>
-
- <pluginManagement>
- <plugins>
-
- <!-- compiler plugin configuration -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <compilerId>tuscany-eclipse</compilerId>
- <source>1.5</source>
- <target>1.5</target>
- <compilerArguments>
- <osgi>true</osgi>
- </compilerArguments>
- </configuration>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-eclipse-compiler</artifactId>
- <version>2.0-M1</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- </plugin>
-
- <!-- surefire plugin configuration -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <includes>
- <include>**/*TestCase.java</include>
- </includes>
- <reportFormat>brief</reportFormat>
- <useFile>false</useFile>
- <forkMode>once</forkMode>
- <argLine>-ea -Xmx256m</argLine>
- </configuration>
- </plugin>
-
- <!-- jar plugin configuration -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.1</version>
- <configuration>
- <archive>
- <manifestEntries>
- <Extension-Name>${project.artifactId}</Extension-Name>
- <Specification-Title>${name}</Specification-Title>
- <Specification-Vendor>The Apache Software Foundation</Specification-Vendor>
- <Specification-Version>${version}</Specification-Version>
- <Implementation-Title>${name}</Implementation-Title>
- <Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id>
- <Implementation-Vendor>The Apache Software Foundation</Implementation-Vendor>
- <Implementation-Version>${version}</Implementation-Version>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
-
- <!-- code coverage check plugin configuration -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clover-plugin</artifactId>
- <configuration>
- <jdk>1.5</jdk>
- </configuration>
- </plugin>
-
- <!-- ant plugin global configuration -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.3</version>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-trax</artifactId>
- <version>1.7.1</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/samples/README b/tags/java/sca/2.0-M1/samples/README
deleted file mode 100644
index 4ccefa3695..0000000000
--- a/tags/java/sca/2.0-M1/samples/README
+++ /dev/null
@@ -1,232 +0,0 @@
-The Apache Tuscany SCA Samples
-==============================
-The Apache Tuscany SCA samples are built as part of the main Maven build and
-run, using the provided JUnit test cases, as tests in the Maven build.
-
-In the binary distribution of Apache Tuscany most samples can also
-be run using the provided Ant build.xml files. These show the samples running
-from a simple main() method without the need for a JUnit test case.
-
-In these notes text that appears in angled brackets like this <example> means
-that you need to make a choice and provide your own text at that point.
-
-These simple samples have been created with the intention of illustrating the
-usage of the SCA API and annotations and certainly not to levels of SCA component
-abstraction. In real life situations you should use SCA to assemble real and
-usually bigger components, and when you do that you'll get all the benefits of
-SCA, bindings, policies, integration in an SOA environment etc..
-
-Sample Overview
----------------
-The samples generally show off different features of the SCA runtime
-and the extensions that come packaged with it.
-
-binding-ws-calculator - Calculator running inside a web app also
- showing webservices binding
-
-calculator - Calculator built with java components and
- local wires.
-
-calculator-equinox - Calculator running inside a Equinox OSGi runtime
-
-calculator-osgi - Calculator running inside a OSGi runtime
-
-calculator-rmi-reference - The calculator configured to talk RMI to
- the calculator-rmi-service sample
-calculator-rmi-service - The calculator configured to accept RMI
- requests from calculator-rmi-reference
-
-implementation-java-calculator
-
-
-Sample Layout
--------------
-All sample directories are organized in the same way based on the default
-project template provided by Maven. For example, take a look at the calculator
-sample;
-
-calculator/
- src/ - Holds all of the source files for the sample
- main/ - Groups together the files that implement the sample
- java/ - Java source files
- resources/ - Non java resource files such as composte files
- test/ - Groups together files that provide sample tests
- java - Java test sources files. Usually JUnit test cases
- target/ - Holds the files generated when the sample is built
- classes/ - For example, Java class files
- test-classes/ - classes from src/test and other test files
-
-Getting Ready To Build
-----------------------
-You will need to install the following software before you start.
-
-J2SE Development Kit (JDK) 5.0
-Apache Ant 1.7.1 - if you are going to use Ant
-Apache Maven 2.0.9 - if you are going to use Maven
-
-Java and Ant and/or Maven binary directories must be present in your PATH so
-that their executable programs are available in your environment. You may
-find it useful to use a script to set up your environment, for example;
-
-For UNIX:
- JAVA_HOME=/<installation_directory>
- ANT_HOME=/<installation_directory>/apache-ant-1.7.0
- MAVEN_HOME=/<installation_directory>/maven-2.0.6
- export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$PATH
-
-For Windows:
- set JAVA_HOME=C:\<installation_directory>
- set ANT_HOME=C:\<installation_directory>\apache-ant-1.7.0
- set MAVEN_HOME=C:\<installation_directory>\maven-2.0.6
- set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%MAVEN_HOME%\bin;%PATH%
-
-
-Building And Running The SCA Samples Using Ant
-----------------------------------------------
-The build.xml files provided with the Apache Tuscany SCA samples are designed
-to work with the binary distribution. They rely on the tuscany-sca-manifest.jar
-to describe the class path and this jar is only provided as part of the
-binary distribution.
-
-The binary distribution of SCA also includes precompiled versions of each sample.
-If you look in the target directory of each sample you will see this jar file. To
-run a sample based on all of the precompiled artifacts all you have to do is:
-
-cd <sampledir>
-ant run
-
-Check each <sampledir>/README file as some samples require that two progams are
-run to get the desired result, for example, the two samples that show how
-to build extensions are run from their associated application samples.
-
-If you want to rebuild a sample, for example, if you have changed it, do the
-following:
-
-cd <sampledir>
-ant compile
-
-Once the sample is built you have the option of running the sample in whatever
-way best suits you. Two alternatives are provided in the ant build files.
-
-The compile target builds the class files and then builds the jar so you can use
-the same command as before:
-
-ant run
-
-This will use the generated jar to run the samples. The command line version of
-this is:
-
-on Windows
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\<sample jar file> <sample runnable class>
-
-for example : java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator.jar calculator.CalculatorClient
-
-on *nix
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/<sample jar file> <sample runnable class>
-
-for example : java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator.jar calculator.CalculatorClient
-
-
-You can use the compiled classes directly using
-
-ant run-classes
-
-The command line version of this is:
-
-on Windows
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\classes <sample runnable class>
-
-for example : java -cp ..\..\features\tuscany-sca-manifest.jar;target\classes calculator.CalculatorClient
-
-on *nix
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/classes <sample runnable class>
-
-for example : java -cp ../../features/tuscany-sca-manifest.jar:target/classes calculator.CalculatorClient
-
-The class specified on the command of course depends on which sample you want to
-run. In the examples we have used we are running the CalculatorClient from the calculator sample.
-
-
-Building And Running The SCA Samples Using Maven
-------------------------------------------------
-
-The Maven build process will work from both source and binary distributions.
-To build and test all of the Apache Tuscany SCA sources, including the samples,
-do the following.
-
-cd sca
-mvn
-
-This will take a little while to complete. Experience with Maven tells us that
-sometimes there are problems downloading the dependencies that Apache Tuscany
-SCA requires. If Maven reports that it cannot download required dependencies
-try running the Maven build again.
-
-Once you have all of the source built you can build and run each sample
-independently if required.
-
-cd <sampledir>
-mvn
-
-When using Maven the samples are run within JUnit test cases and so you will
-sometimes not see any test output. You will always see an indication of test
-success or failure.
-
-Using The Samples In An IDE
----------------------------------------------
-The easiest way to use the samples in an IDE is to use Maven to generate all
-of the IDE project files for you automatically. This works best if you
-generate IDE projects for all of the Apache Tuscany modules. You can then
-include the ones you are interested in working with in you IDE.
-
-To build IDE project files for all of the modules in Apache Tuscany SCA;
-
-cd sca
-
-If you are an Eclipse user do the following
-
-mvn -Peclipse
-
-If you are an IDEA user do the following
-
-mvn idea:idea
-
-These commands generate project files for each module in Apache Tuscany SCA.
-The modules you are interested in can now be included in your IDE, for example,
-in Eclipse, if you create a new Java project and use the option to "create a
-new project from existing source" you can specify an SCA module directory,
-which includes the generated project files, and Eclipse will treat it like any
-other Java project.
-
-Using The Samples In An IDE Without Maven
------------------------------------------
-We don't provide any IDE project files with our distributions so you will have to
-import the sample files into your IDE manually. Here's an example of how it can be
-done using Eclipse.
-
-In a new or existing workspace
- Create a new java project to represent the sample you want to work on, e.g.
- calculator
- Import all of the sample code and resources into this project, e.g.
- File, Import and then select tuscany-sca-1.0-incubating\samples\calculator from the filesystem
- Configure the source path to include
- src/main/java
- src/main/resources
- Configure the output folder to be
- calculator/target
- Configure the build path to include the manifest jar tuscany-sca-manifiest.jar provided in
- features
- If you select calculator.CalculatorClient.java and run as "Java Application" you should see
- 3 + 2=5.0
- 3 - 2=1.0
- 3 * 2=6.0
- 3 / 2=1.5
-
-The details of how to do this for other development environments will
-vary but the process will be similar.
-
-
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/README b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/README
deleted file mode 100644
index fb5afcc7ec..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/README
+++ /dev/null
@@ -1,97 +0,0 @@
-Calculator Sample
-=================
-This sample implements a simple calculator using SCA components.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-If you just want to run it to see what happens open a command prompt, navigate
-to this sample directory and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-binding-ws-calculator.jar sample.SampleClientImpl
-
-and on *nix do
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/sample-binding-ws-calculator.jar sample.SampleClientImpl
-
-Sample Overview
----------------
-The sample provides a single calculator service with a default SCA (java)
-binding. The CalculatorClient exercises this interface by calling add,
-subtract, multiply and divide operations. This results in messages passing to
-the appropriate components in the composite across the local wires.
-
-calculator/
- src/
- main/
- java/
- calculator/
- CalculatorService.java - the first component, calls +-/* as
- appropriate
- CalculatorServiceImpl.java
- AddService.java - adds two numbers
- AddServiceImpl.java
- SubtractService.java - subtracts one number from another
- SubtractServiceImpl.java
- MultiplyService.java - multiplies two numbers
- MultiplyServiceImpl.java
- DivideService.java - divides one number by another
- DivideServiceImpl.java
- CalculatorClient.java - starts the SCA Runtime and
- deploys the Calculator.composite.
- It then calls the deployed Calculator
- Components services
- resources/
- Calculator.composite - the SCA assembly for this sample
- test/
- java/
- calculator/
- CalculatorTestCase.java - JUnit test case
- calculator.png - a pictorial representation of the sample
- .composite file
- build.xml - the Ant build file
- pom.xml - the Maven build file
-
-Building And Running The Sample Using Ant
------------------------------------------
-With the binary distribution the sample can be built and run using Ant as
-follows
-
-cd calculator
-ant compile
-ant run
-
-You should see the following output from the run target.
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
-
-Building And Running The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd calculator
-mvn
-
-You should see the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running calculator.CalculatorTestCase
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/build.xml b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/build.xml
deleted file mode 100644
index cf77c8a2a1..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/build.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project name="binding-ws-calculator" default="run">
-
- <property name="jar.name" value="sample-binding-ws-calculator.jar" />
- <property name="main.class" value="sample.SampleClientImpl" />
-
- <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>
- <pathelement location="../../modules/tuscany-sca-api-2.0-M1.jar"/>
- <pathelement location="../../modules/tuscany-node-api-2.0-M1.jar"/>
- </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>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/calculator.png b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/calculator.png
deleted file mode 100644
index 995a57b1fd..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/calculator.png
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/calculator.svg b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/calculator.svg
deleted file mode 100644
index af34f07e04..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/calculator.svg
+++ /dev/null
@@ -1,329 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="1052.3622"
- height="744.09448"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator"
- sodipodi:docname="calculator.svg"
- version="1.0"
- inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator\calculator.png"
- inkscape:export-xdpi="52.84"
- inkscape:export-ydpi="52.84">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="471.80491"
- inkscape:cy="378.84265"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- inkscape:window-width="1054"
- inkscape:window-height="721"
- inkscape:window-x="59"
- inkscape:window-y="79" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1">
- <g
- id="g2997"
- transform="matrix(1,0,0,1.144214,0,-27.53557)">
- <rect
- rx="15.307091"
- ry="12.692303"
- y="192.00233"
- x="258.31146"
- height="299.99988"
- width="495.71429"
- id="rect2067"
- style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <flowRoot
- id="flowRoot2954"
- xml:space="preserve"><flowRegion
- id="flowRegion2956"><rect
- y="212.66591"
- x="281.42856"
- height="61.42857"
- width="170"
- id="rect2958" /></flowRegion><flowPara
- id="flowPara2960">Calculator</flowPara></flowRoot> </g>
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect2988"
- width="115.66247"
- height="191.57716"
- x="339.91632"
- y="262.1673"
- rx="6.9961648"
- ry="15.892869" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2966"
- transform="translate(79.61125,62.65764)"><flowRegion
- id="flowRegion2968"><rect
- id="rect2970"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara2972">Calculator</flowPara><flowPara
- id="flowPara1895">Service</flowPara><flowPara
- id="flowPara1897">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
- id="path3017" />
- <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
- id="path3019" />
- <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
- id="path1883" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1885"
- transform="translate(-46.16225,128.7269)"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion
- id="flowRegion1887"><rect
- id="rect1889"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara
- id="flowPara1891">Calculator</flowPara><flowPara
- id="flowPara1893">Service</flowPara></flowRoot> <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1899"
- width="115.66247"
- height="70.148659"
- x="594.75488"
- y="209.73451"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1901"
- transform="translate(334.4498,10.22481)"><flowRegion
- id="flowRegion1903"><rect
- id="rect1905"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1907">Add</flowPara><flowPara
- id="flowPara1909">Service</flowPara><flowPara
- id="flowPara1911">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z "
- id="path1913" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1917"
- width="115.66247"
- height="70.148659"
- x="594.06543"
- y="292.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1919"
- transform="translate(333.7604,93.08188)"><flowRegion
- id="flowRegion1921"><rect
- id="rect1923"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1925">Subtract</flowPara><flowPara
- id="flowPara1927">Service</flowPara><flowPara
- id="flowPara1929">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z "
- id="path1931" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1933"
- width="115.66247"
- height="70.148659"
- x="594.77979"
- y="371.87729"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1935"
- transform="translate(334.4747,172.3676)"><flowRegion
- id="flowRegion1937"><rect
- id="rect1939"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1941">Multiply</flowPara><flowPara
- id="flowPara1943">Service</flowPara><flowPara
- id="flowPara1945">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z "
- id="path1947" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1949"
- width="115.66247"
- height="70.148659"
- x="596.20831"
- y="452.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1951"
- transform="translate(335.9032,253.0819)"><flowRegion
- id="flowRegion1953"><rect
- id="rect1955"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1957">Divide</flowPara><flowPara
- id="flowPara1959">Service</flowPara><flowPara
- id="flowPara1961">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z "
- id="path1963" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1965"
- transform="translate(161.0221,114.967)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1967"><rect
- id="rect1969"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1973">add</flowPara><flowPara
- id="flowPara1977">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
- id="path1979" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1981"
- transform="translate(160.6632,150.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1983"><rect
- id="rect1985"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1987">subtract</flowPara><flowPara
- id="flowPara1989">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
- id="path1991" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1993"
- transform="translate(161.3775,184.2583)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1995"><rect
- id="rect1997"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1999">multiply</flowPara><flowPara
- id="flowPara2001">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
- id="path2003" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2005"
- transform="translate(159.9489,215.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2007"><rect
- id="rect2009"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2011">divide</flowPara><flowPara
- id="flowPara2013">Service</flowPara></flowRoot> <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
- id="path2015" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
- id="path2017" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
- id="path2019" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
- id="path2021" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 292.85714,355.52305 L 330,354.80877"
- id="path2023" />
- </g>
-</svg>
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/pom.xml b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/pom.xml
deleted file mode 100644
index b2df1a2827..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/pom.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-binding-ws-calculator</artifactId>
- <name>Apache Tuscany SCA Binding WS Calculator Sample</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-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <type>pom</type>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <type>pom</type>
- <version>2.0-M1</version>
- </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-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/AddService.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/AddService.java
deleted file mode 100644
index dd7ecb827d..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The Add service interface
- */
-@Remotable
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 7ca8fb04b5..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorClientImpl.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorClientImpl.java
deleted file mode 100644
index 7e5ff160f0..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorClientImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package calculator;
-
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-import sample.SampleClient;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-@Scope("COMPOSITE")
-public class CalculatorClientImpl implements SampleClient {
-
- private CalculatorService calculatorService;
-
- @Reference
- public void setCalculatorService(CalculatorService calculatorService) {
- this.calculatorService = calculatorService;
- }
-
- /**
- * This code used to be in an @Init method which removed the need for a JSE client
- * to prod the compoite. However OASIS is debating whether to allow references to be used
- * inside @Init methods and it can cause deadlocks in our runtime. So rather than make
- * changes in the runtime we are falling backon the JSE drive mechanism until we know
- * which way the specs are going
- */
- public void runSample() {
- System.out.println("SCA API ClassLoader: " + print(Reference.class.getClassLoader()));
- 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));
- }
-
- private static String print(ClassLoader cl) {
- StringBuffer buf = new StringBuffer();
- for (; cl != null;) {
- buf.append(cl.toString());
- buf.append(' ');
- cl = cl.getParent();
- }
- return buf.toString();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index 031fa8b912..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-
-/**
- * The Calculator service interface.
- */
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 17fad7de6b..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/DivideService.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 30d248208b..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index 1323edf55a..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605938..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index 91b803bc9e..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/SubtractService.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index bf0d1882b6..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 58cc4a3547..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/sample/SampleClient.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/sample/SampleClient.java
deleted file mode 100644
index 6620f6a5e7..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/sample/SampleClient.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-/**
- * The sample service interface.
- */
-public interface SampleClient {
- void runSample();
-}
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/sample/SampleClientImpl.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/sample/SampleClientImpl.java
deleted file mode 100644
index 3f6ecfdb03..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/java/sample/SampleClientImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sample;
-
-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 SampleClientImpl {
- public static void main(String[] args) throws Exception {
- Node node = NodeFactory.newInstance().createNode();
-
- node.start();
-
- SampleClient sampleClient = node.getService(SampleClient.class, "SampleClient");
- sampleClient.runSample();
-
- node.stop();
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/resources/Calculator.composite b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/resources/Calculator.composite
deleted file mode 100644
index f4bcaf4352..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/resources/Calculator.composite
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- xmlns:sample="http://sample"
- name="Calculator">
-
- <component name="SampleClient">
- <implementation.java class="calculator.CalculatorClientImpl"/>
- <reference name="calculatorService" target="CalculatorServiceComponent" />
- </component>
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" >
- <binding.ws uri="http://localhost:8085/AddServiceComponent"/>
- </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.ws uri="http://localhost:8085/AddServiceComponent"/>
- </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/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 8b60ae590c..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- xmlns:sample="http://sample">
- <deployable composite="sample:Calculator"/>
-</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/test/java/calculator/CalculatorTestCase.java b/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/test/java/calculator/CalculatorTestCase.java
deleted file mode 100644
index bc90f0e566..0000000000
--- a/tags/java/sca/2.0-M1/samples/binding-ws-calculator/src/test/java/calculator/CalculatorTestCase.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.apache.tuscany.sca.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;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import sample.SampleClientImpl;
-
-/**
- * Test the Calculator composition.
- */
-public class CalculatorTestCase {
-
- @Test
- public void testSample() throws Exception {
- SampleClientImpl.main(null);
- }
-}
diff --git a/tags/java/sca/2.0-M1/samples/build-common.xml b/tags/java/sca/2.0-M1/samples/build-common.xml
deleted file mode 100644
index 3260b68771..0000000000
--- a/tags/java/sca/2.0-M1/samples/build-common.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<project name="common">
- <!-- Set the distro path based on the existence of the pom.xml -->
- <condition property="distro.path" value="../../distribution/all/target" else="../..">
- <available file="../../distribution/pom.xml"/>
- </condition>
-
- <!-- Convert the path to an absolute location -->
- <property name="distro.root" location="${distro.path}"/>
- <echo>Distribution: ${distro.root}</echo>
-
- <!-- @file is relative to the enclosing file -->
- <import file="${distro.root}/features/build-path.xml"/>
-
- <target name="common-init">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- <mkdir dir="${sample.root}/target/classes"/>
- </target>
-
- <target name="common-jar-compile" depends="common-init">
- <javac srcdir="${sample.root}/src/main/java"
- destdir="${sample.root}/target/classes"
- debug="on"
- source="1.5"
- target="1.5">
- <classpath refid="tuscany.path"/>
- </javac>
- <copy todir="${sample.root}/target/classes">
- <fileset dir="${sample.root}/src/main/resources"/>
- </copy>
- <jar destfile="${sample.jar}" basedir="${sample.root}/target/classes">
- </jar>
- </target>
-
- <target name="common-war-compile" depends="common-init">
- <javac srcdir="${sample.root}/src/main/java"
- destdir="${sample.root}/target/classes"
- debug="on"
- source="1.5"
- target="1.5">
- <classpath refid="tuscany.path"/>
- </javac>
- <copy todir="${sample.root}/target/classes">
- <fileset dir="${sample.root}/src/main/resources"/>
- </copy>
- <war destfile="${sample.war}" webxml="${sample.root}/src/main/webapp/WEB-INF/web.xml">
- <fileset dir="${sample.root}/src/main/webapp"/>
- <lib refid="tuscany.path"/>
- <classes dir="${sample.root}/target/classes"/>
- </war>
- </target>
-
- <target name="common-run-jse" depends="compile">
- <java jar="${distro.root}/modules/tuscany-node-launcher-2.0-M1.jar"
- fork="true"
- inputstring="q">
- <jvmarg value="-Djava.util.logging.config.file=${sample.root}/../../logging.properties"/>
- <arg value="${sample.composite}"/>
- <!-- would be good to have the node launcher run the first deployable
- composite if this is not specified so I don't have to put it here -->
- <arg value="${sample.jar}"/>
- </java>
- </target>
-
- <target name="common-run-equinox" depends="compile">
- <java jar="${distro.root}/modules/tuscany-node-launcher-equinox-2.0-M1.jar"
- fork="true"
- inputstring="q">
- <jvmarg value="-Djava.util.logging.config.file=${sample.root}/../../logging.properties"/>
- <arg value="${sample.composite}"/>
- <!-- would be good to have the node launcher run the first deplyable
- composite if this is not specified so I don't have to put it here -->
- <arg value="${sample.jar}"/>
- </java>
- </target>
-
- <target name="common-clean">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-</project>
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/README b/tags/java/sca/2.0-M1/samples/calculator-equinox/README
deleted file mode 100644
index 7f76542622..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/README
+++ /dev/null
@@ -1,97 +0,0 @@
-Calculator Sample
-=================
-This sample implements a simple calculator using SCA components.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-If you just want to run it to see what happens open a command prompt, navigate
-to this sample directory and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator-equinox.jar calculator.CalculatorClient
-
-and on *nix do
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator-equinox.jar calculator.CalculatorClient
-
-Sample Overview
----------------
-The sample provides a single calculator service with a default SCA (java)
-binding. The CalculatorClient exercises this interface by calling add,
-subtract, multiply and divide operations. This results in messages passing to
-the appropriate components in the composite across the local wires.
-
-calculator/
- src/
- main/
- java/
- calculator/
- CalculatorService.java - the first component, calls +-/* as
- appropriate
- CalculatorServiceImpl.java
- AddService.java - adds two numbers
- AddServiceImpl.java
- SubtractService.java - subtracts one number from another
- SubtractServiceImpl.java
- MultiplyService.java - multiplies two numbers
- MultiplyServiceImpl.java
- DivideService.java - divides one number by another
- DivideServiceImpl.java
- CalculatorClient.java - starts the SCA Runtime and
- deploys the Calculator.composite.
- It then calls the deployed Calculator
- Components services
- resources/
- Calculator.composite - the SCA assembly for this sample
- test/
- java/
- calculator/
- CalculatorTestCase.java - JUnit test case
- calculator.png - a pictorial representation of the sample
- .composite file
- build.xml - the Ant build file
- pom.xml - the Maven build file
-
-Building And Running The Sample Using Ant
------------------------------------------
-With the binary distribution the sample can be built and run using Ant as
-follows
-
-cd calculator
-ant compile
-ant run
-
-You should see the following output from the run target.
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
-
-Building And Running The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd calculator
-mvn
-
-You should see the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running calculator.CalculatorTestCase
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/build.xml b/tags/java/sca/2.0-M1/samples/calculator-equinox/build.xml
deleted file mode 100644
index 75c4839cfa..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/build.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project name="calculator-equinox" default="run">
- <property name="sample.name" value="${ant.project.name}"/>
- <property name="sample.jar" value="./target/sample-${sample.name}.jar" />
-
- <target name="init">
- <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">
- <classpath>
- <fileset dir="../../features">
- <include name="tuscany-sca-manifest.jar" />
- </fileset>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="${sample.jar}" basedir="target/classes">
- </jar>
- </target>
-
- <target name="run" depends="compile">
- <java jar="../../features/tuscany-sca-manifest.jar" fork="true">
- <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/>
- <!-- optional to set the deployable composite -->
- <arg value="-composite"/>
- <arg value="Calculator.composite"/>
- <!-- stop the node after the application runs -->
- <arg value="-ttl"/>
- <arg value="0"/>
- <arg value="${sample.jar}"/>
- </java>
- </target>
-
- <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="Calculator.composite"/>
- <arg value="-config"/>
- <arg value="../../features/configuration"/>
- <arg value="-ttl"/>
- <arg value="0"/>
- <arg value="${sample.jar}"/>
- </java>
- </target>
-
- <target name="clean">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-</project>
-
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/calculator.png b/tags/java/sca/2.0-M1/samples/calculator-equinox/calculator.png
deleted file mode 100644
index 995a57b1fd..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/calculator.png
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/calculator.svg b/tags/java/sca/2.0-M1/samples/calculator-equinox/calculator.svg
deleted file mode 100644
index af34f07e04..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/calculator.svg
+++ /dev/null
@@ -1,329 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="1052.3622"
- height="744.09448"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator"
- sodipodi:docname="calculator.svg"
- version="1.0"
- inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator\calculator.png"
- inkscape:export-xdpi="52.84"
- inkscape:export-ydpi="52.84">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="471.80491"
- inkscape:cy="378.84265"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- inkscape:window-width="1054"
- inkscape:window-height="721"
- inkscape:window-x="59"
- inkscape:window-y="79" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1">
- <g
- id="g2997"
- transform="matrix(1,0,0,1.144214,0,-27.53557)">
- <rect
- rx="15.307091"
- ry="12.692303"
- y="192.00233"
- x="258.31146"
- height="299.99988"
- width="495.71429"
- id="rect2067"
- style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <flowRoot
- id="flowRoot2954"
- xml:space="preserve"><flowRegion
- id="flowRegion2956"><rect
- y="212.66591"
- x="281.42856"
- height="61.42857"
- width="170"
- id="rect2958" /></flowRegion><flowPara
- id="flowPara2960">Calculator</flowPara></flowRoot> </g>
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect2988"
- width="115.66247"
- height="191.57716"
- x="339.91632"
- y="262.1673"
- rx="6.9961648"
- ry="15.892869" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2966"
- transform="translate(79.61125,62.65764)"><flowRegion
- id="flowRegion2968"><rect
- id="rect2970"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara2972">Calculator</flowPara><flowPara
- id="flowPara1895">Service</flowPara><flowPara
- id="flowPara1897">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
- id="path3017" />
- <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
- id="path3019" />
- <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
- id="path1883" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1885"
- transform="translate(-46.16225,128.7269)"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion
- id="flowRegion1887"><rect
- id="rect1889"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara
- id="flowPara1891">Calculator</flowPara><flowPara
- id="flowPara1893">Service</flowPara></flowRoot> <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1899"
- width="115.66247"
- height="70.148659"
- x="594.75488"
- y="209.73451"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1901"
- transform="translate(334.4498,10.22481)"><flowRegion
- id="flowRegion1903"><rect
- id="rect1905"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1907">Add</flowPara><flowPara
- id="flowPara1909">Service</flowPara><flowPara
- id="flowPara1911">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z "
- id="path1913" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1917"
- width="115.66247"
- height="70.148659"
- x="594.06543"
- y="292.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1919"
- transform="translate(333.7604,93.08188)"><flowRegion
- id="flowRegion1921"><rect
- id="rect1923"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1925">Subtract</flowPara><flowPara
- id="flowPara1927">Service</flowPara><flowPara
- id="flowPara1929">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z "
- id="path1931" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1933"
- width="115.66247"
- height="70.148659"
- x="594.77979"
- y="371.87729"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1935"
- transform="translate(334.4747,172.3676)"><flowRegion
- id="flowRegion1937"><rect
- id="rect1939"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1941">Multiply</flowPara><flowPara
- id="flowPara1943">Service</flowPara><flowPara
- id="flowPara1945">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z "
- id="path1947" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1949"
- width="115.66247"
- height="70.148659"
- x="596.20831"
- y="452.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1951"
- transform="translate(335.9032,253.0819)"><flowRegion
- id="flowRegion1953"><rect
- id="rect1955"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1957">Divide</flowPara><flowPara
- id="flowPara1959">Service</flowPara><flowPara
- id="flowPara1961">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z "
- id="path1963" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1965"
- transform="translate(161.0221,114.967)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1967"><rect
- id="rect1969"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1973">add</flowPara><flowPara
- id="flowPara1977">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
- id="path1979" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1981"
- transform="translate(160.6632,150.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1983"><rect
- id="rect1985"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1987">subtract</flowPara><flowPara
- id="flowPara1989">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
- id="path1991" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1993"
- transform="translate(161.3775,184.2583)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1995"><rect
- id="rect1997"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1999">multiply</flowPara><flowPara
- id="flowPara2001">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
- id="path2003" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2005"
- transform="translate(159.9489,215.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2007"><rect
- id="rect2009"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2011">divide</flowPara><flowPara
- id="flowPara2013">Service</flowPara></flowRoot> <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
- id="path2015" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
- id="path2017" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
- id="path2019" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
- id="path2021" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 292.85714,355.52305 L 330,354.80877"
- id="path2023" />
- </g>
-</svg>
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/pom.xml b/tags/java/sca/2.0-M1/samples/calculator-equinox/pom.xml
deleted file mode 100644
index 40e64056d7..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/pom.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-calculator-equinox</artifactId>
- <name>Apache Tuscany SCA Calculator Equinox Sample</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-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility-equinox</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/AddService.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/AddService.java
deleted file mode 100644
index 188451ebac..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The Add service interface
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 7ca8fb04b5..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorClient.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorClient.java
deleted file mode 100644
index 84c98d7f70..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorClient.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package calculator;
-
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-@Scope("COMPOSITE") @EagerInit
-public class CalculatorClient {
-
- private CalculatorService calculatorService;
-
- @Reference
- public void setCalculatorService(CalculatorService calculatorService) {
- this.calculatorService = calculatorService;
- }
-
- @Init
- public void calculate() {
-
- // Calculate
- System.out.println("SCA API ClassLoader: " + print(Reference.class.getClassLoader()));
- 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));
- }
-
- private static String print(ClassLoader cl) {
- StringBuffer buf = new StringBuffer();
- for (; cl != null;) {
- buf.append(cl.toString());
- buf.append(' ');
- cl = cl.getParent();
- }
- return buf.toString();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index 031fa8b912..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-
-/**
- * The Calculator service interface.
- */
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 17fad7de6b..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/DivideService.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 30d248208b..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index 1323edf55a..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605938..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index 91b803bc9e..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/SubtractService.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index bf0d1882b6..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 58cc4a3547..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/resources/Calculator.composite b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/resources/Calculator.composite
deleted file mode 100644
index 913081b9be..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/main/resources/Calculator.composite
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- 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>
-
- <component name="CalculatorClient">
- <implementation.java class="calculator.CalculatorClient"/>
- <reference name="calculatorService" target="CalculatorServiceComponent" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/test/java/calculator/CalculatorTestCase.java b/tags/java/sca/2.0-M1/samples/calculator-equinox/src/test/java/calculator/CalculatorTestCase.java
deleted file mode 100644
index b49e1da130..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-equinox/src/test/java/calculator/CalculatorTestCase.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-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;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This shows how to test the Calculator composition.
- */
-public class CalculatorTestCase {
-
- private static NodeLauncher launcher;
- private static Node node;
-
- public static void main(String[] args) throws Exception {
- setUpBeforeClass();
- tearDownAfterClass();
- }
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- launcher = NodeLauncher.newInstance();
- String location = ContributionLocationHelper.getContributionLocation(CalculatorClient.class);
- node = launcher.createNode("Calculator.composite", new Contribution("test", location));
- System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader());
- node.start();
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (node != null) {
- node.stop();
- node.destroy();
- }
- if (launcher != null) {
- launcher.destroy();
- }
- }
-
- @Test
- public void testDummy() throws Exception {
- }
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/samples/calculator-osgi/META-INF/MANIFEST.MF
deleted file mode 100644
index 56d59b05ff..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-Private-Package: calculator;version="2.0.0"
-Tool: Bnd-0.0.255
-Bundle-Name: Apache Tuscany SCA Calculator OSGi Sample
-Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-Bundle-Vendor: The Apache Software Foundation
-Eclipse-LazyStart: false
-Bundle-Version: 2.0.0
-Bnd-LastModified: 1223949424781
-Bundle-Activator: calculator.CalculatorActivator
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Calculator OSGi Sample
-Import-Package: org.apache.tuscany.sca.node;version="2.0.0",
- org.oasisopen.sca.annotation;version="2.0.0",
- org.osgi.framework;version="1.4"
-Bundle-SymbolicName: sample-calculator-osgi
-Bundle-DocURL: http://www.apache.org/
-
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/README b/tags/java/sca/2.0-M1/samples/calculator-osgi/README
deleted file mode 100644
index 332526d43a..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/README
+++ /dev/null
@@ -1,97 +0,0 @@
-Calculator Sample
-=================
-This sample implements a simple calculator using SCA components and run it in a OSGi environment.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-If you just want to run it to see what happens open a command prompt, navigate
-to this sample directory and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -jar ..\..\features\tuscany-sca-equinox-manifest.jar -composite Calculator.composite -config ..\..\features\configuration\ -ttl 0 target\sample-calculator-osgi.jar
-
-and on *nix do
-
-java -jar ../../features/tuscany-sca-equinox-manifest.jar -composite Calculator.composite -config ../../features/configuration/ -ttl 0 target/sample-calculator-osgi.jar
-
-Sample Overview
----------------
-The sample provides a single calculator service with a default SCA (java)
-binding. The CalculatorClient exercises this interface by calling add,
-subtract, multiply and divide operations. This results in messages passing to
-the appropriate components in the composite across the local wires.
-
-calculator/
- src/
- main/
- java/
- calculator/
- CalculatorService.java - the first component, calls +-/* as
- appropriate
- CalculatorServiceImpl.java
- AddService.java - adds two numbers
- AddServiceImpl.java
- SubtractService.java - subtracts one number from another
- SubtractServiceImpl.java
- MultiplyService.java - multiplies two numbers
- MultiplyServiceImpl.java
- DivideService.java - divides one number by another
- DivideServiceImpl.java
- CalculatorClient.java - starts the SCA Runtime and
- deploys the Calculator.composite.
- It then calls the deployed Calculator
- Components services
- resources/
- Calculator.composite - the SCA assembly for this sample
- test/
- java/
- calculator/
- CalculatorTestCase.java - JUnit test case
- calculator.png - a pictorial representation of the sample
- .composite file
- build.xml - the Ant build file
- pom.xml - the Maven build file
-
-Building And Running The Sample Using Ant
------------------------------------------
-With the binary distribution the sample can be built and run using Ant as
-follows
-
-cd calculator
-ant compile
-ant run
-
-You should see the following output from the run target.
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
-
-Building And Running The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd calculator
-mvn
-
-You should see the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running calculator.CalculatorTestCase
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/build.xml b/tags/java/sca/2.0-M1/samples/calculator-osgi/build.xml
deleted file mode 100644
index 46522211f9..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/build.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project name="calculator-osgi" default="run">
- <property name="sample.name" value="${ant.project.name}"/>
- <property name="sample.jar" value="./target/sample-${sample.name}.jar" />
-
- <target name="init">
- <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">
- <classpath>
- <fileset dir="../../features">
- <include name="tuscany-sca-manifest.jar" />
- </fileset>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="${sample.jar}" basedir="target/classes">
- </jar>
- </target>
-
- <target name="run" depends="compile">
- <java jar="../../features/tuscany-sca-manifest.jar" fork="true">
- <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/>
- <!-- optional to set the deployable composite -->
- <arg value="-composite"/>
- <arg value="Calculator.composite"/>
- <!-- stop the node after the application runs -->
- <arg value="-ttl"/>
- <arg value="0"/>
- <arg value="${sample.jar}"/>
- </java>
- </target>
-
- <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="Calculator.composite"/>
- <arg value="-config"/>
- <arg value="../../features/configuration"/>
- <arg value="-ttl"/>
- <arg value="0"/>
- <arg value="${sample.jar}"/>
- </java>
- </target>
-
- <target name="clean">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-</project>
-
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/pom.xml b/tags/java/sca/2.0-M1/samples/calculator-osgi/pom.xml
deleted file mode 100644
index d3b6bdb761..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-calculator-osgi</artifactId>
- <name>Apache Tuscany SCA Calculator OSGi Sample</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>
- <version>2.0-M1</version>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <version>2.0-M1</version>
- <type>pom</type>
- </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.sca</groupId>
- <artifactId>tuscany-maven-osgi-junit</artifactId>
- <version>2.0-M1</version>
- <executions>
- <execution>
- <id>osgi-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- </execution>
- <configuration></configuration>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/AddService.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/AddService.java
deleted file mode 100644
index 188451ebac..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The Add service interface
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 7ca8fb04b5..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
deleted file mode 100644
index 4408568629..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * Bundle Activator for Calculator
- *
- */
-public class CalculatorActivator implements BundleActivator {
- private Node node;
-
- public void start(BundleContext context) throws Exception {
- try {
- NodeFactory factory = NodeFactory.newInstance();
- String url = ContributionLocationHelper.getContributionLocation(getClass());
- Contribution contrib = new Contribution("c1", url);
- node = factory.createNode("Calculator.composite", contrib);
- node.start();
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
-
- public void stop(BundleContext context) throws Exception {
- if (node != null) {
- node.stop();
- node = null;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java
deleted file mode 100644
index afd5ea48fc..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package calculator;
-
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-@Scope("COMPOSITE")
-@EagerInit
-public class CalculatorClient {
-
- private CalculatorService calculatorService;
-
- @Reference
- public void setCalculatorService(CalculatorService calculatorService) {
- this.calculatorService = calculatorService;
- }
-
- @Init
- public void calculate() {
- // Calculate
- System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader());
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index c89043276e..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The Calculator service interface.
- */
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 39f55ca31f..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/DivideService.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 30d248208b..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index 1323edf55a..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605938..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index 91b803bc9e..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/SubtractService.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index bf0d1882b6..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 58cc4a3547..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/resources/Calculator.composite b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/resources/Calculator.composite
deleted file mode 100644
index 913081b9be..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/main/resources/Calculator.composite
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- 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>
-
- <component name="CalculatorClient">
- <implementation.java class="calculator.CalculatorClient"/>
- <reference name="calculatorService" target="CalculatorServiceComponent" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java b/tags/java/sca/2.0-M1/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
deleted file mode 100644
index 9d9b0a9ffb..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This shows how to test the Calculator composition.
- */
-public class CalculatorTestCase {
-
- private static Node node;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation(CalculatorClient.class);
- node = NodeFactory.newInstance().createNode("Calculator.composite", new Contribution("test", location));
- System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader());
- node.start();
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (node != null) {
- node.stop();
- node.destroy();
- }
- }
-
- @Test
- public void testDummy() throws Exception {
- }
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/README b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/README
deleted file mode 100644
index 07b6dd9713..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/README
+++ /dev/null
@@ -1,138 +0,0 @@
-Calculator RMI Reference Sample
-===============================
-
-This sample illustrates the use of Tuscany RMI Binding to call reference
-services that are hosted as Java RMI services.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-If you just want to run it to see what happens open a command prompt, first
-navigate to the calculator-rmi-service sample and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator-rmi-service.jar calculator.CalculatorServer
-
-and on *nix do
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator-rmi-service.jar calculator.CalculatorServer
-
-Now you have the server running you need to open another command prompt, navigate
-to this sample directory and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator-rmi-reference.jar calculator.CalculatorClient
-
-and on *nix do
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator-rmi-reference.jar calculator.CalculatorClient
-
-Sample Overview
----------------
-This sample extends the calculator sample by replacing the local wired
-connections with RMI bindings. Instead of local add, subtract, multiply and
-divide components, an RMI service implementation now provides the
-add, subtract, multiply and divide interfaces and is hosted as an RMI server.
-References specified in the .composite file include an RMI binding which targets
-this RMI server.
-
-This sample adds a number of classes to the basic calculator sample:
-
-calculator-rmi-reference/
- src/
- main/
- java/
- calculator/
- CalculatorService.java - as calculator sample
- AddService.java - as calculator sample
- SubtractService.java - as calculator sample
- MultipleService.java - as calculator sample
- DivideService.java - as calculator sample
- CalculatorClient.java - as calculator sample
- CalculatorServiceImpl.java - calls the RMI service
- that provides the target for the
- RMI bindings in the composite
- resources/
- CalculatorRMIReference.composite - the SCA assembly for this sample
- test/
- java/
- calculator/
- CalculatorRMIReferenceTestCase.java - JUnit test case
- CalculatorRMIServiceImpl.java - test RMI service to call
- calculator-rmi-reference.png - a pictorial representation of the
- .composite file
- build.xml - the Ant build file for the client
- pom.xml - the Maven build file
-
-Note. As this test creates and uses local network connections you may need to
-configure your firewall, if you are running one, to allow the test to run
-successfully.
-
-Building And Running The Sample Using Ant
------------------------------------------
-With the binary distribution the sample can be built and run using Ant.
-
-The server provides an RMI server that the acts as a target for the SCA RMI
-bindings. Start a new console and use the following commands.
-
-cd calculator-rmi-service
-ant compile
-ant run
-
-This will run up the server and display the following.
-
-run:
- [java] Starting of the SCA Calculator Application exposed as RMI Services...
- [java] ...Press Enter to Exit...
-
-The client is very similar to the calculator sample. It starts the SCA runtime
-and calls each of the calculator operations. In doing this the RMI bindings
-make calls out to the RMI server you started in the previous step. Start
-a new console and use the following commands.
-
-cd calculator-rmi-reference
-ant compile
-ant run
-
-You should see the following output from the run target.
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
-
-If you now return to the console window running the server and press enter the
-server should stop.
-
-Building And Running The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd calculator-rmi-reference
-mvn
-
-You should see the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running calculator.CalculatorRMIReferenceTestCase
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.308 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
-
-
-
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/build.xml b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/build.xml
deleted file mode 100644
index d51f776e07..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/build.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<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>
- <pathelement location="../../modules/tuscany-sca-api-2.0-M1.jar"/>
- <pathelement location="../../modules/tuscany-node-api-2.0-M1.jar"/>
- </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>
-
-</project>
-
-
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/calculator-rmi-reference.png b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/calculator-rmi-reference.png
deleted file mode 100644
index 8c76b77a9f..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/calculator-rmi-reference.png
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/calculator-rmi-reference.svg b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/calculator-rmi-reference.svg
deleted file mode 100644
index ba802e6717..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/calculator-rmi-reference.svg
+++ /dev/null
@@ -1,412 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="1052.3622"
- height="744.09448"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator-rmi-reference"
- sodipodi:docname="calculator-rmi-reference.svg"
- version="1.0"
- inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator-rmi-reference\calculator-rmi-reference.png"
- inkscape:export-xdpi="52.84"
- inkscape:export-ydpi="52.84">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="553.58838"
- inkscape:cy="368.42498"
- inkscape:document-units="px"
- inkscape:current-layer="g2997"
- inkscape:window-width="1134"
- inkscape:window-height="721"
- inkscape:window-x="1"
- inkscape:window-y="105" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1">
- <g
- id="g2997"
- transform="matrix(0.679966,0,0,1.144214,82.34853,-27.53557)">
- <rect
- rx="15.307091"
- ry="12.692303"
- y="192.00233"
- x="258.31146"
- height="299.99988"
- width="495.71429"
- id="rect2067"
- style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.2674253;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <flowRoot
- id="flowRoot2954"
- xml:space="preserve"
- transform="matrix(1.365843,0,0,1,-103.2086,0)"><flowRegion
- id="flowRegion2956"><rect
- y="212.66591"
- x="281.42856"
- height="61.42857"
- width="170"
- id="rect2958" /></flowRegion><flowPara
- id="flowPara2960">Calculator</flowPara></flowRoot> </g>
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect2988"
- width="115.66247"
- height="191.57716"
- x="339.91632"
- y="262.1673"
- rx="6.9961648"
- ry="15.892869" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2966"
- transform="translate(79.61125,62.65764)"><flowRegion
- id="flowRegion2968"><rect
- id="rect2970"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara2972">Calculator</flowPara><flowPara
- id="flowPara1895">Service</flowPara><flowPara
- id="flowPara1897">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
- id="path3017" />
- <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
- id="path3019" />
- <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
- id="path1883" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1885"
- transform="translate(-46.16225,128.7269)"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion
- id="flowRegion1887"><rect
- id="rect1889"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara
- id="flowPara1891">Calculator</flowPara><flowPara
- id="flowPara1893">Service</flowPara></flowRoot> <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1899"
- width="115.66247"
- height="70.148659"
- x="773.32635"
- y="331.87738"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1901"
- transform="translate(498.7355,125.2248)"><flowRegion
- id="flowRegion1903"><rect
- id="rect1905"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1907">Calculator</flowPara><flowPara
- id="flowPara1909">Service</flowPara><flowPara
- id="flowPara1911">RMI</flowPara><flowPara
- id="flowPara2004">Impl</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 567.77069,220.86752 L 630.65876,220.86752 L 642.09292,246.48812 L 628.75306,270.13795 L 567.77069,270.13795 L 582.06342,246.48812 L 567.77069,220.86752 z "
- id="path1913" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1965"
- transform="translate(161.0221,114.967)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1967"><rect
- id="rect1969"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1973">add</flowPara><flowPara
- id="flowPara1977">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
- id="path1979" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1981"
- transform="translate(160.6632,150.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1983"><rect
- id="rect1985"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1987">subtract</flowPara><flowPara
- id="flowPara1989">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
- id="path1991" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1993"
- transform="translate(161.3775,184.2583)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1995"><rect
- id="rect1997"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1999">multiply</flowPara><flowPara
- id="flowPara2001">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
- id="path2003" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2005"
- transform="translate(159.9489,215.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2007"><rect
- id="rect2009"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2011">divide</flowPara><flowPara
- id="flowPara2013">Service</flowPara></flowRoot> <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
- id="path2015" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
- id="path2017" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
- id="path2019" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
- id="path2021" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 292.85714,355.52305 L 330,354.80877"
- id="path2023" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1950"
- transform="translate(301.0221,17.10977)"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1952"><rect
- id="rect1954"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1958">Add</flowPara><flowPara
- id="flowPara1962">Reference</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 567.83889,304.45927 L 630.72696,304.45927 L 642.16112,330.07987 L 628.82126,353.7297 L 567.83889,353.7297 L 582.13162,330.07987 L 567.83889,304.45927 z "
- id="path1964" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1966"
- transform="translate(301.0903,100.7015)"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1968"><rect
- id="rect1970"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1972">Subtract</flowPara><flowPara
- id="flowPara1974">Reference</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 567.1246,382.31641 L 630.01267,382.31641 L 641.44683,407.93701 L 628.10697,431.58684 L 567.1246,431.58684 L 581.41733,407.93701 L 567.1246,382.31641 z "
- id="path1976" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1978"
- transform="translate(300.376,178.5587)"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1980"><rect
- id="rect1982"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1984">Multiply</flowPara><flowPara
- id="flowPara1986">Reference</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 569.98175,459.45927 L 632.86982,459.45927 L 644.30398,485.07987 L 630.96412,508.7297 L 569.98175,508.7297 L 584.27448,485.07987 L 569.98175,459.45927 z "
- id="path1988" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1990"
- transform="translate(303.2332,255.7015)"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1992"><rect
- id="rect1994"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1996">Divide</flowPara><flowPara
- id="flowPara1998">Reference</flowPara></flowRoot> <path
- sodipodi:type="arc"
- style="opacity:1;fill:#f19a9a;fill-opacity:1;stroke:#2e2424;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="path2000"
- sodipodi:cx="736.78571"
- sodipodi:cy="361.95163"
- sodipodi:rx="39.642857"
- sodipodi:ry="38.57143"
- d="M 758.87546,329.92324 A 39.642857,38.57143 0 1 1 757.94075,329.33134"
- sodipodi:start="5.3034219"
- sodipodi:end="11.558474"
- sodipodi:open="true"
- transform="translate(-22.42857,4.142857)" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2006"
- transform="translate(411.7392,139.0467)"><flowRegion
- id="flowRegion2008"><rect
- id="rect2010"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara2016">RMI</flowPara><flowPara
- id="flowPara2018">Registry</flowPara></flowRoot> <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 642.14286,246.23734 L 692.85714,333.3802"
- id="path2027" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 640.71429,330.52305 L 677.14286,350.52305"
- id="path2029" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 640.71429,408.3802 L 677.85714,382.66591"
- id="path2031" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 645,484.80877 L 693.57143,400.52305"
- id="path2033" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 753.57143,366.95163 L 773.57143,366.95163"
- id="path2035" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2037"
- transform="translate(385.3078,69.25256)"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2039"><rect
- id="rect2041"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2045">RMI</flowPara></flowRoot> <flowRoot
- xml:space="preserve"
- id="flowRoot2059"
- transform="translate(371.9396,116.0363)"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2061"><rect
- id="rect2063"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2065">RMI</flowPara></flowRoot> <flowRoot
- xml:space="preserve"
- id="flowRoot2067"
- transform="translate(366.9396,168.8935)"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2069"><rect
- id="rect2071"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2073">RMI</flowPara></flowRoot> <flowRoot
- xml:space="preserve"
- id="flowRoot2075"
- transform="translate(376.9396,209.6077)"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2077"><rect
- id="rect2079"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2081">RMI</flowPara></flowRoot> </g>
-</svg>
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/pom.xml b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/pom.xml
deleted file mode 100644
index 647ed5b80c..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/pom.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-calculator-rmi-reference</artifactId>
- <name>Apache Tuscany SCA Calculator RMI Reference Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java
deleted file mode 100644
index ec57a6a533..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the add service
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java
deleted file mode 100644
index 3ee36be233..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index 0bac3da45c..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 675350860e..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 835e4fda6d..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the divide service
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index db568cc762..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index 30e4e6a56a..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the subtract service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/resources/CalculatorRMIReference.composite b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/resources/CalculatorRMIReference.composite
deleted file mode 100644
index 17341b2a59..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/main/resources/CalculatorRMIReference.composite
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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="Calculator">
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService">
- <tuscany:binding.rmi uri="rmi://localhost:8099/CalculatorRMIService"/>
- </reference>
- <reference name="subtractService">
- <tuscany:binding.rmi uri="rmi://localhost:8099/CalculatorRMIService"/>
- </reference>
- <reference name="multiplyService">
- <tuscany:binding.rmi uri="rmi://localhost:8099/CalculatorRMIService"/>
- </reference>
- <reference name="divideService">
- <tuscany:binding.rmi uri="rmi://localhost:8099/CalculatorRMIService"/>
- </reference>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java
deleted file mode 100644
index b7aa70f122..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIServiceImpl.java
deleted file mode 100644
index d8ded42cb2..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIServiceImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-
-
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorRMIServiceImpl extends UnicastRemoteObject implements CalculatorService {
-
- private static final long serialVersionUID = -1543948944662001428L;
-
- public CalculatorRMIServiceImpl() throws RemoteException {
- super();
- }
-
- public double add(double n1, double n2) throws RemoteException {
- return n1 + n2;
- }
-
- public double subtract(double n1, double n2) {
- return n1 - n2;
- }
-
- public double multiply(double n1, double n2) {
- return n1 * n2;
- }
-
- public double divide(double n1, double n2) {
- return n1 / n2;
- }
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/README b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/README
deleted file mode 100644
index 144881134b..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/README
+++ /dev/null
@@ -1,147 +0,0 @@
-Calculator RMI Service Sample
-=============================
-
-This sample illustrates the use of Tuscany RMI Binding to expose component
-services as Java RMI Services. It also demonstrates how a simple Java RMI
-Client application invokes the SCA Application's services exposed as RMI
-Services.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-If you just want to run it to see what happens open a command prompt, navigate
-to this sample directory and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator-rmi-service.jar calculator.CalculatorServer
-
-and on *nix do
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator-rmi-service.jar calculator.CalculatorServer
-
-Now you have the server running you need to open another command prompt, navigate
-to the calculator-rmi-reference sample directory and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-calculator-rmi-reference.jar calculator.CalculatorClient
-
-and on *nix do
-
-java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-calculator-rmi-reference.jar calculator.CalculatorClient
-
-
-Sample Overview
----------------
-This sample extends the calculator sample by replacing the local service
-binding with an RMI binding. SO a java client can call the service exposed
-by the SCA application using an RMI client.
-
-This sample adds a number of classes to the basic calculator sample:
-
-calculator-rmi-service/
- src/
- main/
- java/
- calculator/
- CalculatorService.java - as calculator sample
- CalculatorServiceImpl.java
- AddService.java - as calculator sample
- AddServiceImpl.java
- SubtractService.java - as calculator sample
- SubtractServiceImpl.java
- MultiplyService.java - as calculator sample
- MultiplyServiceImpl.java
- DivideService.java - as calculator sample
- DivideServiceImpl.java
- CalculatorClient.java - (Not currently used) Uses the
- java naming service to
- look up the Calculator RMI service.
- It then calls add, subtract, multiple
- and divide methods on the service
- CalculatorServer.java - starts the SCA Runtime and deploys
- the CalculatorRMIServer.composite.
- In doing this the SCA RMI binding
- acts to expose the CalculatorService
- over RMI.
- resources/
- CalculatorRMIServer.composite - the SCA assembly for this sample
- test/
- java/
- calculator/
- CalculatorRMIServerTestCase.java - JUnit test case
- calculator-rmi-service.png - a pictorial representation of the
- .composite file
- build.xml - the Ant build file for the server
- pom.xml - the Maven build file
-
-Note. As this test creates and uses local network connections you may need to
-configure your firewall, if you are running one, to allow the test to run
-successfully.
-
-Building And Running The Sample Using Ant
------------------------------------------
-With the binary distribution the sample can be built and run using Ant. Two
-build files are used to support client and server functions.
-
-The server starts the SCA runtime and loads the SCA calculator application
-which exposes an RMI service. Start a new console and use the following
-commands.
-
-cd calculator-rmi-service
-ant compile
-ant run
-
-This will run up the server and display the following.
-
-run:
- [java] Starting of the SCA Calculator Application exposed as RMI Services...
- [java] ...Press Enter to Exit...
-
-The client is very similar to the calculator sample
-
-It locates the RMI service that the SCA runtime is exposing and calls each of
-the calculator operations. Start a new console and use the following commands.
-
-cd calculator-rmi-reference
-ant compile
-ant run
-
-You should see the following output from the run target.
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
-
-If you now return to the console window running the server and press enter the
-server should stop.
-
-Building And Running The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd calculator-rmi-service
-mvn
-
-You should see the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running calculator.CalculatorRMIServerTestCase
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.819 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/build.xml b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/build.xml
deleted file mode 100644
index 6318d07eae..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/build.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<project name="binding-rmi-calculator-service" default="run">
-
- <property name="jar.name" value="sample-calculator-rmi-service.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>
- <pathelement location="../../modules/tuscany-sca-api-2.0-M1.jar"/>
- <pathelement location="../../modules/tuscany-node-api-2.0-M1.jar"/>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${jar.name}" basedir="target/classes">
- </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="target/${jar.name}"/>
- </java>
- </target>
-
- <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="-config"/>
- <arg value="../../features/configuration"/>
- <arg value="target/${jar.name}"/>
- </java>
- </target>
-
-
-</project>
-
-
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/calculator-rmi-service.png b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/calculator-rmi-service.png
deleted file mode 100644
index 574f5eb14b..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/calculator-rmi-service.png
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/calculator-rmi-service.svg b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/calculator-rmi-service.svg
deleted file mode 100644
index 9253110f98..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/calculator-rmi-service.svg
+++ /dev/null
@@ -1,330 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="1052.3622"
- height="744.09448"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator-rmi-service"
- sodipodi:docname="calculator-rmi-service.svg"
- version="1.0"
- inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator-rmi-service\calculator-rmi-service.png"
- inkscape:export-xdpi="52.84"
- inkscape:export-ydpi="52.84">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="471.80491"
- inkscape:cy="378.84265"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- inkscape:window-width="1054"
- inkscape:window-height="721"
- inkscape:window-x="186"
- inkscape:window-y="165" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1">
- <g
- id="g2997"
- transform="matrix(1,0,0,1.144214,0,-27.53557)">
- <rect
- rx="15.307091"
- ry="12.692303"
- y="192.00233"
- x="258.31146"
- height="299.99988"
- width="495.71429"
- id="rect2067"
- style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <flowRoot
- id="flowRoot2954"
- xml:space="preserve"><flowRegion
- id="flowRegion2956"><rect
- y="212.66591"
- x="281.42856"
- height="61.42857"
- width="170"
- id="rect2958" /></flowRegion><flowPara
- id="flowPara2960">Calculator</flowPara></flowRoot> </g>
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect2988"
- width="115.66247"
- height="191.57716"
- x="339.91632"
- y="262.1673"
- rx="6.9961648"
- ry="15.892869" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2966"
- transform="translate(79.61125,62.65764)"><flowRegion
- id="flowRegion2968"><rect
- id="rect2970"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara2972">Calculator</flowPara><flowPara
- id="flowPara1895">Service</flowPara><flowPara
- id="flowPara1897">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
- id="path3017" />
- <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
- id="path3019" />
- <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
- id="path1883" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1885"
- transform="translate(-46.16225,128.7269)"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1887"><rect
- id="rect1889"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1891">Calculator</flowPara><flowPara
- id="flowPara1893">Service</flowPara><flowPara
- id="flowPara1950">(RMI)</flowPara></flowRoot> <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1899"
- width="115.66247"
- height="70.148659"
- x="594.75488"
- y="209.73451"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1901"
- transform="translate(334.4498,10.22481)"><flowRegion
- id="flowRegion1903"><rect
- id="rect1905"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1907">Add</flowPara><flowPara
- id="flowPara1909">Service</flowPara><flowPara
- id="flowPara1911">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z "
- id="path1913" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1917"
- width="115.66247"
- height="70.148659"
- x="594.06543"
- y="292.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1919"
- transform="translate(333.7604,93.08188)"><flowRegion
- id="flowRegion1921"><rect
- id="rect1923"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1925">Subtract</flowPara><flowPara
- id="flowPara1927">Service</flowPara><flowPara
- id="flowPara1929">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z "
- id="path1931" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1933"
- width="115.66247"
- height="70.148659"
- x="594.77979"
- y="371.87729"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1935"
- transform="translate(334.4747,172.3676)"><flowRegion
- id="flowRegion1937"><rect
- id="rect1939"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1941">Multiply</flowPara><flowPara
- id="flowPara1943">Service</flowPara><flowPara
- id="flowPara1945">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z "
- id="path1947" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1949"
- width="115.66247"
- height="70.148659"
- x="596.20831"
- y="452.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1951"
- transform="translate(335.9032,253.0819)"><flowRegion
- id="flowRegion1953"><rect
- id="rect1955"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1957">Divide</flowPara><flowPara
- id="flowPara1959">Service</flowPara><flowPara
- id="flowPara1961">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z "
- id="path1963" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1965"
- transform="translate(161.0221,114.967)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1967"><rect
- id="rect1969"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1973">add</flowPara><flowPara
- id="flowPara1977">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
- id="path1979" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1981"
- transform="translate(160.6632,150.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1983"><rect
- id="rect1985"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1987">subtract</flowPara><flowPara
- id="flowPara1989">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
- id="path1991" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1993"
- transform="translate(161.3775,184.2583)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1995"><rect
- id="rect1997"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1999">multiply</flowPara><flowPara
- id="flowPara2001">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
- id="path2003" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2005"
- transform="translate(159.9489,215.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2007"><rect
- id="rect2009"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2011">divide</flowPara><flowPara
- id="flowPara2013">Service</flowPara></flowRoot> <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
- id="path2015" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
- id="path2017" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
- id="path2019" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
- id="path2021" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 292.85714,355.52305 L 330,354.80877"
- id="path2023" />
- </g>
-</svg>
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/pom.xml b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/pom.xml
deleted file mode 100644
index 835672f247..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-calculator-rmi-service</artifactId>
- <name>Apache Tuscany SCA Calculator RMI Service Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/AddService.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/AddService.java
deleted file mode 100644
index ec57a6a533..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the add service
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java
deleted file mode 100644
index e9c635e3c8..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorClient.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorClient.java
deleted file mode 100644
index 2b99485b68..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorClient.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package calculator;
-
-import java.rmi.Naming;
-
-/**
- * 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 {
- CalculatorService calculatorService = (CalculatorService)Naming.lookup("//localhost:8099/CalculatorRMIService");
-
- // Calculate
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java
deleted file mode 100644
index ffa40d0234..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index b0a46b6dd0..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 675350860e..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 835e4fda6d..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the divide service
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index 8c33862f6d..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index db568cc762..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index c7fbc73c00..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index 30e4e6a56a..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the subtract service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 1a7f145ad8..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/resources/CalculatorRMIServer.composite b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/resources/CalculatorRMIServer.composite
deleted file mode 100644
index c1a15e9107..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/resources/CalculatorRMIServer.composite
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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="Calculator">
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <service name="CalculatorService">
- <interface.java interface="calculator.CalculatorService"/>
- <tuscany:binding.rmi uri="rmi://localhost:8099/CalculatorRMIService"/>
- </service>
- <reference name="addService" target="AddServiceComponent"></reference>
- <reference name="subtractService" target="SubtractServiceComponent"></reference>
- <reference name="multiplyService" target="MultiplyServiceComponent"></reference>
- <reference name="divideService" target="DivideServiceComponent"></reference>
- </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/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 8b60ae590c..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- xmlns:sample="http://sample">
- <deployable composite="sample:Calculator"/>
-</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java b/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java
deleted file mode 100644
index eb824679a8..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator/README b/tags/java/sca/2.0-M1/samples/calculator/README
deleted file mode 100644
index 56c22d9c89..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/README
+++ /dev/null
@@ -1,97 +0,0 @@
-Calculator Sample
-=================
-This sample implements a simple calculator using SCA components.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-If you just want to run it to see what happens open a command prompt, navigate
-to this sample directory and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator.jar calculator.CalculatorClient
-
-and on *nix do
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator.jar calculator.CalculatorClient
-
-Sample Overview
----------------
-The sample provides a single calculator service with a default SCA (java)
-binding. The CalculatorClient exercises this interface by calling add,
-subtract, multiply and divide operations. This results in messages passing to
-the appropriate components in the composite across the local wires.
-
-calculator/
- src/
- main/
- java/
- calculator/
- CalculatorService.java - the first component, calls +-/* as
- appropriate
- CalculatorServiceImpl.java
- AddService.java - adds two numbers
- AddServiceImpl.java
- SubtractService.java - subtracts one number from another
- SubtractServiceImpl.java
- MultiplyService.java - multiplies two numbers
- MultiplyServiceImpl.java
- DivideService.java - divides one number by another
- DivideServiceImpl.java
- CalculatorClient.java - starts the SCA Runtime and
- deploys the Calculator.composite.
- It then calls the deployed Calculator
- Components services
- resources/
- Calculator.composite - the SCA assembly for this sample
- test/
- java/
- calculator/
- CalculatorTestCase.java - JUnit test case
- calculator.png - a pictorial representation of the sample
- .composite file
- build.xml - the Ant build file
- pom.xml - the Maven build file
-
-Building And Running The Sample Using Ant
------------------------------------------
-With the binary distribution the sample can be built and run using Ant as
-follows
-
-cd calculator
-ant compile
-ant run
-
-You should see the following output from the run target.
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
-
-Building And Running The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd calculator
-mvn
-
-You should see the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running calculator.CalculatorTestCase
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
diff --git a/tags/java/sca/2.0-M1/samples/calculator/build.xml b/tags/java/sca/2.0-M1/samples/calculator/build.xml
deleted file mode 100644
index 8d52a87049..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/build.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<project name="calculator" default="compile">
-
- <property name="jar.name" value="sample-calculator.jar" />
- <property name="main.class" value="calculator.CalculatorClient" />
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java" destdir="target/classes" debug="on" source="1.5" target="1.5">
- <classpath>
- <pathelement location="../../modules/tuscany-sca-api-2.0-M1.jar"/>
- <pathelement location="../../modules/tuscany-node-api-2.0-M1.jar"/>
- </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="init">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- <mkdir dir="target/classes"/>
- </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>
-
-</project>
-
-
diff --git a/tags/java/sca/2.0-M1/samples/calculator/calculator.png b/tags/java/sca/2.0-M1/samples/calculator/calculator.png
deleted file mode 100644
index 995a57b1fd..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/calculator.png
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/samples/calculator/calculator.svg b/tags/java/sca/2.0-M1/samples/calculator/calculator.svg
deleted file mode 100644
index 0615925c50..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/calculator.svg
+++ /dev/null
@@ -1,329 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="1052.3622"
- height="744.09448"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator"
- sodipodi:docname="calculator.svg"
- version="1.0"
- inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator\calculator.png"
- inkscape:export-xdpi="52.84"
- inkscape:export-ydpi="52.84">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="471.80491"
- inkscape:cy="378.84265"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- inkscape:window-width="1054"
- inkscape:window-height="721"
- inkscape:window-x="59"
- inkscape:window-y="79" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1">
- <g
- id="g2997"
- transform="matrix(1,0,0,1.144214,0,-27.53557)">
- <rect
- rx="15.307091"
- ry="12.692303"
- y="192.00233"
- x="258.31146"
- height="299.99988"
- width="495.71429"
- id="rect2067"
- style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <flowRoot
- id="flowRoot2954"
- xml:space="preserve"><flowRegion
- id="flowRegion2956"><rect
- y="212.66591"
- x="281.42856"
- height="61.42857"
- width="170"
- id="rect2958" /></flowRegion><flowPara
- id="flowPara2960">Calculator</flowPara></flowRoot> </g>
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect2988"
- width="115.66247"
- height="191.57716"
- x="339.91632"
- y="262.1673"
- rx="6.9961648"
- ry="15.892869" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2966"
- transform="translate(79.61125,62.65764)"><flowRegion
- id="flowRegion2968"><rect
- id="rect2970"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara2972">Calculator</flowPara><flowPara
- id="flowPara1895">Service</flowPara><flowPara
- id="flowPara1897">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
- id="path3017" />
- <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
- id="path3019" />
- <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
- id="path1883" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1885"
- transform="translate(-46.16225,128.7269)"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion
- id="flowRegion1887"><rect
- id="rect1889"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara
- id="flowPara1891">Calculator</flowPara><flowPara
- id="flowPara1893">Service</flowPara></flowRoot> <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1899"
- width="115.66247"
- height="70.148659"
- x="594.75488"
- y="209.73451"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1901"
- transform="translate(334.4498,10.22481)"><flowRegion
- id="flowRegion1903"><rect
- id="rect1905"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1907">Add</flowPara><flowPara
- id="flowPara1909">Service</flowPara><flowPara
- id="flowPara1911">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z "
- id="path1913" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1917"
- width="115.66247"
- height="70.148659"
- x="594.06543"
- y="292.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1919"
- transform="translate(333.7604,93.08188)"><flowRegion
- id="flowRegion1921"><rect
- id="rect1923"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1925">Subtract</flowPara><flowPara
- id="flowPara1927">Service</flowPara><flowPara
- id="flowPara1929">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z "
- id="path1931" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1933"
- width="115.66247"
- height="70.148659"
- x="594.77979"
- y="371.87729"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1935"
- transform="translate(334.4747,172.3676)"><flowRegion
- id="flowRegion1937"><rect
- id="rect1939"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1941">Multiply</flowPara><flowPara
- id="flowPara1943">Service</flowPara><flowPara
- id="flowPara1945">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z "
- id="path1947" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1949"
- width="115.66247"
- height="70.148659"
- x="596.20831"
- y="452.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1951"
- transform="translate(335.9032,253.0819)"><flowRegion
- id="flowRegion1953"><rect
- id="rect1955"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1957">Divide</flowPara><flowPara
- id="flowPara1959">Service</flowPara><flowPara
- id="flowPara1961">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z "
- id="path1963" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1965"
- transform="translate(161.0221,114.967)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1967"><rect
- id="rect1969"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1973">add</flowPara><flowPara
- id="flowPara1977">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
- id="path1979" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1981"
- transform="translate(160.6632,150.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1983"><rect
- id="rect1985"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1987">subtract</flowPara><flowPara
- id="flowPara1989">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
- id="path1991" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1993"
- transform="translate(161.3775,184.2583)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1995"><rect
- id="rect1997"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1999">multiply</flowPara><flowPara
- id="flowPara2001">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
- id="path2003" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2005"
- transform="translate(159.9489,215.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2007"><rect
- id="rect2009"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2011">divide</flowPara><flowPara
- id="flowPara2013">Service</flowPara></flowRoot> <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
- id="path2015" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
- id="path2017" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
- id="path2019" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
- id="path2021" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 292.85714,355.52305 L 330,354.80877"
- id="path2023" />
- </g>
-</svg>
diff --git a/tags/java/sca/2.0-M1/samples/calculator/pom.xml b/tags/java/sca/2.0-M1/samples/calculator/pom.xml
deleted file mode 100644
index 2dec0fe89d..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/pom.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-calculator</artifactId>
- <name>Apache Tuscany SCA Calculator Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/AddService.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/AddService.java
deleted file mode 100644
index 188451ebac..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The Add service interface
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 7ca8fb04b5..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorClient.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorClient.java
deleted file mode 100644
index 03fc56ceb3..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorClient.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package calculator;
-
-import org.apache.tuscany.sca.node.Client;
-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 {
-
- Node node = NodeFactory.newInstance().createNode();
-
- node.start();
-
- CalculatorService calculatorService = ((Client)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/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index 031fa8b912..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-
-/**
- * The Calculator service interface.
- */
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 17fad7de6b..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/DivideService.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 30d248208b..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index 1323edf55a..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605938..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index 91b803bc9e..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/SubtractService.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index bf0d1882b6..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 58cc4a3547..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/calculator/src/main/resources/Calculator.composite b/tags/java/sca/2.0-M1/samples/calculator/src/main/resources/Calculator.composite
deleted file mode 100644
index 90872041b0..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/resources/Calculator.composite
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- 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/tags/java/sca/2.0-M1/samples/calculator/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/2.0-M1/samples/calculator/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 8b60ae590c..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- xmlns:sample="http://sample">
- <deployable composite="sample:Calculator"/>
-</contribution> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/samples/calculator/src/test/java/calculator/CalculatorTestCase.java b/tags/java/sca/2.0-M1/samples/calculator/src/test/java/calculator/CalculatorTestCase.java
deleted file mode 100644
index 27a424b1cc..0000000000
--- a/tags/java/sca/2.0-M1/samples/calculator/src/test/java/calculator/CalculatorTestCase.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import static org.junit.Assert.assertEquals;
-
-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 org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * This shows how to test the Calculator service component.
- */
-@Scope("COMPOSITE") @EagerInit
-public class CalculatorTestCase{
- private static Node node;
- private static CalculatorService calculatorService;
-
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- NodeFactory factory = NodeFactory.newInstance();
- String contribution = ContributionLocationHelper.getContributionLocation(CalculatorClient.class);
- node = factory.createNode("Calculator.composite", new Contribution("calculator", contribution));
- node.start();
-
- calculatorService = ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- node.stop();
- }
-
- @Test
- public void testCalculator() throws Exception {
- // Calculate
- assertEquals(calculatorService.add(3, 2), 5.0, 0);
- assertEquals(calculatorService.subtract(3, 2), 1.0, 0);
- assertEquals(calculatorService.multiply(3, 2), 6.0, 0);
- assertEquals(calculatorService.divide(3, 2), 1.5, 0);
- }
-}
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/README b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/README
deleted file mode 100644
index 28eccbdebb..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/README
+++ /dev/null
@@ -1,96 +0,0 @@
-Calculator Sample
-=================
-This sample implements a simple calculator using SCA components.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-If you just want to run it to see what happens open a command prompt, navigate
-to this sample directory and do:
-
-ant run
-
-OR if you don't have ant, on Windows do
-
-java -jar ..\..\features\tuscany-sca-equinox-manifest.jar -composite Calculator.composite -config ..\..\features\configuration\ -ttl 0 target\sample-implementation-java-calculator.jar
-and on *nix do
-
-java -jar ../../features/tuscany-sca-equinox-manifest.jar -composite Calculator.composite -config ../../features/configuration/ -ttl 0 target/sample-implementation-java-calculator.jar
-
-Sample Overview
----------------
-The sample provides a single calculator service with a default SCA (java)
-binding. The CalculatorClient exercises this interface by calling add,
-subtract, multiply and divide operations. This results in messages passing to
-the appropriate components in the composite across the local wires.
-
-calculator/
- src/
- main/
- java/
- calculator/
- CalculatorService.java - the first component, calls +-/* as
- appropriate
- CalculatorServiceImpl.java
- AddService.java - adds two numbers
- AddServiceImpl.java
- SubtractService.java - subtracts one number from another
- SubtractServiceImpl.java
- MultiplyService.java - multiplies two numbers
- MultiplyServiceImpl.java
- DivideService.java - divides one number by another
- DivideServiceImpl.java
- CalculatorClient.java - starts the SCA Runtime and
- deploys the Calculator.composite.
- It then calls the deployed Calculator
- Components services
- resources/
- Calculator.composite - the SCA assembly for this sample
- test/
- java/
- calculator/
- CalculatorTestCase.java - JUnit test case
- calculator.png - a pictorial representation of the sample
- .composite file
- build.xml - the Ant build file
- pom.xml - the Maven build file
-
-Building And Running The Sample Using Ant
------------------------------------------
-With the binary distribution the sample can be built and run using Ant as
-follows
-
-cd calculator
-ant compile
-ant run
-
-You should see the following output from the run target.
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
-
-Building And Running The Sample Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd calculator
-mvn
-
-You should see the following output from the test phase.
-
--------------------------------------------------------
- T E S T S
--------------------------------------------------------
-Running calculator.CalculatorTestCase
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec
-
-Results :
-
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-This shows that the Junit test cases have run successfully.
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/build.xml b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/build.xml
deleted file mode 100644
index 4bdd2cfd36..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/build.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<project name="implementation-java-calculator" default="run"> <!-- could dertmine the same name autmatically -->
-
- <property name="jar.name" value="sample-implementation-java-calculator.jar" />
-
- <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>
- <pathelement location="../../modules/tuscany-sca-api-2.0-M1.jar"/>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${jar.name}" basedir="target/classes"/>
- </target>
-
- <target name="run" depends="compile">
- <java classname="org.apache.tuscany.sca.launcher.LauncherMain"
- fork="true"
- inputstring="q"
- failonerror="true">
- <classpath>
- <pathelement location="../../bin/launcher.jar"/>
- </classpath>
- <arg value="target/${jar.name}"/>
- </java>
- </target>
-</project>
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/calculator.png b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/calculator.png
deleted file mode 100644
index 995a57b1fd..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/calculator.png
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/calculator.svg b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/calculator.svg
deleted file mode 100644
index af34f07e04..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/calculator.svg
+++ /dev/null
@@ -1,329 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="1052.3622"
- height="744.09448"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator"
- sodipodi:docname="calculator.svg"
- version="1.0"
- inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator\calculator.png"
- inkscape:export-xdpi="52.84"
- inkscape:export-ydpi="52.84">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="471.80491"
- inkscape:cy="378.84265"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- inkscape:window-width="1054"
- inkscape:window-height="721"
- inkscape:window-x="59"
- inkscape:window-y="79" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1">
- <g
- id="g2997"
- transform="matrix(1,0,0,1.144214,0,-27.53557)">
- <rect
- rx="15.307091"
- ry="12.692303"
- y="192.00233"
- x="258.31146"
- height="299.99988"
- width="495.71429"
- id="rect2067"
- style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
- <flowRoot
- id="flowRoot2954"
- xml:space="preserve"><flowRegion
- id="flowRegion2956"><rect
- y="212.66591"
- x="281.42856"
- height="61.42857"
- width="170"
- id="rect2958" /></flowRegion><flowPara
- id="flowPara2960">Calculator</flowPara></flowRoot> </g>
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect2988"
- width="115.66247"
- height="191.57716"
- x="339.91632"
- y="262.1673"
- rx="6.9961648"
- ry="15.892869" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2966"
- transform="translate(79.61125,62.65764)"><flowRegion
- id="flowRegion2968"><rect
- id="rect2970"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara2972">Calculator</flowPara><flowPara
- id="flowPara1895">Service</flowPara><flowPara
- id="flowPara1897">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
- id="path3017" />
- <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
- id="path3019" />
- <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
- id="path1883" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1885"
- transform="translate(-46.16225,128.7269)"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion
- id="flowRegion1887"><rect
- id="rect1889"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara
- id="flowPara1891">Calculator</flowPara><flowPara
- id="flowPara1893">Service</flowPara></flowRoot> <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1899"
- width="115.66247"
- height="70.148659"
- x="594.75488"
- y="209.73451"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1901"
- transform="translate(334.4498,10.22481)"><flowRegion
- id="flowRegion1903"><rect
- id="rect1905"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1907">Add</flowPara><flowPara
- id="flowPara1909">Service</flowPara><flowPara
- id="flowPara1911">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z "
- id="path1913" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1917"
- width="115.66247"
- height="70.148659"
- x="594.06543"
- y="292.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1919"
- transform="translate(333.7604,93.08188)"><flowRegion
- id="flowRegion1921"><rect
- id="rect1923"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1925">Subtract</flowPara><flowPara
- id="flowPara1927">Service</flowPara><flowPara
- id="flowPara1929">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z "
- id="path1931" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1933"
- width="115.66247"
- height="70.148659"
- x="594.77979"
- y="371.87729"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1935"
- transform="translate(334.4747,172.3676)"><flowRegion
- id="flowRegion1937"><rect
- id="rect1939"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1941">Multiply</flowPara><flowPara
- id="flowPara1943">Service</flowPara><flowPara
- id="flowPara1945">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z "
- id="path1947" />
- <rect
- style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- id="rect1949"
- width="115.66247"
- height="70.148659"
- x="596.20831"
- y="452.59158"
- rx="6.9961648"
- ry="5.8193965" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1951"
- transform="translate(335.9032,253.0819)"><flowRegion
- id="flowRegion1953"><rect
- id="rect1955"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591" /></flowRegion><flowPara
- id="flowPara1957">Divide</flowPara><flowPara
- id="flowPara1959">Service</flowPara><flowPara
- id="flowPara1961">Component</flowPara></flowRoot> <path
- style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z "
- id="path1963" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1965"
- transform="translate(161.0221,114.967)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1967"><rect
- id="rect1969"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1973">add</flowPara><flowPara
- id="flowPara1977">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
- id="path1979" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1981"
- transform="translate(160.6632,150.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1983"><rect
- id="rect1985"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1987">subtract</flowPara><flowPara
- id="flowPara1989">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
- id="path1991" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot1993"
- transform="translate(161.3775,184.2583)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion1995"><rect
- id="rect1997"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara1999">multiply</flowPara><flowPara
- id="flowPara2001">Service</flowPara></flowRoot> <path
- style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
- id="path2003" />
- <flowRoot
- xml:space="preserve"
- id="flowRoot2005"
- transform="translate(159.9489,215.6868)"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion2007"><rect
- id="rect2009"
- width="170"
- height="61.42857"
- x="281.42856"
- y="212.66591"
- style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara2011">divide</flowPara><flowPara
- id="flowPara2013">Service</flowPara></flowRoot> <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
- id="path2015" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
- id="path2017" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
- id="path2019" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
- id="path2021" />
- <path
- style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 292.85714,355.52305 L 330,354.80877"
- id="path2023" />
- </g>
-</svg>
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/pom.xml b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/pom.xml
deleted file mode 100644
index b57f3f513c..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/pom.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-implementation-java-calculator</artifactId>
- <name>Apache Tuscany SCA Implementation Java Calculator Sample</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-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-M1</version>
- </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/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/AddService.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/AddService.java
deleted file mode 100644
index 188451ebac..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The Add service interface
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/AddServiceImpl.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 7ca8fb04b5..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorClient.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorClient.java
deleted file mode 100644
index 84c98d7f70..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorClient.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package calculator;
-
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-@Scope("COMPOSITE") @EagerInit
-public class CalculatorClient {
-
- private CalculatorService calculatorService;
-
- @Reference
- public void setCalculatorService(CalculatorService calculatorService) {
- this.calculatorService = calculatorService;
- }
-
- @Init
- public void calculate() {
-
- // Calculate
- System.out.println("SCA API ClassLoader: " + print(Reference.class.getClassLoader()));
- 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));
- }
-
- private static String print(ClassLoader cl) {
- StringBuffer buf = new StringBuffer();
- for (; cl != null;) {
- buf.append(cl.toString());
- buf.append(' ');
- cl = cl.getParent();
- }
- return buf.toString();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorService.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index 031fa8b912..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-
-/**
- * The Calculator service interface.
- */
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 17fad7de6b..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/DivideService.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 30d248208b..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/DivideServiceImpl.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index 1323edf55a..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/MultiplyService.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605938..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/MultiplyServiceImpl.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index 91b803bc9e..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/SubtractService.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index bf0d1882b6..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/SubtractServiceImpl.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 58cc4a3547..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import 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/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/resources/Calculator.composite b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/resources/Calculator.composite
deleted file mode 100644
index 913081b9be..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/main/resources/Calculator.composite
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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"
- 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>
-
- <component name="CalculatorClient">
- <implementation.java class="calculator.CalculatorClient"/>
- <reference name="calculatorService" target="CalculatorServiceComponent" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/test/java/calculator/CalculatorTestCase.java b/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/test/java/calculator/CalculatorTestCase.java
deleted file mode 100644
index 461c970373..0000000000
--- a/tags/java/sca/2.0-M1/samples/implementation-java-calculator/src/test/java/calculator/CalculatorTestCase.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-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;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This shows how to test the Calculator composition.
- */
-public class CalculatorTestCase {
-
- private static NodeLauncher launcher;
- private static Node node;
- private static String status = "Sample Success";
-
- public static void main(String[] args) throws Exception {
- setUpBeforeClass();
- tearDownAfterClass();
- }
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- launcher = NodeLauncher.newInstance();
- String location = ContributionLocationHelper.getContributionLocation(CalculatorClient.class);
- node = launcher.createNode("Calculator.composite", new Contribution("test", location));
-
- try {
- node.start();
- } catch (Exception ex) {
- status = ex.toString();
- System.out.println(status);
- }
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (node != null) {
- node.stop();
- node.destroy();
- }
- if (launcher != null) {
- launcher.destroy();
- }
- }
-
- @Test
- public void testSample() throws Exception {
- Assert.assertEquals("Sample Success", status);
- }
-}
diff --git a/tags/java/sca/2.0-M1/samples/logging.properties b/tags/java/sca/2.0-M1/samples/logging.properties
deleted file mode 100644
index cf452e7812..0000000000
--- a/tags/java/sca/2.0-M1/samples/logging.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-handlers= java.util.logging.ConsoleHandler
-
-.level = INFO
-
-java.util.logging.ConsoleHandler.level = FINE
-java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
-
-org.apache.tuscany.sca.level = INFO
diff --git a/tags/java/sca/2.0-M1/samples/pom.xml b/tags/java/sca/2.0-M1/samples/pom.xml
deleted file mode 100644
index 1ce8a11b65..0000000000
--- a/tags/java/sca/2.0-M1/samples/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-samples</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Samples</name>
-
- <repositories>
- <repository>
- <id>apache.incubator</id>
- <url>http://people.apache.org/repo/m2-incubating-repository</url>
- </repository>
- </repositories>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>calculator</module>
- <module>calculator-equinox</module>
- <module>calculator-osgi</module>
- <module>calculator-rmi-reference</module>
- <module>calculator-rmi-service</module>
-
- <module>implementation-java-calculator</module>
- <module>binding-ws-calculator</module>
- <!-- module>host-webapp-calculator</module -->
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/tags/java/sca/2.0-M1/stest/pom.xml b/tags/java/sca/2.0-M1/stest/pom.xml
deleted file mode 100644
index bc9ad46870..0000000000
--- a/tags/java/sca/2.0-M1/stest/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-stests</artifactId>
- <packaging>pom</packaging>
- <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>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>sampleTest</module>
- </modules>
- </profile>
- <profile>
- <id>old</id>
- <modules>
- <module>binding-echo</module>
- </modules>
- </profile>
- </profiles>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/pom.xml b/tags/java/sca/2.0-M1/stest/sampleTest/pom.xml
deleted file mode 100644
index c4cc464116..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/pom.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-stests</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>stest-sampleTest</artifactId>
- <name>Apache Tuscany SCA Specification Sample Testcase</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-node-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility-equinox</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-xml</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</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/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0001_Client.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0001_Client.java
deleted file mode 100644
index bbe76aef62..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0001_Client.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import org.oasisopen.sca.annotation.Service;
-
-import test.TestInvocation;
-
-/**
- * Basic test initiation class
- * @author MikeEdwards
- *
- */
-@Service(TestInvocation.class)
-public class ASM_0001_Client implements TestInvocation {
-
- private String testName = "ASM_0001";
-
- /**
- * This method is offered as a service and is
- * invoked by the test client to run the test
- */
- public String invokeTest( String input ) throws TestException {
- String response = null;
-
- response = runTest( input );
-
- return response;
- } // end method invokeTest
-
- /**
- * This method actually runs the test - and is subclassed by classes that run other tests.
- * @param input - an input string
- * @return - a response string = "ASM_0001 inputString invoked ok";
- *
- */
- public String runTest( String input ){
- String response = null;
-
- response = testName + " " + input + " invoked ok";
-
- return response;
- } // end method runTest
-
- /**
- * Sets the name of the test
- * @param name - the test name
- */
- protected void setTestName( String name ) {
- testName = name;
- }
-
-} //
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0002_Client.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0002_Client.java
deleted file mode 100644
index 156f93bb1e..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0002_Client.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Property;
-
-import test.TestInvocation;
-
-/**
- * Test initiation class with a single reference of multiplicity 1..1
- * @author MikeEdwards
- *
- */
-@Service(TestInvocation.class)
-public class ASM_0002_Client implements TestInvocation {
-
- @Property
- public String testName = "ASM_xxxx";
-
- @Reference
- public Service1 reference1;
-
- /**
- * This method is offered as a service and is
- * invoked by the test client to run the test
- */
- public String invokeTest( String input ) throws TestException {
- String response = null;
-
- try {
- response = runTest( input );
- } catch( Exception e ) {
- throw new TestException("Test service got an exception during execution: " + e.getClass().getName()+ " " + e.getMessage() );
- } // end try
- return response;
- } // end method invokeTest
-
- /**
- * This method actually runs the test - and is subclassed by classes that run other tests.
- * @param input - an input string
- * @return - a response string = "ASM_0001 inputString invoked ok";
- *
- */
- public String runTest( String input ){
- String response = null;
-
- String response1 = reference1.operation1(input);
-
- response = testName + " " + input + " " + response1;
-
- return response;
- } // end method runTest
-
- /**
- * Sets the name of the test
- * @param name - the test name
- */
- protected void setTestName( String name ) {
- testName = name;
- }
-
-} //
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0003_Client.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0003_Client.java
deleted file mode 100644
index 7a8369644f..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/ASM_0003_Client.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Property;
-
-import test.TestInvocation;
-
-import java.util.List;
-
-/**
- * Basic test initiation class
- * @author MikeEdwards
- *
- */
-@Service(TestInvocation.class)
-public class ASM_0003_Client implements TestInvocation {
-
- @Property
- public String testName = "ASM_xxxx";
-
- @Reference
- public List<Service1> reference1;
-
- /**
- * This method is offered as a service and is
- * invoked by the test client to run the test
- */
- public String invokeTest( String input ) throws TestException {
- String response = null;
-
- response = runTest( input );
-
- return response;
- } // end method invokeTest
-
- /**
- * This method actually runs the test - and is subclassed by classes that run other tests.
- * @param input - an input string
- * @return - a response string = "ASM_0001 inputString invoked ok";
- *
- */
- public String runTest( String input ){
- String response = "";
-
- for( Service1 reference : reference1 ) {
- response += reference.operation1(input);
- } // end for
-
- response = testName + " " + input + " " + response;
-
- return response;
- } // end method runTest
-
- /**
- * Sets the name of the test
- * @param name - the test name
- */
- protected void setTestName( String name ) {
- testName = name;
- }
-
-} //
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service1.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service1.java
deleted file mode 100644
index ad654e4a3f..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service1.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-// TODO: Need to change *ALL* annotations to org.oasisopen.xxxx
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * A test service interface
- * @author MikeEdwards
- *
- */
-@Remotable
-public interface Service1 {
-
- /**
- * Method for invoking testcase service
- * @param input - input parameter(s) as a String
- * @return - output data as a String
- */
- public String operation1( String input );
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service1Superset.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service1Superset.java
deleted file mode 100644
index 54a283a1a7..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service1Superset.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-/**
- * A superset of the basic test service interface
- * @author MikeEdwards
- *
- */
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface Service1Superset {
-
- /**
- * Method for invoking testcase service
- * @param input - input parameter(s) as a String
- * @return - output data as a String
- */
- public String operation1( String input );
-
- /**
- * A second method for invoking a testcase service
- * @param input - input parameter(s) as a String
- * @return - output data as a String
- */
- public String operation2( String input );
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service2.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service2.java
deleted file mode 100644
index 15bcb9481c..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/Service2.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-/**
- * A test service interface, designed to be incompatible with the Service1 interface
- * @author MikeEdwards
- *
- */
-public interface Service2 {
-
- /**
- * Method for invoking testcase service
- * @param input - input parameter(s) as a String
- * @return - output data as a String
- */
- public int operation2( int input );
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestException.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestException.java
deleted file mode 100644
index 6238a5c24b..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-/*
- * Exception thrown by SCA Test services
- */
-public class TestException extends Exception {
-
- /**
- * Required serialVersionUID field
- */
- private static final long serialVersionUID = -6978058912756564824L;
-
- public TestException() { super(); };
-
- public TestException( String msg ) { super( msg ); };
-
- public TestException( String msg, Throwable cause ) { super( msg, cause); };
-
- public TestException( Throwable cause ) { super( cause ); };
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestInvocation.class b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestInvocation.class
deleted file mode 100644
index 64e43c20c9..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestInvocation.class
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestInvocation.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestInvocation.java
deleted file mode 100644
index ee42e0fe4e..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/TestInvocation.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import javax.jws.WebService;
-import javax.jws.WebMethod;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Basic interface to invoke testcases
- * @author MikeEdwards
- *
- */
-@Remotable
-public interface TestInvocation {
-
- /**
- * Method for invoking testcase
- * @param input - input parameter(s) as a String
- * @return - output data as a String
- * @throws - a TestException is thrown in cases where the test service fails internally
- */
- @WebMethod
- public String invokeTest( String input ) throws TestException ;
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl.java
deleted file mode 100644
index ff81bd5d54..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import org.oasisopen.sca.annotation.*;
-
-/**
- * Simple Java component implementation for business interface Service1
- * @author MikeEdwards
- *
- */
-@Service(Service1.class)
-public class service1Impl implements Service1 {
-
- @Property
- public String serviceName = "service1";
-
- public String operation1(String input) {
- return serviceName + " operation1 invoked";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl2.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl2.java
deleted file mode 100644
index 367a92efac..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl2.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import org.oasisopen.sca.annotation.*;
-
-/**
- * Enhanced Java component implementation for business interface Service1,
- * where the implementation also has a single reference using the Service1
- * interface and which gets called when operation1 is invoked
- * @author MikeEdwards
- *
- */
-@Service(Service1.class)
-public class service1Impl2 implements Service1 {
-
- @Property
- public String serviceName = "service1";
- // Reference with an implied multiplicity of (1..1) since required=true is the default
- @Reference
- public Service1 reference1 = null;
-
- public String operation1(String input) {
- String result = reference1.operation1(input);
- return serviceName + " operation1 invoked" + " " + result;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl3.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl3.java
deleted file mode 100644
index 49021867c4..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl3.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import org.oasisopen.sca.annotation.*;
-
-/**
- * Enhanced Java component implementation for business interface Service1,
- * where the implementation also has a single reference using the Service1
- * interface with mutiplicity 1..n all of which and which get called when
- * operation1 is invoked
- * @author MikeEdwards
- *
- */
-@Service(Service1.class)
-public class service1Impl3 implements Service1 {
-
- @Property
- public String serviceName = "service1";
- // Required = true + an array -> multiplicity 1..n
- @Reference(required=true)
- public Service1[] reference1 = null;
-
- public String operation1(String input) {
- String result = "";
- // Call each of the references in the array, concatenating the results
- for( int i=0 ; i < reference1.length; i++ ) {
- result = result.concat( reference1[i].operation1(input) );
- } // end for
- return serviceName + " operation1 invoked" + " " + result;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl4.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl4.java
deleted file mode 100644
index bb0226ca79..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl4.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import org.oasisopen.sca.annotation.*;
-
-/**
- * Enhanced Java component implementation for business interface Service1,
- * where the implementation also has a single reference using the Service1
- * interface with multiplicity 0..n all of which and which get called when
- * operation1 is invoked
- * @author MikeEdwards
- *
- */
-@Service(Service1.class)
-public class service1Impl4 implements Service1 {
-
- @Property
- public String serviceName = "service1";
- // Required = false + an array -> multiplicity 0..n
- @Reference(required=false)
- public Service1[] reference1 = null;
-
- public String operation1(String input) {
- String result = serviceName + " operation1 invoked";
- // Call each of the references in the array, concatenating the results
- for( int i=0 ; i < reference1.length; i++ ) {
- result = result.concat(" ");
- result = result.concat( reference1[i].operation1(input) );
- } // end for
- return result;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl5.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl5.java
deleted file mode 100644
index a7f2145643..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1Impl5.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import org.oasisopen.sca.annotation.*;
-
-/**
- * Java component implementation for business interface Service1
- * - no references
- * - 3 properties
- * @author MikeEdwards
- *
- */
-@Service(Service1.class)
-public class service1Impl5 implements Service1 {
-
- @Property
- public String serviceName = "service1";
- @Property
- public String serviceData1;
- @Property
- public String serviceData2;
-
- public String operation1(String input) {
- return serviceName + " operation1 invoked" + serviceData1 + serviceData2;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1SupersetImpl.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1SupersetImpl.java
deleted file mode 100644
index e0bc3464f6..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service1SupersetImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import org.oasisopen.sca.annotation.*;
-
-/**
- * Simple Java component implementation for business interface Service1Superset
- * @author MikeEdwards
- *
- */
-@Service(Service1Superset.class)
-public class service1SupersetImpl implements Service1Superset {
-
- @Property
- public String serviceName = "service1";
-
- public String operation1(String input) {
- return serviceName + " operation1 invoked";
- }
-
- public String operation2(String input) {
- return serviceName + " operation2 invoked";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service2Impl.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service2Impl.java
deleted file mode 100644
index a05a74dc35..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/java/test/service2Impl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import org.oasisopen.sca.annotation.*;
-
-/**
- * Simple Java component implementation for business interface Service2
- * @author MikeEdwards
- *
- */
-@Service(Service2.class)
-public class service2Impl implements Service2 {
-
- @Property
- public String serviceName = "service1";
-
- public int operation2(int input) {
- return input+1;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient.wsdl b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient.wsdl
deleted file mode 100644
index f9475a016a..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient.wsdl
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Produced from the TestInvocation,java interface by running a service
- based on that interface in an SCA runtime using a Web services binding
-
- Mike Edwards, 6th January 2008
--->
-<wsdl:definitions name="TestInvocationService"
- targetNamespace="http://test/"
- xmlns:tns="http://test/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/">
- <wsdl:types>
- <xs:schema targetNamespace="http://test/" version="1.0" xmlns:tns="http://test/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:element name="TestException" type="tns:TestException"/>
- <xs:complexType name="TestException">
- <xs:sequence>
- <xs:element minOccurs="0" name="message" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:schema>
- <xs:schema attributeFormDefault="qualified" elementFormDefault="unqualified"
- targetNamespace="http://test/"
- xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:element name="invokeTest">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="invokeTestResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:schema>
- </wsdl:types>
- <wsdl:message name="invokeTest">
- <wsdl:part name="invokeTest" element="tns:invokeTest">
- </wsdl:part>
- </wsdl:message>
- <wsdl:message name="invokeTestResponse">
- <wsdl:part name="invokeTestResponse" element="tns:invokeTestResponse">
- </wsdl:part>
- </wsdl:message>
- <wsdl:message name="TestException">
- <wsdl:part name="TestException" element="tns:TestException">
- </wsdl:part>
- </wsdl:message>
- <wsdl:portType name="TestInvocation">
- <wsdl:operation name="invokeTest">
- <wsdl:input message="tns:invokeTest">
- </wsdl:input>
- <wsdl:output message="tns:invokeTestResponse">
- </wsdl:output>
- <wsdl:fault name="TestException" message="tns:TestException">
- </wsdl:fault>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="TestInvocationBinding" type="tns:TestInvocation">
- <SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="invokeTest">
- <SOAP:operation soapAction=""/>
- <wsdl:input>
- <SOAP:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <SOAP:body use="literal"/>
- </wsdl:output>
- <wsdl:fault name="TestException">
- <SOAP:fault name="TestException" use="literal"/>
- </wsdl:fault>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="TestInvocationService">
- <wsdl:port name="TestInvocationPort" binding="tns:TestInvocationBinding">
- <SOAP:address location="http://localhost:8080/TestClient"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient_0002.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient_0002.composite
deleted file mode 100644
index b36f01d5b1..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient_0002.composite
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestClient_0002">
-
- <service name="TestInvocation" promote="TestClient/TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- </service>
-
- <property name="testName" type="string"/>
-
- <component name="TestClient">
- <implementation.java class="test.ASM_0002_Client"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- </service>
- <reference name="reference1">
- <interface.java interface="test.Service1"/>
- </reference>
- <property name="testName" source="$testName"/>
- </component>
-
- <reference name="reference1" promote="TestClient/reference1">
- <interface.java interface="test.Service1"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient_0003.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient_0003.composite
deleted file mode 100644
index 1d474fe937..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestClient_0003.composite
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestClient_0003">
-
- <service name="TestInvocation" promote="TestClient/TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- </service>
-
- <property name="testName" type="string"/>
-
- <component name="TestClient">
- <implementation.java class="test.ASM_0003_Client"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- </service>
- <reference name="reference1">
- <interface.java interface="test.Service1"/>
- </reference>
- <property name="testName" source="$testName"/>
- </component>
-
- <reference name="reference1" promote="TestClient/reference1" multiplicity="1..n">
- <interface.java interface="test.Service1"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite1.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite1.composite
deleted file mode 100644
index b6f23cf979..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite1.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 simple composite which provides a single service and no references -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite1">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite10.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite10.composite
deleted file mode 100644
index 286790a1b9..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite10.composite
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- An example of a composite which has a single service and
- a single reference, but where the reference has a binding
- applied to it, with a target service identified -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite10">
-
- <service name="Service1" promote="Composite10Component1/Service1">
- <interface.java interface="test.Service1"/>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="Composite10Component1">
- <implementation.java class="test.service1Impl2"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
- <reference name="Reference1" promote="Composite10Component1/reference1">
- <interface.java interface="test.Service1"/>
- <binding.sca uri="TestComponent2/Service1"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite11.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite11.composite
deleted file mode 100644
index 3ab9a03978..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite11.composite
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- An example of a composite which has one component with a reference
- that is multiplicity 1..1 and which is both wired to a service of a
- second component in the same composite and is also promoted by a
- composite reference -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite11">
-
- <service name="Service1" promote="Composite11Component1/Service1">
- <interface.java interface="test.Service1"/>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="Composite11Component1">
- <implementation.java class="test.service1Impl2"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName" source="$serviceName"/>
- <!-- reference is multiplicity 1..1 -->
- <reference name="reference1" target="Composite11Component2/Service1">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="Composite11Component2">
- <implementation.java class="test.service1Impl"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">Composite11-C2</property>
- </component>
-
- <reference name="Reference1" promote="Composite11Component1/reference1">
- <interface.java interface="test.Service1"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite12.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite12.composite
deleted file mode 100644
index 0a734ee9f4..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite12.composite
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 simple composite which provides a single service and no references
- plus a property with a complex type -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TestComposite12">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <property name="complexType" type="test:ComplexType1"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl5"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName" source="$serviceName"/>
- <property name="serviceData1" source="$complexType/firstData"/>
- <property name="serviceData2" source="$complexType/secondData"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite13.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite13.composite
deleted file mode 100644
index f75d90e9db..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite13.composite
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 simple composite which provides a single service and no references
- plus a property with a complex type with a type which is an XSD global
- element -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TestComposite13">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <property name="complexType" element="test:globalElement1"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl5"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName" source="$serviceName"/>
- <property name="serviceData1" source="$complexType/firstData"/>
- <property name="serviceData2" source="$complexType/secondData"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite14.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite14.composite
deleted file mode 100644
index d995fe0461..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite14.composite
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 simple composite which provides a single service and no references
- plus a property with a simple type -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TestComposite14">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <property name="simpleType" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl5"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName" source="$serviceName"/>
- <property name="serviceData1" source="$simpleType"/>
- <property name="serviceData2" source="$simpleType"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite15.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite15.composite
deleted file mode 100644
index 49b167531c..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite15.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 simple composite which provides a single service and no references,
- where the service is configured with multiple explicit bindings -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite15">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- <binding.sca/>
- <binding.ws/>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite16.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite16.composite
deleted file mode 100644
index a7296c76e2..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite16.composite
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 composite which multiple <service/> subelements with the same name and no references -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite16">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <service name="Service2" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite17.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite17.composite
deleted file mode 100644
index fcec5d8b34..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite17.composite
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 composite which has a single service with a @promote attribute
- that does not reference the <service/> of a <component/> within the
- <composite/> and no references -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite17">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <service name="Service2" promote="SpuriousComponent/SpuriousService">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite18.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite18.composite
deleted file mode 100644
index 7d26ea850a..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite18.composite
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 composite which has a single service with a declared <interface/>
- that is a compatible subset of the interface of the component service
- declared in the @promote attribute -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite18">
-
- <service name="Service1" promote="TestComponent1/Service1Superset">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1SupersetImpl"/>
- <service name="Service1Superset">
- <interface.java interface="test.Service1Superset"></interface.java>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite2.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite2.composite
deleted file mode 100644
index 0ab8d35f66..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite2.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite2">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite3.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite3.composite
deleted file mode 100644
index cc91e1eeea..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite3.composite
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- An example of a composite which is invalid because it has two
- composite level references with the same @name attribute -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite3">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"/>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl2"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
- <reference name="Reference1" promote="TestComponent1/Reference">
- <interface.java interface="test.Service1"/>
- </reference>
-
- <reference name="Reference1" promote="TestComponent1/Reference">
- <interface.java interface="test.Service1"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite4.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite4.composite
deleted file mode 100644
index 4792ad35f3..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite4.composite
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- An example of a composite which has a single service and
- a single reference -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite4">
-
- <service name="Service1" promote="Composite4Component1/Service1">
- <interface.java interface="test.Service1"/>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="Composite4Component1">
- <implementation.java class="test.service1Impl2"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
- <reference name="Reference1" promote="Composite4Component1/reference1">
- <interface.java interface="test.Service1"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite5.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite5.composite
deleted file mode 100644
index 808f20727f..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite5.composite
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 offering a single service, with a modified interface
- type -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite5">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service2"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service2Impl"/>
- <service name="Service1">
- <interface.java interface="test.Service2"></interface.java>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite6.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite6.composite
deleted file mode 100644
index dc9ea75f3b..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite6.composite
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- An example of a composite which has a single service and
- a single reference with multiplicity 1..n -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite6">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"/>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl3"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName" source="$serviceName"/>
- <reference name="reference1" multiplicity="1..n">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <reference name="Reference1" promote="TestComponent1/reference1" multiplicity="1..n">
- <interface.java interface="test.Service1"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite7.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite7.composite
deleted file mode 100644
index 82a71288ff..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite7.composite
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- An example of a composite which has a single service and
- a single reference with multiplicity 0..n -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite7">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"/>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl4"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName" source="$serviceName"/>
- <reference name="reference1" multiplicity="0..n">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <reference name="Reference1" promote="TestComponent1/reference1" multiplicity="0..n">
- <interface.java interface="test.Service1"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite8.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite8.composite
deleted file mode 100644
index 212e0e81b6..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite8.composite
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- An example of a composite which has a single service and
- a single reference with multiplicity 0..1 -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite8">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"/>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl4"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName" source="$serviceName"/>
- <reference name="reference1" multiplicity="0..n">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <reference name="Reference1" promote="TestComponent1/reference1" multiplicity="0..1">
- <interface.java interface="test.Service1"/>
- </reference>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite9.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite9.composite
deleted file mode 100644
index 81c1e63190..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestComposite9.composite
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 that provides a single service with the extended
- Service1Superset interface -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TestComposite9">
-
- <service name="Service1" promote="Composite9Component1/Service1Superset">
- <interface.java interface="test.Service1Superset"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="Composite9Component1">
- <implementation.java class="test.service1SupersetImpl"/>
- <service name="Service1Superset">
- <interface.java interface="test.Service1Superset"></interface.java>
- </service>
- <property name="serviceName" source="$serviceName"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestDuplicate1.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestDuplicate1.composite
deleted file mode 100644
index 068e27bf30..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestDuplicate1.composite
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- 1st of a pair of composite files where the composites have duplicated
- names and targetNamespaces -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="DuplicateComposite">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">duplicate1</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestDuplicate2.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestDuplicate2.composite
deleted file mode 100644
index 5d98da7195..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/TestDuplicate2.composite
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- 2nd of a pair of composite files where the composites have duplicated
- names and targetNamespaces -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="DuplicateComposite">
-
- <service name="Service1" promote="TestComponent1/Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
-
- <property name="serviceName" type="string"/>
-
- <component name="TestComponent1">
- <implementation.java class="test.service1Impl"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">duplicate2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0001.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0001.composite
deleted file mode 100644
index 8f0d5301c5..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0001.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0001">
-
- <component name="TestClient">
- <implementation.java class="test.ASM_0001_Client"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.sca/>
- </service>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0002.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0002.composite
deleted file mode 100644
index f33e1436f5..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0002.composite
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!--
- ASM_0002_TestCase tests that component with a single reference can be wired to a single
- component service in the same composite.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0002">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0002</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service1</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0003.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0003.composite
deleted file mode 100644
index 639dd11aae..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0003.composite
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Test case that verifies that an implementation with a reference with multiplicity 1..n can
- be validly wired to 3 target services and invoke them all correctly.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0003">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0003"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1 TestComponent2/Service1 TestComponent3/Service1" />
- <property name="testName">ASM_0003</property>
- </component>
-
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service1</property>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
- <component name="TestComponent3">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service3</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0004.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0004.composite
deleted file mode 100644
index ecae73fa5c..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0004.composite
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Test that verifies that a reference with multiplicity 1..1 which is provided
- with multiple wire targets in the component configuration is marked as an error -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0004">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1 TestComponent2/Service1 TestComponent3/Service1" />
- <property name="testName">ASM_0004</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service1</property>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
- <component name="TestComponent3">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service3</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0005.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0005.composite
deleted file mode 100644
index ab7a907c75..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0005.composite
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Test that a component with multiple <service/> elements must have unique @name attributes for each
- service - negative test that has a component with 2 services with the same name -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0005">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0005</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite2"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service1</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0006.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0006.composite
deleted file mode 100644
index 223c692f8b..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0006.composite
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Test checks that the @name attribute of a <service/>
- element of a <component/> matches the @name attribute of a <service/> element of the
- componentType of the <implementation/> used by the <component/> -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0006">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/InvalidName" />
- <property name="testName">ASM_0005</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="InvalidName">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service1</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0007.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0007.composite
deleted file mode 100644
index 7ab4d9db39..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0007.composite
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Test that the @name attribute of a <reference/> element of a
- component is not equal to the @name attribute of any other
- <reference/> element of the same component -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0007">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0005</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite3"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- Two references with the same name - the implementation also has
- two references of the same name so that the component type
- matches the configuration of the component -->
- <reference name="Reference1" target="TestComponent2/Service1"/>
- <reference name="Reference1" target="TestComponent2/Service1"/>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0008.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0008.composite
deleted file mode 100644
index 9ddb8aa8cf..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0008.composite
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that the @name attribute of a <reference/> element of a
- component is equal to the @name attribute of a <reference/>
- element of the <componentType/> of the <implementation/> of
- the <component/> - negative test in that here there is a
- reference @name which does NOT match a reference name in the
- component type -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0008">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0005</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite4"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- This reference has a name that does not match the name of a
- Reference in the implementation -->
- <reference name="InvalidName" target="TestComponent2/Service1"/>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0009.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0009.composite
deleted file mode 100644
index 9d836489c8..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0009.composite
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that the @name attribute of a <component/> element
- in a <composite/> is not the same as the @name
- attribute of a second component in the same <composite/> -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0009">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0009</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0010.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0010.composite
deleted file mode 100644
index ef1b5d1663..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0010.composite
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests interface specified by the <interface/> child element of a
- <service/> element is a compatible subset of the interface declared
- for the <service/> element with the same @name attribute in the
- <componentType/> of the <implementation/> of the <component/>
- parent of the <service/> -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0010">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0010</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite5"/>
- <!-- This service declares interface Service1 while the implementation offers
- Service2, which is not compatible with Service1 -->
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0011.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0011.composite
deleted file mode 100644
index d8e5958132..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0011.composite
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests the multiplicity of a <reference/> element of a <component/>
- can be 1..1 where the multiplicity of the equivalent <reference/>
- element in the <componentType/> of the <implementation/> of the
- <component/> is 1..n -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0011">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0011</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite6"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- The multiplicity declared for this reference is 1..1 while the multiplicity of
- the corresponding reference on the componentType of the implementation is 1..n -->
- <reference name="Reference1" target="TestComponent2/Service1" multiplicity="1..1">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0012.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0012.composite
deleted file mode 100644
index bd945f443b..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0012.composite
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that the the multiplicity
- of a <reference/> element of a <component/> can be any one of 0..1,
- 1..1, 0..n, 1..n where the multiplicity of the equivalent <reference/>
- element in the <componentType/> of the <implementation/> of the
- <component/> is 0..n -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0012">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0012</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite7"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- The multiplicity declared for this reference is 0..1 while the multiplicity of
- the corresponding reference on the componentType of the implementation is 0..n -->
- <reference name="Reference1" target="TestComponent2/Service1" multiplicity="0..1">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite7"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service2</property>
- <!-- The multiplicity declared for this reference is 1..1 while the multiplicity of
- the corresponding reference on the componentType of the implementation is 0..n -->
- <reference name="Reference1" target="TestComponent3/Service1" multiplicity="1..1">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="TestComponent3">
- <implementation.composite name="tns:TestComposite7"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service3</property>
- <!-- The multiplicity declared for this reference is 0..n while the multiplicity of
- the corresponding reference on the componentType of the implementation is 0..n -->
- <reference name="Reference1" target="TestComponent4/Service1" multiplicity="0..n">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="TestComponent4">
- <implementation.composite name="tns:TestComposite7"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service4</property>
- <!-- The multiplicity declared for this reference is 1..n while the multiplicity of
- the corresponding reference on the componentType of the implementation is 0..n -->
- <reference name="Reference1" target="TestComponent5/Service1" multiplicity="1..n">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="TestComponent5">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service5</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0013.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0013.composite
deleted file mode 100644
index 49ee9824bd..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0013.composite
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that the the multiplicity
- of a <reference/> element of a <component/> is
- 1..1 where the multiplicity of the equivalent <reference/>
- element in the <componentType/> of the <implementation/> of the
- <component/> is 1..1 -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0013">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0013</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite4"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- The multiplicity declared for this reference is 1..1 while the multiplicity of
- the corresponding reference on the componentType of the implementation is 1..1 -->
- <reference name="Reference1" target="TestComponent2/Service1" multiplicity="1..1">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0014.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0014.composite
deleted file mode 100644
index 93c605d332..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0014.composite
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that the multiplicity of a <reference/> element of a
- <component/> is 0..n where the multiplicity of the equivalent
- <reference/> element in the <componentType/> of the
- <implementation/> of the <component/> is 1..1 -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0014">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0014</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite4"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- The multiplicity declared for this reference is 0..n while the multiplicity of
- the corresponding reference on the componentType of the implementation is 1..1 -->
- <reference name="Reference1" target="TestComponent2/Service1" multiplicity="0..n">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0015.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0015.composite
deleted file mode 100644
index ac887f6dfa..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0015.composite
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that the the multiplicity
- of a <reference/> element of a <component/> is
- 1..1 where the multiplicity of the equivalent <reference/>
- element in the <componentType/> of the <implementation/> of the
- <component/> is 0..1 -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0015">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0015</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite8"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- The multiplicity declared for this reference is 1..1 while the multiplicity of
- the corresponding reference on the componentType of the implementation is 0..1 -->
- <reference name="Reference1" target="TestComponent2/Service1" multiplicity="1..1">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0016.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0016.composite
deleted file mode 100644
index 08ae9416f2..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0016.composite
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that the interface declared by the <interface/> child element
- of a <reference/> of a <component/> is a compatible superset of the
- interface declared on the corresponding <reference/> of the
- componentType of the <implementation/> of the <component/> -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0016">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0016</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite4"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <reference name="Reference1" target="TestComponent2/Service1">
- <!-- Component type has the interface = test.Service1 - here
- we use an interface that is a superset -->
- <interface.java interface="test.Service1Superset"/>
- </reference>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite9"/>
- <service name="Service1">
- <interface.java interface="test.Service1Superset"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0017.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0017.composite
deleted file mode 100644
index b2d45743ac..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0017.composite
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <reference/> of a <component/> has no <binding/>
- child element, but the corresponding <reference/> element in the
- componentType does have a binding child element, the <binding/>
- from the componentType is used for the reference -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0017">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0017</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite10"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- ComponentType has a binding for this reference that
- identifies the target for this reference -->
- <reference name="Reference1">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0018.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0018.composite
deleted file mode 100644
index 5d14af662a..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0018.composite
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <reference/> of a <component/> has a <binding/>
- child element and the corresponding <reference/> element in the
- componentType has a binding child element, the <binding/>
- from the <reference/> is used for the reference -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0018">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0018</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite10"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- ComponentType has a binding for this reference that
- identifies a target for this reference -->
- <reference name="Reference1">
- <interface.java interface="test.Service1"/>
- <binding.sca uri="TestComponent3/Service1"/>
- </reference>
- </component>
-
- <!-- This component is the target identified by the Component Type -->
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
- <!-- This component is the target identified by the reference -->
- <component name="TestComponent3">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service3</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0019.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0019.composite
deleted file mode 100644
index eb6315f9c9..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0019.composite
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <reference/> of a <component/> has autowire=true
- and also has target identifying a single target service that the
- reference is wired only to the single service identified by the
- target attribute -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0019">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0019</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite7"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <reference name="Reference1" autowire="true" target="TestComponent3/Service1">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <!-- This component is the target identified by the Component Type -->
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
- <!-- This component is the target identified by the reference -->
- <component name="TestComponent3">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service3</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0020.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0020.composite
deleted file mode 100644
index bb35a8a9b8..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0020.composite
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <reference/> of a <component/> has
- @autowire=true and where there is also a single <wire/> element
- which as that <reference/> as its source that the reference is
- wired only to the single service identified by the <wire/> element -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0020">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0020</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite7"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <reference name="Reference1" autowire="true">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <wire source="TestComponent1/Reference1" target="TestComponent3/Service1"/>
-
- <!-- This component is the target identified by the Component Type -->
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
- <!-- This component is the target identified by the reference -->
- <component name="TestComponent3">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service3</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0021.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0021.composite
deleted file mode 100644
index 193546103d..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0021.composite
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <reference/> of a <component/> has @autowire=true
- and where the <reference/> has a <binding/> child element which
- declares a single target service, the reference is wired only to
- the single service identified by the <wire/> element -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0021">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0021</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite7"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <reference name="Reference1" autowire="true">
- <interface.java interface="test.Service1"/>
- <binding.sca uri="TestComponent3/Service1"/>
- </reference>
- </component>
-
- <!-- This component is the target identified by the Component Type -->
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
- <!-- This component is the target identified by the reference -->
- <component name="TestComponent3">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service3</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0022.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0022.composite
deleted file mode 100644
index 9eb0254938..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0022.composite
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> <reference/> with multiplicity=0..1
- is unwired (by any means) that the component executes correctly -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0022">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0022</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite8"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- Reference is 0..1 and is deliberately left unwired -->
- <reference name="Reference1">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0023.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0023.composite
deleted file mode 100644
index e1d6e4bf70..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0023.composite
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> <reference/> with multiplicity=1..1
- is wired to a component service in the same composite and is also
- promoted by a <composite/> <reference/> which is wired to a target
- service by a component using the <composite/> as its implementation,
- that this is an error -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0023">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0023</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite11"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <reference name="Reference1" target="TestComponent2/Service1">
- <interface.java interface="test.Service1"/>
- </reference>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"></interface.java>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0024.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0024.composite
deleted file mode 100644
index 31ec496e2e..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0024.composite
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> <reference/> has @target set to
- some service, that the reference can have no child <binding/> elements -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0024">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0024</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite4"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <reference name="Reference1" target="TestComponent2/Service1">
- <interface.java interface="test.Service1"/>
- <!-- A binding which contradicts the @target attribute -->
- <binding.ws/>
- </reference>
- </component>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- <binding.ws/>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0025.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0025.composite
deleted file mode 100644
index 96ee58484a..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0025.composite
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> <property/> has its value set by means
- of a child <value/> element, that the type of the <value/> element matches
- the type declared for the <property/> element -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_0025">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0025</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite12"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- Property with complex type with a value declared using a <value/> subelement -->
- <property name="complexType" type="test:ComplexType1">
- <value>
- <firstData>complex1</firstData>
- <secondData>complex2</secondData>
- </value>
- </property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0026.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0026.composite
deleted file mode 100644
index 3c5a441899..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0026.composite
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> <property/> has its value set by means
- of a child element that is NOT a <value/> element, that a) the type of
- the <property/> element is declared as an XML Schema global element by
- its @element attribute and that the child element is an instance of that
- global element -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_0026">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0026</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite13"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- Property with complex type with a value declared using a subelement
- with the correct XSD global element type -->
- <property name="complexType" element="test:globalElement1">
- <test:globalElement1>
- <firstData>complex1</firstData>
- <secondData>complex2</secondData>
- </test:globalElement1>
- </property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0027.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0027.composite
deleted file mode 100644
index c2ed53146f..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0027.composite
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> has 2 or more <property/> child elements
- that each <property/> element has a unique @name attribute value -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_0027">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0027</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- Multiple properties with the same @name attribute value - an error -->
- <property name="serviceName">service2</property>
- <property name="serviceName">service3</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0028.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0028.composite
deleted file mode 100644
index 591b5f9ab6..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0028.composite
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that a <component/> <property/> @name attribute matches the
- @name attribute of one of the <property/> elements of the
- <componentType/> of the <implementation/> of the <component/> -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_0028">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0028</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- Property with @name attribute that does not match the @name
- attribute of any of the <property/> elements in the
- <componentType/> of the <implementation/> -->
- <property name="randomName">randomValue</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0029.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0029.composite
deleted file mode 100644
index aeed8552c8..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0029.composite
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that that where a <component/> <property/> has @many=false that
- there is only one <value/> child element of the <property/> -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_0029">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0029</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite12"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- Property with complex type with many=false but 2 <value/>
- subelements - which is an error -->
- <property name="complexType" type="test:ComplexType1">
- <value>
- <test:firstData>SomeData</test:firstData>
- <test:secondData>MoreData</test:secondData>
- </value>
- <value>
- <test:firstData>SomeData2</test:firstData>
- <test:secondData>MoreData2</test:secondData>
- </value>
- </property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0030.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0030.composite
deleted file mode 100644
index 0ce29cdab2..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0030.composite
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that a <component/> <property/> with a @value attribute set
-does not have any <value/> child elements -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_0030">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0030</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite14"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <!-- Property with value set via a @value attribute and also having
- <value/> child elements, which is an error -->
- <property name="simpleType" value="someValue">
- <value>someOtherValue</value>
- </property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0031.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0031.composite
deleted file mode 100644
index 50cd134a6e..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0031.composite
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> <reference/> has its @target attribute set
- to a valid service and the <composite/> also contains a <wire/> element with
- @source set to the <component/> <reference/> and @target set to a second valid
- service and has @replace=true, the <reference/> is wired to the second service
- only -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_0031">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0031</property>
- </component>
-
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite4"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <reference name="Reference1" target="TestComponent2/Service1"/>
- </component>
-
- <!-- Here is a wire that overrides the reference target of TestComponent1/Reference1 -->
- <wire source="TestComponent1/Reference1" target="TestComponent3/Service1" replace="true"/>
-
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
- <component name="TestComponent3">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service3</property>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0032.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0032.composite
deleted file mode 100644
index fbd629f07f..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0032.composite
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> <service/> has no <binding/> subelements
- and the corresponding <service/> element of the <componentType/> of the
- <component/> <implementation/> has one or more <binding/> subelements,
- the <component/> <service/> is made available with all the bindings
- declared on the <service/> element of the <componentType/> -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_0032">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0032</property>
- </component>
-
- <!-- Implementation with a single reference with multiplicity 1..n which
- has multiple concrete bindings applied to it -->
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite6"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <reference name="Reference1">
- <interface.java interface="test.Service1"/>
- <binding.sca uri="TestComponent2/Service1"/>
- <binding.ws uri="http://localhost:8080/TestComponent2"/>
- </reference>
- </component>
-
- <!-- A component with a service that has no bindings but where the service in the
- componentType has multiple bindings explicitly set on it -->
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite15"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0033.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0033.composite
deleted file mode 100644
index 750f297af8..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0033.composite
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> <service/> has no <binding/> subelements
- and the corresponding <service/> element of the <componentType/> of the
- <component/> <implementation/> has no <binding/> subelements, the
- <component/> <service/> is made available with binding.sca -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_0033">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0033</property>
- </component>
-
- <!-- Implementation with a single reference with multiplicity 1..n which
- has multiple concrete bindings applied to it -->
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite6"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <reference name="Reference1">
- <interface.java interface="test.Service1"/>
- <binding.sca uri="TestComponent2/Service1"/>
- <binding.sca uri="TestComponent2/Service1"/>
- </reference>
- </component>
-
- <!-- A component with a service that has no bindings set and where the service
- in the componentType has no bindings explicitly set on it -->
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0034.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0034.composite
deleted file mode 100644
index 41edb731ef..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0034.composite
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> <service/> has 1 or more <binding/>
- subelements the <component/> <service/> is made available with
- all the bindings declared on the <service/> element -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_0034">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_0034</property>
- </component>
-
- <!-- Implementation with a single reference with multiplicity 1..n which
- has multiple concrete bindings applied to it -->
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite6"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- <reference name="Reference1">
- <interface.java interface="test.Service1"/>
- <binding.sca uri="TestComponent2/Service1"/>
- <binding.ws uri="http://localhost:8080/TestComponent2"/>
- </reference>
- </component>
-
- <!-- A component with a service that has multiple bindings explicitly set on it -->
- <component name="TestComponent2">
- <implementation.composite name="tns:TestComposite1"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- <binding.sca/>
- <binding.ws/>
- </service>
- <property name="serviceName">service2</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0101.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0101.composite
deleted file mode 100644
index c6a44392b4..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_0101.composite
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://oasis/tests"
- xmlns:sample="http://oasis/tests"
- name="TEST_ASM_0101">
-
- <component name="TestClient">
- <implementation.java class="test.ASM_0001_Client"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.sca/>
- <binding.ws/>
- </service>
- <!-- reference name="testRef1" target="TestComponent1/service1" / -->
- </component>
-
-<!--
- <component name="TestComponent1">
- <implementation.java class="test.ASM_0001_Impl1"/>
- <service name="service1"/>
- </component>
--->
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6001.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6001.composite
deleted file mode 100644
index 816ffb7521..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6001.composite
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <component/> <service/> has 1 or more <binding/>
- subelements the <component/> <service/> is made available with
- all the bindings declared on the <service/> element -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_6001">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_6001</property>
- </component>
-
- <!-- Component which uses a composite as its implementation where the contribution
- contains 2 <composite/> artifacts which have identical names and targetNamspaces -->
- <component name="TestComponent1">
- <implementation.composite name="tns:DuplicateComposite"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6002.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6002.composite
deleted file mode 100644
index 9ec38e5c78..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6002.composite
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <composite/> has multiple <service/> subelements
- that the @name attributes are unique across those subelements -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_6002">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_6002</property>
- </component>
-
- <!-- Component which uses a composite which has 2 <service/> subelements with
- the same @name attribute -->
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite16"/>
- <property name="serviceName">service1</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6003.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6003.composite
deleted file mode 100644
index a15b0785c0..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6003.composite
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that where a <composite/> has a <service/> subelement that the
- @promote attribute identifies a <service/> of a <component/> in the
- <composite/> -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_6003">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_6003</property>
- </component>
-
- <!-- Component which uses a composite which has a <service/> subelements with
- a @promote attribute which does not contain the name of a <service/> of
- one of the <component/> within the <composite/> -->
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite17"/>
- <service name="Service1">
- <interface.java interface="test.Service1"/>
- </service>
- <property name="serviceName">service1</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6004.composite b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6004.composite
deleted file mode 100644
index 31aaf45e4d..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_ASM_6004.composite
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Tests that the <interface/> declared on a <service/> subelement of a
- <composite/> is a compatible subset of the <interface/> declared on
- the <component/> <service/> reference by the @promote attribute -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://oasis/tests"
- xmlns:tns="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- name="TEST_ASM_6004">
-
- <component name="TestClient">
- <implementation.composite name="tns:TestClient_0002"/>
- <service name="TestInvocation">
- <interface.java interface="test.TestInvocation"/>
- <binding.ws/>
- </service>
- <reference name="reference1" target="TestComponent1/Service1" />
- <property name="testName">ASM_6004</property>
- </component>
-
- <!-- Component which uses a composite which has a <service/> subelement which
- has an <interface/> declared which is a compatible subset of the interface
- of the promoted component service -->
- <component name="TestComponent1">
- <implementation.composite name="tns:TestComposite18"/>
- <property name="serviceName">service1</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_Types.xsd b/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_Types.xsd
deleted file mode 100644
index ab473cdb92..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/main/resources/Test_Types.xsd
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 for Schema types used by the SCA TestCases -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://oasis/tests"
- xmlns:test="http://oasis/tests"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
-
- <!-- A complex type -->
- <complexType name="ComplexType1">
- <element name="firstData" type="string" />
- <element name="secondData" type="string" />
- </complexType>
-
- <!-- A global element with a complex type -->
- <element name="globalElement1" type="test:ComplexType1"/>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0002_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0002_TestCase.java
deleted file mode 100644
index 600d859e38..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0002_TestCase.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * ASM_0002_TestCase
- */
-public class ASM_0002_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0002";
- config.input = "request";
- config.output = config.testName + " " + config.input + " service1 operation1 invoked";
- config.composite = "Test_ASM_0002.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0002
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0003_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0003_TestCase.java
deleted file mode 100644
index 4f85967b0d..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0003_TestCase.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0003_Client;
-import testClient.TestInvocation;
-
-/**
- * A generic test client based on Tuscany APIs
- */
-public class ASM_0003_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0003";
- config.input = "request";
- config.output = config.testName + " " + config.input + " service1 operation1 invoked" +
- "service2 operation1 invoked" + "service3 operation1 invoked";
- config.composite = "Test_ASM_0003.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0003_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0004_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0004_TestCase.java
deleted file mode 100644
index 4997b28859..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0004_TestCase.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * A generic test client based on Tuscany APIs
- */
-public class ASM_0004_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0004";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0004.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0005_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0005_TestCase.java
deleted file mode 100644
index 718eb73908..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0005_TestCase.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0005_TestCase, which checks that a component with multiple <service/>
- * elements with the same @name attribute is an error
- */
-public class ASM_0005_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0005";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0005.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0006_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0006_TestCase.java
deleted file mode 100644
index 7260eb949e..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0006_TestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0006_TestCase, which checks that the @name attribute of a <service/>
- * element of a <component/> matches the @name attribute of a <service/> element of the
- * componentType of the <implementation/> used by the <component/>
- */
-public class ASM_0006_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0006";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0006.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0007_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0007_TestCase.java
deleted file mode 100644
index 44781eb87a..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0007_TestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0007_TestCase, which tests that the @name attribute of a <reference/>
- * element of a component is not equal to the @name attribute of any other <reference/>
- * element of the same component
- */
-public class ASM_0007_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0007";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0007.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0008_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0008_TestCase.java
deleted file mode 100644
index 0bdc3af4a3..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0008_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0008_TestCase, which Tests that the @name attribute of a
- * <reference/> element of a component is equal to the @name attribute of a
- * <reference/> element of the <componentType/> of the <implementation/> of
- * the <component/>
- */
-public class ASM_0008_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0008";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0008.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0009_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0009_TestCase.java
deleted file mode 100644
index cb1e600542..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0009_TestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0009_TestCase, which tests that the @name attribute of a
- * <component/> element in a <composite/> is not the same as the @name
- * attribute of a second component in the same <composite/>
- */
-public class ASM_0009_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0009";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0009.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0010_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0010_TestCase.java
deleted file mode 100644
index 7af957db99..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0010_TestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0009_TestCase, which tests that the interface specified
- * by the <interface/> child element of a <service/> element is a compatible
- * subset of the interface declared for the <service/> element with the
- * same @name attribute in the <componentType/> of the <implementation/>
- * of the <component/> parent of the <service/>
- */
-public class ASM_0010_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0010";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0010.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0011_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0011_TestCase.java
deleted file mode 100644
index ed850761f7..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0011_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0011_TestCase, which tests that the the multiplicity
- * of a <reference/> element of a <component/> can be 1..1 where the
- * multiplicity of the equivalent <reference/> element in the
- * <componentType/> of the <implementation/> of the <component/> is 1..n
- */
-public class ASM_0011_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0011";
- config.input = "request";
- config.output = "ASM_0011 request service1 operation1 invoked service2 operation1 invoked";
- config.composite = "Test_ASM_0011.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0012_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0012_TestCase.java
deleted file mode 100644
index 32a680f47f..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0012_TestCase.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0012_TestCase, which tests that the the multiplicity
- * of a <reference/> element of a <component/> can be any one of 0..1,
- * 1..1, 0..n, 1..n where the multiplicity of the equivalent <reference/>
- * element in the <componentType/> of the <implementation/> of the
- * <component/> is 0..n
- */
-public class ASM_0012_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0012";
- config.input = "request";
- config.output = "ASM_0012 request service1 operation1 invoked service2 operation1 invoked" +
- " service3 operation1 invoked service4 operation1 invoked service5 operation1 invoked";
- config.composite = "Test_ASM_0012.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0013_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0013_TestCase.java
deleted file mode 100644
index 96ad97cc67..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0013_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0013_TestCase, which tests that the the multiplicity
- * of a <reference/> element of a <component/> is 1..1 where the
- * multiplicity of the equivalent <reference/> element in the
- * <componentType/> of the <implementation/> of the <component/> is 1..1
- */
-public class ASM_0013_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0013";
- config.input = "request";
- config.output = "ASM_0013 request service1 operation1 invoked service2 operation1 invoked";
- config.composite = "Test_ASM_0013.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0014_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0014_TestCase.java
deleted file mode 100644
index cce3b20239..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0014_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0014_TestCase, which tests that the multiplicity of a
- * <reference/> element of a <component/> is 0..n where the multiplicity
- * of the equivalent <reference/> element in the <componentType/> of the
- * <implementation/> of the <component/> is 1..1
- */
-public class ASM_0014_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0014";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0014.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0015_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0015_TestCase.java
deleted file mode 100644
index 4991d6f9c2..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0015_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0015_TestCase, which tests that the the multiplicity
- * of a <reference/> element of a <component/> is 1..1 where the
- * multiplicity of the equivalent <reference/> element in the
- * <componentType/> of the <implementation/> of the <component/> is 0..1
- */
-public class ASM_0015_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0015";
- config.input = "request";
- config.output = "ASM_0015 request service1 operation1 invoked service2 operation1 invoked";
- config.composite = "Test_ASM_0015.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0016_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0016_TestCase.java
deleted file mode 100644
index afc6e88fe1..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0016_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0016_TestCase, which tests that the interface declared
- * by the <interface/> child element of a <reference/> of a <component/>
- * is a compatible superset of the interface declared on the corresponding
- * <reference/> of the componentType of the <implementation/> of the <component/>
- */
-public class ASM_0016_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0016";
- config.input = "request";
- config.output = "ASM_0016 request service1 operation1 invoked service2 operation1 invoked";
- config.composite = "Test_ASM_0016.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0017_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0017_TestCase.java
deleted file mode 100644
index e977c1a252..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0017_TestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0017_TestCase, which tests that where a <reference/>
- * of a <component/> has no <binding/> child element, but the
- * corresponding <reference/> element in the componentType does have
- * a binding child element, the <binding/> from the componentType is
- * used for the reference
- */
-public class ASM_0017_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0017";
- config.input = "request";
- config.output = "ASM_0017 request service1 operation1 invoked service2 operation1 invoked";
- config.composite = "Test_ASM_0017.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0018_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0018_TestCase.java
deleted file mode 100644
index 645f174df8..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0018_TestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0018_TestCase, which tests that where a <reference/>
- * of a <component/> has a <binding/> child element and the
- * corresponding <reference/> element in the componentType has
- * a binding child element, the <binding/> from the <reference/> is
- * used for the reference
- */
-public class ASM_0018_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0018";
- config.input = "request";
- config.output = "ASM_0018 request service1 operation1 invoked service3 operation1 invoked";
- config.composite = "Test_ASM_0018.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0019_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0019_TestCase.java
deleted file mode 100644
index 1bfea7841f..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0019_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0018_TestCase, which tests that where a <reference/>
- * of a <component/> has @autowire=”true” and also has @target identifying
- * a single target service that the reference is wired only to the single
- * service identified by the @target attribute
- */
-public class ASM_0019_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0019";
- config.input = "request";
- config.output = "ASM_0019 request service1 operation1 invoked service3 operation1 invoked";
- config.composite = "Test_ASM_0019.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0020_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0020_TestCase.java
deleted file mode 100644
index aeb6a92095..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0020_TestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0020_TestCase, which tests that where a <reference/>
- * of a <component/> has @autowire=true and where there is also a single
- * <wire/> element which as that <reference/> as its source that the
- * reference is wired only to the single service identified by the
- * <wire/> element
- */
-public class ASM_0020_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0020";
- config.input = "request";
- config.output = "ASM_0020 request service1 operation1 invoked service3 operation1 invoked";
- config.composite = "Test_ASM_0020.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0021_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0021_TestCase.java
deleted file mode 100644
index 4397a564c8..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0021_TestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0021_TestCase, which tests that where a <reference/>
- * of a <component/> has @autowire=true and where the <reference/> has
- * a <binding/> child element which declares a single target service,
- * the reference is wired only to the single service identified by the
- * <wire/> element
- */
-public class ASM_0021_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0021";
- config.input = "request";
- config.output = "ASM_0021 request service1 operation1 invoked service3 operation1 invoked";
- config.composite = "Test_ASM_0021.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0022_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0022_TestCase.java
deleted file mode 100644
index f845f0eaf5..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0022_TestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0022_TestCase, which tests that where a <component/>
- * <reference/> with multiplicity=0..1 is unwired (by any means) that
- * the component executes correctly
- */
-public class ASM_0022_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0022";
- config.input = "request";
- config.output = "ASM_0022 request service1 operation1 invoked";
- config.composite = "Test_ASM_0022.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0023_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0023_TestCase.java
deleted file mode 100644
index c0be74ee02..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0023_TestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0021_TestCase, which tests that where a <component/>
- * <reference/> with multiplicity=1..1 is wired to a component service
- * in the same composite and is also promoted by a <composite/> <reference/>
- * which is wired to a target service by a component using the <composite/>
- * as its implementation, that this is an error
- */
-public class ASM_0023_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0023";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0023.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0024_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0024_TestCase.java
deleted file mode 100644
index efae40f0eb..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0024_TestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0024_TestCase, which tests that where a <component/>
- * <reference/> has @target set to some service, that the reference
- * can have no child <binding/> elements
- */
-public class ASM_0024_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0024";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0024.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0025_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0025_TestCase.java
deleted file mode 100644
index e05554fa14..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0025_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0025_TestCase, which tests that where a <component/>
- * <property/> has its value set by means of a child <value/> element,
- * that the type of the <value/> element matches the type declared for
- * the <property/> element
- */
-public class ASM_0025_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0025";
- config.input = "request";
- config.output = "ASM_0025 request service1 operation1 invokedcomplex1complex2";
- config.composite = "Test_ASM_0025.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0026_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0026_TestCase.java
deleted file mode 100644
index 2a56abcd7e..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0026_TestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0026_TestCase, which tests that where a <component/> <property/>
- * has its value set by means of a child element that is NOT a <value/> element,
- * that a) the type of the <property/> element is declared as an XML Schema global
- * element by its @element attribute and b) that the child element is an instance
- * of that global element
- */
-public class ASM_0026_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0026";
- config.input = "request";
- config.output = "ASM_0026 request service1 operation1 invokedcomplex1complex2";
- config.composite = "Test_ASM_0026.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0027_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0027_TestCase.java
deleted file mode 100644
index 389d971f82..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0027_TestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0027_TestCase, which tests that where a <component/> has
- * 2 or more <property/> child elements that each <property/> element has a
- * unique @name attribute value
- */
-public class ASM_0027_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0027";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0027.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0027
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0028_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0028_TestCase.java
deleted file mode 100644
index b5eb110aaa..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0028_TestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0028_TestCase, which tests a <component/> <property/> @name
- * attribute matches the @name attribute of one of the <property/> elements of
- * the <componentType/> of the <implementation/> of the <component/>
- */
-public class ASM_0028_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0028";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0028.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0028
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0029_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0029_TestCase.java
deleted file mode 100644
index 13a3986135..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0029_TestCase.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0029_TestCase, which tests that where a <component/> <property/>
- * has @many=false that there is only one <value/> child element of the <property/>
- */
-public class ASM_0029_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0029";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0029.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0029
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0030_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0030_TestCase.java
deleted file mode 100644
index 3916cc397e..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0030_TestCase.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0030_TestCase, which tests that a <component/> <property/>
- * with a @value attribute set does not have any <value/> child elements
- */
-public class ASM_0030_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0030";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_0030.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0030
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0031_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0031_TestCase.java
deleted file mode 100644
index 32c7afca85..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0031_TestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0031_TestCase, which tests that where a <component/> <reference/>
- * has its @target attribute set to a valid service and the <composite/> also
- * contains a <wire/> element with @source set to the <component/> <reference/>
- * and @target set to a second valid service and has @replace=true, the <reference/>
- * is wired to the second service only
- */
-public class ASM_0031_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0031";
- config.input = "request";
- config.output = "ASM_0031 request service1 operation1 invoked service3 operation1 invoked";
- config.composite = "Test_ASM_0031.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0031
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0032_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0032_TestCase.java
deleted file mode 100644
index 0601cab2ee..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0032_TestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0032_TestCase, which tests where a <component/> <service/>
- * has no <binding/> subelements and the corresponding <service/> element of
- * the <componentType/> of the <component/> <implementation/> has one or more
- * <binding/> subelements, the <component/> <service/> is made available with
- * all the bindings declared on the <service/> element of the <componentType/>
- */
-public class ASM_0032_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0032";
- config.input = "request";
- config.output = "ASM_0032 request service1 operation1 invoked service2 operation1 invokedservice2 operation1 invoked";
- config.composite = "Test_ASM_0032.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0032
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0033_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0033_TestCase.java
deleted file mode 100644
index ffc1dcaa33..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0033_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0033_TestCase, which tests that where a <component/> <service/>
- * has no <binding/> subelements and the corresponding <service/> element of the
- * <componentType/> of the <component/> <implementation/> has no <binding/> subelements,
- * the <component/> <service/> is made available with binding.sca
- */
-public class ASM_0033_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0033";
- config.input = "request";
- config.output = "ASM_0033 request service1 operation1 invoked service2 operation1 invokedservice2 operation1 invoked";
- config.composite = "Test_ASM_0033.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0032
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0034_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0034_TestCase.java
deleted file mode 100644
index 9f54b0d3df..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_0034_TestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_0034_TestCase, which tests that where a <component/> <service/>
- * has 1 or more <binding/> subelements the <component/> <service/> is made
- * available with all the bindings declared on the <service/> element
- */
-public class ASM_0034_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0034";
- config.input = "request";
- config.output = "ASM_0034 request service1 operation1 invoked service2 operation1 invokedservice2 operation1 invoked";
- config.composite = "Test_ASM_0034.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_0034
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6001_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6001_TestCase.java
deleted file mode 100644
index 0f6ca04682..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6001_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_6001_TestCase, which tests that where an SCA contribution
- * contains two <composite/> elements with the same name and same
- * targetNamespace that an SCA application using that composite does not run
- * and that the SCA runtime reports an error
- */
-public class ASM_6001_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_6001";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_6001.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_6001
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6002_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6002_TestCase.java
deleted file mode 100644
index e53a3cde1b..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6002_TestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_6002_TestCase, which tests that where a <composite/> has
- * multiple <service/> subelements that the @name attributes are unique
- * across those subelements
- */
-public class ASM_6002_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_6002";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_6002.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_6002
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6003_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6003_TestCase.java
deleted file mode 100644
index 153bb3fcea..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6003_TestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_6003_TestCase, which tests that where a <composite/> has a
- * <service/> subelement that the @promote attribute identifies a <service/>
- * of a <component/> in the <composite/>
- */
-public class ASM_6003_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_6003";
- config.input = "request";
- config.output = "exception";
- config.composite = "Test_ASM_6003.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_6003
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6004_TestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6004_TestCase.java
deleted file mode 100644
index d5b6fb3771..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/ASM_6004_TestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-
-import test.ASM_0002_Client;
-import testClient.TestInvocation;
-
-/**
- * Client for ASM_6004_TestCase, which tests that the <interface/> declared
- * on a <service/> subelement of a <composite/> is a compatible subset of the
- * <interface/> declared on the <component/> <service/> reference by the
- * @promote attribute
- */
-public class ASM_6004_TestCase extends BaseJAXWSTestCase {
-
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_6004";
- config.input = "request";
- config.output = "ASM_6004 request service1 operation1 invoked";
- config.composite = "Test_ASM_6004.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0002_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class Test_ASM_6004
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java
deleted file mode 100644
index ede2658ac0..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-import static org.junit.Assert.*;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-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;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.xml.ws.Service;
-import javax.xml.namespace.QName;
-
-import test.ASM_0001_Client;
-import testClient.TestInvocation;
-import testClient.TestException_Exception;
-import testClient.TestException;
-
-/**
- * A generic test client based on JAX-WS APIs
- */
-public class BaseJAXWSTestCase {
-
- protected NodeLauncher launcher;
- protected Node node;
- protected TestConfiguration testConfiguration = getTestConfiguration();
- static boolean proceed = true;
-
- public static void main(String[] args) throws Exception {
- BaseJAXWSTestCase test = new BaseJAXWSTestCase();
- test.setUp();
- test.tearDown();
- }
-
- @Before
- public void setUp() throws Exception {
- try {
- startContribution();
- } catch (Exception e) {
- // If the SCA runtime refuses to start an invalid contribution, then this is also
- // regarded as a successful outcome
- System.out.println( "Exception received - detail: " + e.getMessage() );
- assertEquals( testConfiguration.getExpectedOutput(), "exception" );
- System.out.println("Test " + testConfiguration.getTestName() + " completed successfully");
- // Mark this test as not to proceed further
- proceed = false;
- } // end try
- }
-
- @After
- public void tearDown() throws Exception {
- stopContribution();
- }
-
- @Test
- public void testDummy() throws Exception {
- // If an exception were thrown during initialization, let's go no further
- if( proceed == false ) return;
-
- // System.out.println("Test " + testName + " starting");
- String output = null;
- try {
- output = invokeTest( testConfiguration.getInput() );
-
- } catch ( TestException_Exception e ) {
- TestException exceptionContent = e.getFaultInfo();
- System.out.println("Service fault received - detail: " + exceptionContent.getMessage() );
- assertEquals( testConfiguration.getExpectedOutput(), "exception" );
- System.out.println("Test " + testConfiguration.getTestName() + " completed successfully");
- return;
- } catch (Throwable e) {
- e.printStackTrace();
- System.out.println( "Exception received - detail: " + e.getMessage() );
- assertEquals( testConfiguration.getExpectedOutput(), "exception" );
- System.out.println("Test " + testConfiguration.getTestName() + " completed successfully");
- return;
- }
- assertEquals( testConfiguration.getExpectedOutput(), output );
- System.out.println("Test " + testConfiguration.getTestName() + " completed successfully");
- }
-
- public String invokeTest( String input ) throws Exception {
- //Web service invocation via JAXWS
- QName serviceName = new QName("http://test/", "TestInvocationService");
- URL wsdlLocation = this.getClass().getClassLoader().getResource("TestClient.wsdl");
- javax.xml.ws.Service webService = Service.create( wsdlLocation, serviceName );
- TestInvocation wsProxy = (TestInvocation) webService.getPort(testConfiguration.getServiceInterface());
-
- String output = wsProxy.invokeTest(input);
-
- return output;
- } // end method invokeTest
-
- protected <T> T getService( Class<T> interfaze, String serviceName ) {
- T service = node.getService( interfaze, serviceName );
- return service;
- } // end getService
-
- protected void startContribution() throws Exception {
- // Tuscany specific code which starts the contribution holding the test
- launcher = NodeLauncher.newInstance();
- node = launcher.createNode(testConfiguration.getComposite(),
- new Contribution(testConfiguration.getTestName(), getContributionURI()));
- System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader());
- node.start();
- } // end method startContribution
-
- protected void stopContribution() throws Exception {
- if (node != null) {
- node.stop();
- node.destroy();
- }
- if (launcher != null) {
- launcher.destroy();
- }
- } // end method stopContribution
-
- protected String getContributionURI() {
- String location = ContributionLocationHelper.getContributionLocation(testConfiguration.getTestClass());
- return location;
- }
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0001";
- config.input = "request";
- config.output = config.testName + " " + config.input + " invoked ok";
- config.composite = "Test_ASM_0101.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0001_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class BaseTest
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/BaseTestCase.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/BaseTestCase.java
deleted file mode 100644
index a728373daa..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/BaseTestCase.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package client;
-
-import static org.junit.Assert.*;
-
-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;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import test.ASM_0001_Client;
-import test.TestInvocation;
-
-/**
- * A generic test client based on Tuscany APIs
- */
-public class BaseTestCase {
-
- protected NodeLauncher launcher;
- protected Node node;
- protected TestConfiguration testConfiguration = getTestConfiguration();
-
- public static void main(String[] args) throws Exception {
- BaseTestCase test = new BaseTestCase();
- test.setUp();
- test.tearDown();
- }
-
- @Before
- public void setUp() throws Exception {
- startContribution();
- }
-
- @After
- public void tearDown() throws Exception {
- stopContribution();
- }
-
- @Test
- public void testDummy() throws Exception {
- // System.out.println("Test " + testName + " starting");
- try {
- String output = invokeTest( testConfiguration.getInput() );
- assertEquals( testConfiguration.getExpectedOutput(), output );
- } catch (Exception e) {
- assertEquals( testConfiguration.getExpectedOutput(), "exception" );
- System.out.println( "Expected exception - detail: " + e.getMessage() );
- }
- System.out.println("Test " + testConfiguration.getTestName() + " completed successfully");
- }
-
- public String invokeTest( String input ) throws Exception {
-
- TestInvocation service = (TestInvocation) getService( testConfiguration.getServiceInterface(),
- testConfiguration.getTestServiceName() );
-
- return service.invokeTest( input );
- } // end method invokeTest
-
- protected <T> T getService( Class<T> interfaze, String serviceName ) {
- T service = node.getService( interfaze, serviceName );
- return service;
- } // end getService
-
- protected void startContribution() throws Exception {
- // Tuscany specific code which starts the contribution holding the test
- launcher = NodeLauncher.newInstance();
- node = launcher.createNode(testConfiguration.getComposite(),
- new Contribution(testConfiguration.getTestName(), getContributionURI()));
- System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader());
- node.start();
- } // end method startContribution
-
- protected void stopContribution() throws Exception {
- if (node != null) {
- node.stop();
- node.destroy();
- }
- if (launcher != null) {
- launcher.destroy();
- }
- } // end method stopContribution
-
- protected String getContributionURI() {
- String location = ContributionLocationHelper.getContributionLocation(testConfiguration.getTestClass());
- return location;
- }
-
- protected TestConfiguration getTestConfiguration() {
- TestConfiguration config = new TestConfiguration();
- config.testName = "ASM_0001";
- config.input = "request";
- config.output = config.testName + " " + config.input + " invoked ok";
- config.composite = "Test_ASM_0001.composite";
- config.testServiceName = "TestClient";
- config.testClass = ASM_0001_Client.class;
- config.serviceInterface = TestInvocation.class;
- return config;
- }
-
-} // end class BaseTest
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/TestConfiguration.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/TestConfiguration.java
deleted file mode 100644
index 3e3bf01718..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/client/TestConfiguration.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package client;
-
-/**
- * A class to hold the metadata about the test
- * @author MikeEdwards
- *
- */
-class TestConfiguration {
-
- public String testName;
- public String input;
- public String output;
- public String composite;
- public String testServiceName;
- public Class<?> testClass; //TODO - does the client need this??
- public Class<?> serviceInterface;
-
- public TestConfiguration() { }
-
- public String getTestName() { return testName; }
- public String getInput() { return input; }
- public String getExpectedOutput() { return output; }
- public String getComposite() { return composite; }
- public String getTestServiceName() { return testServiceName; }
- public Class<?> getTestClass() { return testClass; }
- public Class<?> getServiceInterface() { return serviceInterface; }
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/InvokeTest.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/InvokeTest.java
deleted file mode 100644
index 2dcb4142f4..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/InvokeTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package testClient;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="arg0" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "arg0"
-})
-@XmlRootElement(name = "invokeTest")
-public class InvokeTest {
-
- @XmlElementRef(name = "arg0", type = JAXBElement.class)
- protected JAXBElement<String> arg0;
-
- /**
- * Gets the value of the arg0 property.
- *
- * @return
- * possible object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public JAXBElement<String> getArg0() {
- return arg0;
- }
-
- /**
- * Sets the value of the arg0 property.
- *
- * @param value
- * allowed object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public void setArg0(JAXBElement<String> value) {
- this.arg0 = ((JAXBElement<String> ) value);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/InvokeTestResponse.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/InvokeTestResponse.java
deleted file mode 100644
index 3c7419370a..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/InvokeTestResponse.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package testClient;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "_return"
-})
-@XmlRootElement(name = "invokeTestResponse")
-public class InvokeTestResponse {
-
- @XmlElementRef(name = "return", type = JAXBElement.class)
- protected JAXBElement<String> _return;
-
- /**
- * Gets the value of the return property.
- *
- * @return
- * possible object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public JAXBElement<String> getReturn() {
- return _return;
- }
-
- /**
- * Sets the value of the return property.
- *
- * @param value
- * allowed object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public void setReturn(JAXBElement<String> value) {
- this._return = ((JAXBElement<String> ) value);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/ObjectFactory.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/ObjectFactory.java
deleted file mode 100644
index e24d2f58b9..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/ObjectFactory.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package testClient;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the testClient package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private final static QName _TestException_QNAME = new QName("http://test/", "TestException");
- private final static QName _InvokeTestArg0_QNAME = new QName("", "arg0");
- private final static QName _InvokeTestResponseReturn_QNAME = new QName("", "return");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: testClient
- *
- */
- public ObjectFactory() {
- }
-
- /**
- * Create an instance of {@link InvokeTest }
- *
- */
- public InvokeTest createInvokeTest() {
- return new InvokeTest();
- }
-
- /**
- * Create an instance of {@link InvokeTestResponse }
- *
- */
- public InvokeTestResponse createInvokeTestResponse() {
- return new InvokeTestResponse();
- }
-
- /**
- * Create an instance of {@link TestException }
- *
- */
- public TestException createTestException() {
- return new TestException();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link TestException }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://test/", name = "TestException")
- public JAXBElement<TestException> createTestException(TestException value) {
- return new JAXBElement<TestException>(_TestException_QNAME, TestException.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "", name = "arg0", scope = InvokeTest.class)
- public JAXBElement<String> createInvokeTestArg0(String value) {
- return new JAXBElement<String>(_InvokeTestArg0_QNAME, String.class, InvokeTest.class, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "", name = "return", scope = InvokeTestResponse.class)
- public JAXBElement<String> createInvokeTestResponseReturn(String value) {
- return new JAXBElement<String>(_InvokeTestResponseReturn_QNAME, String.class, InvokeTestResponse.class, value);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/README.txt b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/README.txt
deleted file mode 100644
index d376ab955d..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/README.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-This README describes the JAX-WS client files for the SCA Assembly test invocation interface.
-
-The test invocation interface is in the TestInvocation.java interface file.
-This is presented as a Web service by the SCA runtime, for invocation by a general Web service client.
-The WSDL is captured in the file TestClient.wsdl in the resources directory for the testcases.
-
-The JAX-WS client files for invoking the Web service contained in TestClient.wsdl are contained in this
-package. They are generated from the WSDL using the wsimport tool (a standard part of JDK 1.6.x):
-
-wsimport TestClient.wsdl -keep -p testClient
-
-"-keep" is used to ensure that the generated .java files are retained (otherwise all that is created are
-the binary .class files).
-
-"-p testClient" is used to force the generated Java files to belong to the package "testClient" - this package
-name is used to keep a clean separation between the client files and the test service files
-
-
-Mike Edwards, 6th January 2009. \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestException.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestException.java
deleted file mode 100644
index cfda989712..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestException.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package testClient;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for TestException complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="TestException">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="message" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "TestException", propOrder = {
- "message"
-})
-public class TestException {
-
- protected String message;
-
- /**
- * Gets the value of the message property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Sets the value of the message property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setMessage(String value) {
- this.message = value;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestException_Exception.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestException_Exception.java
deleted file mode 100644
index c710d0d6ef..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestException_Exception.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package testClient;
-
-import javax.xml.ws.WebFault;
-
-
-/**
- * This class was generated by the JAX-WS RI.
- * JAX-WS RI 2.1.1 in JDK 6
- * Generated source version: 2.1
- *
- */
-@WebFault(name = "TestException", targetNamespace = "http://test/")
-public class TestException_Exception
- extends Exception
-{
-
- /**
- * Java type that goes as soapenv:Fault detail element.
- *
- */
- private TestException faultInfo;
-
- /**
- *
- * @param message
- * @param faultInfo
- */
- public TestException_Exception(String message, TestException faultInfo) {
- super(message);
- this.faultInfo = faultInfo;
- }
-
- /**
- *
- * @param message
- * @param faultInfo
- * @param cause
- */
- public TestException_Exception(String message, TestException faultInfo, Throwable cause) {
- super(message, cause);
- this.faultInfo = faultInfo;
- }
-
- /**
- *
- * @return
- * returns fault bean: testClient.TestException
- */
- public TestException getFaultInfo() {
- return faultInfo;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestInvocation.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestInvocation.java
deleted file mode 100644
index d6633dea81..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestInvocation.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package testClient;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-
-
-/**
- * This class was generated by the JAX-WS RI.
- * JAX-WS RI 2.1.1 in JDK 6
- * Generated source version: 2.1
- *
- */
-@WebService(name = "TestInvocation", targetNamespace = "http://test/")
-@XmlSeeAlso({
- ObjectFactory.class
-})
-public interface TestInvocation {
-
-
- /**
- *
- * @param arg0
- * @return
- * returns java.lang.String
- * @throws TestException_Exception
- */
- @WebMethod
- @WebResult(targetNamespace = "")
- @RequestWrapper(localName = "invokeTest", targetNamespace = "http://test/", className = "testClient.InvokeTest")
- @ResponseWrapper(localName = "invokeTestResponse", targetNamespace = "http://test/", className = "testClient.InvokeTestResponse")
- public String invokeTest(
- @WebParam(name = "arg0", targetNamespace = "")
- String arg0)
- throws TestException_Exception
- ;
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestInvocationService.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestInvocationService.java
deleted file mode 100644
index 3ca43532ea..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/TestInvocationService.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package testClient;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebEndpoint;
-import javax.xml.ws.WebServiceClient;
-import javax.xml.ws.WebServiceFeature;
-
-
-/**
- * This class was generated by the JAX-WS RI.
- * JAX-WS RI 2.1.1 in JDK 6
- * Generated source version: 2.1
- *
- */
-@WebServiceClient(name = "TestInvocationService", targetNamespace = "http://test/", wsdlLocation = "file:/C:/temp/Tuscany_2_0_Work/TestClient.wsdl")
-public class TestInvocationService
- extends Service
-{
-
- private final static URL TESTINVOCATIONSERVICE_WSDL_LOCATION;
-
- static {
- URL url = null;
- try {
- url = new URL("file:/C:/temp/Tuscany_2_0_Work/TestClient.wsdl");
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- TESTINVOCATIONSERVICE_WSDL_LOCATION = url;
- }
-
- public TestInvocationService(URL wsdlLocation, QName serviceName) {
- super(wsdlLocation, serviceName);
- }
-
- public TestInvocationService() {
- super(TESTINVOCATIONSERVICE_WSDL_LOCATION, new QName("http://test/", "TestInvocationService"));
- }
-
- /**
- *
- * @return
- * returns TestInvocation
- */
- @WebEndpoint(name = "TestInvocationPort")
- public TestInvocation getTestInvocationPort() {
- return (TestInvocation)super.getPort(new QName("http://test/", "TestInvocationPort"), TestInvocation.class);
- }
-
- /**
- *
- * @param features
- * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
- * @return
- * returns TestInvocation
- */
- @WebEndpoint(name = "TestInvocationPort")
- public TestInvocation getTestInvocationPort(WebServiceFeature... features) {
- return (TestInvocation)super.getPort(new QName("http://test/", "TestInvocationPort"), TestInvocation.class, features);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/package-info.java b/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/package-info.java
deleted file mode 100644
index 3167a4513e..0000000000
--- a/tags/java/sca/2.0-M1/stest/sampleTest/src/test/java/testClient/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://test/")
-package testClient;
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/core/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/features/core/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/core/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/core/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/features/core/META-INF/MANIFEST.MF
deleted file mode 100644
index 63215d7c6f..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA Tools Core Feature
-Bundle-SymbolicName: org.apache.tuscany.sca.feature.core
-Bundle-Version: 1.4.0
-Bundle-Vendor: Apache Software Foundation
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/core/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/features/core/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/core/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/core/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/features/core/build.properties
deleted file mode 100644
index f36e15c5d3..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/core/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- NOTICE,\
- LICENSE,\
- META-INF/
-src.includes = .project,\
- LICENSE,\
- NOTICE,\
- build.properties,\
- feature.xml,\
- META-INF/
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/core/feature.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/core/feature.xml
deleted file mode 100644
index 1a20ac1eb1..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/core/feature.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<feature
- id="org.apache.tuscany.sca.feature.core"
- label="Apache Tuscany SCA Core Eclipse Feature"
- version="1.4.0"
- provider-name="Apache Software Foundation">
-
- <description url="http://incubator.apache.org/tuscany">
- Apache Tuscany SCA Tools Core Feature.
- </description>
-
- <license url="http://www.apache.org/licenses/LICENSE-2.0">
- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- </license>
-
- <requires>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.jobs"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.debug.ui"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.osgi"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.eclipse.ui.workbench"/>
- </requires>
-
- <plugin
- id="org.apache.tuscany.sca.plugin.core"
- download-size="0"
- install-size="0"
- version="1.4.0"/>
-
-</feature>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/core/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/core/pom.xml
deleted file mode 100644
index 11ddc162eb..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/core/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.feature.core</artifactId>
- <name>Apache Tuscany SCA Core Eclipse Feature</name>
-
- <build>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/META-INF/MANIFEST.MF
deleted file mode 100644
index f363ae7b2a..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA JEE Eclipse Feature
-Bundle-SymbolicName: org.apache.tuscany.sca.feature.ejava
-Bundle-Version: 1.4.0
-Bundle-Vendor: Apache Software Foundation
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/build.properties
deleted file mode 100644
index f36e15c5d3..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- NOTICE,\
- LICENSE,\
- META-INF/
-src.includes = .project,\
- LICENSE,\
- NOTICE,\
- build.properties,\
- feature.xml,\
- META-INF/
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/feature.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/feature.xml
deleted file mode 100644
index ef2ab6c2ba..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/feature.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<feature
- id="org.apache.tuscany.sca.feature.ejava"
- label="Apache Tuscany SCA JEE Eclipse Feature"
- version="1.4.0"
- provider-name="Apache Software Foundation">
-
- <description url="http://incubator.apache.org/tuscany">
- Apache Tuscany SCA JEE Eclipse Feature.
- </description>
-
- <license url="http://www.apache.org/licenses/LICENSE-2.0">
- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- </license>
-
- <requires>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.jobs"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.debug.ui"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.osgi"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.apache.tuscany.sca.plugin.core"/>
- <import plugin="org.eclipse.ui.workbench"/>
- <import feature="org.apache.tuscany.sca.feature.core" version="1.4.0"/>
- </requires>
-
- <plugin
- id="org.apache.tuscany.sca.plugin.ejava"
- download-size="0"
- install-size="0"
- version="1.4.0"/>
-
-</feature>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/pom.xml
deleted file mode 100644
index 87767f430c..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/ejava/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.feature.ejava</artifactId>
- <name>Apache Tuscany SCA JEE Eclipse Feature</name>
-
- <build>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/features/manager/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/features/manager/META-INF/MANIFEST.MF
deleted file mode 100644
index 8d8f5b271d..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA Domain Manager Eclipse Feature
-Bundle-SymbolicName: org.apache.tuscany.sca.feature.manager
-Bundle-Version: 1.4.0
-Bundle-Vendor: Apache Software Foundation
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/features/manager/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/features/manager/build.properties
deleted file mode 100644
index f36e15c5d3..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- NOTICE,\
- LICENSE,\
- META-INF/
-src.includes = .project,\
- LICENSE,\
- NOTICE,\
- build.properties,\
- feature.xml,\
- META-INF/
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/feature.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/manager/feature.xml
deleted file mode 100644
index 189342993d..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/feature.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<feature
- id="org.apache.tuscany.sca.feature.manager"
- label="Apache Tuscany SCA Domain Manager Eclipse Feature"
- version="1.4.0"
- provider-name="Apache Software Foundation">
-
- <description url="http://incubator.apache.org/tuscany">
- Apache Tuscany SCA Domain Manager Eclipse Feature.
- </description>
-
- <license url="http://www.apache.org/licenses/LICENSE-2.0">
- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- </license>
-
- <includes
- id="org.apache.tuscany.sca.feature.core"
- version="1.4.0"/>
-
- <requires>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.jobs"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.debug.ui"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.osgi"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.apache.tuscany.sca.plugin.core"/>
- <import plugin="org.eclipse.ui.workbench"/>
- <import feature="org.apache.tuscany.sca.feature.core" version="1.4.0"/>
- </requires>
-
- <plugin
- id="org.apache.tuscany.sca.plugin.manager"
- download-size="0"
- install-size="0"
- version="1.4.0"/>
-
-</feature>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/manager/pom.xml
deleted file mode 100644
index 5be50bac8d..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/manager/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.feature.manager</artifactId>
- <name>Apache Tuscany SCA Domain Manager Eclipse Feature</name>
-
- <build>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/process/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/features/process/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/process/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/process/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/features/process/META-INF/MANIFEST.MF
deleted file mode 100644
index 7f10d43405..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/process/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA Process Eclipse Feature
-Bundle-SymbolicName: org.apache.tuscany.sca.feature.process
-Bundle-Version: 1.4.0
-Bundle-Vendor: Apache Software Foundation
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/process/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/features/process/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/process/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/process/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/features/process/build.properties
deleted file mode 100644
index f36e15c5d3..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/process/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- NOTICE,\
- LICENSE,\
- META-INF/
-src.includes = .project,\
- LICENSE,\
- NOTICE,\
- build.properties,\
- feature.xml,\
- META-INF/
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/process/feature.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/process/feature.xml
deleted file mode 100644
index 08332be61e..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/process/feature.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<feature
- id="org.apache.tuscany.sca.feature.process"
- label="Apache Tuscany SCA Process Eclipse Feature"
- version="1.4.0"
- provider-name="Apache Software Foundation">
-
- <description url="http://incubator.apache.org/tuscany">
- Apache Tuscany SCA Process Eclipse Feature.
- </description>
-
- <license url="http://www.apache.org/licenses/LICENSE-2.0">
- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- </license>
-
- <includes
- id="org.apache.tuscany.sca.feature.core"
- version="1.4.0"/>
-
- <requires>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.jobs"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.debug.ui"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.osgi"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.apache.tuscany.sca.plugin.core"/>
- <import plugin="org.eclipse.ui.workbench"/>
- <import feature="org.apache.tuscany.sca.feature.core" version="1.4.0"/>
- </requires>
-
- <plugin
- id="org.apache.tuscany.sca.plugin.process"
- download-size="0"
- install-size="0"
- version="1.4.0"/>
-
-</feature>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/process/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/process/pom.xml
deleted file mode 100644
index de76f0bbf0..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/process/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.feature.process</artifactId>
- <name>Apache Tuscany SCA Process Eclipse Feature</name>
-
- <build>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/features/web20/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/features/web20/META-INF/MANIFEST.MF
deleted file mode 100644
index 2dc129ebaa..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA Web 2.0 Eclipse Feature
-Bundle-SymbolicName: org.apache.tuscany.sca.feature.web20
-Bundle-Version: 1.4.0
-Bundle-Vendor: Apache Software Foundation
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/features/web20/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/features/web20/build.properties
deleted file mode 100644
index f36e15c5d3..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- NOTICE,\
- LICENSE,\
- META-INF/
-src.includes = .project,\
- LICENSE,\
- NOTICE,\
- build.properties,\
- feature.xml,\
- META-INF/
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/feature.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/web20/feature.xml
deleted file mode 100644
index 8fe97d24a3..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/feature.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<feature
- id="org.apache.tuscany.sca.feature.web20"
- label="Apache Tuscany SCA Web 2.0 Eclipse Feature"
- version="1.4.0"
- provider-name="Apache Software Foundation">
-
- <description url="http://incubator.apache.org/tuscany">
- Apache Tuscany SCA Web 2.0 Eclipse Feature.
- </description>
-
- <license url="http://www.apache.org/licenses/LICENSE-2.0">
- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- </license>
-
- <includes
- id="org.apache.tuscany.sca.feature.core"
- version="1.4.0"/>
-
- <requires>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.jobs"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.debug.ui"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.osgi"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.apache.tuscany.sca.plugin.core"/>
- <import plugin="org.eclipse.ui.workbench"/>
- <import feature="org.apache.tuscany.sca.feature.core" version="1.4.0"/>
- </requires>
-
- <plugin
- id="org.apache.tuscany.sca.plugin.web20"
- download-size="0"
- install-size="0"
- version="1.4.0"/>
-
-</feature>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/web20/pom.xml
deleted file mode 100644
index cb21a9b831..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/web20/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.feature.web20</artifactId>
- <name>Apache Tuscany SCA Web 2.0 Eclipse Feature</name>
-
- <build>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/META-INF/MANIFEST.MF
deleted file mode 100644
index 9fb9f1282b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA Web Service Eclipse Feature
-Bundle-SymbolicName: org.apache.tuscany.sca.feature.webservice
-Bundle-Version: 1.4.0
-Bundle-Vendor: Apache Software Foundation
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/build.properties
deleted file mode 100644
index f36e15c5d3..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- NOTICE,\
- LICENSE,\
- META-INF/
-src.includes = .project,\
- LICENSE,\
- NOTICE,\
- build.properties,\
- feature.xml,\
- META-INF/
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/feature.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/feature.xml
deleted file mode 100644
index d905b6475c..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/feature.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<feature
- id="org.apache.tuscany.sca.feature.webservice"
- label="Apache Tuscany SCA Web Service Eclipse Feature"
- version="1.4.0"
- provider-name="Apache Software Foundation">
-
- <description url="http://incubator.apache.org/tuscany">
- Apache Tuscany SCA Web Service Eclipse Feature.
- </description>
-
- <license url="http://www.apache.org/licenses/LICENSE-2.0">
- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- </license>
-
- <includes
- id="org.apache.tuscany.sca.feature.core"
- version="1.4.0"/>
-
- <requires>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.jobs"/>
- <import plugin="org.eclipse.debug.core"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.debug.ui"/>
- <import plugin="org.eclipse.jdt.launching"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.osgi"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.apache.tuscany.sca.plugin.core"/>
- <import plugin="org.eclipse.ui.workbench"/>
- <import feature="org.apache.tuscany.sca.feature.core" version="1.4.0"/>
- </requires>
-
- <plugin
- id="org.apache.tuscany.sca.plugin.webservice"
- download-size="0"
- install-size="0"
- version="1.4.0"/>
-
-</feature>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/pom.xml
deleted file mode 100644
index e7a6f67d85..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/features/webservice/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.feature.webservice</artifactId>
- <name>Apache Tuscany SCA Web Service Eclipse Feature</name>
-
- <build>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/META-INF/MANIFEST.MF
deleted file mode 100644
index 0d8b1053bf..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,32 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA Core Eclipse Plugin
-Bundle-SymbolicName: org.apache.tuscany.sca.plugin.core;singleton:=true
-Bundle-Version: 1.4.0
-Import-Package: org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.core.runtime.jobs,
- org.eclipse.debug.core,
- org.eclipse.debug.core.model,
- org.eclipse.debug.ui,
- org.eclipse.debug.ui.sourcelookup,
- org.eclipse.jdt.core,
- org.eclipse.jdt.debug.ui.launchConfigurations,
- org.eclipse.jdt.launching,
- org.eclipse.jdt.ui.wizards,
- org.eclipse.jface.dialogs,
- org.eclipse.jface.operation,
- org.eclipse.jface.resource,
- org.eclipse.jface.viewers,
- org.eclipse.jface.wizard,
- org.eclipse.osgi.service.datalocation;version="1.0.0",
- org.eclipse.swt,
- org.eclipse.swt.graphics,
- org.eclipse.swt.widgets,
- org.eclipse.ui,
- org.eclipse.ui.progress,
- org.osgi.framework;version="1.3.0"
-Bundle-Vendor: Apache Software Foundation
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.ui.ide
-Export-Package: org.apache.tuscany.sca.plugin.core.classpath
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/NOTICE
deleted file mode 100644
index 8591680386..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/NOTICE
+++ /dev/null
@@ -1,12 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software under the SCA Collaboration license
-(see the LICENSE file contained in this distribution), with the following
-copyright:
-
-(c) Copyright SCA Collaboration 2006, 2007
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/build.properties
deleted file mode 100644
index c402b2eb45..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
- plugin.xml,\
- xsd/,\
- icons/,\
- .,\
- LICENSE,\
- NOTICE,\
- org/
-src.includes = xsd/,\
- plugin.xml,\
- .classpath,\
- .project,\
- LICENSE,\
- META-INF/,\
- NOTICE,\
- build.properties,\
- icons/,\
- .settings/,\
- org/,\
- pom.xml
-jars.compile.order = .
-source.. = .
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/exsd/runtimeClasspathContainerInitializer.exsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/exsd/runtimeClasspathContainerInitializer.exsd
deleted file mode 100644
index 6b6d79d45b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/exsd/runtimeClasspathContainerInitializer.exsd
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.apache.tuscany.sca.plugin.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.apache.tuscany.sca.plugin.core" id="runtimeClasspathContainerInitializer" name="Tuscany Runtime Classpath Container Initializers"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="runtimeClasspathContainerInitializer">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jdt.core.IClasspathContainer"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiInfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/icons/t.gif b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/icons/t.gif
deleted file mode 100644
index ba896ced08..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/icons/t.gif
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/icons/tuscany.gif b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/icons/tuscany.gif
deleted file mode 100644
index 849dd76d4a..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/icons/tuscany.gif
+++ /dev/null
Binary files differ
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseClasspathContainer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseClasspathContainer.java
deleted file mode 100644
index ee9a3d2de9..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseClasspathContainer.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.classpath;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainer;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.osgi.framework.Bundle;
-
-/**
- * A base classpath container implementation.
- *
- * @version $Rev$ $Date$
- */
-public class BaseClasspathContainer implements RuntimeClasspathContainer {
-
- private String pluginID;
- private String libraryID;
- private String libraryName;
- private String distributionName;
- private String sourceDistributionName;
- private String distributionVersion;
- private String homeProperty;
- private String sourceProperty;
-
- /**
- * Constructs a new Classpath container.
- *
- * @param pluginID
- * @param libraryID
- * @param libraryName
- * @param distributionName
- * @param distributionVersion
- * @param homeProperty
- * @param sourceProperty
- */
- public BaseClasspathContainer(String pluginID, String libraryID, String libraryName,
- String distributionName, String sourceDistributionName, String distributionVersion,
- String homeProperty, String sourceProperty) {
- this.pluginID = pluginID;
- this.libraryID = libraryID;
- this.libraryName = libraryName;
- this.distributionName = distributionName;
- this.sourceDistributionName = sourceDistributionName;
- this.distributionVersion = distributionVersion;
- this.homeProperty = homeProperty;
- this.sourceProperty = sourceProperty;
- }
-
- public IClasspathEntry[] getClasspathEntries() {
- List<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
-
- // Get the runtime distribution location
- IPath runtimePath = runtimePath();
-
- // Get the source distribution location
- IPath sourcePath = sourcePath();
-
- // Add the JARs from runtime/lib and runtime/modules as classpath entries
- if (runtimePath != null) {
-
- // Add the jars from runtime/modules
- File modulesDirectory = runtimePath.append("modules").toFile();
- if (modulesDirectory != null && modulesDirectory.exists()) {
- for (File file : modulesDirectory.listFiles()) {
- IPath path = new Path(file.getPath());
- String name = path.lastSegment();
- String extension = path.getFileExtension();
-
- // Only include API and launcher JARs
- if (!"jar".equals(extension)) {
- continue;
- }
- if (name.indexOf("-api-") == -1 && name.indexOf("-launcher-") == -1) {
- continue;
- }
-
- list.add(JavaCore.newLibraryEntry(path, sourcePath, null));
- }
- }
-
- // Add the jars from runtime/lib
- File libDirectory = runtimePath.append("lib").toFile();
- if (libDirectory != null && libDirectory.exists()) {
- for (File file : libDirectory.listFiles()) {
- IPath path = new Path(file.getPath());
- String name = path.lastSegment();
- String extension = path.getFileExtension();
-
- // Only include jaxb, jaxws and jsr API JARs
- if (!"jar".equals(extension)) {
- continue;
- }
- if (name.indexOf("-api-") != -1) {
- if (name.startsWith("jaxb") || name.startsWith("jaxws") || name.startsWith("jsr")) {
- list.add(JavaCore.newLibraryEntry(path, sourcePath, null));
- }
- }
- }
- }
- }
-
- return (IClasspathEntry[])list.toArray(new IClasspathEntry[list.size()]);
- }
-
- public IClasspathEntry[] getRuntimeClasspathEntries() {
-
- // Get the runtime distribution location
- IPath runtimePath = runtimePath();
-
- if (runtimePath != null) {
- return new IClasspathEntry[] {JavaCore.newLibraryEntry(runtimePath, null, null)};
- } else {
- return new IClasspathEntry[0];
- }
- }
-
- public String getDescription() {
- return libraryName;
- }
-
- public int getKind() {
- return IClasspathContainer.K_APPLICATION;
- }
-
- public IPath getPath() {
- return new Path(libraryID);
- }
-
- /**
- * Returns the location of the runtime distribution.
- *
- * @return
- */
- private IPath runtimePath() {
- IPath path = artifactLocation(pluginID, distributionName, distributionVersion, null, null);
-
- if (path == null) {
-
- // Try to get the location of the distribution from
- // the HOME property or environment variable
- String home = System.getProperty(homeProperty);
- if (home == null || home.length() == 0) {
- home = System.getenv(homeProperty);
- }
- if (home != null && home.length() != 0) {
- if (new File(home).exists()) {
- path = new Path(home);
- }
- }
- }
- return path;
- }
-
- /**
- * Returns the location of the source distribution.
- *
- * @return
- */
- private IPath sourcePath() {
- IPath path = artifactLocation(pluginID, sourceDistributionName, distributionVersion, "src", ".zip");
-
- if (path == null) {
-
- // Try to get the location of the source distribution from
- // the SRC property or environment variable
- String source = System.getProperty(sourceProperty);
- if (source == null || source.length() == 0) {
- source = System.getenv(sourceProperty);
- }
- if (source != null && source.length() != 0) {
- if (new File(source).exists()) {
- path = new Path(source);
- }
- }
- }
- return path;
- }
-
- /**
- * Returns the location of the specified artifact.
- *
- * @param pluginId
- * @param artifactId
- * @param version
- * @param classifier
- * @param extension
- * @return
- */
- private IPath artifactLocation(String pluginId, String artifactId, String version, String classifier, String extension) {
- String artifactName;
- if (classifier != null) {
- artifactName = artifactId + '-' + version + '-' + classifier;
- } else {
- artifactName = artifactId + '-' + version;
- }
- if (extension != null) {
- artifactName += extension;
- }
- try {
- Bundle bundle = Platform.getBundle(pluginId);
- URL location = FileLocator.find(bundle, new Path(artifactName), null);
- location = FileLocator.toFileURL(location);
- IPath path = new Path(new File(location.toURI()).getPath());
- return path;
- } catch (Exception e) {
- error("Artifact not found: " + artifactName, e);
- return null;
- }
- }
-
- /**
- * Log an error.
- *
- * @param msg
- * @param e
- */
- private void error(String msg, Exception e) {
- Platform.getLog(
- Platform.getBundle(pluginID)).log(
- new Status(IStatus.ERROR, pluginID, IStatus.OK, msg, e));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseClasspathContainerInitializer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseClasspathContainerInitializer.java
deleted file mode 100644
index 7ea8d700f7..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseClasspathContainerInitializer.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainerInitializer;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.ClasspathContainerInitializer;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-
-/**
- * A base classpath container implementation.
- *
- * @version $Rev$ $Date$
- */
-public class BaseClasspathContainerInitializer extends ClasspathContainerInitializer implements RuntimeClasspathContainerInitializer {
-
- private RuntimeClasspathContainer container;
-
- public BaseClasspathContainerInitializer(RuntimeClasspathContainer container) {
- this.container = container;
- }
-
- @Override
- public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
- JavaCore.setClasspathContainer(containerPath,
- new IJavaProject[] {project},
- new IClasspathContainer[] {container},
- null);
- }
-
- @Override
- public boolean canUpdateClasspathContainer(IPath containerPath, IJavaProject project) {
- return true;
- }
-
- public IClasspathContainer getRuntimeClasspathContainer() {
- return new IClasspathContainer() {
- public IClasspathEntry[] getClasspathEntries() {
- return container.getRuntimeClasspathEntries();
- }
-
- public String getDescription() {
- return container.getDescription();
- }
-
- public int getKind() {
- return container.getKind();
- }
-
- public IPath getPath() {
- return container.getPath();
- }
- };
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseLibraryEntryPage.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseLibraryEntryPage.java
deleted file mode 100644
index 70e794d2ce..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/BaseLibraryEntryPage.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.classpath;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.wizards.IClasspathContainerPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * A base classpath container page implementation.
- *
- * @version $Rev$ $Date$
- */
-public class BaseLibraryEntryPage extends WizardPage implements IClasspathContainerPage {
-
- private String name;
- private String id;
- private IClasspathEntry classpathEntry;
-
- public BaseLibraryEntryPage(String id, String name) {
- super(name);
- this.name = name;
- this.id = id;
- }
-
- public void createControl(Composite parent) {
- setTitle(name);
-
- Label label = new Label(parent, SWT.NONE);
- label.setText("Press Finish to add the library.");
- label.setFont(parent.getFont());
-
- setControl(label);
- }
-
- public boolean finish() {
- classpathEntry = JavaCore.newContainerEntry(new Path(id));
- return true;
- }
-
- public boolean isPageComplete() {
- return true;
- }
-
- public IClasspathEntry getSelection() {
- return classpathEntry;
- }
-
- public void setSelection(IClasspathEntry containerEntry) {
- this.classpathEntry = containerEntry;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreClasspathContainer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreClasspathContainer.java
deleted file mode 100644
index 53a8f8b32f..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreClasspathContainer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainer;
-
-
-/**
- * A classpath container for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class CoreClasspathContainer extends BaseClasspathContainer implements RuntimeClasspathContainer {
-
- public CoreClasspathContainer() {
- super("org.apache.tuscany.sca.plugin.core",
- "org.apache.tuscany.sca.plugin.core.runtime.library", "Tuscany SCA Core Library",
- "tuscany-sca", "tuscany-distribution-core", "1.4-EQUINOX-SNAPSHOT",
- "TUSCANY_HOME", "TUSCANY_SRC");
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreClasspathContainerInitializer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreClasspathContainerInitializer.java
deleted file mode 100644
index 883c7c0781..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreClasspathContainerInitializer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.core.classpath.CoreClasspathContainer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainerInitializer;
-
-
-/**
- * A classpath container initializer for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class CoreClasspathContainerInitializer extends BaseClasspathContainerInitializer implements RuntimeClasspathContainerInitializer {
-
- public CoreClasspathContainerInitializer() {
- super(new CoreClasspathContainer());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreLibraryEntryPage.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreLibraryEntryPage.java
deleted file mode 100644
index f90483a00d..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/CoreLibraryEntryPage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseLibraryEntryPage;
-
-
-/**
- * A classpath container page for the core runtime library.
- *
- * @version $Rev$ $Date$
- */
-public class CoreLibraryEntryPage extends BaseLibraryEntryPage {
-
- public CoreLibraryEntryPage() {
- super("org.apache.tuscany.sca.plugin.core.runtime.library", "Tuscany SCA Core Library");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainer.java
deleted file mode 100644
index 4830268272..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.classpath;
-
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-
-/**
- * A provider of a classpath container for use when launching the Tuscany
- * runtime.
- *
- * @version $Rev: $ $Date: $
- */
-public interface RuntimeClasspathContainer extends IClasspathContainer {
-
- /**
- * Returns the classpath entries to use at runtime.
- *
- * @return
- */
- IClasspathEntry[] getRuntimeClasspathEntries();
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainerInitializer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainerInitializer.java
deleted file mode 100644
index 18850d9333..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainerInitializer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.classpath;
-
-import org.eclipse.jdt.core.IClasspathContainer;
-
-/**
- * A provider of a classpath container for use when launching the Tuscany
- * runtime.
- *
- * @version $Rev: $ $Date: $
- */
-public interface RuntimeClasspathContainerInitializer {
-
- /**
- * Returns the classpath container to use.
- *
- * @return
- */
- IClasspathContainer getRuntimeClasspathContainer();
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainerInitializerExtensionPoint.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainerInitializerExtensionPoint.java
deleted file mode 100644
index 909290859a..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/classpath/RuntimeClasspathContainerInitializerExtensionPoint.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.classpath;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainerInitializer;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-
-/**
- * Utility functions to help list extensions registered in the runtime classpath
- * extension point.
- *
- * @version $Rev: $ $Date: $
- */
-public class RuntimeClasspathContainerInitializerExtensionPoint {
-
- private static final String EXTENSION_POINT_ID = "org.apache.tuscany.sca.plugin.core.runtimeClasspathContainerInitializer";
-
- /**
- * Return the installed runtime classpath entries.
- *
- * @return
- * @throws CoreException
- */
- public static String installedRuntimeClasspath() throws CoreException {
-
- List<IClasspathEntry> classpathEntries = new ArrayList<IClasspathEntry>();
- for (IExtension extension: Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID).getExtensions()) {
- for (IConfigurationElement configuration: extension.getConfigurationElements()) {
- RuntimeClasspathContainerInitializer initializer = (RuntimeClasspathContainerInitializer)configuration.createExecutableExtension("class");
- IClasspathContainer container = initializer.getRuntimeClasspathContainer();
- classpathEntries.addAll(Arrays.asList(container.getClasspathEntries()));
- }
- }
-
- String separator = System.getProperty("path.separator");
- StringBuffer classpath = new StringBuffer();
- for (int i = 0, n = classpathEntries.size(); i < n; i++) {
- IClasspathEntry entry = classpathEntries.get(i);
- if (i >0) {
- classpath.append(separator);
- }
- classpath.append(entry.getPath().toFile().toURI().getPath());
- }
-
- return classpath.toString();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/DomainManagerLauncherUtil.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/DomainManagerLauncherUtil.java
deleted file mode 100644
index 060f6ff6cb..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/DomainManagerLauncherUtil.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.launch;
-
-import static org.apache.tuscany.sca.plugin.core.launch.TuscanyLaunchConfigurationDelegate.TUSCANY_LAUNCH_CONFIGURATIONTYPE;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.Socket;
-
-import org.apache.tuscany.sca.plugin.core.classpath.CoreClasspathContainer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainerInitializerExtensionPoint;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.JavaRuntime;
-
-/**
- * Provides utility methods to launch the SCA Domain Manager.
- *
- * @version $Rev: $ $Date: $
- */
-public class DomainManagerLauncherUtil {
-
- private static final String TUSCANY_DOMAIN_LAUNCH_CONFIGURATION = "SCA Domain Manager";
- private static final String TUSCANY_SCA_DOMAIN_PROJECT = "tuscany-sca-domain";
-
- private static final String PING_HEADER =
- "GET /ping HTTP/1.0\n" + "Host: localhost\n"
- + "Content-Type: text/xml\n"
- + "Connection: close\n"
- + "Content-Length: ";
- private static final String PING_CONTENT = "";
- private static final String PING =
- PING_HEADER + PING_CONTENT.getBytes().length + "\n\n" + PING_CONTENT;
-
- /**
- * Returns the SCA domain project.
- *
- * @return
- * @throws CoreException
- */
- static IProject domainProject(IProgressMonitor progressMonitor) throws CoreException {
-
- IProject domainProject = ResourcesPlugin.getWorkspace().getRoot().getProject(TUSCANY_SCA_DOMAIN_PROJECT);
- if (progressMonitor.isCanceled()) {
- return domainProject;
- }
- if (!domainProject.exists()) {
- progressMonitor.subTask("Creating SCA domain resources");
-
- // Create SCA domain project if necessary
- domainProject.create(new SubProgressMonitor(progressMonitor, 5));
- domainProject.open(new SubProgressMonitor(progressMonitor, 5));
-
- String html = "<html>\n" +
- "<head>\n" +
- "<meta http-equiv=\"refresh\" content=\"0;url=http://localhost:9990/ui/home\">\n" +
- "</head>\n" +
- "<body>\n" +
- "<a href=\"http://localhost:9990/ui/home\">SCA Domain</a>\n" +
- "</body>\n" +
- "</html>";
-
- IFile file = domainProject.getFile(new Path("domain.html"));
- file.create(new ByteArrayInputStream(html.getBytes()), true, new SubProgressMonitor(progressMonitor, 5));
-
- IProjectDescription description = domainProject.getDescription();
- String[] prevNatures= description.getNatureIds();
- String[] newNatures= new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
- newNatures[prevNatures.length]= JavaCore.NATURE_ID;
- description.setNatureIds(newNatures);
- domainProject.setDescription(description, new SubProgressMonitor(progressMonitor, 5));
-
- IJavaProject javaProject = JavaCore.create(domainProject);
- javaProject.setOutputLocation(domainProject.getFullPath(), new SubProgressMonitor(progressMonitor, 5));
-
- IClasspathEntry classPath = JavaCore.newContainerEntry(new CoreClasspathContainer().getPath());
- IClasspathEntry jrePath = JavaRuntime.getDefaultJREContainerEntry();
- javaProject.setRawClasspath(new IClasspathEntry[] {jrePath, classPath}, new SubProgressMonitor(progressMonitor, 5));
-
- } else {
- domainProject.open(new SubProgressMonitor(progressMonitor, 5));
- }
-
- return domainProject;
- }
-
- /**
- * Returns true if the SCA domain controller is running.
- *
- * @return
- */
- private static boolean isDomainManagerRunning() {
- try {
- Socket client = new Socket("localhost", 9990);
- OutputStream os = client.getOutputStream();
- os.write(DomainManagerLauncherUtil.PING.getBytes());
- os.flush();
- String response = DomainManagerLauncherUtil.read(client);
- if (response.indexOf("<span id=\"ping\">") != -1) {
- return true;
- } else {
- return false;
- }
- } catch (IOException e) {
- return false;
- }
- }
-
- /**
- * Wait for domain to be running.
- *
- * @return
- */
- private static boolean waitForDomainManager(IProgressMonitor progressMonitor) throws InterruptedException {
- progressMonitor.subTask("Contacting SCA domain manager");
- for (int i = 0; i < 40; i++) {
- if (progressMonitor.isCanceled()) {
- return false;
- }
- if (isDomainManagerRunning()) {
- return true;
- }
- Thread.sleep(500);
- }
- return false;
- }
-
- static void launchDomainManager(IProgressMonitor progressMonitor) throws JavaModelException, CoreException, InterruptedException {
-
- progressMonitor.beginTask("Starting SCA Domain Manager", 100);
-
- // If the SCA domain controller is not running yet, launch it
- if (!isDomainManagerRunning()) {
-
- progressMonitor.subTask("Starting SCA domain manager");
- if (progressMonitor.isCanceled()) {
- return;
- }
-
- // Get the SCA domain project
- IProject domainProject = domainProject(progressMonitor);
-
- // Get the domain manager launch configuration
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType =launchManager.getLaunchConfigurationType(TUSCANY_LAUNCH_CONFIGURATIONTYPE);
- ILaunchConfiguration configuration = null;
- for (ILaunchConfiguration c : launchManager.getLaunchConfigurations(launchConfigurationType)) {
- if (TUSCANY_DOMAIN_LAUNCH_CONFIGURATION.equals(c.getName())) {
- configuration = c;
- break;
- }
- }
-
- if (configuration == null) {
- progressMonitor.worked(10);
- if (progressMonitor.isCanceled()) {
- return;
- }
-
- // Create a new launch configuration
- ILaunchConfigurationWorkingCopy newConfiguration = launchConfigurationType.newInstance(null, TUSCANY_DOMAIN_LAUNCH_CONFIGURATION);
-
- // Set the project and type to launch
- newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, domainProject.getProject().getName());
- newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.apache.tuscany.sca.node.launcher.DomainManagerLauncher");
- newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, domainProject.getLocation().toString());
-
- // Pass the runtime classpath as a system property
- newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "\"-DTUSCANY_PATH=" + RuntimeClasspathContainerInitializerExtensionPoint.installedRuntimeClasspath() + "\"");
-
- // Save the configuration
- newConfiguration.doSave();
-
- configuration = newConfiguration;
- }
-
- // Launch
- configuration.launch(ILaunchManager.RUN_MODE, new SubProgressMonitor(progressMonitor, 20));
-
- if (progressMonitor.isCanceled()) {
- return;
- }
- if (!waitForDomainManager(progressMonitor)) {
- throw new RuntimeException("SCA Domain Manager could not be started.");
- }
- }
- if (progressMonitor.isCanceled()) {
- return;
- }
- progressMonitor.done();
-
- }
-
- /**
- * Read a String from a socket.
- *
- * @param socket
- * @return
- * @throws IOException
- */
- static String read(Socket socket) throws IOException {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
- StringBuffer sb = new StringBuffer();
- String str;
- while ((str = reader.readLine()) != null) {
- sb.append(str);
- }
- return sb.toString();
- } finally {
- if (reader != null) {
- reader.close();
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/NodeLauncherUtil.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/NodeLauncherUtil.java
deleted file mode 100644
index edbe4b3e69..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/NodeLauncherUtil.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.launch;
-
-import static org.apache.tuscany.sca.plugin.core.launch.DomainManagerLauncherUtil.domainProject;
-import static org.apache.tuscany.sca.plugin.core.launch.DomainManagerLauncherUtil.launchDomainManager;
-import static org.apache.tuscany.sca.plugin.core.launch.TuscanyLaunchConfigurationDelegate.TUSCANY_LAUNCH_CONFIGURATIONTYPE;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.Socket;
-
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainerInitializerExtensionPoint;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-
-/**
- * Provides utility methods to launch SCA nodes.
- *
- * @version $Rev: $ $Date: $
- */
-public class NodeLauncherUtil {
-
- private static final String START_HEADER1 =
- "GET /quickstart?";
- private static final String START_HEADER2 =
- " HTTP/1.0\n" + "Host: localhost\n"
- + "Content-Type: text/xml\n"
- + "Connection: close\n"
- + "Content-Length: ";
- private static final String START_CONTENT = "";
-
- /**
- * Launch an SCA node.
- *
- * @param mode
- * @param file
- * @param launchManager
- * @param launchConfigurationType
- * @throws CoreException
- * @throws JavaModelException
- */
- static void launchNode(String mode,
- IFile file,
- IProgressMonitor progressMonitor) throws CoreException, JavaModelException, IOException, InterruptedException {
- progressMonitor.subTask("Starting SCA node");
- if (progressMonitor.isCanceled()) {
- return;
- }
-
- // First start the SCA domain manager
- launchDomainManager(new SubProgressMonitor(progressMonitor, 20));
-
- // Get the Java project
- IJavaProject javaProject = JavaCore.create(file.getProject());
-
- // Get the contribution location and URI
- String contributionLocation = contributionLocation(javaProject);
- String contributionURI = contributionURI(javaProject);
-
- // Determine the composite file URI
- String compositeURI = compositeURI(javaProject, file);
-
- // Configure the node
- String nodeName = configureNode(contributionURI, contributionLocation, compositeURI, progressMonitor);
-
- // Get the node launch configuration
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType =launchManager.getLaunchConfigurationType(TUSCANY_LAUNCH_CONFIGURATIONTYPE);
- ILaunchConfiguration configuration = null;
- for (ILaunchConfiguration c : launchManager.getLaunchConfigurations(launchConfigurationType)) {
- if (file.getFullPath().toString().equals(c.getAttribute("COMPOSITE_PATH", ""))) {
- configuration = c;
- break;
- }
- }
-
- if (configuration == null) {
- progressMonitor.worked(10);
- if (progressMonitor.isCanceled()) {
- return;
- }
-
- // Create a new launch configuration
- ILaunchConfigurationWorkingCopy newConfiguration = launchConfigurationType.newInstance(null,
- launchManager.generateUniqueLaunchConfigurationNameFrom(file.getName()));
-
- // Set the project and type to launch
- newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, file.getProject().getName());
- newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.apache.tuscany.sca.node.launcher.NodeLauncher");
-
- // Pass the URL of the node install image to the launcher
- newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
- "http://localhost:9990/node-config/" + nodeName);
-
- // Save the composite path in the launch configuration
- newConfiguration.setAttribute("COMPOSITE_PATH", file.getFullPath().toString());
-
- // Pass the runtime classpath as a system property
- newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "\"-DTUSCANY_PATH=" + RuntimeClasspathContainerInitializerExtensionPoint.installedRuntimeClasspath() + "\"");
-
- // Save the configuration
- newConfiguration.doSave();
-
- configuration = newConfiguration;
- }
-
- // Launch
- configuration.launch(mode, null);
- }
-
- /**
- * Returns the location of the SCA contribution representing a Java project.
- * @param javaProject
- * @return
- * @throws MalformedURLException
- * @throws JavaModelException
- */
- private static String contributionLocation(IJavaProject javaProject) throws MalformedURLException, JavaModelException {
- IPath location = javaProject.getOutputLocation();
- IResource resource;
- if (location.segmentCount() == 1) {
- resource = javaProject.getProject();
- } else {
- resource = javaProject.getProject().getWorkspace().getRoot().getFolder(location);
- }
- location = resource.getLocation();
- String url = location.toFile().toURI().toURL().toString();
- if (url.endsWith("/")) {
- url = url.substring(0, url.length() - 1);
- }
- return url;
- }
-
- /**
- * Returns the URI of the SCA contribution representing a Java project.
- * @param javaProject
- * @return
- */
- private static String contributionURI(IJavaProject javaProject) {
- return javaProject.getProject().getName();
- }
-
- /**
- * Returns the SCA artifact URI of a composite file inside a Java project.
- *
- * @param javaProject
- * @param file
- * @return
- * @throws JavaModelException
- */
- private static String compositeURI(IJavaProject javaProject, IFile file) throws JavaModelException {
-
- // Find the Java source container containing the specified file
- IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
- int sourceFolderSegments = 0;
- for (IClasspathEntry entry : classpathEntries) {
- if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- sourceFolderSegments = entry.getPath().matchingFirstSegments(file.getFullPath());
- if (sourceFolderSegments > 0)
- break;
- }
- }
-
- // Determine the composite URI
- String compositeURI = file.getFullPath().removeFirstSegments(sourceFolderSegments).toString();
- return compositeURI;
- }
-
- /**
- * Send a request to the SCA domain manager to configure an SCA node for
- * the specified composite.
- *
- * @param contributionURI
- * @param contributionLocation
- * @param compositeURI
- * @return
- * @throws IOException
- */
- private static String configureNode(String contributionURI, String contributionLocation, String compositeURI,
- IProgressMonitor progressMonitor) throws IOException, CoreException {
- progressMonitor.subTask("Configuring node");
-
- // Send the request to configure the node
- Socket client = new Socket("localhost", 9990);
- OutputStream os = client.getOutputStream();
- String request = START_HEADER1 +
- "contribution=" + contributionURI + "&location=" + contributionLocation + "&composite=" + compositeURI +
- START_HEADER2 + START_CONTENT.getBytes().length + "\n\n" + START_CONTENT;
- os.write(request.getBytes());
- os.flush();
- String response = DomainManagerLauncherUtil.read(client);
-
- // Refresh the domain project
- domainProject(progressMonitor).refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
-
- int i = response.indexOf("<span id=\"node\">");
- if (i != -1) {
-
- // Extract the node name
- response = response.substring(i + 16);
- i = response.indexOf("</span>");
- String nodeName = response.substring(0, i);
- return nodeName;
-
- } else {
- throw new RuntimeException("Node could not be configured: " + response);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchConfigurationDelegate.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchConfigurationDelegate.java
deleted file mode 100644
index 056deb5b27..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchConfigurationDelegate.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.launch;
-
-import java.io.File;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
-import org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate;
-import org.eclipse.jdt.launching.ExecutionArguments;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMRunner;
-import org.eclipse.jdt.launching.VMRunnerConfiguration;
-
-/**
- * Launch configuration delegate for the Tuscany launch configuration.
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyLaunchConfigurationDelegate extends AbstractJavaLaunchConfigurationDelegate implements
- ILaunchConfigurationDelegate {
-
- public static final String TUSCANY_LAUNCH_CONFIGURATIONTYPE = "org.apache.tuscany.sca.plugin.core.launch.configurationtype";
-
- public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
- throws CoreException {
-
- // Verify the configuration
- String mainTypeName = verifyMainTypeName(configuration);
- IVMInstall vm = verifyVMInstall(configuration);
- IVMRunner runner = vm.getVMRunner(mode);
-
- ExecutionArguments execArgs =
- new ExecutionArguments(getVMArguments(configuration), getProgramArguments(configuration));
- Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
- String[] classpath = getClasspath(configuration);
-
- File workingDir = verifyWorkingDirectory(configuration);
- String workingDirName = null;
- if (workingDir != null)
- workingDirName = workingDir.getAbsolutePath();
-
- // Create a VM runner configuration
- VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName, classpath);
- runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
- runConfig.setVMArguments(execArgs.getVMArgumentsArray());
- runConfig.setVMSpecificAttributesMap(vmAttributesMap);
- runConfig.setWorkingDirectory(workingDirName);
- runConfig.setBootClassPath(getBootpath(configuration));
-
- // Run!!
- runner.run(runConfig, launch, monitor);
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchConfigurationTabGroup.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchConfigurationTabGroup.java
deleted file mode 100644
index 5f8ea73db4..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.launch;
-
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.CommonTab;
-import org.eclipse.debug.ui.EnvironmentTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
-
-/**
- * Tab groups from the Tuscany launch configuration.
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup implements
- ILaunchConfigurationTabGroup {
-
- public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- ILaunchConfigurationTab[] tabs =
- new ILaunchConfigurationTab[] {new JavaArgumentsTab(), new JavaJRETab(), new JavaClasspathTab(),
- new SourceLookupTab(), new EnvironmentTab(), new CommonTab()};
-
- setTabs(tabs);
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchDomainManagerAction.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchDomainManagerAction.java
deleted file mode 100644
index f66fa71191..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchDomainManagerAction.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.plugin.core.launch;
-
-import static org.apache.tuscany.sca.plugin.core.launch.DomainManagerLauncherUtil.launchDomainManager;
-import static org.apache.tuscany.sca.plugin.core.log.LogUtil.error;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * Launch the SCA DomainManager.
- *
- * @version $Rev: $ $Date: $
- */
-public class TuscanyLaunchDomainManagerAction implements IWorkbenchWindowActionDelegate {
-
- private IWorkbenchWindow window;
-
- public TuscanyLaunchDomainManagerAction() {
- }
-
- public void run(IAction action) {
-
- try {
-
- // Run with a progress monitor
- window.run(true, true, new IRunnableWithProgress() {
-
- public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
- try {
-
- launchDomainManager(progressMonitor);
-
- } catch (Exception e) {
- throw new InvocationTargetException(e);
- } finally {
- progressMonitor.done();
- }
- }
- });
-
- } catch (Exception e) {
- error("Could not launch SCA Domain Manager", e);
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- public void dispose() {
- }
-
- public void init(IWorkbenchWindow window) {
- this.window = window;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchNodeFilter.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchNodeFilter.java
deleted file mode 100644
index 6eba5ffdc2..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchNodeFilter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.launch;
-
-/**
- * TuscanyLaunchNodeFilter
- *
- * @version $Rev: $ $Date: $
- */
-public class TuscanyLaunchNodeFilter {
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchNodeShortcut.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchNodeShortcut.java
deleted file mode 100644
index 2a4c7206db..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/launch/TuscanyLaunchNodeShortcut.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.launch;
-
-import static org.apache.tuscany.sca.plugin.core.launch.NodeLauncherUtil.launchNode;
-import static org.apache.tuscany.sca.plugin.core.log.LogUtil.error;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.ui.ILaunchShortcut;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * A launch shortcut for SCA .composite files.
- *
- * @version $Rev$ $Date$
- */
-public class TuscanyLaunchNodeShortcut implements ILaunchShortcut {
-
- public void launch(final ISelection selection, final String mode) {
-
- try {
-
- // Make sure we have a .composite file selected
- if (!(selection instanceof IStructuredSelection)) {
- return;
- }
- Object[] selections = ((IStructuredSelection)selection).toArray();
- if (selections.length == 0) {
- return;
- }
- final IFile file = (IFile)selections[0];
- if (!file.getFileExtension().equals("composite")) {
- return;
- }
-
- // Run with a progress monitor
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, new IRunnableWithProgress() {
-
- public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
- try {
- progressMonitor.beginTask("Starting SCA Composite", 100);
-
- launchNode(mode, file, progressMonitor);
-
- progressMonitor.done();
-
- } catch (Exception e) {
- throw new InvocationTargetException(e);
- } finally {
- progressMonitor.done();
- }
- }
- });
-
- } catch (Exception e) {
- error("Could not launch SCA composite", e);
- }
- }
-
- public void launch(IEditorPart editor, String mode) {
- //TODO later...
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/log/LogUtil.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/log/LogUtil.java
deleted file mode 100644
index 5fc1a75960..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/log/LogUtil.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.log;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-
-/**
- * A log utility
- *
- * @version $Rev: $ $Date: $
- */
-public class LogUtil {
-
- public static void error(String msg, Exception e) {
- Platform.getLog(
- Platform.getBundle("org.apache.tuscany.sca.plugin.core")).log(
- new Status(IStatus.ERROR, "org.apache.tuscany.sca.plugin.core", IStatus.OK, msg, e));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewComponentTypeWizard.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewComponentTypeWizard.java
deleted file mode 100644
index 702da9701e..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewComponentTypeWizard.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.newwizards;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-
-/**
- * A wizard to create new .componentType files.
- *
- * @version $Rev$ $Date$
- */
-public class NewComponentTypeWizard extends Wizard implements IWorkbenchWizard {
-
- private IWorkbench workbench;
- private IStructuredSelection selection;
- private NewComponentTypeWizardPage mainPage;
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle("New SCA ComponentType");
- }
-
- public void addPages() {
- mainPage = new NewComponentTypeWizardPage(workbench, selection);
- addPage(mainPage);
- }
-
- @Override
- public boolean performFinish() {
- return mainPage.finish();
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewComponentTypeWizardPage.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewComponentTypeWizardPage.java
deleted file mode 100644
index a1c6cb86a7..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewComponentTypeWizardPage.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.newwizards;
-
-import static org.apache.tuscany.sca.plugin.core.log.LogUtil.error;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.PrintWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.graphics.ImageLoader;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * Wizard page for the new .componentType file wizard.
- *
- * @version $Rev$ $Date$
- */
-public class NewComponentTypeWizardPage extends WizardNewFileCreationPage {
-
- private IWorkbench workbench;
-
- public NewComponentTypeWizardPage(IWorkbench workbench, IStructuredSelection selection) {
- super("New SCA ComponentType Page", selection);
-
- this.workbench = workbench;
-
- setTitle("SCA ComponentType");
- setDescription("Create a new SCA ComponentType.");
-
- try {
- String location = FileLocator.toFileURL(Platform.getBundle("org.apache.tuscany.sca.plugin.core").getEntry("/")).getFile().toString();
- setImageDescriptor(ImageDescriptor.createFromImageData((new ImageLoader()).load(location + "/icons/tuscany.gif")[0]));
- } catch (Exception e) {
- error("Could not create wizard", e);
- }
-
- setFileName("sample.componentType");
-
- }
-
- public boolean finish() {
- try {
- IFile file = createNewFile();
-
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
- IDE.openEditor(workbenchPage, file, true);
- } catch (Exception e) {
- error("Could not open editor", e);
- return false;
- }
- return true;
- }
-
- @Override
- protected InputStream getInitialContents() {
-
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- PrintWriter printWriter = new PrintWriter(outputStream);
- printWriter.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
- printWriter.println("<componentType xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"");
- printWriter.println(" xmlns:t=\"http://tuscany.apache.org/xmlns/sca/1.0\">");
- printWriter.println();
- printWriter.println();
- printWriter.println("</componentType>");
- printWriter.close();
-
- return new ByteArrayInputStream(outputStream.toByteArray());
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewCompositeWizard.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewCompositeWizard.java
deleted file mode 100644
index 5e059308e6..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewCompositeWizard.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.newwizards;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-
-/**
- * A wizard to create new .composite files.
- *
- * @version $Rev$ $Date$
- */
-public class NewCompositeWizard extends Wizard implements IWorkbenchWizard {
-
- private IWorkbench workbench;
- private IStructuredSelection selection;
- private NewCompositeWizardPage mainPage;
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle("New SCA Composite");
- }
-
- public void addPages() {
- mainPage = new NewCompositeWizardPage(workbench, selection);
- addPage(mainPage);
- }
-
- @Override
- public boolean performFinish() {
- return mainPage.finish();
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewCompositeWizardPage.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewCompositeWizardPage.java
deleted file mode 100644
index 5d9f2bdf70..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/org/apache/tuscany/sca/plugin/core/newwizards/NewCompositeWizardPage.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.core.newwizards;
-
-import static org.apache.tuscany.sca.plugin.core.log.LogUtil.error;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.PrintWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.graphics.ImageLoader;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * Wizard page for the new .composite file wizard.
- *
- * @version $Rev$ $Date$
- */
-public class NewCompositeWizardPage extends WizardNewFileCreationPage {
-
- private IWorkbench workbench;
-
- public NewCompositeWizardPage(IWorkbench workbench, IStructuredSelection selection) {
- super("New SCA Composite Page", selection);
-
- this.workbench = workbench;
-
- setTitle("SCA Composite");
- setDescription("Create a new SCA Composite.");
-
- try {
- String location = FileLocator.toFileURL(Platform.getBundle("org.apache.tuscany.sca.plugin.core").getEntry("/")).getFile().toString();
- setImageDescriptor(ImageDescriptor.createFromImageData((new ImageLoader()).load(location + "/icons/tuscany.gif")[0]));
- } catch (Exception e) {
- error("Could not create wizard", e);
- }
-
- setFileName("sample.composite");
-
- }
-
- public boolean finish() {
- try {
- IFile file = createNewFile();
-
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
- IDE.openEditor(workbenchPage, file, true);
- } catch (Exception e) {
- error("Could not open editor", e);
- return false;
- }
- return true;
- }
-
- @Override
- protected InputStream getInitialContents() {
-
- IPath path = new Path(getFileName());
- String name = path.removeFileExtension().toString();
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- PrintWriter printWriter = new PrintWriter(outputStream);
- printWriter.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
- printWriter.println("<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"");
- printWriter.println(" xmlns:t=\"http://tuscany.apache.org/xmlns/sca/1.0\"");
- printWriter.println(" xmlns:c=\"http://" + name + "\"");
- printWriter.println(" targetNamespace=\"http://" + name + "\"");
- printWriter.println(" name=\"" + name + "\">");
- printWriter.println();
- printWriter.println();
- printWriter.println("</composite>");
- printWriter.close();
-
- return new ByteArrayInputStream(outputStream.toByteArray());
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/plugin.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/plugin.xml
deleted file mode 100644
index edc17c5ee2..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/plugin.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<plugin>
-
- <extension-point id="runtimeClasspathContainerInitializer"
- name="Tuscany Runtime Classpath Container Initializers"
- schema="exsd/runtimeClasspathContainerInitializer.exsd"/>
-
- <extension point = "org.eclipse.wst.xml.core.catalogContributions">
- <catalogContribution id="default">
- <uri name="http://www.osoa.org/xmlns/sca/1.0" uri="xsd/sca-all.xsd"/>
- </catalogContribution>
- </extension>
-
- <extension point = "org.eclipse.wst.xml.core.catalogContributions">
- <catalogContribution id="default">
- <uri name="http://tuscany.apache.org/xmlns/sca/1.0" uri="xsd/tuscany-sca.xsd"/>
- </catalogContribution>
- </extension>
-
- <extension point="org.eclipse.core.runtime.contentTypes">
- <file-association content-type="org.eclipse.core.runtime.xml" file-extensions="composite"/>
- <file-association content-type="org.eclipse.core.runtime.xml" file-extensions="componentType"/>
- </extension>
-
- <extension
- point="org.apache.tuscany.sca.plugin.core.runtimeClasspathContainerInitializer">
- <runtimeClasspathContainerInitializer
- id="org.apache.tuscany.sca.plugin.core.runtime.library"
- class="org.apache.tuscany.sca.plugin.core.classpath.CoreClasspathContainerInitializer"/>
- </extension>
-
- <extension point="org.eclipse.jdt.core.classpathContainerInitializer">
- <classpathContainerInitializer
- id="org.apache.tuscany.sca.plugin.core.runtime.library"
- class="org.apache.tuscany.sca.plugin.core.classpath.CoreClasspathContainerInitializer"/>
- </extension>
-
- <extension point="org.eclipse.jdt.ui.classpathContainerPage">
- <classpathContainerPage
- id="org.apache.tuscany.sca.plugin.core.runtime.library"
- name="Tuscany SCA Core Library"
- class="org.apache.tuscany.sca.plugin.core.classpath.CoreLibraryEntryPage">
- </classpathContainerPage>
- </extension>
-
- <extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- label="Tuscany"
- visible="true"
- id="org.apache.tuscany.sca.plugin.core.launch.actionSet">
- <action
- label="&amp;Start SCA Domain Manager"
- icon="icons/t.gif"
- class="org.apache.tuscany.sca.plugin.core.launch.TuscanyLaunchDomainManagerAction"
- tooltip="Start SCA Domain Manager"
- toolbarPath="tuscanyGroup"
- id="org.apache.tuscany.sca.plugin.core.launch.TuscanyLaunchDomainManagerAction">
- </action>
- </actionSet>
- </extension>
-
- <extension point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- name="Tuscany"
- delegate="org.apache.tuscany.sca.plugin.core.launch.TuscanyLaunchConfigurationDelegate"
- modes="run, debug"
- sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
- sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"
- id="org.apache.tuscany.sca.plugin.core.launch.configurationtype">
- </launchConfigurationType>
- </extension>
-
- <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
- <launchConfigurationTypeImage
- icon="icons/t.gif"
- configTypeID="org.apache.tuscany.sca.plugin.core.launch.configurationtype"
- id="org.apache.tuscany.sca.plugin.core.launch.configurationtypeimage">
- </launchConfigurationTypeImage>
- </extension>
-
- <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
- <launchConfigurationTabGroup
- type="org.apache.tuscany.sca.plugin.core.launch.configurationtype"
- class="org.apache.tuscany.sca.plugin.core.launch.TuscanyLaunchConfigurationTabGroup"
- id="org.apache.tuscany.sca.plugin.core.launch.configurationtypetabgroup">
- </launchConfigurationTabGroup>
- </extension>
-
- <extension point="org.eclipse.debug.ui.launchShortcuts">
- <shortcut
- id="org.apache.tuscany.sca.plugin.core.launchshortcut"
- class="org.apache.tuscany.sca.plugin.core.launch.TuscanyLaunchNodeShortcut"
- label="Tuscany"
- icon="icons/t.gif"
- modes="run, debug">
- <contextualLaunch>
- <enablement>
- <with variable="selection">
- <count value="1"/>
- <iterate>
- <or>
- <test property="org.eclipse.debug.ui.matchesPattern" value="*.composite"/>
- </or>
- </iterate>
- </with>
- </enablement>
- </contextualLaunch>
- </shortcut>
- </extension>
-
- <extension point="org.eclipse.ui.newWizards">
- <category name="Tuscany" id="org.apache.tuscany.sca.plugin.core.newwizards" />
- <wizard name="Composite" icon="icons/t.gif"
- category="org.apache.tuscany.sca.plugin.core.newwizards"
- class="org.apache.tuscany.sca.plugin.core.newwizards.NewCompositeWizard"
- preferredPerspectives="org.eclipse.jdt.ui.JavaPerspective"
- id="org.apache.tuscany.sca.plugin.core.newwizards.newcompositewizard">
- <description>Create a new SCA Composite</description>
- </wizard>
- <wizard name="ComponentType" icon="icons/t.gif"
- category="org.apache.tuscany.sca.plugin.core.newwizards"
- class="org.apache.tuscany.sca.plugin.core.newwizards.NewComponentTypeWizard"
- preferredPerspectives="org.eclipse.jdt.ui.JavaPerspective"
- id="org.apache.tuscany.sca.plugin.core.newwizards.newcompositewizard">
- <description>Create a new SCA ComponentType</description>
- </wizard>
- </extension>
-
-</plugin>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/pom.xml
deleted file mode 100644
index 76b0b8745a..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/pom.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.plugin.core</artifactId>
- <name>Apache Tuscany SCA Core Eclipse Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jdt.debug</groupId>
- <artifactId>ui</artifactId>
- <version>3.2.100-v20070531-1800</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- <version>1.0.0-v20070606</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- <version>3.3.0-v20070426</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.swt.win32.win32</groupId>
- <artifactId>x86</artifactId>
- <version>3.3.0-v3346</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-core</artifactId>
- <version>2.0-M1</version>
- <type>zip</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-core</artifactId>
- <version>2.0-M1</version>
- <classifier>src</classifier>
- <type>zip</type>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>${basedir}</sourceDirectory>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <classifier>tmp</classifier>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </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/jar.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- <appendAssemblyId>false</appendAssemblyId>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <id>repo1.eclipse</id>
- <url>http://repo1.maven.org/eclipse/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/src/main/assembly/jar.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/src/main/assembly/jar.xml
deleted file mode 100644
index 7832ba5131..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/src/main/assembly/jar.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>plugin</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <!--
- <format>dir</format>
- <format>tar.gz</format>
- -->
- <format>jar</format>
- </formats>
-
- <fileSets>
-
- <!-- Add the classes -->
- <fileSet>
- <directory>target/classes</directory>
- <outputDirectory></outputDirectory>
- <excludes>
- <!-- General file/folders to exclude -->
- <exclude>**/.*</exclude>
- <exclude>**/.*/**</exclude>
- <exclude>**/*.log</exclude>
-
- <!-- Sample specific files/folders to exclude -->
- <exclude>pom.xml</exclude>
- <exclude>src/</exclude>
- <exclude>src/**/*</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-
- <dependencySets>
-
- <!-- Add the distributions -->
- <dependencySet>
- <useTransitiveDependencies>false</useTransitiveDependencies>
- <unpack>true</unpack>
- <includes>
- <include>*:zip</include>
- </includes>
- <excludes>
- <exclude>*:zip:src</exclude>
- </excludes>
- <unpackOptions>
- <excludes>
- <exclude>*/samples</exclude>
- <exclude>*/samples/**/*</exclude>
- </excludes>
- </unpackOptions>
- </dependencySet>
-
- <dependencySet>
- <useTransitiveDependencies>false</useTransitiveDependencies>
- <unpack>false</unpack>
- <includes>
- <include>*:zip:src</include>
- </includes>
- </dependencySet>
- </dependencySets>
-
-</assembly>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-all.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-all.xsd
deleted file mode 100644
index 1b19ede427..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-all.xsd
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
-
- <include schemaLocation="sca.xsd"/>
-
- <include schemaLocation="sca-contribution.xsd"/>
-
- <include schemaLocation="sca-binding-ejb.xsd"/>
-
- <include schemaLocation="sca-implementation-bpel.xsd"/>
- <include schemaLocation="sca-implementation-spring.xsd"/>
- <include schemaLocation="sca-implementation-ejb.xsd"/>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-ejb.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-ejb.xsd
deleted file mode 100644
index 26bedfcce5..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-ejb.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="binding.ejb" type="sca:EJBSessionBeanBinding"
- substitutionGroup="sca:binding" />
-
- <simpleType name="BeanType">
- <restriction base="string">
- <enumeration value="stateless"/>
- <enumeration value="stateful"/>
- </restriction>
- </simpleType>
-
- <simpleType name="VersionValue">
- <restriction base="string">
- <enumeration value="EJB2"/>
- <enumeration value="EJB3"/>
- </restriction>
- </simpleType>
-
-
- <complexType name="EJBSessionBeanBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="homeInterface" type="NCName" use="optional"/>
- <attribute name="ejb-link-name" type="NCName" use="optional"/>
- <attribute name="session-type" type="sca:BeanType" use="optional" default="stateless"/>
- <attribute name="ejb-version" type="sca:VersionValue" use="optional" default="EJB2"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-jms.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-jms.xsd
deleted file mode 100644
index 850f32b56a..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-jms.xsd
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <complexType name="JMSBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <element name="destination" type="sca:Destination" minOccurs="0"/>
- <element name="connectionFactory" type="sca:ConnectionFactory"
- minOccurs="0"/>
- <element name="activationSpec" type="sca:ActivationSpec"
- minOccurs="0"/>
- <element name="response" type="sca:Response" minOccurs="0"/>
- <element name="headers" type="sca:Headers" minOccurs="0"/>
- <element name="resourceAdapter" type="sca:ResourceAdapter"
- minOccurs="0"/>
- <element name="operationProperties" type="sca:OperationProperties"
- minOccurs="0" maxOccurs="unbounded"/>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="correlationScheme"
- default="RequestMsgIDToCorrelID">
- <simpleType>
- <restriction base="string">
- <enumeration value="RequestMsgIDToCorrelID"/>
- <enumeration value="RequestCorrelIDToCorrelID"/>
- <enumeration value="None"/>
- </restriction>
- </simpleType>
- </attribute>
-
- <attribute name="initialContextFactory" type="anyURI"/>
- <attribute name="jndiURL" type="anyURI"/>
- <attribute name="requestConnection" type="QName"/>
- <attribute name="responseConnection" type="QName"/>
- <attribute name="operationProperties" type="QName"/>
- <anyAttribute/>
- </extension>
- </complexContent>
- </complexType>
-
- <simpleType name="CreateResource">
- <restriction base="string">
- <enumeration value="always"/>
- <enumeration value="never"/>
- <enumeration value="ifnotexist"/>
- </restriction>
- </simpleType>
-
- <complexType name="Destination">
- <sequence>
- <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="anyURI" use="required"/>
- <attribute name="type" use="optional" default="queue">
- <simpleType>
- <restriction base="string">
- <enumeration value="queue"/>
- <enumeration value="topic"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="create" type="sca:CreateResource"
- use="optional" default="ifnotexist"/>
- </complexType>
-
- <complexType name="ConnectionFactory">
- <sequence> <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="anyURI" use="required"/>
- <attribute name="create" type="sca:CreateResource"
- use="optional" default="ifnotexist"/>
- </complexType>
-
- <complexType name="ActivationSpec">
- <sequence>
- <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="anyURI" use="required"/>
- <attribute name="create" type="sca:CreateResource"
- use="optional" default="ifnotexist"/>
- </complexType>
-
- <complexType name="Response">
- <sequence>
- <element name="destination" type="sca:Destination" minOccurs="0"/>
- <element name="connectionFactory" type="sca:ConnectionFactory"
- minOccurs="0"/>
- <element name="activationSpec" type="sca:ActivationSpec" minOccurs="0"/>
- </sequence>
- </complexType>
-
- <complexType name="Headers">
- <sequence>
- <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="JMSType" type="string"/>
- <attribute name="JMSCorrelationID" type="string"/>
- <attribute name="JMSDeliveryMode" type="string"/>
- <attribute name="JMSTimeToLive" type="int"/>
- <attribute name="JMSPriority" type="string"/>
- </complexType>
-
- <complexType name="ResourceAdapter">
- <sequence>
- <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="string" use="required"/>
- </complexType>
-
- <complexType name="OperationProperties">
- <sequence>
- <element name="property" type="string"
- minOccurs="0" maxOccurs="unbounded"/>
- <element name="headers" type="sca:Headers"/>
- </sequence>
- <attribute name="name" type="string" use="required"/>
- <attribute name="nativeOperation" type="string"/>
- </complexType>
-
- <element name="binding.jms" type="sca:JMSBinding"
- substitutionGroup="sca:binding"/>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-sca.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-sca.xsd
deleted file mode 100644
index 02703402ef..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-sca.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="binding.sca" type="sca:SCABinding"
- substitutionGroup="sca:binding"/>
- <complexType name="SCABinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-webservice.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-webservice.xsd
deleted file mode 100644
index 3e92de193b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-binding-webservice.xsd
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- xmlns:wsa="http://www.w3.org/2004/12/addressing"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="binding.ws" type="sca:WebServiceBinding"
- substitutionGroup="sca:binding"/>
- <complexType name="WebServiceBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="wsdlElement" type="anyURI" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-contribution.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-contribution.xsd
deleted file mode 100644
index 6861d7afd9..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-contribution.xsd
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="contribution" type="sca:Contribution"/>
-
- <complexType name="Contribution">
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <any namespace="##any" processContents="lax"/>
- </choice>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-core.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-core.xsd
deleted file mode 100644
index 1c6291792b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-core.xsd
+++ /dev/null
@@ -1,350 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <element name="componentType" type="sca:ComponentType"/>
- <complexType name="ComponentType">
- <sequence>
- <choice minOccurs="0" maxOccurs="1">
- <element ref="sca:implementation"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="service" type="sca:ComponentService" />
- <element name="reference" type="sca:ComponentReference"/>
- <element name="property" type="sca:Property"/>
- </choice>
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- -->
- </sequence>
- <attribute name="constrainingType" type="QName" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="composite" type="sca:Composite"/>
- <complexType name="Composite">
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="include" type="sca:Include"/>
- <element name="service" type="sca:Service"/>
- <element name="property" type="sca:Property"/>
- <element name="component" type="sca:Component"/>
- <element name="reference" type="sca:Reference"/>
- <element name="wire" type="sca:Wire"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="targetNamespace" type="anyURI" use="optional"/>
- <attribute name="local" type="boolean" use="optional" default="false"/>
- <attribute name="autowire" type="boolean" use="optional" default="false"/>
- <attribute name="constrainingType" type="QName" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Service">
- <sequence>
- <element ref="sca:interface" minOccurs="0" maxOccurs="1" />
- <element name="operation" type="sca:Operation" minOccurs="0"
- maxOccurs="unbounded" />
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding" />
- <any namespace="##other" processContents="lax"/>
- </choice>
- <element ref="sca:callback" minOccurs="0" maxOccurs="1" />
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required" />
- <attribute name="promote" type="anyURI" use="required" />
- <attribute name="requires" type="sca:listOfQNames" use="optional" />
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax" />
- </complexType>
-
- <element name="interface" type="sca:Interface" abstract="true" />
- <complexType name="Interface" abstract="true"/>
-
- <complexType name="Reference">
- <sequence>
- <element ref="sca:interface" minOccurs="0" maxOccurs="1" />
- <element name="operation" type="sca:Operation" minOccurs="0"
- maxOccurs="unbounded" />
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding" />
- <any namespace="##other" processContents="lax" />
- </choice>
- <element ref="sca:callback" minOccurs="0" maxOccurs="1" />
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required" />
- <attribute name="target" type="sca:listOfAnyURIs" use="optional"/>
- <attribute name="wiredByImpl" type="boolean" use="optional" default="false"/>
- <attribute name="multiplicity" type="sca:Multiplicity"
- use="optional" default="1..1" />
- <attribute name="promote" type="sca:listOfAnyURIs" use="required" />
- <attribute name="requires" type="sca:listOfQNames" use="optional" />
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax" />
- </complexType>
-
- <complexType name="SCAPropertyBase" mixed="true">
- <!-- mixed="true" to handle simple type -->
- <sequence>
- <any namespace="##any" processContents="lax" minOccurs="0"
- maxOccurs="1" />
- <!-- NOT an extension point; This xsd:any exists to accept
- the element-based or complex type property
- i.e. no element-based extension point under "sca:property" -->
- </sequence>
- </complexType>
-
- <!-- complex type for sca:property declaration -->
- <complexType name="Property" mixed="true">
- <complexContent>
- <extension base="sca:SCAPropertyBase">
- <!-- extension defines the place to hold default value -->
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="type" type="QName" use="optional"/>
- <attribute name="element" type="QName" use="optional"/>
- <attribute name="many" type="boolean" default="false"
- use="optional"/>
- <attribute name="noDefault" type="boolean" default="false"
- use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- <!-- an extension point ; attribute-based only -->
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="PropertyValue" mixed="true">
- <complexContent>
- <extension base="sca:SCAPropertyBase">
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="type" type="QName" use="optional"/>
- <attribute name="element" type="QName" use="optional"/>
- <attribute name="many" type="boolean" default="false"
- use="optional"/>
- <attribute name="source" type="string" use="optional"/>
- <attribute name="file" type="anyURI" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- <!-- an extension point ; attribute-based only -->
- </extension>
- </complexContent>
- </complexType>
-
- <element name="binding" type="sca:Binding" abstract="true"/>
- <complexType name="Binding" abstract="true">
- <sequence>
- <element name="operation" type="sca:Operation" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="uri" type="anyURI" use="optional"/>
- <attribute name="name" type="QName" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- </complexType>
-
- <element name="bindingType" type="sca:BindingType"/>
- <complexType name="BindingType">
- <sequence minOccurs="0" maxOccurs="unbounded">
- <any namespace="##other" processContents="lax" />
- </sequence>
- <attribute name="type" type="QName" use="required"/>
- <attribute name="alwaysProvides" type="sca:listOfQNames" use="optional"/>
- <attribute name="mayProvide" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="callback" type="sca:Callback"/>
- <complexType name="Callback">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Component">
- <sequence>
- <choice minOccurs="0" maxOccurs="1">
- <element ref="sca:implementation"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="service" type="sca:ComponentService"/>
- <element name="reference" type="sca:ComponentReference"/>
- <element name="property" type="sca:PropertyValue" />
- </choice>
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="autowire" type="boolean" use="optional" default="false"/>
- <attribute name="constrainingType" type="QName" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="ComponentService">
- <sequence>
- <element ref="sca:interface" minOccurs="0" maxOccurs="1"/>
- <element name="operation" type="sca:Operation" minOccurs="0"
- maxOccurs="unbounded" />
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding" />
- <any namespace="##other" processContents="lax"/>
- </choice>
- <element ref="sca:callback" minOccurs="0" maxOccurs="1"/>
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="requires" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="ComponentReference">
- <sequence>
- <element ref="sca:interface" minOccurs="0" maxOccurs="1" />
- <element name="operation" type="sca:Operation" minOccurs="0"
- maxOccurs="unbounded" />
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding" />
- <any namespace="##other" processContents="lax" />
- </choice>
- <element ref="sca:callback" minOccurs="0" maxOccurs="1" />
- <!--
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- -->
- </sequence>
- <attribute name="name" type="NCName" use="required" />
- <attribute name="target" type="sca:listOfAnyURIs" use="optional"/>
- <attribute name="multiplicity" type="sca:Multiplicity"
- use="optional" default="1..1" />
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- <anyAttribute namespace="##any" processContents="lax" />
- </complexType>
-
- <element name="implementation" type="sca:Implementation"
- abstract="true" />
- <complexType name="Implementation" abstract="true">
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- </complexType>
-
- <element name="implementationType" type="sca:ImplementationType"/>
- <complexType name="ImplementationType">
- <sequence minOccurs="0" maxOccurs="unbounded">
- <any namespace="##other" processContents="lax" />
- </sequence>
- <attribute name="type" type="QName" use="required"/>
- <attribute name="alwaysProvides" type="sca:listOfQNames" use="optional"/>
- <attribute name="mayProvide" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Wire">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="source" type="anyURI" use="required"/>
- <attribute name="target" type="anyURI" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="include" type="sca:Include"/>
- <complexType name="Include">
- <attribute name="name" type="QName"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Operation">
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="constrainingType" type="sca:ConstrainingType"/>
- <complexType name="ConstrainingType">
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="service" type="sca:ComponentService"/>
- <element name="reference" type="sca:ComponentReference"/>
- <element name="property" type="sca:Property" />
- </choice>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="targetNamespace" type="anyURI"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
-
- <simpleType name="Multiplicity">
- <restriction base="string">
- <enumeration value="0..1"/>
- <enumeration value="1..1"/>
- <enumeration value="0..n"/>
- <enumeration value="1..n"/>
- </restriction>
- </simpleType>
-
- <simpleType name="OverrideOptions">
- <restriction base="string">
- <enumeration value="no"/>
- <enumeration value="may"/>
- <enumeration value="must"/>
- </restriction>
- </simpleType>
-
- <!-- Global attribute definition for @requires to permit use of intents
- within WSDL documents -->
- <attribute name="requires" type="sca:listOfQNames"/>
-
- <!-- Global attribute defintion for @endsConversation to mark operations
- as ending a conversation -->
- <attribute name="endsConversation" type="boolean" default="false"/>
-
- <simpleType name="listOfQNames">
- <list itemType="QName"/>
- </simpleType>
-
- <simpleType name="listOfAnyURIs">
- <list itemType="anyURI"/>
- </simpleType>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-definitions.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-definitions.xsd
deleted file mode 100644
index 0249882a92..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-definitions.xsd
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
- <include schemaLocation="sca-policy.xsd"/>
-
- <element name="definitions">
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:intent"/>
- <element ref="sca:policySet"/>
- <element ref="sca:binding"/>
- <element ref="sca:bindingType"/>
- <element ref="sca:implementationType"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </choice>
- <attribute name="targetNamespace" type="anyURI" use="optional"/>
- </complexType>
- </element>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-bpel.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-bpel.xsd
deleted file mode 100644
index 87b443fb36..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-bpel.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<xsd:schema xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <xsd:include schemaLocation="sca-core.xsd" />
-
- <xsd:element name="implementation.bpel" type="BpelImplementation"
- substitutionGroup="implementation" />
-
- <xsd:complexType name="BpelImplementation">
- <xsd:complexContent>
- <xsd:extension base="Implementation">
- <xsd:sequence>
- <xsd:any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="process" type="xsd:QName" use="required" />
- <xsd:anyAttribute namespace="##any" processContents="lax" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="interface.partnerLinkType" type="BpelPartnerLinkType"
- substitutionGroup="interface" />
-
- <xsd:complexType name="BpelPartnerLinkType">
- <xsd:complexContent>
- <xsd:extension base="Interface">
- <xsd:sequence>
- <xsd:any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="type" type="xsd:QName" use="required" />
- <xsd:attribute name="serviceRole" type="xsd:NCName" use="optional" />
- <xsd:anyAttribute namespace="##any" processContents="lax" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-</xsd:schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-composite.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-composite.xsd
deleted file mode 100644
index 99669bc672..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-composite.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
- <element name="implementation.composite" type="sca:SCAImplementation"
- substitutionGroup="sca:implementation"/>
- <complexType name="SCAImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="QName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-cpp.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-cpp.xsd
deleted file mode 100644
index 6f1cf14a4b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-cpp.xsd
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sdo="commonj.sdo/XML"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.cpp" type="sca:CPPImplementation" substitutionGroup="sca:implementation" />
- <complexType name="CPPImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <element name="method" type="sca:CPPImplementationMethod" minOccurs="0" maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="library" type="NCName" use="required"/>
- <attribute name="header" type="NCName" use="required"/>
- <attribute name="path" type="NCName" use="optional"/>
- <attribute name="class" type="Name" use="optional"/>
- <attribute name="scope" type="sca:CPPImplementationScope" use="optional"/>
- <attribute name="eagerInit" type="boolean" use="optional"/>
- <attribute name="allowsPassByReference" type="boolean" use="optional"/>
- <attribute name="conversationMaxAge" type="string" use="optional"/>
- <attribute name="conversationMaxIdle" type="string" use="optional"/>
- <attribute name="conversationSinglePrincipal" type="boolean" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-
- <simpleType name="CPPImplementationScope">
- <restriction base="string">
- <enumeration value="stateless"/>
- <enumeration value="composite"/>
- <enumeration value="request"/>
- <enumeration value="converstion"/>
- </restriction>
- </simpleType>
-
- <complexType name="CPPImplementationMethod">
- <complexContent>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="allowsPassByReference" type="boolean" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexContent>
- </complexType>
-
-</schema>
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd
deleted file mode 100644
index 1bca6199cb..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.ejb" type="sca:EJBImplementation"
- substitutionGroup="sca:implementation"/>
- <complexType name="EJBImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <!-- we might want to make this refer to the JEE ejb-link type -->
- <attribute name="ejb-link" type="token" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-java.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-java.xsd
deleted file mode 100644
index f9d8171b8e..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-java.xsd
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.java" type="sca:JavaImplementation"
- substitutionGroup="sca:implementation"/>
- <complexType name="JavaImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="class" type="NCName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-spring.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-spring.xsd
deleted file mode 100644
index 1cf9fb3ea9..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-implementation-spring.xsd
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.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> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-cpp.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-cpp.xsd
deleted file mode 100644
index 44f14e5ed5..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-cpp.xsd
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.commonj.org/xmlns/sca/1.0/"
- xmlns:sca="http://www.commonj.org/xmlns/sca/1.0/"
- xmlns:sdo="commonj.sdo/XML"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="interface.cpp" type="sca:CPPInterface" substitutionGroup="sca:interface"/>
-
- <complexType name="CPPInterface">
- <complexContent>
- <extension base="sca:Interface">
- <sequence>
- <element name="method" type="sca:CPPMethod" minOccurs="0" maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="header" type="NCName" use="required"/>
- <attribute name="class" type="Name" use="required"/>
- <attribute name="callbackHeader" type="NCName" use="optional"/>
- <attribute name="callbackClass" type="Name" use="optional"/>
- <attribute name="remotable" type="boolean" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="CPPMethod">
- <complexContent>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="oneWay" type="boolean" use="optional"/>
- <attribute name="endConversation" type="boolean" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexContent>
- </complexType>
-
-</schema>
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-java.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-java.xsd
deleted file mode 100644
index 81f939bdb4..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-java.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="interface.java" type="sca:JavaInterface" substitutionGroup="sca:interface"/>
- <complexType name="JavaInterface">
- <complexContent>
- <extension base="sca:Interface">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="interface" type="NCName" use="required"/>
- <attribute name="callbackInterface" type="NCName" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-wsdl.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-wsdl.xsd
deleted file mode 100644
index c1fdfd8f3c..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-interface-wsdl.xsd
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="interface.wsdl" type="sca:WSDLPortType" substitutionGroup="sca:interface"/>
- <complexType name="WSDLPortType">
- <complexContent>
- <extension base="sca:Interface">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="interface" type="anyURI" use="required"/>
- <attribute name="callbackInterface" type="anyURI" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-policy.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-policy.xsd
deleted file mode 100644
index c22ffd6618..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca-policy.xsd
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <element name="intent" type="sca:Intent"/>
- <complexType name="Intent">
- <sequence>
- <element name="description" type="string" minOccurs="0" maxOccurs="1" />
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="QName" use="required"/>
- <attribute name="constrains" type="sca:listOfQNames" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="policySet" type="sca:PolicySet"/>
- <complexType name="PolicySet">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="policySetReference" type="sca:PolicySetReference"/>
- <element name="intentMap" type="sca:IntentMap"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <attribute name="name" type="QName" use="required"/>
- <attribute name="provides" type="sca:listOfQNames" use="optional"/>
- <attribute name="appliesTo" type="string" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="PolicySetReference">
- <attribute name="name" type="QName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="IntentMap">
- <choice minOccurs="1" maxOccurs="unbounded">
- <element name="qualifier" type="sca:Qualifier"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <attribute name="provides" type="QName" use="required"/>
- <attribute name="default" type="string" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Qualifier">
- <choice minOccurs="1" maxOccurs="unbounded">
- <element name="intentMap" type="sca:IntentMap"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <attribute name="name" type="string" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="allow" type="sca:Allow"/>
- <complexType name="Allow">
- <attribute name="roles" type="string" use="required"/>
- </complexType>
-
- <element name="permitAll" type="sca:PermitAll"/>
- <complexType name="PermitAll"/>
-
- <element name="denyAll" type="sca:DenyAll"/>
- <complexType name="DenyAll"/>
-
- <element name="runAs" type="sca:RunAs"/>
- <complexType name="RunAs">
- <attribute name="role" type="string" use="required"/>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca.xsd
deleted file mode 100644
index 10f54275d0..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/sca.xsd
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright SCA Collaboration 2006, 2007 -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
-
- <include schemaLocation="sca-core.xsd"/>
-
- <include schemaLocation="sca-interface-java.xsd"/>
- <include schemaLocation="sca-interface-wsdl.xsd"/>
-
- <include schemaLocation="sca-implementation-java.xsd"/>
- <include schemaLocation="sca-implementation-composite.xsd"/>
-
- <include schemaLocation="sca-binding-webservice.xsd"/>
- <include schemaLocation="sca-binding-jms.xsd"/>
- <include schemaLocation="sca-binding-sca.xsd"/>
-
- <include schemaLocation="sca-definitions.xsd"/>
- <include schemaLocation="sca-policy.xsd"/>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-atom.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-atom.xsd
deleted file mode 100644
index c93a1d72de..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-atom.xsd
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.atom" type="t:AtomBinding"/>
-
- <complexType name="AtomBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="title" type="string" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-dwr.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-dwr.xsd
deleted file mode 100644
index d0da5421ec..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-dwr.xsd
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.dwr" type="t:DWRBinding"/>
-
- <complexType name="DWRBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-http.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-http.xsd
deleted file mode 100644
index ff48b97d7a..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-http.xsd
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.http" type="t:HTTPBinding"/>
-
- <complexType name="HTTPBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-jsonrpc.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-jsonrpc.xsd
deleted file mode 100644
index 7c79738898..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-jsonrpc.xsd
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.jsonrpc" type="t:JSONRPCBinding"/>
-
- <complexType name="JSONRPCBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-notification.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-notification.xsd
deleted file mode 100644
index 6d5468b2f9..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-notification.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.notification" type="t:NotificationBinding"/>
-
- <complexType name="NotificationBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="ntm" type="anyURI" use="optional"/>
- <attribute name="notificationType" type="anyURI" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rmi.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rmi.xsd
deleted file mode 100644
index 26be6feae5..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rmi.xsd
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.rmi" type="t:RMIBinding"/>
-
- <complexType name="RMIBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rss.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rss.xsd
deleted file mode 100644
index 821f323d73..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rss.xsd
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="binding.rss" type="t:RSSBinding"/>
-
- <complexType name="RSSBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="title" type="string" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-node.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-node.xsd
deleted file mode 100644
index 1b5c8aece2..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-node.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.node" type="t:NodeImplementation"/>
-
- <complexType name="NodeImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="uri" type="string" use="required"/>
- <attribute name="composite" type="QName" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-notification.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-notification.xsd
deleted file mode 100644
index f8d437310e..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-notification.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.notification" type="t:NotificationImplementation"/>
-
- <complexType name="NotificationImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-osgi.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-osgi.xsd
deleted file mode 100644
index f8ece54a07..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-osgi.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.osgi" type="t:OSGiImplementation"/>
-
- <!-- TODO Declare the proper attributes and elements -->
- <complexType name="OSGiImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##any" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-resource.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-resource.xsd
deleted file mode 100644
index dd596821ea..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-resource.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.resource" type="t:ResourceImplementation"/>
-
- <complexType name="ResourceImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="location" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-script.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-script.xsd
deleted file mode 100644
index e1723d65f0..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-script.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.script" type="t:ScriptImplementation"/>
-
- <complexType name="ScriptImplementation">
- <complexContent mixed="true">
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="script" type="anyURI" use="optional"/>
- <attribute name="language" type="NCName" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-widget.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-widget.xsd
deleted file mode 100644
index 0c0998595f..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-widget.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.widget" type="t:WidgetImplementation"/>
-
- <complexType name="WidgetImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="location" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-xquery.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-xquery.xsd
deleted file mode 100644
index cdabb697aa..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-xquery.xsd
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
- elementFormDefault="qualified">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-core.xsd"/>
-
- <element name="implementation.xquery" type="t:XQueryImplementation"/>
-
- <complexType name="XQueryImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="location" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca.xsd b/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca.xsd
deleted file mode 100644
index da5e696e01..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/core/xsd/tuscany-sca.xsd
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.0">
-
- <import namespace="http://www.osoa.org/xmlns/sca/1.0" schemaLocation="sca-all.xsd"/>
-
- <include schemaLocation="tuscany-sca-binding-atom.xsd"/>
- <include schemaLocation="tuscany-sca-binding-dwr.xsd"/>
- <include schemaLocation="tuscany-sca-binding-http.xsd"/>
- <include schemaLocation="tuscany-sca-binding-jsonrpc.xsd"/>
- <include schemaLocation="tuscany-sca-binding-notification.xsd"/>
- <include schemaLocation="tuscany-sca-binding-rmi.xsd"/>
- <include schemaLocation="tuscany-sca-binding-rss.xsd"/>
-
- <!--
- <include schemaLocation="tuscany-sca-implementation-das.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-data.xsd"/>
- -->
- <include schemaLocation="tuscany-sca-implementation-node.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-notification.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-osgi.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-resource.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-script.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-widget.xsd"/>
- <include schemaLocation="tuscany-sca-implementation-xquery.xsd"/>
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/META-INF/MANIFEST.MF
deleted file mode 100644
index fb238f04b1..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,32 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA JEE Eclipse Plugin
-Bundle-SymbolicName: org.apache.tuscany.sca.plugin.ejava;singleton:=true
-Bundle-Version: 1.4.0
-Import-Package: org.apache.tuscany.sca.plugin.core.classpath,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.core.runtime.jobs,
- org.eclipse.debug.core,
- org.eclipse.debug.core.model,
- org.eclipse.debug.ui,
- org.eclipse.debug.ui.sourcelookup,
- org.eclipse.jdt.core,
- org.eclipse.jdt.debug.ui.launchConfigurations,
- org.eclipse.jdt.launching,
- org.eclipse.jdt.ui.wizards,
- org.eclipse.jface.dialogs,
- org.eclipse.jface.operation,
- org.eclipse.jface.resource,
- org.eclipse.jface.viewers,
- org.eclipse.jface.wizard,
- org.eclipse.osgi.service.datalocation;version="1.0.0",
- org.eclipse.swt,
- org.eclipse.swt.graphics,
- org.eclipse.swt.widgets,
- org.eclipse.ui,
- org.eclipse.ui.progress,
- org.osgi.framework;version="1.3.0"
-Bundle-Vendor: Apache Software Foundation
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.ui.ide
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/NOTICE
deleted file mode 100644
index 8591680386..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/NOTICE
+++ /dev/null
@@ -1,12 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software under the SCA Collaboration license
-(see the LICENSE file contained in this distribution), with the following
-copyright:
-
-(c) Copyright SCA Collaboration 2006, 2007
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/build.properties
deleted file mode 100644
index c402b2eb45..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
- plugin.xml,\
- xsd/,\
- icons/,\
- .,\
- LICENSE,\
- NOTICE,\
- org/
-src.includes = xsd/,\
- plugin.xml,\
- .classpath,\
- .project,\
- LICENSE,\
- META-INF/,\
- NOTICE,\
- build.properties,\
- icons/,\
- .settings/,\
- org/,\
- pom.xml
-jars.compile.order = .
-source.. = .
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/org/apache/tuscany/sca/plugin/ejava/classpath/EJavaClasspathContainer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/org/apache/tuscany/sca/plugin/ejava/classpath/EJavaClasspathContainer.java
deleted file mode 100644
index eae6682e3b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/org/apache/tuscany/sca/plugin/ejava/classpath/EJavaClasspathContainer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.ejava.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainer;
-
-
-/**
- * A classpath container for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class EJavaClasspathContainer extends BaseClasspathContainer implements RuntimeClasspathContainer {
-
- public EJavaClasspathContainer() {
- super("org.apache.tuscany.sca.plugin.ejava",
- "org.apache.tuscany.sca.plugin.ejava.runtime.library", "Tuscany SCA JEE Library",
- "tuscany-sca", "tuscany-distribution-ejava", "1.4-EQUINOX-SNAPSHOT",
- "TUSCANY_HOME", "TUSCANY_SRC");
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/org/apache/tuscany/sca/plugin/ejava/classpath/EJavaClasspathContainerInitializer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/org/apache/tuscany/sca/plugin/ejava/classpath/EJavaClasspathContainerInitializer.java
deleted file mode 100644
index 9b7c199c79..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/org/apache/tuscany/sca/plugin/ejava/classpath/EJavaClasspathContainerInitializer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.ejava.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.ejava.classpath.EJavaClasspathContainer;
-
-
-/**
- * A classpath container initializer for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class EJavaClasspathContainerInitializer extends BaseClasspathContainerInitializer implements RuntimeClasspathContainerInitializer {
-
- public EJavaClasspathContainerInitializer() {
- super(new EJavaClasspathContainer());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/plugin.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/plugin.xml
deleted file mode 100644
index fef1afe0b9..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/plugin.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<plugin>
-
- <extension
- point="org.apache.tuscany.sca.plugin.core.runtimeClasspathContainerInitializer">
- <runtimeClasspathContainerInitializer
- id="org.apache.tuscany.sca.plugin.ejava.runtime.library"
- class="org.apache.tuscany.sca.plugin.ejava.classpath.EJavaClasspathContainerInitializer"/>
- </extension>
-
-</plugin>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/pom.xml
deleted file mode 100644
index 35a8988550..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/ejava/pom.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.plugin.ejava</artifactId>
- <name>Apache Tuscany SCA JEE Eclipse Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jdt.debug</groupId>
- <artifactId>ui</artifactId>
- <version>3.2.100-v20070531-1800</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- <version>1.0.0-v20070606</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- <version>3.3.0-v20070426</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.swt.win32.win32</groupId>
- <artifactId>x86</artifactId>
- <version>3.3.0-v3346</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.core</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-ejava</artifactId>
- <version>2.0-M1</version>
- <type>zip</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-ejava</artifactId>
- <version>2.0-M1</version>
- <classifier>src</classifier>
- <type>zip</type>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>${basedir}</sourceDirectory>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <classifier>tmp</classifier>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </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>../core/src/main/assembly/jar.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- <appendAssemblyId>false</appendAssemblyId>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <id>repo1.eclipse</id>
- <url>http://repo1.maven.org/eclipse/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/META-INF/MANIFEST.MF
deleted file mode 100644
index 2a70682fae..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,32 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA Domain Manager Eclipse Plugin
-Bundle-SymbolicName: org.apache.tuscany.sca.plugin.manager;singleton:=true
-Bundle-Version: 1.4.0
-Import-Package: org.apache.tuscany.sca.plugin.core.classpath,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.core.runtime.jobs,
- org.eclipse.debug.core,
- org.eclipse.debug.core.model,
- org.eclipse.debug.ui,
- org.eclipse.debug.ui.sourcelookup,
- org.eclipse.jdt.core,
- org.eclipse.jdt.debug.ui.launchConfigurations,
- org.eclipse.jdt.launching,
- org.eclipse.jdt.ui.wizards,
- org.eclipse.jface.dialogs,
- org.eclipse.jface.operation,
- org.eclipse.jface.resource,
- org.eclipse.jface.viewers,
- org.eclipse.jface.wizard,
- org.eclipse.osgi.service.datalocation;version="1.0.0",
- org.eclipse.swt,
- org.eclipse.swt.graphics,
- org.eclipse.swt.widgets,
- org.eclipse.ui,
- org.eclipse.ui.progress,
- org.osgi.framework;version="1.3.0"
-Bundle-Vendor: Apache Software Foundation
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.ui.ide
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/NOTICE
deleted file mode 100644
index 8591680386..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/NOTICE
+++ /dev/null
@@ -1,12 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software under the SCA Collaboration license
-(see the LICENSE file contained in this distribution), with the following
-copyright:
-
-(c) Copyright SCA Collaboration 2006, 2007
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/build.properties
deleted file mode 100644
index c402b2eb45..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
- plugin.xml,\
- xsd/,\
- icons/,\
- .,\
- LICENSE,\
- NOTICE,\
- org/
-src.includes = xsd/,\
- plugin.xml,\
- .classpath,\
- .project,\
- LICENSE,\
- META-INF/,\
- NOTICE,\
- build.properties,\
- icons/,\
- .settings/,\
- org/,\
- pom.xml
-jars.compile.order = .
-source.. = .
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/org/apache/tuscany/sca/plugin/manager/classpath/ManagerClasspathContainer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/org/apache/tuscany/sca/plugin/manager/classpath/ManagerClasspathContainer.java
deleted file mode 100644
index 3676883f87..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/org/apache/tuscany/sca/plugin/manager/classpath/ManagerClasspathContainer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.manager.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainer;
-
-
-/**
- * A classpath container for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class ManagerClasspathContainer extends BaseClasspathContainer implements RuntimeClasspathContainer {
-
- public ManagerClasspathContainer() {
- super("org.apache.tuscany.sca.plugin.manager",
- "org.apache.tuscany.sca.plugin.manager.runtime.library", "Tuscany SCA Domain Manager Library",
- "tuscany-sca", "tuscany-distribution-manager", "1.4-EQUINOX-SNAPSHOT",
- "TUSCANY_HOME", "TUSCANY_SRC");
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/org/apache/tuscany/sca/plugin/manager/classpath/ManagerClasspathContainerInitializer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/org/apache/tuscany/sca/plugin/manager/classpath/ManagerClasspathContainerInitializer.java
deleted file mode 100644
index 9c7df0f488..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/org/apache/tuscany/sca/plugin/manager/classpath/ManagerClasspathContainerInitializer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.manager.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.manager.classpath.ManagerClasspathContainer;
-
-
-/**
- * A classpath container initializer for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class ManagerClasspathContainerInitializer extends BaseClasspathContainerInitializer implements RuntimeClasspathContainerInitializer {
-
- public ManagerClasspathContainerInitializer() {
- super(new ManagerClasspathContainer());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/plugin.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/plugin.xml
deleted file mode 100644
index 2e09146dfd..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/plugin.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<plugin>
-
- <extension
- point="org.apache.tuscany.sca.plugin.core.runtimeClasspathContainerInitializer">
- <runtimeClasspathContainerInitializer
- id="org.apache.tuscany.sca.plugin.manager.runtime.library"
- class="org.apache.tuscany.sca.plugin.manager.classpath.ManagerClasspathContainerInitializer"/>
- </extension>
-
-</plugin>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/pom.xml
deleted file mode 100644
index ab15936e6a..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/manager/pom.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.plugin.manager</artifactId>
- <name>Apache Tuscany SCA Domain Manager Eclipse Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jdt.debug</groupId>
- <artifactId>ui</artifactId>
- <version>3.2.100-v20070531-1800</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- <version>1.0.0-v20070606</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- <version>3.3.0-v20070426</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.swt.win32.win32</groupId>
- <artifactId>x86</artifactId>
- <version>3.3.0-v3346</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.core</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-manager</artifactId>
- <version>2.0-M1</version>
- <type>zip</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-manager</artifactId>
- <version>2.0-M1</version>
- <classifier>src</classifier>
- <type>zip</type>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>${basedir}</sourceDirectory>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <classifier>tmp</classifier>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </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>../core/src/main/assembly/jar.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- <appendAssemblyId>false</appendAssemblyId>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <id>repo1.eclipse</id>
- <url>http://repo1.maven.org/eclipse/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/META-INF/MANIFEST.MF
deleted file mode 100644
index 0acd32e51c..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,32 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA Process Eclipse Plugin
-Bundle-SymbolicName: org.apache.tuscany.sca.plugin.process;singleton:=true
-Bundle-Version: 1.4.0
-Import-Package: org.apache.tuscany.sca.plugin.core.classpath,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.core.runtime.jobs,
- org.eclipse.debug.core,
- org.eclipse.debug.core.model,
- org.eclipse.debug.ui,
- org.eclipse.debug.ui.sourcelookup,
- org.eclipse.jdt.core,
- org.eclipse.jdt.debug.ui.launchConfigurations,
- org.eclipse.jdt.launching,
- org.eclipse.jdt.ui.wizards,
- org.eclipse.jface.dialogs,
- org.eclipse.jface.operation,
- org.eclipse.jface.resource,
- org.eclipse.jface.viewers,
- org.eclipse.jface.wizard,
- org.eclipse.osgi.service.datalocation;version="1.0.0",
- org.eclipse.swt,
- org.eclipse.swt.graphics,
- org.eclipse.swt.widgets,
- org.eclipse.ui,
- org.eclipse.ui.progress,
- org.osgi.framework;version="1.3.0"
-Bundle-Vendor: Apache Software Foundation
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.ui.ide
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/NOTICE
deleted file mode 100644
index 8591680386..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/NOTICE
+++ /dev/null
@@ -1,12 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software under the SCA Collaboration license
-(see the LICENSE file contained in this distribution), with the following
-copyright:
-
-(c) Copyright SCA Collaboration 2006, 2007
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/build.properties
deleted file mode 100644
index c402b2eb45..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
- plugin.xml,\
- xsd/,\
- icons/,\
- .,\
- LICENSE,\
- NOTICE,\
- org/
-src.includes = xsd/,\
- plugin.xml,\
- .classpath,\
- .project,\
- LICENSE,\
- META-INF/,\
- NOTICE,\
- build.properties,\
- icons/,\
- .settings/,\
- org/,\
- pom.xml
-jars.compile.order = .
-source.. = .
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/org/apache/tuscany/sca/plugin/process/classpath/ProcessClasspathContainer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/org/apache/tuscany/sca/plugin/process/classpath/ProcessClasspathContainer.java
deleted file mode 100644
index 225fa67b58..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/org/apache/tuscany/sca/plugin/process/classpath/ProcessClasspathContainer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.process.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainer;
-
-
-/**
- * A classpath container for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class ProcessClasspathContainer extends BaseClasspathContainer implements RuntimeClasspathContainer {
-
- public ProcessClasspathContainer() {
- super("org.apache.tuscany.sca.plugin.process",
- "org.apache.tuscany.sca.plugin.process.runtime.library", "Tuscany SCA Process Library",
- "tuscany-sca", "tuscany-distribution-process", "1.4-EQUINOX-SNAPSHOT",
- "TUSCANY_HOME", "TUSCANY_SRC");
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/org/apache/tuscany/sca/plugin/process/classpath/ProcessClasspathContainerInitializer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/org/apache/tuscany/sca/plugin/process/classpath/ProcessClasspathContainerInitializer.java
deleted file mode 100644
index dab0eeaadc..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/org/apache/tuscany/sca/plugin/process/classpath/ProcessClasspathContainerInitializer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.process.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.process.classpath.ProcessClasspathContainer;
-
-
-/**
- * A classpath container initializer for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class ProcessClasspathContainerInitializer extends BaseClasspathContainerInitializer implements RuntimeClasspathContainerInitializer {
-
- public ProcessClasspathContainerInitializer() {
- super(new ProcessClasspathContainer());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/plugin.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/plugin.xml
deleted file mode 100644
index 3e5f87f634..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/plugin.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<plugin>
-
- <extension
- point="org.apache.tuscany.sca.plugin.core.runtimeClasspathContainerInitializer">
- <runtimeClasspathContainerInitializer
- id="org.apache.tuscany.sca.plugin.process.runtime.library"
- class="org.apache.tuscany.sca.plugin.process.classpath.ProcessClasspathContainerInitializer"/>
- </extension>
-
-</plugin>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/pom.xml
deleted file mode 100644
index cb5ba54f6a..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/process/pom.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.plugin.process</artifactId>
- <name>Apache Tuscany SCA Process Eclipse Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jdt.debug</groupId>
- <artifactId>ui</artifactId>
- <version>3.2.100-v20070531-1800</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- <version>1.0.0-v20070606</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- <version>3.3.0-v20070426</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.swt.win32.win32</groupId>
- <artifactId>x86</artifactId>
- <version>3.3.0-v3346</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.core</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-process</artifactId>
- <version>2.0-M1</version>
- <type>zip</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-process</artifactId>
- <version>2.0-M1</version>
- <classifier>src</classifier>
- <type>zip</type>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>${basedir}</sourceDirectory>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <classifier>tmp</classifier>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </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>../core/src/main/assembly/jar.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- <appendAssemblyId>false</appendAssemblyId>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <id>repo1.eclipse</id>
- <url>http://repo1.maven.org/eclipse/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/META-INF/MANIFEST.MF
deleted file mode 100644
index 3c2816ec4b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,32 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA Web 2.0 Eclipse Plugin
-Bundle-SymbolicName: org.apache.tuscany.sca.plugin.web20;singleton:=true
-Bundle-Version: 1.4.0
-Import-Package: org.apache.tuscany.sca.plugin.core.classpath,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.core.runtime.jobs,
- org.eclipse.debug.core,
- org.eclipse.debug.core.model,
- org.eclipse.debug.ui,
- org.eclipse.debug.ui.sourcelookup,
- org.eclipse.jdt.core,
- org.eclipse.jdt.debug.ui.launchConfigurations,
- org.eclipse.jdt.launching,
- org.eclipse.jdt.ui.wizards,
- org.eclipse.jface.dialogs,
- org.eclipse.jface.operation,
- org.eclipse.jface.resource,
- org.eclipse.jface.viewers,
- org.eclipse.jface.wizard,
- org.eclipse.osgi.service.datalocation;version="1.0.0",
- org.eclipse.swt,
- org.eclipse.swt.graphics,
- org.eclipse.swt.widgets,
- org.eclipse.ui,
- org.eclipse.ui.progress,
- org.osgi.framework;version="1.3.0"
-Bundle-Vendor: Apache Software Foundation
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.ui.ide
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/NOTICE
deleted file mode 100644
index 8591680386..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/NOTICE
+++ /dev/null
@@ -1,12 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software under the SCA Collaboration license
-(see the LICENSE file contained in this distribution), with the following
-copyright:
-
-(c) Copyright SCA Collaboration 2006, 2007
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/build.properties
deleted file mode 100644
index c402b2eb45..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
- plugin.xml,\
- xsd/,\
- icons/,\
- .,\
- LICENSE,\
- NOTICE,\
- org/
-src.includes = xsd/,\
- plugin.xml,\
- .classpath,\
- .project,\
- LICENSE,\
- META-INF/,\
- NOTICE,\
- build.properties,\
- icons/,\
- .settings/,\
- org/,\
- pom.xml
-jars.compile.order = .
-source.. = .
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/org/apache/tuscany/sca/plugin/web20/classpath/Web20ClasspathContainer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/org/apache/tuscany/sca/plugin/web20/classpath/Web20ClasspathContainer.java
deleted file mode 100644
index e153ad3d25..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/org/apache/tuscany/sca/plugin/web20/classpath/Web20ClasspathContainer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.web20.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainer;
-
-
-/**
- * A classpath container for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class Web20ClasspathContainer extends BaseClasspathContainer implements RuntimeClasspathContainer {
-
- public Web20ClasspathContainer() {
- super("org.apache.tuscany.sca.plugin.web20",
- "org.apache.tuscany.sca.plugin.web20.runtime.library", "Tuscany SCA Web 2.0 Library",
- "tuscany-sca", "tuscany-distribution-web20", "1.4-EQUINOX-SNAPSHOT",
- "TUSCANY_HOME", "TUSCANY_SRC");
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/org/apache/tuscany/sca/plugin/web20/classpath/Web20ClasspathContainerInitializer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/org/apache/tuscany/sca/plugin/web20/classpath/Web20ClasspathContainerInitializer.java
deleted file mode 100644
index 96026db08e..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/org/apache/tuscany/sca/plugin/web20/classpath/Web20ClasspathContainerInitializer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.web20.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.web20.classpath.Web20ClasspathContainer;
-
-
-/**
- * A classpath container initializer for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class Web20ClasspathContainerInitializer extends BaseClasspathContainerInitializer implements RuntimeClasspathContainerInitializer {
-
- public Web20ClasspathContainerInitializer() {
- super(new Web20ClasspathContainer());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/plugin.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/plugin.xml
deleted file mode 100644
index 6bf9087474..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/plugin.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<plugin>
-
- <extension
- point="org.apache.tuscany.sca.plugin.core.runtimeClasspathContainerInitializer">
- <runtimeClasspathContainerInitializer
- id="org.apache.tuscany.sca.plugin.web20.runtime.library"
- class="org.apache.tuscany.sca.plugin.web20.classpath.Web20ClasspathContainerInitializer"/>
- </extension>
-
-</plugin>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/pom.xml
deleted file mode 100644
index 1cb0725c9b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/web20/pom.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.plugin.web20</artifactId>
- <name>Apache Tuscany SCA Web 2.0 Eclipse Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jdt.debug</groupId>
- <artifactId>ui</artifactId>
- <version>3.2.100-v20070531-1800</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- <version>1.0.0-v20070606</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- <version>3.3.0-v20070426</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.swt.win32.win32</groupId>
- <artifactId>x86</artifactId>
- <version>3.3.0-v3346</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.core</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-web20</artifactId>
- <version>2.0-M1</version>
- <type>zip</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-web20</artifactId>
- <version>2.0-M1</version>
- <classifier>src</classifier>
- <type>zip</type>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>${basedir}</sourceDirectory>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <classifier>tmp</classifier>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </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>../core/src/main/assembly/jar.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- <appendAssemblyId>false</appendAssemblyId>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <id>repo1.eclipse</id>
- <url>http://repo1.maven.org/eclipse/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/META-INF/MANIFEST.MF b/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/META-INF/MANIFEST.MF
deleted file mode 100644
index 9d83fd9b6b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,32 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Apache Tuscany SCA Web Service Eclipse Plugin
-Bundle-SymbolicName: org.apache.tuscany.sca.plugin.webservice;singleton:=true
-Bundle-Version: 1.4.0
-Import-Package: org.apache.tuscany.sca.plugin.core.classpath,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.core.runtime.jobs,
- org.eclipse.debug.core,
- org.eclipse.debug.core.model,
- org.eclipse.debug.ui,
- org.eclipse.debug.ui.sourcelookup,
- org.eclipse.jdt.core,
- org.eclipse.jdt.debug.ui.launchConfigurations,
- org.eclipse.jdt.launching,
- org.eclipse.jdt.ui.wizards,
- org.eclipse.jface.dialogs,
- org.eclipse.jface.operation,
- org.eclipse.jface.resource,
- org.eclipse.jface.viewers,
- org.eclipse.jface.wizard,
- org.eclipse.osgi.service.datalocation;version="1.0.0",
- org.eclipse.swt,
- org.eclipse.swt.graphics,
- org.eclipse.swt.widgets,
- org.eclipse.ui,
- org.eclipse.ui.progress,
- org.osgi.framework;version="1.3.0"
-Bundle-Vendor: Apache Software Foundation
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.ui.ide
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/NOTICE
deleted file mode 100644
index 8591680386..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/NOTICE
+++ /dev/null
@@ -1,12 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software under the SCA Collaboration license
-(see the LICENSE file contained in this distribution), with the following
-copyright:
-
-(c) Copyright SCA Collaboration 2006, 2007
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/build.properties b/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/build.properties
deleted file mode 100644
index c402b2eb45..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
- plugin.xml,\
- xsd/,\
- icons/,\
- .,\
- LICENSE,\
- NOTICE,\
- org/
-src.includes = xsd/,\
- plugin.xml,\
- .classpath,\
- .project,\
- LICENSE,\
- META-INF/,\
- NOTICE,\
- build.properties,\
- icons/,\
- .settings/,\
- org/,\
- pom.xml
-jars.compile.order = .
-source.. = .
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/org/apache/tuscany/sca/plugin/webservice/classpath/WebServiceClasspathContainer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/org/apache/tuscany/sca/plugin/webservice/classpath/WebServiceClasspathContainer.java
deleted file mode 100644
index f588dc191c..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/org/apache/tuscany/sca/plugin/webservice/classpath/WebServiceClasspathContainer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.webservice.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainer;
-
-
-/**
- * A classpath container for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class WebServiceClasspathContainer extends BaseClasspathContainer implements RuntimeClasspathContainer {
-
- public WebServiceClasspathContainer() {
- super("org.apache.tuscany.sca.plugin.webservice",
- "org.apache.tuscany.sca.plugin.webservice.runtime.library", "Tuscany SCA Web Service Library",
- "tuscany-sca", "tuscany-distribution-webservice", "1.4-EQUINOX-SNAPSHOT",
- "TUSCANY_HOME", "TUSCANY_SRC");
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/org/apache/tuscany/sca/plugin/webservice/classpath/WebServiceClasspathContainerInitializer.java b/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/org/apache/tuscany/sca/plugin/webservice/classpath/WebServiceClasspathContainerInitializer.java
deleted file mode 100644
index 6310209c3a..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/org/apache/tuscany/sca/plugin/webservice/classpath/WebServiceClasspathContainerInitializer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.plugin.webservice.classpath;
-
-import org.apache.tuscany.sca.plugin.core.classpath.BaseClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.core.classpath.RuntimeClasspathContainerInitializer;
-import org.apache.tuscany.sca.plugin.webservice.classpath.WebServiceClasspathContainer;
-
-
-/**
- * A classpath container initializer for the core runtime.
- *
- * @version $Rev$ $Date$
- */
-public class WebServiceClasspathContainerInitializer extends BaseClasspathContainerInitializer implements RuntimeClasspathContainerInitializer {
-
- public WebServiceClasspathContainerInitializer() {
- super(new WebServiceClasspathContainer());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/plugin.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/plugin.xml
deleted file mode 100644
index 1fd46d3e75..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/plugin.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<plugin>
-
- <extension
- point="org.apache.tuscany.sca.plugin.core.runtimeClasspathContainerInitializer">
- <runtimeClasspathContainerInitializer
- id="org.apache.tuscany.sca.plugin.webservice.runtime.library"
- class="org.apache.tuscany.sca.plugin.webservice.classpath.WebServiceClasspathContainerInitializer"/>
- </extension>
-
-</plugin>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/pom.xml
deleted file mode 100644
index b52bf4f15f..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/plugins/webservice/pom.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.plugin.webservice</artifactId>
- <name>Apache Tuscany SCA Web Service Eclipse Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jdt.debug</groupId>
- <artifactId>ui</artifactId>
- <version>3.2.100-v20070531-1800</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- <version>1.0.0-v20070606</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- <version>3.3.0-v20070426</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.swt.win32.win32</groupId>
- <artifactId>x86</artifactId>
- <version>3.3.0-v3346</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.core</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-webservice</artifactId>
- <version>2.0-M1</version>
- <type>zip</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-webservice</artifactId>
- <version>2.0-M1</version>
- <classifier>src</classifier>
- <type>zip</type>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>${basedir}</sourceDirectory>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <classifier>tmp</classifier>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </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>../core/src/main/assembly/jar.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- <appendAssemblyId>false</appendAssemblyId>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <id>repo1.eclipse</id>
- <url>http://repo1.maven.org/eclipse/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/pom.xml
deleted file mode 100644
index dfc387c823..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/pom.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <packaging>pom</packaging>
- <artifactId>tuscany-sca-eclipse-tools</artifactId>
- <name>Apache Tuscany SCA Eclipse Tools</name>
-
- <profiles>
- <profile>
- <id>distribution</id>
- <modules>
-<!--
- <module>features/core</module>
- <module>features/ejava</module>
- <module>features/manager</module>
- <module>features/process</module>
- <module>features/web20</module>
- <module>features/webservice</module>
- <module>plugins/core</module>
- <module>plugins/ejava</module>
- <module>plugins/manager</module>
- <module>plugins/process</module>
- <module>plugins/web20</module>
- <module>plugins/webservice</module>
- <module>site/updatesite</module>
--->
- </modules>
- </profile>
-
- <profile>
- <id>eclipse</id>
- <modules>
- <module>features/core</module>
- <module>features/ejava</module>
- <module>features/manager</module>
- <module>features/process</module>
- <module>features/web20</module>
- <module>features/webservice</module>
- <module>plugins/core</module>
- <module>plugins/ejava</module>
- <module>plugins/manager</module>
- <module>plugins/process</module>
- <module>plugins/web20</module>
- <module>plugins/webservice</module>
- <module>site/updatesite</module>
- </modules>
- </profile>
- </profiles>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/LICENSE b/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/NOTICE b/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/etc/generate-p2.sh b/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/etc/generate-p2.sh
deleted file mode 100755
index ea2eb865f4..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/etc/generate-p2.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# After building the updatesite Zip, this script can be used to generate the
-# Eclipse Ganymede P2 metadata for the site.
-
-rm -rf target/p2-tmp
-mkdir target/p2-tmp
-cd target/p2-tmp
-unzip ../apache-tuscany-sca-1.4-SNAPSHOT-updatesite.zip
-
-eclipse -nosplash -application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator -updateSite tuscany-sca-1.4-SNAPSHOT-updatesite/ -site file:tuscany-sca-1.4-SNAPSHOT-updatesite/site.xml -metadataRepository file:tuscany-sca-1.4-SNAPSHOT-updatesite/ -metadataRepositoryName "Apache Tuscany SCA Eclipse Update Site." -artifactRepository file:tuscany-sca-1.4-SNAPSHOT-updatesite/ -artifactRepositoryName "Eclipse Ganymede Artifacts" -noDefaultIUs -vmargs -Xmx256m
-
-zip ../apache-tuscany-sca-1.4-SNAPSHOT-updatesite.zip tuscany-sca-1.4-SNAPSHOT-updatesite/artifacts.xml tuscany-sca-1.4-SNAPSHOT-updatesite/content.xml
-
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/pom.xml b/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/pom.xml
deleted file mode 100644
index d8e0cfff9b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/pom.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-eclipse-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>org.apache.tuscany.sca.updatesite</artifactId>
- <name>Apache Tuscany SCA Eclipse Update Site</name>
-
- <properties>
- <tuscany.version>${pom.version}</tuscany.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.core</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.feature.core</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.ejava</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.feature.ejava</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.manager</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.feature.manager</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.process</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.feature.process</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.web20</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.feature.web20</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.plugin.webservice</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.feature.webservice</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>${basedir}</directory>
- <excludes>
- <exclude>**/.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.*</exclude>
- <exclude>target/**</exclude>
- </excludes>
- </resource>
- </resources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>updatesite-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/updatesite.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- <finalName>apache-tuscany-sca-${pom.version}</finalName>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/site.xml b/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/site.xml
deleted file mode 100644
index 97efa9db39..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/site.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<site>
- <description url="http://incubator.apache.org/tuscany">
- Apache Tuscany SCA Eclipse Update Site.
- </description>
-
- <feature url="features/org.apache.tuscany.sca.feature.core-2.0-M1.jar"
- id="org.apache.tuscany.sca.feature.core" version="1.4.0">
- <category name="org.apache.tuscany.sca.core.features"/>
- </feature>
-
- <feature url="features/org.apache.tuscany.sca.feature.ejava-2.0-M1.jar"
- id="org.apache.tuscany.sca.feature.ejava" version="1.4.0">
- <category name="org.apache.tuscany.sca.optional.features"/>
- </feature>
-
- <feature url="features/org.apache.tuscany.sca.feature.manager-2.0-M1.jar"
- id="org.apache.tuscany.sca.feature.manager" version="1.4.0">
- <category name="org.apache.tuscany.sca.core.features"/>
- </feature>
-
- <feature url="features/org.apache.tuscany.sca.feature.process-2.0-M1.jar"
- id="org.apache.tuscany.sca.feature.process" version="1.4.0">
- <category name="org.apache.tuscany.sca.optional.features"/>
- </feature>
-
- <feature url="features/org.apache.tuscany.sca.feature.web20-2.0-M1.jar"
- id="org.apache.tuscany.sca.feature.web20" version="1.4.0">
- <category name="org.apache.tuscany.sca.optional.features"/>
- </feature>
-
- <feature url="features/org.apache.tuscany.sca.feature.webservice-2.0-M1.jar"
- id="org.apache.tuscany.sca.feature.webservice" version="1.4.0">
- <category name="org.apache.tuscany.sca.optional.features"/>
- </feature>
-
- <archive path="features/org.apache.tuscany.sca.feature.core_1.4.0.jar"
- url="features/org.apache.tuscany.sca.feature.core-2.0-M1.jar"/>
- <archive path="plugins/org.apache.tuscany.sca.plugin.core_1.4.0.jar"
- url="plugins/org.apache.tuscany.sca.plugin.core-2.0-M1.jar"/>
-
- <archive path="features/org.apache.tuscany.sca.feature.ejava_1.4.0.jar"
- url="features/org.apache.tuscany.sca.feature.ejava-2.0-M1.jar"/>
- <archive path="plugins/org.apache.tuscany.sca.plugin.ejava_1.4.0.jar"
- url="plugins/org.apache.tuscany.sca.plugin.ejava-2.0-M1.jar"/>
-
- <archive path="features/org.apache.tuscany.sca.feature.manager_1.4.0.jar"
- url="features/org.apache.tuscany.sca.feature.manager-2.0-M1.jar"/>
- <archive path="plugins/org.apache.tuscany.sca.plugin.manager_1.4.0.jar"
- url="plugins/org.apache.tuscany.sca.plugin.manager-2.0-M1.jar"/>
-
- <archive path="features/org.apache.tuscany.sca.feature.process_1.4.0.jar"
- url="features/org.apache.tuscany.sca.feature.process-2.0-M1.jar"/>
- <archive path="plugins/org.apache.tuscany.sca.plugin.process_1.4.0.jar"
- url="plugins/org.apache.tuscany.sca.plugin.process-2.0-M1.jar"/>
-
- <archive path="features/org.apache.tuscany.sca.feature.web20_1.4.0.jar"
- url="features/org.apache.tuscany.sca.feature.web20-2.0-M1.jar"/>
- <archive path="plugins/org.apache.tuscany.sca.plugin.web20_1.4.0.jar"
- url="plugins/org.apache.tuscany.sca.plugin.web20-2.0-M1.jar"/>
-
- <archive path="features/org.apache.tuscany.sca.feature.webservice_1.4.0.jar"
- url="features/org.apache.tuscany.sca.feature.webservice-2.0-M1.jar"/>
- <archive path="plugins/org.apache.tuscany.sca.plugin.webservice_1.4.0.jar"
- url="plugins/org.apache.tuscany.sca.plugin.webservice-2.0-M1.jar"/>
-
- <category-def name="org.apache.tuscany.sca.core.features"
- label="Core Features"/>
- <category-def name="org.apache.tuscany.sca.optional.features"
- label="Optional Features"/>
-
-</site>
diff --git a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml b/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml
deleted file mode 100644
index c1225e320b..0000000000
--- a/tags/java/sca/2.0-M1/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>updatesite</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <fileSet>
- <outputDirectory>tuscany-sca-${tuscany.version}-updatesite</outputDirectory>
- <includes>
- <include>LICENSE</include>
- <include>NOTICE</include>
- <include>site.xml</include>
- </includes>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>tuscany-sca-${tuscany.version}-updatesite/plugins</outputDirectory>
- <unpack>false</unpack>
- <includes>
- <include>org.apache.tuscany.sca:org.apache.tuscany.sca.plugin.*</include>
- </includes>
- <scope>runtime</scope>
- </dependencySet>
-
- <dependencySet>
- <outputDirectory>tuscany-sca-${tuscany.version}-updatesite/features</outputDirectory>
- <unpack>false</unpack>
- <includes>
- <include>org.apache.tuscany.sca:org.apache.tuscany.sca.feature.*</include>
- </includes>
- <scope>runtime</scope>
- </dependencySet>
- </dependencySets>
-
-</assembly>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/LICENSE b/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/NOTICE b/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/pom.xml b/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/pom.xml
deleted file mode 100644
index b46c3125e1..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-maven-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-maven-ant-generator</artifactId>
- <packaging>maven-plugin</packaging>
- <name>Apache Tuscany SCA Ant Build Generator Maven Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-settings</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/src/main/java/org/apache/tuscany/sca/tools/ant/generator/plugin/AntGeneratorMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/src/main/java/org/apache/tuscany/sca/tools/ant/generator/plugin/AntGeneratorMojo.java
deleted file mode 100644
index d7b80bd67c..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-ant-generator/src/main/java/org/apache/tuscany/sca/tools/ant/generator/plugin/AntGeneratorMojo.java
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.tools.ant.generator.plugin;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.model.FileSet;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.PluginExecution;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.settings.Settings;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-
-/**
- * A Maven plugin that generates an Ant build.xml file for Tuscany SCA samples.
- *
- * Build dependencies and additional build steps like WSDL2Java for example are
- * automatically determined from the pom.xml file describing the module's Maven build.
- *
- * @version $Rev$ $Date$
- * @goal generate
- * @phase generate-sources
- * @requiresDependencyResolution test
- * @description Generate Ant build script for an SCA project
- */
-public class AntGeneratorMojo extends AbstractMojo {
-
- /**
- * The project to generate an Ant build for.
- *
- * @parameter expression="${project}"
- * @required
- */
- private MavenProject project;
-
- /**
- * Used for resolving artifacts
- *
- * @component
- */
- private ArtifactResolver resolver;
-
- /**
- * Factory for creating artifact objects
- *
- * @component
- */
- private ArtifactFactory factory;
-
- /**
- * The local repository where the artifacts are located
- *
- * @parameter expression="${localRepository}"
- * @required
- */
- private ArtifactRepository localRepository;
-
- /**
- * The remote repositories where artifacts are located
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- */
- private List remoteRepositories;
-
- /**
- * The current user system settings for use in Maven.
- *
- * @parameter expression="${settings}"
- * @required
- * @readonly
- */
- private Settings settings;
-
- /**
- * The main class name.
- * @parameter
- */
- private String mainClass;
-
- /**
- * If set true then only the dependency file is created. The dependency
- * file can then be included in a hand generated build.xml file
- * @parameter
- */
- private Boolean buildDependencyFileOnly;
-
- /**
- * The build.xml file to generate.
- * @parameter expression="${basedir}/build.xml"
- */
- private String buildFile;
-
- /**
- * The build-dependency.xml file to generate.
- * @parameter expression="${basedir}/build-dependency.xml"
- */
- private String buildDependencyFile;
-
- public void execute() throws MojoExecutionException {
- if ((buildDependencyFileOnly != null) &&
- (buildDependencyFileOnly == true)){
- generateBuildDependencyFile();
- } else {
- generateBuildFile();
- }
- }
-
- /**
- * Generate Ant build dependency XML file
- */
- private void generateBuildDependencyFile() throws MojoExecutionException {
-
- getLog().info("Generating " + buildDependencyFile);
-
- // Open the target build-dependency.xml file
- File targetFile = new File(buildDependencyFile);
- PrintWriter pw;
- try {
- pw = new PrintWriter(new FileOutputStream(targetFile));
- } catch (FileNotFoundException e) {
- throw new MojoExecutionException(e.toString());
- }
-
- // Generate the Apache license header
- generateLicenseHeader(pw);
-
- // Generate Ant filesets representing the build dependencies
- generateBuildDependencies(pw);
-
- pw.close();
- }
-
- /**
- * Generate Ant build XML file
- */
- private void generateBuildFile() throws MojoExecutionException {
-
- getLog().info("Generating " + buildFile);
-
- // Open the target build.xml file
- File targetFile = new File(buildFile);
- PrintWriter pw;
- try {
- pw = new PrintWriter(new FileOutputStream(targetFile));
- } catch (FileNotFoundException e) {
- throw new MojoExecutionException(e.toString());
- }
-
- // Determine the project packaging
- String packaging = project.getPackaging().toLowerCase();
-
- // Generate the Apache license header
- generateLicenseHeader(pw);
-
- pw.println("<project name=\"" + project.getArtifactId() + "\" default=\"compile\">");
- pw.println();
-
- // Generate the compile target
- int base = project.getBasedir().toString().length() + 1;
- pw.println(" <target name=\"compile\">");
- pw.println(" <mkdir dir=\"target/classes\"/>");
-
- // Generate any pre-compilation tasks
- generatePreCompileTasks(pw);
-
- // Generate the compile task
- pw.println(" <javac destdir=\"target/classes\" debug=\"on\" source=\"1.5\" target=\"1.5\">");
- for (String source: (List<String>)project.getCompileSourceRoots()) {
- if (source.length() > base) {
- source = source.substring(base);
- } else {
- source = ".";
- }
- pw.println(" <src path=\"" + source + "\"/>");
- }
- pw.println(" <classpath>");
- pw.println(" <fileset refid=\"tuscany.jars\"/>");
- pw.println(" <fileset refid=\"3rdparty.jars\"/>");
- pw.println(" </classpath>");
- pw.println(" </javac>");
- pw.println(" <copy todir=\"target/classes\">");
- for (FileSet resource: (List<FileSet>)project.getResources()) {
- String source = resource.getDirectory();
- if (source.length() > base) {
- source = source.substring(base);
-
- if (source.equals(".")){
- pw.println(" <fileset dir=\".\" includes=\"*\" excludes=\"src, target, pom.xml, build.xml\"/>");
- } else {
- pw.println(" <fileset dir=\"" + source + "\"/>");
- }
- } else {
- if (project.getResources().size() > 1) {
- break;
- }
- pw.println(" <fileset dir=\".\" excludes=\"**/*.java, pom.xml, build.xml, target\"/>");
- source = ".";
- }
- }
- pw.println(" </copy>");
-
- // Build a JAR
- if (packaging.equals("jar")) {
- pw.println(" <jar destfile=\"target/" + project.getArtifactId() + ".jar\" basedir=\"target/classes\">");
- pw.println(" <manifest>");
- if (mainClass != null) {
- pw.println(" <attribute name=\"Main-Class\" value=\"" + mainClass + "\"/>");
- }
- pw.println(" </manifest>");
- pw.println(" </jar>");
-
- } else if (packaging.equals("war")) {
-
- // Build a WAR
- pw.println(" <war destfile=\"target/" + project.getArtifactId() + ".war\" webxml=\"src/main/webapp/WEB-INF/web.xml\">");
- pw.println(" <fileset dir=\"src/main/webapp\"/>");
- pw.println(" <lib refid=\"tuscany.jars\"/>");
- pw.println(" <lib refid=\"3rdparty.jars\"/>");
- pw.println(" <classes dir=\"target/classes\"/>");
- pw.println(" </war>");
- }
- pw.println(" </target>");
- pw.println();
-
-
- // Generate a package target alongside the compile target
- // Tuscany SCA samples use "package" as the target for webapps
- pw.println(" <target name=\"package\" depends=\"compile\"/>");
- pw.println();
-
- // Generate the run target
- if (mainClass != null) {
- pw.println(" <target name=\"run\">");
- pw.println(" <java classname=\"" + mainClass + "\" fork=\"true\">");
- pw.println(" <classpath>");
- pw.println(" <pathelement location=\"target/" + project.getArtifactId() + ".jar\"/>");
- pw.println(" <fileset refid=\"tuscany.jars\"/>");
- pw.println(" <fileset refid=\"3rdparty.jars\"/>");
- pw.println(" </classpath>");
- pw.println(" </java>");
- pw.println(" </target>");
- pw.println();
- }
-
- // Generate the clean target
- pw.println(" <target name=\"clean\">");
- pw.println(" <delete includeemptydirs=\"true\">");
- pw.println(" <fileset dir=\"target\"/>");
- pw.println(" </delete>");
- pw.println(" </target>");
- pw.println();
-
- // Generate Ant filesets representing the build dependencies
- generateBuildDependencies(pw);
-
- pw.println("</project>");
- pw.close();
- }
-
- /**
- * Generate Ant filesets representing the build dependencies.
- * @param pw PrintWriter to write to
- */
- private void generateBuildDependencies(PrintWriter pw) {
-
- // Determine the module dependencies
- List<String> tuscanyModules = new ArrayList<String>();
- List<String> otherModules = new ArrayList<String>();
- for (Artifact artifact: (List<Artifact>)project.getRuntimeArtifacts()) {
- if (artifact.getGroupId().startsWith("org.apache.tuscany.sca")) {
- tuscanyModules.add(artifact.getFile().getName());
- } else {
- otherModules.add(artifact.getFile().getName());
- }
- }
-
- // Sort lists of modules, making output deterministic
- Collections.sort(tuscanyModules);
- Collections.sort(otherModules);
-
- // Generate filesets for the tuscany and 3rd party dependencies
- pw.println(" <fileset id=\"tuscany.jars\" dir=\"../../modules\">");
- for (String name: tuscanyModules) {
- pw.println(" <include name=\"" + name +"\"/>");
- }
- pw.println(" </fileset>");
- pw.println(" <fileset id=\"3rdparty.jars\" dir=\"../../lib\">");
- for (String name: otherModules) {
- pw.println(" <include name=\"" + name +"\"/>");
- }
- pw.println(" </fileset>");
- pw.println();
- }
-
- /**
- * Extract plugin execution configurations out of the Maven model. This handles
- * nested configurations with a base configuration and a collection of nested
- * configuration elements, for example:
- * <configuration>
- * <schemaFiles>
- * <configuration>
- * <fileName>x.wsdl</fileName>
- * </configuration>
- * <configuration>
- * <fileName>y.wsdl</fileName>
- * </configuration>
- * </schemaFiles>
- * <noNotification>true</noNotification>
- * </configuration>
- *
- * @param execution Maven plugin execution model
- * @return a list of maps containing the plugin configuration key value pairs
- */
- private static List<Map<String, String>> pluginConfigurations(PluginExecution execution) {
- List<Map<String, String>> configurations = new ArrayList<Map<String,String>>();
- Map<String, String> topConfiguration = new HashMap<String, String>();
-
- Xpp3Dom dom = (Xpp3Dom)execution.getConfiguration();
- for (Xpp3Dom element: dom.getChildren()) {
- if (element.getChildCount() != 0) {
- // Handle nested configuration element, create a child configuration
- // for each
- for (Xpp3Dom childConfigurationElement: element.getChildren()) {
- Map<String, String> childConfiguration = new HashMap<String, String>();
- for (Xpp3Dom childElement: childConfigurationElement.getChildren()) {
- childConfiguration.put(childElement.getName(), childElement.getValue());
- }
- configurations.add(childConfiguration);
- }
- } else {
- // Handle top level key value pair element
- topConfiguration.put(element.getName(), element.getValue());
- }
- }
- // Return the top configuration or the child configurations merged
- // with the top one
- if (configurations.isEmpty()) {
- configurations.add(topConfiguration);
- } else {
- for (Map<String, String> configuration: configurations) {
- configuration.putAll(topConfiguration);
- }
- }
- return configurations;
- }
-
- /**
- * Generate Ant tasks for the pre-compilation generation plugins
- * used in the Maven module.
- * @param pw PrintWriter to write to
- * @return list of directories containing generated source to compile
- */
- private void generatePreCompileTasks(PrintWriter pw) {
- String baseDir = project.getBasedir().getAbsolutePath() + '/';
-
- List<Plugin> plugins = (List<Plugin>)project.getBuildPlugins();
- for (Plugin plugin: plugins) {
-
- // Generate Ant task equivalent to the Tuscany SDO plugin
- if ("org.apache.tuscany.sdo".equals(plugin.getGroupId()) && "tuscany-sdo-plugin".equals(plugin.getArtifactId())) {
- for (PluginExecution execution: (List<PluginExecution>)plugin.getExecutions()) {
- for (Map<String, String> configuration: pluginConfigurations(execution)) {
-
- pw.println(" <java classname=\"org.apache.tuscany.sdo.generate.XSD2JavaGenerator\" fork=\"true\">");
-
- // Generate the various code generation options
- for (Map.Entry<String, String> element: configuration.entrySet()) {
- String key = element.getKey();
- String value = element.getValue();
- if (key.equals("schemaNamespace")) {
- pw.println(" <arg value=\"-schemaNamespace\"/>");
- pw.println(" <arg value=\"" + value + "\"/>");
- }
- if (key.equals("javaPackage")) {
- pw.println(" <arg value=\"-javaPackage\"/>");
- pw.println(" <arg value=\"" + value + "\"/>");
- }
- if (key.equals("prefix")) {
- pw.println(" <arg value=\"-prefix\"/>");
- pw.println(" <arg value=\"" + value + "\"/>");
- }
- if (key.equals("noInterfaces") && "true".equals(value)) {
- pw.println(" <arg value=\"-noInterfaces\"/>");
- }
- if (key.equals("noNotification") && "true".equals(value)) {
- pw.println(" <arg value=\"-noNotification\"/>");
- }
- if (key.equals("noContainer") && "true".equals(value)) {
- pw.println(" <arg value=\"-noContainment\"/>");
- }
- if (key.equals("noUnsettable") && "true".equals(value)) {
- pw.println(" <arg value=\"-noUnsettable\"/>");
- }
- }
-
- // Generate target directory parameter
- String targetDirectory = configuration.get("targetDirectory");
- if (targetDirectory == null) {
- targetDirectory = "target/sdo-source";
- } else if (targetDirectory.startsWith(baseDir)) {
- targetDirectory = targetDirectory.substring(baseDir.length());
- }
- pw.println(" <arg value=\"-targetDirectory\"/>");
- pw.println(" <arg value=\"" + targetDirectory + "\"/>");
-
- // Generate schema file parameter
- String schemaFile = configuration.get("schemaFile");
- if (schemaFile == null) {
- schemaFile = configuration.get("fileName");
- }
- if (schemaFile != null) {
- if (schemaFile.startsWith(baseDir)) {
- schemaFile = schemaFile.substring(baseDir.length());
- }
- pw.println(" <arg value=\"" + schemaFile + "\"/>");
- }
-
- pw.println(" <classpath>");
- pw.println(" <fileset refid=\"tuscany.jars\"/>");
- pw.println(" <fileset refid=\"3rdparty.jars\"/>");
- pw.println(" </classpath>");
- pw.println(" </java>");
- }
- }
- }
-
- // Generate Ant task equivalent to the Tuscany WSDL2Java plugin
- else if ("org.apache.tuscany.sca".equals(plugin.getGroupId()) && "tuscany-maven-wsdl2java".equals(plugin.getArtifactId())) {
- for (PluginExecution execution: (List<PluginExecution>)plugin.getExecutions()) {
- for (Map<String, String> configuration: pluginConfigurations(execution)) {
-
- pw.println(" <java classname=\"org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator\" fork=\"true\">");
-
- // Generate the various code generation options
- for (Map.Entry<String, String> element: configuration.entrySet()) {
- String key = element.getKey();
- String value = element.getValue();
- if (key.equals("javaPackage")) {
- pw.println(" <arg value=\"-javaPackage\"/>");
- pw.println(" <arg value=\"" + value + "\"/>");
- }
- }
-
- // Generate target directory parameter
- String targetDirectory = configuration.get("targetDirectory");
- if (targetDirectory == null) {
- targetDirectory = "target/wsdl2java-source";
- } else if (targetDirectory.startsWith(baseDir)) {
- targetDirectory = targetDirectory.substring(baseDir.length());
- }
- pw.println(" <arg value=\"-targetDirectory\"/>");
- pw.println(" <arg value=\"" + targetDirectory + "\"/>");
-
- // Generate WSDL file parameter
- String wsdlFile = configuration.get("wsdlFile");
- if (wsdlFile == null) {
- wsdlFile = configuration.get("fileName");
- }
- if (wsdlFile != null) {
- if (wsdlFile.startsWith(baseDir)) {
- wsdlFile = wsdlFile.substring(baseDir.length());
- }
- pw.println(" <arg value=\"" + wsdlFile + "\"/>");
- }
-
- pw.println(" <classpath>");
- pw.println(" <fileset refid=\"tuscany.jars\"/>");
- pw.println(" <fileset refid=\"3rdparty.jars\"/>");
- pw.println(" </classpath>");
- pw.println(" </java>");
- }
- }
- }
- }
- }
-
- /**
- * Generate license header.
- *
- * @param pw PrintWriter to write to
- */
- private void generateLicenseHeader(PrintWriter pw) {
- pw.println("<!--");
- pw.println(" * Licensed to the Apache Software Foundation (ASF) under one");
- pw.println(" * or more contributor license agreements. See the NOTICE file");
- pw.println(" * distributed with this work for additional information");
- pw.println(" * regarding copyright ownership. The ASF licenses this file");
- pw.println(" * to you under the Apache License, Version 2.0 (the");
- pw.println(" * \"License\"); you may not use this file except in compliance");
- pw.println(" * with the License. You may obtain a copy of the License at");
- pw.println(" * ");
- pw.println(" * http://www.apache.org/licenses/LICENSE-2.0");
- pw.println(" * ");
- pw.println(" * Unless required by applicable law or agreed to in writing,");
- pw.println(" * software distributed under the License is distributed on an");
- pw.println(" * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY");
- pw.println(" * KIND, either express or implied. See the License for the");
- pw.println(" * specific language governing permissions and limitations");
- pw.println(" * under the License.");
- pw.println("-->");
- pw.println();
- }
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/LICENSE b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/NOTICE b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/pom.xml b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/pom.xml
deleted file mode 100644
index 8c3a9576c9..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/pom.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-maven-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-maven-bundle-plugin</artifactId>
- <packaging>maven-plugin</packaging>
- <name>Apache Tuscany SCA Maven OSGi Bundle Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-settings</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-dependency-tree</artifactId>
- <version>1.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>1.4.3</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5.1</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/AbstractIdeSupportMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/AbstractIdeSupportMojo.java
deleted file mode 100644
index 8d2663a8b9..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/AbstractIdeSupportMojo.java
+++ /dev/null
@@ -1,1136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.maven.plugin.eclipse;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-import java.util.zip.ZipFile;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactCollector;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.resolver.DebugResolutionListener;
-import org.apache.maven.artifact.resolver.ResolutionNode;
-import org.apache.maven.artifact.resolver.WarningResolutionListener;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
-import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.model.DependencyManagement;
-import org.apache.maven.model.Exclusion;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.eclipse.Constants;
-import org.apache.maven.plugin.ide.IdeDependency;
-import org.apache.maven.plugin.ide.IdeUtils;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.logging.LogEnabled;
-import org.codehaus.plexus.logging.Logger;
-import org.codehaus.plexus.util.IOUtil;
-
-/**
- * Abstract base plugin which takes care of the common stuff usually needed by maven IDE plugins. A plugin extending
- * AbstractIdeSupportMojo should implement the <code>setup()</code> and <code>writeConfiguration()</code> methods,
- * plus the getters needed to get the various configuration flags and required components. The lifecycle:
- *
- * <pre>
- * *** calls setup() where you can configure your specific stuff and stop the mojo from execute if appropriate ***
- * - manually resolve project dependencies, NOT failing if a dependency is missing
- * - compute project references (reactor projects) if the getUseProjectReferences() flag is set
- * - download sources/javadocs if the getDownloadSources() flag is set
- * *** calls writeConfiguration(), passing the list of resolved referenced dependencies ***
- * - report the list of missing sources or just tell how to turn this feature on if the flag was disabled
- * </pre>
- *
- * @author Fabrizio Giustina
- * @version $Id: AbstractIdeSupportMojo.java 628794 2008-02-18 16:09:11Z aheritier $
- */
-public abstract class AbstractIdeSupportMojo
- extends AbstractMojo
- implements LogEnabled
-{
- /**
- * Is it an PDE project? If yes, the plugin adds the necessary natures and build commands to the .project file.
- * Additionally it copies all libraries to a project local directory and references them instead of referencing the
- * files in the local Maven repository. It also ensured that the "Bundle-Classpath" in META-INF/MANIFEST.MF is
- * synchronized.
- *
- * @parameter expression="${eclipse.pde}" default-value="true"
- */
- protected boolean pde;
-
- /**
- * The project whose project files to create.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- protected MavenProject project;
-
- // [rfeng] Change it to use the current project
- /**
- * The currently executed project (can be a reactor project).
- *
- * @parameter expression="${executedProject}"
- * @readonly
- */
- protected MavenProject executedProject;
-
- /**
- * The project packaging.
- *
- * @parameter expression="${project.packaging}"
- */
- protected String packaging;
-
- /**
- * Artifact factory, needed to download source jars for inclusion in classpath.
- *
- * @component role="org.apache.maven.artifact.factory.ArtifactFactory"
- * @required
- * @readonly
- */
- protected ArtifactFactory artifactFactory;
-
- /**
- * Artifact resolver, needed to download source jars for inclusion in classpath.
- *
- * @component role="org.apache.maven.artifact.resolver.ArtifactResolver"
- * @required
- * @readonly
- */
- protected ArtifactResolver artifactResolver;
-
- /**
- * Artifact collector, needed to resolve dependencies.
- *
- * @component role="org.apache.maven.artifact.resolver.ArtifactCollector"
- * @required
- * @readonly
- */
- protected ArtifactCollector artifactCollector;
-
- /**
- * @component role="org.apache.maven.artifact.metadata.ArtifactMetadataSource" hint="maven"
- */
- protected ArtifactMetadataSource artifactMetadataSource;
-
- /**
- * Remote repositories which will be searched for source attachments.
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- * @required
- * @readonly
- */
- protected List remoteArtifactRepositories;
-
- /**
- * Local maven repository.
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
- */
- protected ArtifactRepository localRepository;
-
- /**
- * If the executed project is a reactor project, this will contains the full list of projects in the reactor.
- *
- * @parameter expression="${reactorProjects}"
- * @required
- * @readonly
- */
- protected List reactorProjects;
-
- /**
- * Skip the operation when true.
- *
- * @parameter expression="${eclipse.skip}" default-value="false"
- */
- private boolean skip;
-
- /**
- * Enables/disables the downloading of source attachments. Defaults to false. When this flag is <code>true</code>
- * remote repositories are checked for sources: in order to avoid repeated check for unavailable source archives, a
- * status cache is mantained into the target dir of the root project. Run <code>mvn:clean</code> or delete the
- * file <code>mvn-eclipse-cache.properties</code> in order to reset this cache.
- *
- * @parameter expression="${downloadSources}"
- */
- protected boolean downloadSources;
-
- /**
- * Enables/disables the downloading of javadoc attachments. Defaults to false. When this flag is <code>true</code>
- * remote repositories are checked for javadocs: in order to avoid repeated check for unavailable javadoc archives,
- * a status cache is mantained into the target dir of the root project. Run <code>mvn:clean</code> or delete the
- * file <code>mvn-eclipse-cache.properties</code> in order to reset this cache.
- *
- * @parameter expression="${downloadJavadocs}"
- */
- protected boolean downloadJavadocs;
-
- /**
- * Plexus logger needed for debugging manual artifact resolution.
- */
- protected Logger logger;
-
- /**
- * Getter for <code>artifactMetadataSource</code>.
- *
- * @return Returns the artifactMetadataSource.
- */
- public ArtifactMetadataSource getArtifactMetadataSource()
- {
- return artifactMetadataSource;
- }
-
- /**
- * Setter for <code>artifactMetadataSource</code>.
- *
- * @param artifactMetadataSource The artifactMetadataSource to set.
- */
- public void setArtifactMetadataSource( ArtifactMetadataSource artifactMetadataSource )
- {
- this.artifactMetadataSource = artifactMetadataSource;
- }
-
- /**
- * Getter for <code>project</code>.
- *
- * @return Returns the project.
- */
- public MavenProject getProject()
- {
- return project;
- }
-
- /**
- * Setter for <code>project</code>.
- *
- * @param project The project to set.
- */
- public void setProject( MavenProject project )
- {
- this.project = project;
- }
-
- /**
- * Getter for <code>reactorProjects</code>.
- *
- * @return Returns the reactorProjects.
- */
- public List getReactorProjects()
- {
- return reactorProjects;
- }
-
- /**
- * Setter for <code>reactorProjects</code>.
- *
- * @param reactorProjects The reactorProjects to set.
- */
- public void setReactorProjects( List reactorProjects )
- {
- this.reactorProjects = reactorProjects;
- }
-
- /**
- * Getter for <code>remoteArtifactRepositories</code>.
- *
- * @return Returns the remoteArtifactRepositories.
- */
- public List getRemoteArtifactRepositories()
- {
- return remoteArtifactRepositories;
- }
-
- /**
- * Setter for <code>remoteArtifactRepositories</code>.
- *
- * @param remoteArtifactRepositories The remoteArtifactRepositories to set.
- */
- public void setRemoteArtifactRepositories( List remoteArtifactRepositories )
- {
- this.remoteArtifactRepositories = remoteArtifactRepositories;
- }
-
- /**
- * Getter for <code>artifactFactory</code>.
- *
- * @return Returns the artifactFactory.
- */
- public ArtifactFactory getArtifactFactory()
- {
- return artifactFactory;
- }
-
- /**
- * Setter for <code>artifactFactory</code>.
- *
- * @param artifactFactory The artifactFactory to set.
- */
- public void setArtifactFactory( ArtifactFactory artifactFactory )
- {
- this.artifactFactory = artifactFactory;
- }
-
- /**
- * Getter for <code>artifactResolver</code>.
- *
- * @return Returns the artifactResolver.
- */
- public ArtifactResolver getArtifactResolver()
- {
- return artifactResolver;
- }
-
- /**
- * Setter for <code>artifactResolver</code>.
- *
- * @param artifactResolver The artifactResolver to set.
- */
- public void setArtifactResolver( ArtifactResolver artifactResolver )
- {
- this.artifactResolver = artifactResolver;
- }
-
- /**
- * Getter for <code>executedProject</code>.
- *
- * @return Returns the executedProject.
- */
- public MavenProject getExecutedProject()
- {
- return executedProject;
- }
-
- /**
- * Setter for <code>executedProject</code>.
- *
- * @param executedProject The executedProject to set.
- */
- public void setExecutedProject( MavenProject executedProject )
- {
- this.executedProject = executedProject;
- }
-
- /**
- * Getter for <code>localRepository</code>.
- *
- * @return Returns the localRepository.
- */
- public ArtifactRepository getLocalRepository()
- {
- return localRepository;
- }
-
- /**
- * Setter for <code>localRepository</code>.
- *
- * @param localRepository The localRepository to set.
- */
- public void setLocalRepository( ArtifactRepository localRepository )
- {
- this.localRepository = localRepository;
- }
-
- /**
- * Getter for <code>downloadJavadocs</code>.
- *
- * @return Returns the downloadJavadocs.
- */
- public boolean getDownloadJavadocs()
- {
- return downloadJavadocs;
- }
-
- /**
- * Setter for <code>downloadJavadocs</code>.
- *
- * @param downloadJavadocs The downloadJavadocs to set.
- */
- public void setDownloadJavadocs( boolean downloadJavadoc )
- {
- downloadJavadocs = downloadJavadoc;
- }
-
- /**
- * Getter for <code>downloadSources</code>.
- *
- * @return Returns the downloadSources.
- */
- public boolean getDownloadSources()
- {
- return downloadSources;
- }
-
- /**
- * Setter for <code>downloadSources</code>.
- *
- * @param downloadSources The downloadSources to set.
- */
- public void setDownloadSources( boolean downloadSources )
- {
- this.downloadSources = downloadSources;
- }
-
- protected void setResolveDependencies( boolean resolveDependencies )
- {
- this.resolveDependencies = resolveDependencies;
- }
-
- protected boolean isResolveDependencies()
- {
- return resolveDependencies;
- }
-
- /**
- * return <code>false</code> if projects available in a reactor build should be considered normal dependencies,
- * <code>true</code> if referenced project will be linked and not need artifact resolution.
- *
- * @return <code>true</code> if referenced project will be linked and not need artifact resolution
- */
- protected abstract boolean getUseProjectReferences();
-
- /**
- * Hook for preparation steps before the actual plugin execution.
- *
- * @return <code>true</code> if execution should continue or <code>false</code> if not.
- * @throws MojoExecutionException generic mojo exception
- */
- protected abstract boolean setup()
- throws MojoExecutionException;
-
- /**
- * Main plugin method where dependencies should be processed in order to generate IDE configuration files.
- *
- * @param deps list of <code>IdeDependency</code> objects, with artifacts, sources and javadocs already resolved
- * @throws MojoExecutionException generic mojo exception
- */
- protected abstract void writeConfiguration( IdeDependency[] deps )
- throws MojoExecutionException;
-
- /**
- * Not a plugin parameter. Collect the list of dependencies with a missing source artifact for the final report.
- */
- private List missingSourceDependencies = new ArrayList();
-
- /**
- * Not a plugin parameter. Collect the list of dependencies with a missing javadoc artifact for the final report.
- */
- // TODO merge this with the missingSourceDependencies in a classifier based map?
- private List missingJavadocDependencies = new ArrayList();
-
- /**
- * Cached array of resolved dependencies.
- */
- private IdeDependency[] ideDeps;
-
- /**
- * Flag for mojo implementations to control whether normal maven dependencies should be resolved. Default value is
- * true.
- */
- private boolean resolveDependencies = true;
-
- /**
- * @see org.codehaus.plexus.logging.LogEnabled#enableLogging(org.codehaus.plexus.logging.Logger)
- */
- public void enableLogging( Logger logger )
- {
- this.logger = logger;
- }
-
- /**
- * @see org.apache.maven.plugin.Mojo#execute()
- */
- public final void execute()
- throws MojoExecutionException, MojoFailureException
- {
- if ( skip )
- {
- return;
- }
-
- boolean processProject = setup();
- if ( !processProject )
- {
- return;
- }
-
- // resolve artifacts
- IdeDependency[] deps = doDependencyResolution();
-
- resolveSourceAndJavadocArtifacts( deps );
-
- writeConfiguration( deps );
-
- reportMissingArtifacts();
-
- }
-
- /**
- * Resolve project dependencies. Manual resolution is needed in order to avoid resolution of multiproject artifacts
- * (if projects will be linked each other an installed jar is not needed) and to avoid a failure when a jar is
- * missing.
- *
- * @throws MojoExecutionException if dependencies can't be resolved
- * @return resolved IDE dependencies, with attached jars for non-reactor dependencies
- */
- protected IdeDependency[] doDependencyResolution()
- throws MojoExecutionException
- {
- if ( ideDeps == null )
- {
- if ( resolveDependencies )
- {
- MavenProject project = getProject();
- ArtifactRepository localRepo = getLocalRepository();
-
- List deps = getProject().getDependencies();
-
- // Collect the list of resolved IdeDependencies.
- List dependencies = new ArrayList();
-
- if ( deps != null )
- {
- Map managedVersions =
- createManagedVersionMap( getArtifactFactory(), project.getId(),
- project.getDependencyManagement() );
-
- ArtifactResolutionResult artifactResolutionResult = null;
-
- try
- {
-
- List listeners = new ArrayList();
-
- if ( logger.isDebugEnabled() )
- {
- listeners.add( new DebugResolutionListener( logger ) );
- }
-
- listeners.add( new WarningResolutionListener( logger ) );
-
- artifactResolutionResult =
- artifactCollector.collect( getProjectArtifacts(), project.getArtifact(), managedVersions,
- localRepo, project.getRemoteArtifactRepositories(),
- getArtifactMetadataSource(), null, listeners );
- }
- catch ( ArtifactResolutionException e )
- {
- getLog().debug( e.getMessage(), e );
- getLog().error(
- Messages.getString( "artifactresolution", new Object[] { //$NON-NLS-1$
- e.getGroupId(), e.getArtifactId(), e.getVersion(),
- e.getMessage() } ) );
-
- // if we are here artifactResolutionResult is null, create a project without dependencies but
- // don't fail
- // (this could be a reactor projects, we don't want to fail everything)
- // Causes MECLIPSE-185. Not sure if it should be handled this way??
- return new IdeDependency[0];
- }
-
- // keep track of added reactor projects in order to avoid duplicates
- Set emittedReactorProjectId = new HashSet();
-
- for ( Iterator i = artifactResolutionResult.getArtifactResolutionNodes().iterator(); i.hasNext(); )
- {
-
- ResolutionNode node = (ResolutionNode) i.next();
- int dependencyDepth = node.getDepth();
- Artifact art = node.getArtifact();
- // don't resolve jars for reactor projects
- if ( hasToResolveJar( art ) )
- {
- try
- {
- artifactResolver.resolve( art, node.getRemoteRepositories(), localRepository );
- }
- catch ( ArtifactNotFoundException e )
- {
- getLog().debug( e.getMessage(), e );
- getLog().warn(
- Messages.getString( "artifactdownload", new Object[] { //$NON-NLS-1$
- e.getGroupId(), e.getArtifactId(), e.getVersion(),
- e.getMessage() } ) );
- }
- catch ( ArtifactResolutionException e )
- {
- getLog().debug( e.getMessage(), e );
- getLog().warn(
- Messages.getString( "artifactresolution", new Object[] { //$NON-NLS-1$
- e.getGroupId(), e.getArtifactId(), e.getVersion(),
- e.getMessage() } ) );
- }
- }
-
- boolean includeArtifact = true;
- if ( getExcludes() != null )
- {
- String artifactFullId = art.getGroupId() + ":" + art.getArtifactId();
- if ( getExcludes().contains( artifactFullId ) )
- {
- getLog().info( "excluded: " + artifactFullId );
- includeArtifact = false;
- }
- }
-
- if ( includeArtifact &&
- ( !( getUseProjectReferences() && isAvailableAsAReactorProject( art ) ) || emittedReactorProjectId.add( art.getGroupId() +
- '-' + art.getArtifactId() ) ) )
- {
-
- // the following doesn't work: art.getArtifactHandler().getPackaging() always returns "jar"
- // also
- // if the packaging specified in pom.xml is different.
-
- // osgi-bundle packaging is provided by the felix osgi plugin
- // eclipse-plugin packaging is provided by this eclipse plugin
- // String packaging = art.getArtifactHandler().getPackaging();
- // boolean isOsgiBundle = "osgi-bundle".equals( packaging ) || "eclipse-plugin".equals(
- // packaging );
-
- // we need to check the manifest, if "Bundle-SymbolicName" is there the artifact can be
- // considered
- // an osgi bundle
- boolean isOsgiBundle = false;
- String osgiSymbolicName = null;
- if ( art.getFile() != null )
- {
- JarFile jarFile = null;
- try
- {
- jarFile = new JarFile( art.getFile(), false, ZipFile.OPEN_READ );
-
- Manifest manifest = jarFile.getManifest();
- if ( manifest != null )
- {
- osgiSymbolicName =
- manifest.getMainAttributes().getValue(
- new Attributes.Name(
- "Bundle-SymbolicName" ) );
- }
- }
- catch ( IOException e )
- {
- getLog().info( "Unable to read jar manifest from " + art.getFile() );
- }
- finally
- {
- if ( jarFile != null )
- {
- try
- {
- jarFile.close();
- }
- catch ( IOException e )
- {
- // ignore
- }
- }
- }
- }
-
- isOsgiBundle = osgiSymbolicName != null;
-
- IdeDependency dep =
- new IdeDependency( art.getGroupId(), art.getArtifactId(), art.getVersion(),
- art.getClassifier(), useProjectReference( art ),
- Artifact.SCOPE_TEST.equals( art.getScope() ),
- Artifact.SCOPE_SYSTEM.equals( art.getScope() ),
- Artifact.SCOPE_PROVIDED.equals( art.getScope() ),
- art.getArtifactHandler().isAddedToClasspath(), art.getFile(),
- art.getType(), isOsgiBundle, osgiSymbolicName, dependencyDepth,
- getProjectNameForArifact( art ) );
- // no duplicate entries allowed. System paths can cause this problem.
- if ( !dependencies.contains( dep ) )
- {
- // [rfeng] Do not add compile/provided dependencies
- if (!(pde && (Artifact.SCOPE_COMPILE.equals(art.getScope()) || Artifact.SCOPE_PROVIDED
- .equals(art.getScope())))) {
- dependencies.add( dep );
- }
- }
- }
-
- }
-
- // @todo a final report with the list of
- // missingArtifacts?
-
- }
-
- ideDeps = (IdeDependency[]) dependencies.toArray( new IdeDependency[dependencies.size()] );
- }
- else
- {
- ideDeps = new IdeDependency[0];
- }
- }
-
- return ideDeps;
- }
-
- /**
- * Find the name of the project as used in eclipse.
- *
- * @param artifact The artifact to find the eclipse name for.
- * @return The name os the eclipse project.
- */
- abstract public String getProjectNameForArifact( Artifact artifact );
-
- /**
- * Returns the list of project artifacts. Also artifacts generated from referenced projects will be added, but with
- * the <code>resolved</code> property set to true.
- *
- * @return list of projects artifacts
- * @throws MojoExecutionException if unable to parse dependency versions
- */
- private Set getProjectArtifacts()
- throws MojoExecutionException
- {
- // keep it sorted, this should avoid random classpath order in tests
- Set artifacts = new TreeSet();
-
- for ( Iterator dependencies = getProject().getDependencies().iterator(); dependencies.hasNext(); )
- {
- Dependency dependency = (Dependency) dependencies.next();
-
- String groupId = dependency.getGroupId();
- String artifactId = dependency.getArtifactId();
- VersionRange versionRange;
- try
- {
- versionRange = VersionRange.createFromVersionSpec( dependency.getVersion() );
- }
- catch ( InvalidVersionSpecificationException e )
- {
- throw new MojoExecutionException(
- Messages.getString(
- "unabletoparseversion", new Object[] { //$NON-NLS-1$
- dependency.getArtifactId(),
- dependency.getVersion(),
- dependency.getManagementKey(), e.getMessage() } ),
- e );
- }
-
- String type = dependency.getType();
- if ( type == null )
- {
- type = Constants.PROJECT_PACKAGING_JAR;
- }
- String classifier = dependency.getClassifier();
- boolean optional = dependency.isOptional();
- String scope = dependency.getScope();
- if ( scope == null )
- {
- scope = Artifact.SCOPE_COMPILE;
- }
-
- Artifact art =
- getArtifactFactory().createDependencyArtifact( groupId, artifactId, versionRange, type, classifier,
- scope, optional );
-
- if ( scope.equalsIgnoreCase( Artifact.SCOPE_SYSTEM ) )
- {
- art.setFile( new File( dependency.getSystemPath() ) );
- }
-
- List exclusions = new ArrayList();
- for ( Iterator j = dependency.getExclusions().iterator(); j.hasNext(); )
- {
- Exclusion e = (Exclusion) j.next();
- exclusions.add( e.getGroupId() + ":" + e.getArtifactId() ); //$NON-NLS-1$
- }
-
- ArtifactFilter newFilter = new ExcludesArtifactFilter( exclusions );
-
- art.setDependencyFilter( newFilter );
-
- artifacts.add( art );
- }
-
- return artifacts;
- }
-
- /**
- * Utility method that locates a project producing the given artifact.
- *
- * @param artifact the artifact a project should produce.
- * @return <code>true</code> if the artifact is produced by a reactor projectart.
- */
- protected boolean isAvailableAsAReactorProject( Artifact artifact )
- {
- if ( reactorProjects != null )
- {
- for ( Iterator iter = reactorProjects.iterator(); iter.hasNext(); )
- {
- MavenProject reactorProject = (MavenProject) iter.next();
-
- if ( reactorProject.getGroupId().equals( artifact.getGroupId() ) &&
- reactorProject.getArtifactId().equals( artifact.getArtifactId() ) )
- {
- if ( reactorProject.getVersion().equals( artifact.getVersion() ) )
- {
- return true;
- }
- else
- {
- getLog().info(
- "Artifact " +
- artifact.getId() +
- " already available as a reactor project, but with different version. Expected: " +
- artifact.getVersion() + ", found: " + reactorProject.getVersion() );
- }
- }
- }
- }
- return false;
- }
-
- /**
- * @return an array with all dependencies avalaible in the workspace, to be implemented by the subclasses.
- */
- protected IdeDependency[] getWorkspaceArtefacts()
- {
- return new IdeDependency[0];
- }
-
- private Map createManagedVersionMap( ArtifactFactory artifactFactory, String projectId,
- DependencyManagement dependencyManagement )
- throws MojoExecutionException
- {
- Map map;
- if ( dependencyManagement != null && dependencyManagement.getDependencies() != null )
- {
- map = new HashMap();
- for ( Iterator i = dependencyManagement.getDependencies().iterator(); i.hasNext(); )
- {
- Dependency d = (Dependency) i.next();
-
- try
- {
- VersionRange versionRange = VersionRange.createFromVersionSpec( d.getVersion() );
- Artifact artifact =
- artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), versionRange,
- d.getType(), d.getClassifier(), d.getScope(),
- d.isOptional() );
- map.put( d.getManagementKey(), artifact );
- }
- catch ( InvalidVersionSpecificationException e )
- {
- throw new MojoExecutionException( Messages.getString( "unabletoparseversion", new Object[] { //$NON-NLS-1$
- projectId, d.getVersion(),
- d.getManagementKey(), e.getMessage() } ),
- e );
- }
- }
- }
- else
- {
- map = Collections.EMPTY_MAP;
- }
- return map;
- }
-
- /**
- * Find the reactor target dir. executedProject doesn't have the multiproject root dir set, and the only way to
- * extract it is iterating on parent projects.
- *
- * @param prj current project
- * @return the parent target dir.
- */
- private File getReactorTargetDir( MavenProject prj )
- {
- if ( prj.getParent() != null )
- {
- if ( prj.getParent().getBasedir() != null && prj.getParent().getBasedir().exists() )
- {
- return getReactorTargetDir( prj.getParent() );
- }
- }
- return new File( prj.getBuild().getDirectory() );
- }
-
- /**
- * Resolve source artifacts and download them if <code>downloadSources</code> is <code>true</code>. Source and
- * javadocs artifacts will be attached to the <code>IdeDependency</code> Resolve source and javadoc artifacts. The
- * resolved artifacts will be downloaded based on the <code>downloadSources</code> and
- * <code>downloadJavadocs</code> attributes. Source and
- *
- * @param deps resolved dependencies
- */
- private void resolveSourceAndJavadocArtifacts( IdeDependency[] deps )
- {
-
- File reactorTargetDir = getReactorTargetDir( project );
- File unavailableArtifactsTmpFile = new File( reactorTargetDir, "mvn-eclipse-cache.properties" );
-
- getLog().info( "Using source status cache: " + unavailableArtifactsTmpFile.getAbsolutePath() );
-
- // create target dir if missing
- if ( !unavailableArtifactsTmpFile.getParentFile().exists() )
- {
- unavailableArtifactsTmpFile.getParentFile().mkdirs();
- }
-
- Properties unavailableArtifactsCache = new Properties();
- if ( unavailableArtifactsTmpFile.exists() )
- {
- InputStream is = null;
- try
- {
- is = new FileInputStream( unavailableArtifactsTmpFile );
- unavailableArtifactsCache.load( is );
- }
- catch ( IOException e )
- {
- getLog().warn( "Unable to read source status for reactor projects" );
- }
- finally
- {
- IOUtil.close( is );
- }
-
- }
-
- final List missingSources =
- resolveDependenciesWithClassifier( deps, "sources", getDownloadSources(), unavailableArtifactsCache );
- missingSourceDependencies.addAll( missingSources );
-
- final List missingJavadocs =
- resolveDependenciesWithClassifier( deps, "javadoc", getDownloadJavadocs(), unavailableArtifactsCache );
- missingJavadocDependencies.addAll( missingJavadocs );
-
- FileOutputStream fos = null;
- try
- {
- fos = new FileOutputStream( unavailableArtifactsTmpFile );
- unavailableArtifactsCache.store( fos, "Temporary index for unavailable sources and javadocs" );
- }
- catch ( IOException e )
- {
- getLog().warn( "Unable to cache source status for reactor projects" );
- }
- finally
- {
- IOUtil.close( fos );
- }
-
- }
-
- /**
- * Resolve the required artifacts for each of the dependency. <code>sources</code> or <code>javadoc</code>
- * artifacts (depending on the <code>classifier</code>) are attached to the dependency.
- *
- * @param deps resolved dependencies
- * @param inClassifier the classifier we are looking for (either <code>sources</code> or <code>javadoc</code>)
- * @param includeRemoteRepositories flag whether we should search remote repositories for the artifacts or not
- * @param unavailableArtifactsCache cache of unavailable artifacts
- * @return the list of dependencies for which the required artifact was not found
- */
- private List resolveDependenciesWithClassifier( IdeDependency[] deps, String inClassifier,
- boolean includeRemoteRepositories,
- Properties unavailableArtifactsCache )
- {
- List missingClassifierDependencies = new ArrayList();
-
- // if downloadSources is off, just check
- // local repository for reporting missing source jars
- List remoteRepos = includeRemoteRepositories ? getRemoteArtifactRepositories() : Collections.EMPTY_LIST;
-
- for ( int j = 0; j < deps.length; j++ )
- {
- IdeDependency dependency = deps[j];
-
- if ( dependency.isReferencedProject() || dependency.isSystemScoped() )
- {
- // artifact not needed
- continue;
- }
-
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug(
- "Searching for sources for " + dependency.getId() + ":" + dependency.getClassifier() +
- " at " + dependency.getId() + ":" + inClassifier );
- }
-
- String key =
- dependency.getClassifier() == null ? dependency.getId() + ":" + inClassifier : dependency.getId() +
- ":" + inClassifier + ":" + dependency.getClassifier();
-
- if ( !unavailableArtifactsCache.containsKey( key ) )
- {
- Artifact artifact =
- IdeUtils.resolveArtifactWithClassifier( dependency.getGroupId(), dependency.getArtifactId(),
- dependency.getVersion(), dependency.getClassifier(),
- inClassifier, localRepository, artifactResolver,
- artifactFactory, remoteRepos, getLog() );
- if ( artifact.isResolved() )
- {
- if ( "sources".equals( inClassifier ) )
- {
- dependency.setSourceAttachment( artifact.getFile() );
- }
- else if ( "javadoc".equals( inClassifier ) )
- {
- dependency.setJavadocAttachment( artifact.getFile() );
- }
- }
- else
- {
- unavailableArtifactsCache.put( key, Boolean.TRUE.toString() );
- // add the dependencies to the list
- // of those lacking the required
- // artifact
- missingClassifierDependencies.add( dependency );
- }
- }
- }
-
- // return the list of dependencies missing the
- // required artifact
- return missingClassifierDependencies;
-
- }
-
- /**
- * Output a message with the list of missing dependencies and info on how turn download on if it was disabled.
- */
- private void reportMissingArtifacts()
- {
- StringBuffer msg = new StringBuffer();
-
- if ( !missingSourceDependencies.isEmpty() )
- {
- if ( getDownloadSources() )
- {
- msg.append( Messages.getString( "sourcesnotavailable" ) ); //$NON-NLS-1$
- }
- else
- {
- msg.append( Messages.getString( "sourcesnotdownloaded" ) ); //$NON-NLS-1$
- }
-
- for ( Iterator it = missingSourceDependencies.iterator(); it.hasNext(); )
- {
- IdeDependency art = (IdeDependency) it.next();
- msg.append( Messages.getString( "sourcesmissingitem", art.getId() ) ); //$NON-NLS-1$
- }
- msg.append( "\n" ); //$NON-NLS-1$
- }
-
- if ( !missingJavadocDependencies.isEmpty() )
- {
- if ( getDownloadJavadocs() )
- {
- msg.append( Messages.getString( "javadocnotavailable" ) ); //$NON-NLS-1$
- }
- else
- {
- msg.append( Messages.getString( "javadocnotdownloaded" ) ); //$NON-NLS-1$
- }
-
- for ( Iterator it = missingJavadocDependencies.iterator(); it.hasNext(); )
- {
- IdeDependency art = (IdeDependency) it.next();
- msg.append( Messages.getString( "javadocmissingitem", art.getId() ) ); //$NON-NLS-1$
- }
- msg.append( "\n" ); //$NON-NLS-1$
- }
- getLog().info( msg );
- }
-
- /**
- * @return List of dependencies to exclude from eclipse classpath.
- * @since 2.5
- */
- public abstract List getExcludes();
-
- /**
- * Checks if jar has to be resolved for the given artifact
- *
- * @param art the artifact to check
- * @return true if resolution should happen
- */
- protected boolean hasToResolveJar( Artifact art )
- {
- return !( getUseProjectReferences() && isAvailableAsAReactorProject( art ) );
- }
-
- /**
- * Checks if a projects reference has to be used for the given artifact
- *
- * @param art the artifact to check
- * @return true if a project reference has to be used.
- */
- protected boolean useProjectReference( Artifact art )
- {
- return getUseProjectReferences() && isAvailableAsAReactorProject( art );
- }
-
- protected boolean isOSGiBundle() {
- File base = project.getBasedir();
- File mf = new File(base, "META-INF/MANIFEST.MF");
- if (mf.isFile()) {
- Manifest manifest = null;
- try {
- InputStream is = new FileInputStream(mf);
- manifest = new Manifest(is);
- is.close();
- } catch (IOException e) {
- // Ignore
- }
- if (manifest != null) {
- String bundleName = manifest.getMainAttributes().getValue("Bundle-SymbolicName");
- if (bundleName != null) {
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseClasspathWriter.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseClasspathWriter.java
deleted file mode 100644
index 88afd024db..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseClasspathWriter.java
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.maven.plugin.eclipse;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.eclipse.Constants;
-import org.apache.maven.plugin.eclipse.EclipseSourceDir;
-import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter;
-import org.apache.maven.plugin.ide.IdeDependency;
-import org.apache.maven.plugin.ide.IdeUtils;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
-import org.codehaus.plexus.util.xml.XMLWriter;
-
-/**
- * Writes eclipse .classpath file.
- *
- * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @author <a href="mailto:kenney@neonics.com">Kenney Westerhof</a>
- * @author <a href="mailto:fgiust@apache.org">Fabrizio Giustina</a>
- * @version $Id: EclipseClasspathWriter.java 636955 2008-03-14 02:10:42Z aheritier $
- */
-public class EclipseClasspathWriter
- extends AbstractEclipseWriter
-{
-
- /**
- * Eclipse build path variable M2_REPO
- */
- private static final String M2_REPO = "M2_REPO"; //$NON-NLS-1$
-
- /**
- * Attribute for sourcepath.
- */
- private static final String ATTR_SOURCEPATH = "sourcepath"; //$NON-NLS-1$
-
- /**
- * Attribute for output.
- */
- private static final String ATTR_OUTPUT = "output"; //$NON-NLS-1$
-
- /**
- * Attribute for path.
- */
- private static final String ATTR_PATH = "path"; //$NON-NLS-1$
-
- /**
- * Attribute for kind - Container (con), Variable (var)..etc.
- */
- private static final String ATTR_KIND = "kind"; //$NON-NLS-1$
-
- /**
- * Attribute value for kind: var
- */
- private static final String ATTR_VAR = "var"; //$NON-NLS-1$
-
- /**
- * Attribute value for kind: lib
- */
- private static final String ATTR_LIB = "lib"; //$NON-NLS-1$
-
- /**
- * Attribute value for kind: src
- */
- private static final String ATTR_SRC = "src"; //$NON-NLS-1$
-
- /**
- * Attribute name for source file includes in a path.
- */
- private static final String ATTR_INCLUDING = "including";
-
- /**
- * Attribute name for source file excludes in a path.
- */
- private static final String ATTR_EXCLUDING = "excluding";
-
- /**
- * Element for classpathentry.
- */
- private static final String ELT_CLASSPATHENTRY = "classpathentry"; //$NON-NLS-1$
-
- /**
- * Element for classpath.
- */
- private static final String ELT_CLASSPATH = "classpath"; //$NON-NLS-1$
-
- /**
- * File name that stores project classpath settings.
- */
- private static final String FILE_DOT_CLASSPATH = ".classpath"; //$NON-NLS-1$
-
- /**
- * @see org.apache.tuscany.sca.maven.plugin.eclipse.writers.EclipseWriter#write()
- */
- public void write()
- throws MojoExecutionException
- {
-
- Writer w;
-
- try
- {
- w =
- new OutputStreamWriter( new FileOutputStream( new File( config.getEclipseProjectDirectory(),
- FILE_DOT_CLASSPATH ) ), "UTF-8" );
- }
- catch ( IOException ex )
- {
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$
- }
-
- XMLWriter writer = new PrettyPrintXMLWriter( w );
-
- writer.startElement( ELT_CLASSPATH );
-
- String defaultOutput =
- IdeUtils.toRelativeAndFixSeparator( config.getProjectBaseDir(), config.getBuildOutputDirectory(), false );
-
- // ----------------------------------------------------------------------
- // Source roots and resources
- // ----------------------------------------------------------------------
-
- // List<EclipseSourceDir>
- List specialSources = new ArrayList();
-
- // Map<String,List<EclipseSourceDir>>
- Map byOutputDir = new HashMap();
-
- for ( int j = 0; j < config.getSourceDirs().length; j++ )
- {
- EclipseSourceDir dir = config.getSourceDirs()[j];
-
- // List<EclipseSourceDir>
- List byOutputDirs = (List) byOutputDir.get( dir.getOutput() );
- if ( byOutputDirs == null )
- {
- // ArrayList<EclipseSourceDir>
- byOutputDir.put( dir.getOutput() == null ? defaultOutput : dir.getOutput(), byOutputDirs =
- new ArrayList() );
- }
- byOutputDirs.add( dir );
- }
-
- for ( int j = 0; j < config.getSourceDirs().length; j++ )
- {
- EclipseSourceDir dir = config.getSourceDirs()[j];
-
- log.debug( "Processing " + ( dir.isResource() ? "re" : "" ) + "source " + dir.getPath() + ": output=" +
- dir.getOutput() + "; default output=" + defaultOutput );
-
- boolean isSpecial = false;
-
- // handle resource with nested output folders
- if ( dir.isResource() )
- {
- // Check if the output is a subdirectory of the default output,
- // and if the default output has any sources that copy there.
-
- if ( dir.getOutput() != null // resource output dir is set
- &&
- !dir.getOutput().equals( defaultOutput ) // output dir is not default target/classes
- && dir.getOutput().startsWith( defaultOutput ) // ... but is nested
- && byOutputDir.get( defaultOutput ) != null // ???
- && !( (List) byOutputDir.get( defaultOutput ) ).isEmpty() // ???
- )
- {
- // do not specify as source since the output will be nested. Instead, mark
- // it as a todo, and handle it with a custom build.xml file later.
-
- log.debug( "Marking as special to prevent output folder nesting: " + dir.getPath() + " (output=" +
- dir.getOutput() + ")" );
-
- isSpecial = true;
- specialSources.add( dir );
- }
- }
-
- writer.startElement( ELT_CLASSPATHENTRY );
-
- writer.addAttribute( ATTR_KIND, "src" ); //$NON-NLS-1$
- writer.addAttribute( ATTR_PATH, dir.getPath() );
-
- if ( !isSpecial && dir.getOutput() != null && !defaultOutput.equals( dir.getOutput() ) )
- {
- writer.addAttribute( ATTR_OUTPUT, dir.getOutput() );
- }
-
- if ( StringUtils.isNotEmpty( dir.getInclude() ) )
- {
- writer.addAttribute( ATTR_INCLUDING, dir.getInclude() );
- }
-
- String excludes = dir.getExclude();
-
- if ( dir.isResource() )
- {
- // automatically exclude java files: eclipse doesn't have the concept of resource directory so it will
- // try to compile any java file found in maven resource dirs
- excludes = StringUtils.isEmpty( excludes ) ? "**/*.java" : excludes + "|**/*.java";
- }
-
- if ( StringUtils.isNotEmpty( excludes ) )
- {
- writer.addAttribute( ATTR_EXCLUDING, excludes );
- }
-
- writer.endElement();
-
- }
-
- /* --------------- Commented out by rfeng
- // handle the special sources.
- if ( !specialSources.isEmpty() )
- {
- log.info( "Creating maven-eclipse.xml Ant file to handle resources" );
-
- try
- {
- Writer buildXmlWriter =
- new OutputStreamWriter( new FileOutputStream( new File( config.getEclipseProjectDirectory(),
- "maven-eclipse.xml" ) ), "UTF-8" );
- PrettyPrintXMLWriter buildXmlPrinter = new PrettyPrintXMLWriter( buildXmlWriter );
-
- buildXmlPrinter.startElement( "project" );
- buildXmlPrinter.addAttribute( "default", "copy-resources" );
-
- buildXmlPrinter.startElement( "target" );
- buildXmlPrinter.addAttribute( "name", "init" );
- // initialize filtering tokens here
- buildXmlPrinter.endElement();
-
- buildXmlPrinter.startElement( "target" );
- buildXmlPrinter.addAttribute( "name", "copy-resources" );
- buildXmlPrinter.addAttribute( "depends", "init" );
-
- for ( Iterator it = specialSources.iterator(); it.hasNext(); )
- {
- // TODO: merge source dirs on output path+filtering to reduce
- // <copy> tags for speed.
- EclipseSourceDir dir = (EclipseSourceDir) it.next();
- buildXmlPrinter.startElement( "copy" );
- buildXmlPrinter.addAttribute( "todir", dir.getOutput() );
- buildXmlPrinter.addAttribute( "filtering", "" + dir.isFiltering() );
-
- buildXmlPrinter.startElement( "fileset" );
- buildXmlPrinter.addAttribute( "dir", dir.getPath() );
- if ( dir.getInclude() != null )
- {
- buildXmlPrinter.addAttribute( "includes", dir.getInclude() );
- }
- if ( dir.getExclude() != null )
- {
- buildXmlPrinter.addAttribute( "excludes", dir.getExclude() );
- }
- buildXmlPrinter.endElement();
-
- buildXmlPrinter.endElement();
- }
-
- buildXmlPrinter.endElement();
-
- buildXmlPrinter.endElement();
-
- IOUtil.close( buildXmlWriter );
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException( "Cannot create " + config.getEclipseProjectDirectory() +
- "/maven-eclipse.xml", e );
- }
-
- log.info( "Creating external launcher file" );
- // now create the launcher
- new EclipseAntExternalLaunchConfigurationWriter().init( log, config, "Maven_Ant_Builder.launch",
- "maven-eclipse.xml" ).write();
-
- // finally add it to the project writer.
-
- config.getBuildCommands().add(
- new BuildCommand(
- "org.eclipse.ui.externaltools.ExternalToolBuilder",
- "LaunchConfigHandle",
- "<project>/" +
- EclipseLaunchConfigurationWriter.FILE_DOT_EXTERNAL_TOOL_BUILDERS +
- "Maven_Ant_Builder.launch" ) );
- }
- */
-
- // ----------------------------------------------------------------------
- // The default output
- // ----------------------------------------------------------------------
-
- writer.startElement( ELT_CLASSPATHENTRY );
- writer.addAttribute( ATTR_KIND, ATTR_OUTPUT );
- writer.addAttribute( ATTR_PATH, defaultOutput );
- writer.endElement();
-
- // ----------------------------------------------------------------------
- // Container classpath entries
- // ----------------------------------------------------------------------
-
- for ( Iterator it = config.getClasspathContainers().iterator(); it.hasNext(); )
- {
- writer.startElement( ELT_CLASSPATHENTRY );
- writer.addAttribute( ATTR_KIND, "con" ); //$NON-NLS-1$
- writer.addAttribute( ATTR_PATH, (String) it.next() );
- writer.endElement(); // name
- }
-
- // ----------------------------------------------------------------------
- // The dependencies
- // ----------------------------------------------------------------------
- Set addedDependencies = new HashSet();
- // TODO if (..magic property equals orderDependencies..)
- IdeDependency[] depsToWrite = config.getDepsOrdered();
- for ( int j = 0; j < depsToWrite.length; j++ )
- {
- IdeDependency dep = depsToWrite[j];
-
- if ( dep.isAddedToClasspath() )
- {
- String depId =
- dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getClassifier() + ":" + dep.getVersion();
- /* avoid duplicates in the classpath for artifacts with different types (like ejbs) */
- if ( !addedDependencies.contains( depId ) )
- {
- addDependency( writer, dep );
- addedDependencies.add( depId );
- }
- }
- }
-
- writer.endElement();
-
- IOUtil.close( w );
-
- }
-
- protected void addDependency( XMLWriter writer, IdeDependency dep )
- throws MojoExecutionException
- {
-
- String path;
- String kind;
- String sourcepath = null;
- String javadocpath = null;
- // [rfeng] Force to non-PDE mode
- boolean pdeMode = false;
-
- if ( dep.isReferencedProject() && !pdeMode )
- {
- path = "/" + dep.getEclipseProjectName(); //$NON-NLS-1$
- kind = ATTR_SRC;
- }
- else if ( dep.isReferencedProject() && pdeMode )
- {
- // don't do anything, referenced projects are automatically handled by eclipse in PDE builds
- return;
- }
- else
- {
- File artifactPath = dep.getFile();
-
- if ( artifactPath == null )
- {
- log.error( Messages.getString( "EclipsePlugin.artifactpathisnull", dep.getId() ) ); //$NON-NLS-1$
- return;
- }
-
- if ( dep.isSystemScoped() )
- {
- path = IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(), artifactPath, false );
-
- if ( log.isDebugEnabled() )
- {
- log.debug( Messages.getString( "EclipsePlugin.artifactissystemscoped", //$NON-NLS-1$
- new Object[] { dep.getArtifactId(), path } ) );
- }
-
- kind = ATTR_LIB;
- }
- else
- {
- File localRepositoryFile = new File( config.getLocalRepository().getBasedir() );
-
- // if the dependency is not provided and the plugin runs in "pde mode", the dependency is
- // added to the Bundle-Classpath:
- if ( pdeMode && ( dep.isProvided() || dep.isOsgiBundle() ) )
- {
- return;
- }
- else if ( pdeMode && !dep.isProvided() && !dep.isTestDependency() )
- {
- // path for link created in .project, not to the actual file
- path = dep.getFile().getName();
-
- kind = ATTR_LIB;
- }
- // running in PDE mode and the dependency is provided means, that it is provided by
- // the target platform. This case is covered by adding the plugin container
- else
- {
- String fullPath = artifactPath.getPath();
- String relativePath =
- IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, new File( fullPath ), false );
-
- if ( !new File( relativePath ).isAbsolute() )
- {
- path = M2_REPO + "/" //$NON-NLS-1$
- + relativePath;
- kind = ATTR_VAR; //$NON-NLS-1$
- }
- else
- {
- path = relativePath;
- kind = ATTR_LIB;
- }
- }
-
- if ( dep.getSourceAttachment() != null )
- {
- if ( ATTR_VAR.equals( kind ) )
- {
- sourcepath =
- M2_REPO +
- "/" //$NON-NLS-1$
- +
- IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, dep.getSourceAttachment(),
- false );
- }
- else
- {
- // source archive must be referenced with the full path, we can't mix a lib with a variable
- sourcepath = IdeUtils.getCanonicalPath( dep.getSourceAttachment() );
- }
- }
-
- if ( dep.getJavadocAttachment() != null )
- {
- // NB eclipse (3.1) doesn't support variables in javadoc paths, so we need to add the
- // full path for the maven repo
- javadocpath =
- StringUtils.replace( IdeUtils.getCanonicalPath( dep.getJavadocAttachment() ), "\\", "/" ); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- }
-
- }
-
- writer.startElement( ELT_CLASSPATHENTRY );
- writer.addAttribute( ATTR_KIND, kind );
- writer.addAttribute( ATTR_PATH, path );
-
- if ( sourcepath != null )
- {
- writer.addAttribute( ATTR_SOURCEPATH, sourcepath );
- }
-
- boolean attributeElemOpen = false;
-
- if ( javadocpath != null )
- {
- if ( !attributeElemOpen )
- {
- writer.startElement( "attributes" ); //$NON-NLS-1$
- attributeElemOpen = true;
- }
-
- writer.startElement( "attribute" ); //$NON-NLS-1$
- writer.addAttribute( "value", "jar:" + new File( javadocpath ).toURI() + "!/" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- writer.addAttribute( "name", "javadoc_location" ); //$NON-NLS-1$ //$NON-NLS-2$
- writer.endElement();
-
- }
-
- if ( Constants.PROJECT_PACKAGING_WAR.equals( this.config.getPackaging() ) && config.getWtpapplicationxml() &&
- kind.equals( ATTR_VAR ) && !dep.isTestDependency() && !dep.isProvided() &&
- !dep.isSystemScopedOutsideProject( this.config.getProject() ) )
- {
- if ( !attributeElemOpen )
- {
- writer.startElement( "attributes" ); //$NON-NLS-1$
- attributeElemOpen = true;
- }
-
- writer.startElement( "attribute" ); //$NON-NLS-1$
- writer.addAttribute( "value", "/WEB-INF/lib" ); //$NON-NLS-1$ //$NON-NLS-2$
- writer.addAttribute( "name", "org.eclipse.jst.component.dependency" ); //$NON-NLS-1$ //$NON-NLS-2$
- writer.endElement();
-
- }
-
- if ( attributeElemOpen )
- {
- writer.endElement();
- }
- writer.endElement();
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseCleanMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseCleanMojo.java
deleted file mode 100644
index ac770c743c..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseCleanMojo.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.maven.plugin.eclipse;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.eclipse.Constants;
-import org.apache.maven.plugin.eclipse.EclipseConfigFile;
-import org.codehaus.plexus.util.FileUtils;
-
-/**
- * Deletes the .project, .classpath, .wtpmodules files and .settings folder used by Eclipse.
- *
- * @goal clean
- */
-public class EclipseCleanMojo
- extends AbstractMojo
-{
-
- /**
- * Definition file for Eclipse Web Tools project.
- */
- private static final String FILE_DOT_WTPMODULES = ".wtpmodules"; //$NON-NLS-1$
-
- /**
- * Classpath definition file for an Eclipse Java project.
- */
- private static final String FILE_DOT_CLASSPATH = ".classpath"; //$NON-NLS-1$
-
- /**
- * Project definition file for an Eclipse Project.
- */
- private static final String FILE_DOT_PROJECT = ".project"; //$NON-NLS-1$
-
- /**
- * Web Project definition file for Eclipse Web Tools Project (Release 1.0x).
- */
- private static final String DIR_DOT_SETTINGS = ".settings"; //$NON-NLS-1$
-
- /**
- * File name where the WTP component settings will be stored - WTP 1.0 name.
- */
- private static final String FILE_DOT_COMPONENT = ".settings/.component"; //$NON-NLS-1$
-
- /**
- * File name where the WTP component settings will be stored - WTP 1.5 name.
- */
- private static final String FILE_DOT_COMPONENT_15 = ".settings/org.eclipse.wst.common.component"; //$NON-NLS-1$
-
- /**
- * File name where Eclipse Project's Facet configuration will be stored.
- */
- private static final String FILE_FACET_CORE_XML = ".settings/org.eclipse.wst.common.project.facet.core.xml"; //$NON-NLS-1$
-
- /**
- * General project preferences.
- */
- private static final String FILE_ECLIPSE_JDT_CORE_PREFS = ".settings/org.eclipse.jdt.core.prefs"; //$NON-NLS-1$
-
- /**
- * Packaging for the current project.
- *
- * @parameter expression="${project.packaging}"
- */
- private String packaging;
-
- /**
- * The root directory of the project
- *
- * @parameter expression="${basedir}"
- */
- private File basedir;
-
- /**
- * Skip the operation when true.
- *
- * @parameter expression="${eclipse.skip}" default-value="false"
- */
- private boolean skip;
-
- /**
- * additional generic configuration files for eclipse
- *
- * @parameter
- */
- private EclipseConfigFile[] additionalConfig;
-
- /**
- * @see org.apache.maven.plugin.AbstractMojo#execute()
- */
- public void execute()
- throws MojoExecutionException
- {
- if ( skip )
- {
- return;
- }
-
- if ( Constants.PROJECT_PACKAGING_POM.equals( this.packaging ) )
- {
- return;
- }
-
- delete( new File( basedir, FILE_DOT_PROJECT ) );
- delete( new File( basedir, FILE_DOT_CLASSPATH ) );
- delete( new File( basedir, FILE_DOT_WTPMODULES ) );
-
- delete( new File( basedir, FILE_DOT_COMPONENT ) );
- delete( new File( basedir, FILE_DOT_COMPONENT_15 ) );
- delete( new File( basedir, FILE_FACET_CORE_XML ) );
- delete( new File( basedir, FILE_ECLIPSE_JDT_CORE_PREFS ) );
-
- File settingsDir = new File( basedir, DIR_DOT_SETTINGS );
- if ( settingsDir.exists() && settingsDir.isDirectory() && settingsDir.list().length == 0 )
- {
- delete( settingsDir );
- }
-
- if ( additionalConfig != null )
- {
- for ( int i = 0; i < additionalConfig.length; i++ )
- {
- delete( new File( basedir, additionalConfig[i].getName() ) );
- }
- }
-
- cleanExtras();
- }
-
- protected void cleanExtras()
- throws MojoExecutionException
- {
- // extension point.
- }
-
- /**
- * Delete a file, handling log messages and exceptions
- *
- * @param f File to be deleted
- * @throws MojoExecutionException only if a file exists and can't be deleted
- */
- protected void delete( File f )
- throws MojoExecutionException
- {
- if ( f.isDirectory() )
- {
- getLog().info( Messages.getString( "EclipseCleanMojo.deletingDirectory", f.getName() ) ); //$NON-NLS-1$
- }
- else
- {
- getLog().info( Messages.getString( "EclipseCleanMojo.deletingFile", f.getName() ) ); //$NON-NLS-1$
- }
-
- if ( f.exists() )
- {
- if ( !f.delete() )
- {
- try
- {
- FileUtils.forceDelete( f );
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException( Messages.getString( "EclipseCleanMojo.failedtodelete", //$NON-NLS-1$
- new Object[] { f.getName(),
- f.getAbsolutePath() } ) );
- }
- }
- }
- else
- {
- getLog().debug( Messages.getString( "EclipseCleanMojo.nofilefound", f.getName() ) ); //$NON-NLS-1$
- }
- }
-
- /**
- * Getter for <code>basedir</code>.
- *
- * @return Returns the basedir.
- */
- public File getBasedir()
- {
- return this.basedir;
- }
-
- /**
- * Setter for <code>basedir</code>.
- *
- * @param basedir The basedir to set.
- */
- public void setBasedir( File basedir )
- {
- this.basedir = basedir;
- }
-
- /**
- * @return the packaging
- */
- public String getPackaging()
- {
- return this.packaging;
- }
-
- /**
- * @param packaging the packaging to set
- */
- public void setPackaging( String packaging )
- {
- this.packaging = packaging;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipsePlugin.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipsePlugin.java
deleted file mode 100644
index fccd64540b..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipsePlugin.java
+++ /dev/null
@@ -1,1556 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.maven.plugin.eclipse;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.model.Resource;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.eclipse.BuildCommand;
-import org.apache.maven.plugin.eclipse.Constants;
-import org.apache.maven.plugin.eclipse.EclipseConfigFile;
-import org.apache.maven.plugin.eclipse.EclipseSourceDir;
-import org.apache.maven.plugin.eclipse.WorkspaceConfiguration;
-import org.apache.maven.plugin.eclipse.reader.ReadWorkspaceLocations;
-import org.apache.maven.plugin.eclipse.writers.EclipseManifestWriter;
-import org.apache.maven.plugin.eclipse.writers.EclipseSettingsWriter;
-import org.apache.maven.plugin.eclipse.writers.EclipseWriterConfig;
-import org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpApplicationXMLWriter;
-import org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpComponent15Writer;
-import org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpComponentWriter;
-import org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpFacetsWriter;
-import org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpmodulesWriter;
-import org.apache.maven.plugin.ide.IdeDependency;
-import org.apache.maven.plugin.ide.IdeUtils;
-import org.apache.maven.plugin.ide.JeeUtils;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.resource.ResourceManager;
-import org.codehaus.plexus.resource.loader.FileResourceLoader;
-import org.codehaus.plexus.resource.loader.ResourceNotFoundException;
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-
-/**
- * Generates the following eclipse configuration files:
- * <ul>
- * <li><code>.project</code> and <code>.classpath</code> files</li>
- * <li><code>.setting/org.eclipse.jdt.core.prefs</code> with project specific compiler settings</li>
- * <li>various configuration files for WTP (Web Tools Project), if the parameter <code>wtpversion</code> is set to a
- * valid version (WTP configuration is not generated by default)</li>
- * </ul>
- * If this goal is run on a multiproject root, dependencies between modules will be configured as direct project
- * dependencies in Eclipse (unless <code>useProjectReferences</code> is set to <code>false</code>).
- *
- * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @author <a href="mailto:fgiust@apache.org">Fabrizio Giustina</a>
- * @version $Id: EclipsePlugin.java 641616 2008-03-26 22:42:42Z aheritier $
- * @goal eclipse
- * @execute phase="generate-resources"
- */
-public class EclipsePlugin
- extends AbstractIdeSupportMojo
-{
-
- private static final String NATURE_WST_FACET_CORE_NATURE = "org.eclipse.wst.common.project.facet.core.nature"; //$NON-NLS-1$
-
- private static final String BUILDER_WST_COMPONENT_STRUCTURAL_DEPENDENCY_RESOLVER =
- "org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver"; //$NON-NLS-1$
-
- protected static final String BUILDER_WST_VALIDATION = "org.eclipse.wst.validation.validationbuilder"; //$NON-NLS-1$
-
- private static final String BUILDER_JDT_CORE_JAVA = "org.eclipse.jdt.core.javabuilder"; //$NON-NLS-1$
-
- private static final String BUILDER_WST_COMPONENT_STRUCTURAL =
- "org.eclipse.wst.common.modulecore.ComponentStructuralBuilder"; //$NON-NLS-1$
-
- private static final String BUILDER_WST_FACET = "org.eclipse.wst.common.project.facet.core.builder"; //$NON-NLS-1$
-
- private static final String BUILDER_PDE_MANIFEST = "org.eclipse.pde.ManifestBuilder"; //$NON-NLS-1$
-
- private static final String BUILDER_PDE_SCHEMA = "org.eclipse.pde.SchemaBuilder"; //$NON-NLS-1$
-
- private static final String NATURE_WST_MODULE_CORE_NATURE = "org.eclipse.wst.common.modulecore.ModuleCoreNature"; //$NON-NLS-1$
-
- private static final String NATURE_JDT_CORE_JAVA = "org.eclipse.jdt.core.javanature"; //$NON-NLS-1$
-
- private static final String NATURE_JEM_WORKBENCH_JAVA_EMF = "org.eclipse.jem.workbench.JavaEMFNature"; //$NON-NLS-1$
-
- private static final String NATURE_PDE_PLUGIN = "org.eclipse.pde.PluginNature"; //$NON-NLS-1$
-
- protected static final String COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER = "org.eclipse.jdt.launching.JRE_CONTAINER"; //$NON-NLS-1$
-
- protected static final String REQUIRED_PLUGINS_CONTAINER = "org.eclipse.pde.core.requiredPlugins"; //$NON-NLS-1$
-
- // warning, order is important for binary search
- public static final String[] WTP_SUPPORTED_VERSIONS = new String[] { "1.0", "1.5", "2.0", "R7", "none" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * Constant for 'artifactId' element in POM.xml.
- */
- private static final String POM_ELT_ARTIFACT_ID = "artifactId"; //$NON-NLS-1$
-
- /**
- * Constant for 'groupId' element in POM.xml.
- */
- private static final String POM_ELT_GROUP_ID = "groupId"; //$NON-NLS-1$
-
- /**
- * List of eclipse project natures. By default the <code>org.eclipse.jdt.core.javanature</code> nature plus the
- * needed WTP natures are added. Natures added using this property <strong>replace</strong> the default list.
- *
- * <pre>
- * &lt;projectnatures&gt;
- * &lt;projectnature&gt;org.eclipse.jdt.core.javanature&lt;/projectnature&gt;
- * &lt;projectnature&gt;org.eclipse.wst.common.modulecore.ModuleCoreNature&lt;/projectnature&gt;
- * &lt;/projectnatures&gt;
- * </pre>
- *
- * @parameter
- */
- private List projectnatures;
-
- /**
- * List of artifact to exclude from eclipse classpath, beeing provided by some eclipse classPathContainer
- * [MECLIPSE-79]
- *
- * @since 2.5
- * @parameter
- */
- private List excludes;
-
- /**
- * List of eclipse project natures to be added to the default ones.
- *
- * <pre>
- * &lt;additionalProjectnatures&gt;
- * &lt;projectnature&gt;org.springframework.ide.eclipse.core.springnature&lt;/projectnature&gt;
- * &lt;/additionalProjectnatures&gt;
- * </pre>
- *
- * @parameter
- */
- private List additionalProjectnatures;
-
- /**
- * List of eclipse project facets to be added to the default ones.
- *
- * <pre>
- * &lt;additionalProjectFacets&gt;
- * &lt;jst.jsf&gt;1.1&lt;jst.jsf/&gt;
- * &lt;/additionalProjectFacets&gt;
- * </pre>
- *
- * @parameter
- */
- private Map additionalProjectFacets;
-
- /**
- * List of eclipse build commands. By default the <code>org.eclipse.jdt.core.javabuilder</code> builder plus the
- * needed WTP builders are added. If you specify any configuration for this parameter, only those buildcommands
- * specified will be used; the defaults won't be added. Use the <code>additionalBuildCommands</code> parameter for
- * that. Configuration example: Old style:
- *
- * <pre>
- * &lt;buildcommands&gt;
- * &lt;buildcommand&gt;org.eclipse.wst.common.modulecore.ComponentStructuralBuilder&lt;/buildcommand&gt;
- * &lt;buildcommand&gt;org.eclipse.jdt.core.javabuilder&lt;/buildcommand&gt;
- * &lt;buildcommand&gt;org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver&lt;/buildcommand&gt;
- * &lt;/buildcommands&gt;
- * </pre>
- *
- * For new style, see <code>additionalBuildCommands</code>.
- *
- * @parameter
- */
- private List buildcommands;
-
- /**
- * List of eclipse build commands to be added to the default ones. Old style:
- *
- * <pre>
- * &lt;additionalBuildcommands&gt;
- * &lt;buildcommand&gt;org.springframework.ide.eclipse.core.springbuilder&lt;/buildcommand&gt;
- * &lt;/additionalBuildcommands&gt;
- * </pre>
- *
- * New style:
- *
- * <pre>
- * &lt;additionalBuildcommands&gt;
- * &lt;buildCommand&gt;
- * &lt;name&gt;org.ui.externaltools.ExternalToolBuilder&lt;/name&gt;
- * &lt;triggers&gt;auto,full,incremental,&lt;/triggers&gt;
- * &lt;arguments&gt;
- * &lt;LaunchConfigHandle&gt;&amp;lt;project&amp;gt;./externalToolBuilders/MavenBuilder.launch&lt;/LaunchConfighandle&gt;
- * &lt;/arguments&gt;
- * &lt;/buildCommand&gt;
- * &lt;/additionalBuildcommands&gt;
- * </pre>
- *
- * Note the difference between <code>build<strong>c</strong>ommand</code> and
- * <code>build<strong>C</strong>ommand</code>. You can mix and match old and new-style configuration entries.
- *
- * @parameter
- */
- private List additionalBuildcommands;
-
- /**
- * List of container classpath entries. By default the <code>org.eclipse.jdt.launching.JRE_CONTAINER</code>
- * classpath container is added. Configuration example:
- *
- * <pre>
- * &lt;classpathContainers&gt;
- * &lt;classpathContainer&gt;org.eclipse.jdt.launching.JRE_CONTAINER&lt;/classpathContainer&gt;
- * &lt;classpathContainer&gt;org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5&lt;/classpathContainer&gt;
- * &lt;classpathContainer&gt;org.eclipse.jst.j2ee.internal.web.container/artifact&lt;/classpathContainer&gt;
- * &lt;/classpathContainers&gt;
- * </pre>
- *
- * @parameter
- */
- private List classpathContainers;
-
- /**
- * Enables/disables the downloading of source attachments. Defaults to false. DEPRECATED - use downloadSources
- *
- * @parameter expression="${eclipse.downloadSources}"
- * @deprecated use downloadSources
- */
- private boolean eclipseDownloadSources;
-
- /**
- * Eclipse workspace directory.
- *
- * @parameter expression="${eclipse.projectDir}" alias="outputDir"
- */
- private File eclipseProjectDir;
-
- /**
- * When set to false, the plugin will not create sub-projects and instead reference those sub-projects using the
- * installed package in the local repository
- *
- * @parameter expression="${eclipse.useProjectReferences}" default-value="true"
- * @required
- */
- private boolean useProjectReferences;
-
- /**
- * The default output directory
- *
- * @parameter expression="${outputDirectory}" alias="outputDirectory"
- * default-value="${project.build.outputDirectory}"
- * @required
- */
- private File buildOutputDirectory;
-
- /**
- * The version of WTP for which configuration files will be generated. The default value is "none" (don't generate
- * WTP configuration), supported versions are "R7", "1.0", and "1.5"
- *
- * @parameter expression="${wtpversion}" default-value="none"
- */
- private String wtpversion;
-
- /**
- * JEE context name of the WTP module. ( ex. WEB context name ).
- *
- * @parameter expression="${wtpContextName}"
- */
- private String wtpContextName;
-
- /**
- * The relative path of the manifest file
- *
- * @parameter expression="${eclipse.manifest}" default-value="${basedir}/META-INF/MANIFEST.MF"
- */
- private File manifest;
-
- /**
- * Allow to configure additional generic configuration files for eclipse that will be written out to disk when
- * running eclipse:eclipse. FOr each file you can specify the name and the text content.
- *
- * <pre>
- * &lt;plugin&gt;
- * &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
- * &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
- * &lt;configuration&gt;
- * &lt;additionalConfig&gt;
- * &lt;file&gt;
- * &lt;name&gt;.checkstyle&lt;/name&gt;
- * &lt;content&gt;
- * &lt;![CDATA[&lt;fileset-config file-format-version=&quot;1.2.0&quot; simple-config=&quot;true&quot;&gt;
- * &lt;fileset name=&quot;all&quot; enabled=&quot;true&quot; check-config-name=&quot;acme corporate style&quot; local=&quot;false&quot;&gt;
- * &lt;file-match-pattern match-pattern=&quot;.&quot; include-pattern=&quot;true&quot;/&gt;
- * &lt;/fileset&gt;
- * &lt;filter name=&quot;NonSrcDirs&quot; enabled=&quot;true&quot;/&gt;
- * &lt;/fileset-config&gt;]]&gt;
- * &lt;/content&gt;
- * &lt;/file&gt;
- * &lt;/additionalConfig&gt;
- * &lt;/configuration&gt;
- * &lt;/plugin&gt;
- * </pre>
- *
- * Instead of the content you can also define (from version 2.5) an url to download the file :
- *
- * <pre>
- * &lt;plugin&gt;
- * &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
- * &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
- * &lt;configuration&gt;
- * &lt;additionalConfig&gt;
- * &lt;file&gt;
- * &lt;name&gt;.checkstyle&lt;/name&gt;
- * &lt;url&gt;http://some.place.org/path/to/file&lt;/url&gt;
- * &lt;/file&gt;
- * &lt;/additionalConfig&gt;
- * &lt;/configuration&gt;
- * </pre>
- *
- * or a location :
- *
- * <pre>
- * &lt;plugin&gt;
- * &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
- * &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
- * &lt;configuration&gt;
- * &lt;additionalConfig&gt;
- * &lt;file&gt;
- * &lt;name&gt;.checkstyle&lt;/name&gt;
- * &lt;location&gt;/checkstyle-config.xml&lt;/location&gt;
- * &lt;/file&gt;
- * &lt;/additionalConfig&gt;
- * &lt;/configuration&gt;
- * &lt;dependencies&gt;
- * &lt;!-- The file defined in the location is stored in this dependency --&gt;
- * &lt;dependency&gt;
- * &lt;groupId&gt;eclipsetest&lt;/groupId&gt;
- * &lt;artifactId&gt;checkstyle-config&lt;/artifactId&gt;
- * &lt;version&gt;1.0&lt;/version&gt;
- * &lt;/dependency&gt;
- * &lt;/dependencies&gt;
- * &lt;/plugin&gt;
- * </pre>
- *
- * @parameter
- */
- private EclipseConfigFile[] additionalConfig;
-
- /**
- * If set to <code>true</code>, the version number of the artifact is appended to the name of the generated
- * Eclipse project. See projectNameTemplate for other options.
- *
- * @parameter expression="${eclipse.addVersionToProjectName}" default-value="false"
- */
- private boolean addVersionToProjectName;
-
- /**
- * If set to <code>true</code>, the groupId of the artifact is appended to the name of the generated Eclipse
- * project. See projectNameTemplate for other options.
- *
- * @parameter expression="${eclipse.addGroupIdToProjectName}" default-value="false"
- */
- private boolean addGroupIdToProjectName;
-
- /**
- * Allows configuring the name of the eclipse projects. This property if set wins over addVersionToProjectName and
- * addGroupIdToProjectName You can use <code>[groupId]</code>, <code>[artifactId]</code> and
- * <code>[version]</code> variables. eg. <code>[groupId].[artifactId]-[version]</code>
- *
- * @parameter expression="${eclipse.projectNameTemplate}"
- */
- private String projectNameTemplate;
-
- /**
- * Parsed wtp version.
- */
- private float wtpVersionFloat;
-
- /**
- * Not a plugin parameter. Is this a java project?
- */
- private boolean isJavaProject;
-
- /**
- * Must the manifest files be written for java projects so that that the jee classpath for wtp is correct.
- *
- * @parameter expression="${eclipse.wtpmanifest}" default-value="false"
- */
- private boolean wtpmanifest;
-
- /**
- * Must the application files be written for ear projects in a separate directory.
- *
- * @parameter expression="${eclipse.wtpapplicationxml}" default-value="false"
- */
- private boolean wtpapplicationxml;
-
- /**
- * What WTP defined server to use for deployment informations.
- *
- * @parameter expression="${eclipse.wtpdefaultserver}"
- */
- private String wtpdefaultserver;
-
- private WorkspaceConfiguration workspaceConfiguration;
-
- /**
- * ResourceManager for getting additonalConfig files from resources
- *
- * @component
- * @required
- * @readonly
- */
- private ResourceManager locator;
-
- /**
- * This eclipse workspace is read and all artifacts detected there will be connected as eclipse projects and will
- * not be linked to the jars in the local repository. Requirement is that it was created with the similar wtp
- * settings as the reactor projects, but the project name template my differ. The pom's in the workspace projects
- * may not contain variables in the artefactId, groupId and version tags.
- *
- * @since 2.5
- * @parameter expression="${eclipse.workspace}"
- */
- protected String workspace;
-
- /**
- * Limit the use of project references to the current workspace. No project references will be created to projects
- * in the reactor when they are not available in the workspace.
- *
- * @parameter expression="${eclipse.limitProjectReferencesToWorkspace}" default-value="false"
- */
- protected boolean limitProjectReferencesToWorkspace;
-
- protected boolean isJavaProject()
- {
- return isJavaProject;
- }
-
- protected boolean isPdeProject()
- {
- return pde;
- }
-
- /**
- * Getter for <code>buildcommands</code>.
- *
- * @return Returns the buildcommands.
- */
- public List getBuildcommands()
- {
- return buildcommands;
- }
-
- /**
- * Setter for <code>buildcommands</code>.
- *
- * @param buildcommands The buildcommands to set.
- */
- public void setBuildcommands( List buildcommands )
- {
- this.buildcommands = buildcommands;
- }
-
- /**
- * Getter for <code>buildOutputDirectory</code>.
- *
- * @return Returns the buildOutputDirectory.
- */
- public File getBuildOutputDirectory()
- {
- return buildOutputDirectory;
- }
-
- /**
- * Setter for <code>buildOutputDirectory</code>.
- *
- * @param buildOutputDirectory The buildOutputDirectory to set.
- */
- public void setBuildOutputDirectory( File buildOutputDirectory )
- {
- this.buildOutputDirectory = buildOutputDirectory;
- }
-
- /**
- * Getter for <code>classpathContainers</code>.
- *
- * @return Returns the classpathContainers.
- */
- public List getClasspathContainers()
- {
- return classpathContainers;
- }
-
- /**
- * Setter for <code>classpathContainers</code>.
- *
- * @param classpathContainers The classpathContainers to set.
- */
- public void setClasspathContainers( List classpathContainers )
- {
- this.classpathContainers = classpathContainers;
- }
-
- /**
- * Getter for <code>eclipseProjectDir</code>.
- *
- * @return Returns the eclipseProjectDir.
- */
- public File getEclipseProjectDir()
- {
- return eclipseProjectDir;
- }
-
- /**
- * Setter for <code>eclipseProjectDir</code>.
- *
- * @param eclipseProjectDir The eclipseProjectDir to set.
- */
- public void setEclipseProjectDir( File eclipseProjectDir )
- {
- this.eclipseProjectDir = eclipseProjectDir;
- }
-
- /**
- * Getter for <code>projectnatures</code>.
- *
- * @return Returns the projectnatures.
- */
- public List getProjectnatures()
- {
- return projectnatures;
- }
-
- /**
- * Setter for <code>projectnatures</code>.
- *
- * @param projectnatures The projectnatures to set.
- */
- public void setProjectnatures( List projectnatures )
- {
- this.projectnatures = projectnatures;
- }
-
- /**
- * Getter for <code>useProjectReferences</code>.
- *
- * @return Returns the useProjectReferences.
- */
- public boolean getUseProjectReferences()
- {
- return useProjectReferences;
- }
-
- /**
- * Setter for <code>useProjectReferences</code>.
- *
- * @param useProjectReferences The useProjectReferences to set.
- */
- public void setUseProjectReferences( boolean useProjectReferences )
- {
- this.useProjectReferences = useProjectReferences;
- }
-
- /**
- * Getter for <code>wtpversion</code>.
- *
- * @return Returns the wtpversion.
- */
- public String getWtpversion()
- {
- return wtpversion;
- }
-
- /**
- * Setter for <code>wtpversion</code>.
- *
- * @param wtpversion The wtpversion to set.
- */
- public void setWtpversion( String wtpversion )
- {
- this.wtpversion = wtpversion;
- }
-
- /**
- * Getter for <code>additionalBuildcommands</code>.
- *
- * @return Returns the additionalBuildcommands.
- */
- public List getAdditionalBuildcommands()
- {
- return additionalBuildcommands;
- }
-
- /**
- * Setter for <code>additionalBuildcommands</code>.
- *
- * @param additionalBuildcommands The additionalBuildcommands to set.
- */
- public void setAdditionalBuildcommands( List additionalBuildcommands )
- {
- this.additionalBuildcommands = additionalBuildcommands;
- }
-
- /**
- * Getter for <code>additionalProjectnatures</code>.
- *
- * @return Returns the additionalProjectnatures.
- */
- public List getAdditionalProjectnatures()
- {
- return additionalProjectnatures;
- }
-
- /**
- * Setter for <code>additionalProjectnatures</code>.
- *
- * @param additionalProjectnatures The additionalProjectnatures to set.
- */
- public void setAdditionalProjectnatures( List additionalProjectnatures )
- {
- this.additionalProjectnatures = additionalProjectnatures;
- }
-
- /**
- * Getter for <code>addVersionToProjectName</code>.
- */
- public boolean isAddVersionToProjectName()
- {
- return addVersionToProjectName;
- }
-
- /**
- * Setter for <code>addVersionToProjectName</code>.
- */
- public void setAddVersionToProjectName( boolean addVersionToProjectName )
- {
- this.addVersionToProjectName = addVersionToProjectName;
- }
-
- /**
- * Getter for <code>addGroupIdToProjectName</code>.
- */
- public boolean isAddGroupIdToProjectName()
- {
- return addGroupIdToProjectName;
- }
-
- /**
- * Setter for <code>addGroupIdToProjectName</code>.
- */
- public void setAddGroupIdToProjectName( boolean addGroupIdToProjectName )
- {
- this.addGroupIdToProjectName = addGroupIdToProjectName;
- }
-
- public String getProjectNameTemplate()
- {
- return projectNameTemplate;
- }
-
- public void setProjectNameTemplate( String projectNameTemplate )
- {
- this.projectNameTemplate = projectNameTemplate;
- }
-
- /**
- * @see org.apache.maven.plugin.Mojo#execute()
- */
- public boolean setup()
- throws MojoExecutionException
- {
- boolean ready = true;
-
- checkDeprecations();
-
- ready = validate();
-
- // TODO: Why are we using project in some places, and executedProject in others??
- ArtifactHandler artifactHandler = project.getArtifact().getArtifactHandler();
-
- // ear projects don't contain java sources
- // pde projects are always java projects
- isJavaProject =
- pde ||
- ( Constants.LANGUAGE_JAVA.equals( artifactHandler.getLanguage() ) && !Constants.PROJECT_PACKAGING_EAR.equals( packaging ) );
-
- setupExtras();
-
- parseConfigurationOptions();
-
- // defaults
- if ( projectnatures == null )
- {
- fillDefaultNatures( packaging );
- }
-
- if ( additionalProjectnatures != null )
- {
- projectnatures.addAll( additionalProjectnatures );
- }
-
- if ( buildcommands == null )
- {
- fillDefaultBuilders( packaging );
- }
- else
- {
- convertBuildCommandList( buildcommands );
- }
-
- if ( additionalBuildcommands != null )
- {
- convertBuildCommandList( additionalBuildcommands );
- buildcommands.addAll( additionalBuildcommands );
- }
-
- if ( classpathContainers == null )
- {
- fillDefaultClasspathContainers( packaging );
- }
- else
- {
- verifyClasspathContainerListIsComplete();
- }
- locator.addSearchPath( FileResourceLoader.ID, project.getFile().getParentFile().getAbsolutePath() );
- locator.setOutputDirectory( new File( project.getBuild().getDirectory() ) );
-
- // ready to start
- return ready;
- }
-
- protected void convertBuildCommandList( List commands )
- {
- if ( commands != null )
- {
- for ( ListIterator i = commands.listIterator(); i.hasNext(); )
- {
- Object command = i.next();
-
- if ( command instanceof String )
- {
- command = new BuildCommand( (String) command );
- i.set( command );
- }
- }
- }
- }
-
- private void parseConfigurationOptions()
- {
- if ( "R7".equalsIgnoreCase( wtpversion ) ) //$NON-NLS-1$
- {
- wtpVersionFloat = 0.7f;
- }
- else if ( "1.0".equalsIgnoreCase( wtpversion ) ) //$NON-NLS-1$
- {
- wtpVersionFloat = 1.0f;
- }
- else if ( "1.5".equalsIgnoreCase( wtpversion ) ) //$NON-NLS-1$
- {
- wtpVersionFloat = 1.5f;
- }
- else if ( "2.0".equalsIgnoreCase( wtpversion ) ) //$NON-NLS-1$
- {
- wtpVersionFloat = 2.0f;
- }
- if ( !"none".equalsIgnoreCase( wtpversion ) )
- {
- getLog().info( Messages.getString( "EclipsePlugin.wtpversion", wtpversion ) );
- }
- }
-
- protected void setupExtras()
- throws MojoExecutionException
- {
- // extension point.
- }
-
- protected void verifyClasspathContainerListIsComplete()
- {
- boolean containsJREContainer = false;
- // Check if classpathContainer contains a JRE (default, alternate or
- // Execution Environment)
- for ( Iterator iter = classpathContainers.iterator(); iter.hasNext(); )
- {
- Object classPathContainer = iter.next();
- if ( classPathContainer != null &&
- classPathContainer.toString().startsWith( COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER ) )
- {
- containsJREContainer = true;
- break;
- }
- }
- if ( !containsJREContainer )
- {
- getLog().warn( Messages.getString( "EclipsePlugin.missingjrecontainer" ) ); //$NON-NLS-1$
- classpathContainers.add( 0, COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER );
- }
- }
-
- private boolean validate()
- throws MojoExecutionException
- {
- // validate sanity of the current m2 project
- if ( Arrays.binarySearch( WTP_SUPPORTED_VERSIONS, wtpversion ) < 0 )
- {
- throw new MojoExecutionException(
- Messages.getString( "EclipsePlugin.unsupportedwtp", new Object[] { //$NON-NLS-1$
- wtpversion,
- StringUtils.join( WTP_SUPPORTED_VERSIONS, " " ) } ) ); //$NON-NLS-1$
- }
-
- assertNotEmpty( executedProject.getGroupId(), POM_ELT_GROUP_ID );
- assertNotEmpty( executedProject.getArtifactId(), POM_ELT_ARTIFACT_ID );
-
- if ( executedProject.getFile() == null || !executedProject.getFile().exists() )
- {
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.missingpom" ) ); //$NON-NLS-1$
- }
-
- if ( "pom".equals( packaging ) && eclipseProjectDir == null ) //$NON-NLS-1$
- {
- getLog().info( Messages.getString( "EclipsePlugin.pompackaging" ) ); //$NON-NLS-1$
- return false;
- }
-
- if ( "eclipse-plugin".equals( packaging ) )
- {
- pde = true;
- }
-
- // [rfeng] Set PDE to false if the project is not a bundle
- if(!isOSGiBundle()) {
- pde = false;
- }
-
- if ( eclipseProjectDir == null )
- {
- eclipseProjectDir = executedProject.getFile().getParentFile();
- }
-
- if ( !eclipseProjectDir.exists() && !eclipseProjectDir.mkdirs() )
- {
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.cantcreatedir", eclipseProjectDir ) ); //$NON-NLS-1$
- }
-
- if ( !eclipseProjectDir.equals( executedProject.getFile().getParentFile() ) )
- {
- if ( !eclipseProjectDir.isDirectory() )
- {
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.notadir", eclipseProjectDir ) ); //$NON-NLS-1$
- }
- eclipseProjectDir = new File( eclipseProjectDir, executedProject.getArtifactId() );
- if ( !eclipseProjectDir.isDirectory() && !eclipseProjectDir.mkdirs() )
- {
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.cantcreatedir", eclipseProjectDir ) ); //$NON-NLS-1$
- }
- }
-
- validateExtras();
-
- return true;
- }
-
- protected void validateExtras()
- {
- // provided for extension.
- }
-
- private void checkDeprecations()
- {
- if ( eclipseDownloadSources )
- {
- // deprecated warning
- getLog().warn( Messages.getString( "EclipsePlugin.deprecatedpar", new Object[] { //$NON-NLS-1$
- "eclipse.downloadSources", //$NON-NLS-1$
- "downloadSources" } ) ); //$NON-NLS-1$
- downloadSources = true;
- }
-
- checkExtraDeprecations();
- }
-
- protected void checkExtraDeprecations()
- {
- // provided for extension.
- }
-
- public void writeConfiguration( IdeDependency[] deps )
- throws MojoExecutionException
- {
- EclipseWriterConfig config = createEclipseWriterConfig( deps );
-
- if ( wtpmanifest && isJavaProject() )
- {
- EclipseManifestWriter.addManifestResource( getLog(), config );
- }
- // NOTE: This could change the config!
- writeExtraConfiguration( config );
-
- if ( wtpVersionFloat == 0.7f )
- {
- new EclipseWtpmodulesWriter().init( getLog(), config ).write();
- }
-
- if ( wtpVersionFloat >= 1.0f )
- {
- new EclipseWtpFacetsWriter().init( getLog(), config ).write();
- }
- if ( wtpVersionFloat == 1.0f )
- {
- new EclipseWtpComponentWriter().init( getLog(), config ).write();
- }
- if ( wtpVersionFloat >= 1.5 )
- {
- new EclipseWtpComponent15Writer().init( getLog(), config ).write();
- }
-
- new EclipseSettingsWriter().init( getLog(), config ).write();
-
- if ( isJavaProject )
- {
- new EclipseClasspathWriter().init( getLog(), config ).write();
- }
-
- if ( wtpapplicationxml )
- {
- new EclipseWtpApplicationXMLWriter().init( getLog(), config ).write();
- }
-
- // [rfeng]
- /*
- if ( pde )
- {
- this.getLog().info( "The Maven Eclipse plugin runs in 'pde'-mode." );
- new EclipseOSGiManifestWriter().init( getLog(), config ).write();
- }
- */
- // [rfeng]
-
- // NOTE: This one MUST be after EclipseClasspathwriter, and possibly others,
- // since currently EclipseClasspathWriter does some magic to detect nested
- // output folders and modifies the configuration by adding new (Ant) builders.
- // So the .project file must be written AFTER those have run!
- new EclipseProjectWriter().init( getLog(), config ).write();
-
- writeAdditionalConfig();
-
- getLog().info( Messages.getString( "EclipsePlugin.wrote", new Object[] { //$NON-NLS-1$
- config.getEclipseProjectName(), eclipseProjectDir.getAbsolutePath() } ) );
- }
-
- protected void writeAdditionalConfig()
- throws MojoExecutionException
- {
- if ( additionalConfig != null )
- {
- for ( int j = 0; j < additionalConfig.length; j++ )
- {
- EclipseConfigFile file = additionalConfig[j];
- File projectRelativeFile = new File( eclipseProjectDir, file.getName() );
- if ( projectRelativeFile.isDirectory() )
- {
- // just ignore?
- getLog().warn( Messages.getString( "EclipsePlugin.foundadir", //$NON-NLS-1$
- projectRelativeFile.getAbsolutePath() ) );
- }
-
- try
- {
- projectRelativeFile.getParentFile().mkdirs();
- if ( file.getContent() == null )
- {
- InputStream inStream;
- if ( file.getLocation() != null )
- {
- inStream = locator.getResourceAsInputStream( file.getLocation() );
- }
- else
- {
- inStream = file.getURL().openConnection().getInputStream();
- }
- OutputStream outStream = new FileOutputStream( projectRelativeFile );
- try
- {
- IOUtil.copy( inStream, outStream );
- }
- finally
- {
- inStream.close();
- outStream.close();
- }
- }
- else
- {
- FileUtils.fileWrite( projectRelativeFile.getAbsolutePath(), file.getContent() );
- }
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.cantwritetofile", //$NON-NLS-1$
- projectRelativeFile.getAbsolutePath() ) );
- }
- catch ( ResourceNotFoundException e )
- {
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.cantfindresource", //$NON-NLS-1$
- file.getLocation() ) );
- }
-
- }
- }
- }
-
- protected EclipseWriterConfig createEclipseWriterConfig( IdeDependency[] deps )
- throws MojoExecutionException
- {
- File projectBaseDir = executedProject.getFile().getParentFile();
-
- // build a list of UNIQUE source dirs (both src and resources) to be
- // used in classpath and wtpmodules
- EclipseSourceDir[] sourceDirs = buildDirectoryList( executedProject, eclipseProjectDir, buildOutputDirectory );
-
- EclipseWriterConfig config = new EclipseWriterConfig();
-
- config.setWorkspaceConfiguration( getWorkspaceConfiguration() );
-
- config.setProjectNameTemplate( calculateProjectNameTemplate() );
-
- String projectName = IdeUtils.getProjectName( config.getProjectNameTemplate(), project );
-
- config.setEclipseProjectName( projectName );
-
- config.setWtpapplicationxml( wtpapplicationxml );
-
- config.setWtpVersion( wtpVersionFloat );
-
- Set convertedBuildCommands = new LinkedHashSet();
-
- if ( buildcommands != null )
- {
- for ( Iterator it = buildcommands.iterator(); it.hasNext(); )
- {
- Object cmd = it.next();
-
- if ( cmd instanceof BuildCommand )
- {
- convertedBuildCommands.add( cmd );
- }
- else
- {
- convertedBuildCommands.add( new BuildCommand( (String) cmd ) );
- }
- }
- }
-
- config.setBuildCommands( new LinkedList( convertedBuildCommands ) );
-
- config.setBuildOutputDirectory( buildOutputDirectory );
- config.setClasspathContainers( classpathContainers );
- config.setDeps( deps );
- config.setEclipseProjectDirectory( eclipseProjectDir );
- config.setLocalRepository( localRepository );
- config.setOSGIManifestFile( manifest );
- config.setPde( pde );
- config.setProject( project );
- config.setProjectBaseDir( projectBaseDir );
- config.setProjectnatures( projectnatures );
- config.setProjectFacets( additionalProjectFacets );
- config.setSourceDirs( sourceDirs );
- config.setAddVersionToProjectName( isAddVersionToProjectName() );
- config.setPackaging( packaging );
-
- collectWarContextRootsFromReactorEarConfiguration( config );
-
- return config;
- }
-
- /**
- * If this is a war module peek into the reactor an search for an ear module that defines the context root of this
- * module.
- *
- * @param config config to save the context root.
- */
- private void collectWarContextRootsFromReactorEarConfiguration( EclipseWriterConfig config )
- {
- if ( reactorProjects != null && wtpContextName == null &&
- Constants.PROJECT_PACKAGING_WAR.equals( project.getPackaging() ) )
- {
- for ( Iterator iter = reactorProjects.iterator(); iter.hasNext(); )
- {
- MavenProject reactorProject = (MavenProject) iter.next();
-
- if ( Constants.PROJECT_PACKAGING_EAR.equals( reactorProject.getPackaging() ) )
- {
- Xpp3Dom[] warDefinitions =
- IdeUtils.getPluginConfigurationDom( reactorProject, JeeUtils.ARTIFACT_MAVEN_EAR_PLUGIN,
- new String[] { "modules", "webModule" } );
- for ( int index = 0; index < warDefinitions.length; index++ )
- {
- Xpp3Dom groupId = warDefinitions[index].getChild( "groupId" );
- Xpp3Dom artifactId = warDefinitions[index].getChild( "artifactId" );
- Xpp3Dom contextRoot = warDefinitions[index].getChild( "contextRoot" );
- if ( groupId != null && artifactId != null && contextRoot != null &&
- groupId.getValue() != null && artifactId.getValue() != null &&
- contextRoot.getValue() != null )
- {
- getLog().info(
- "Found context root definition for " + groupId.getValue() + ":" +
- artifactId.getValue() + " " + contextRoot.getValue() );
- if ( project.getArtifactId().equals( artifactId.getValue() ) &&
- project.getGroupId().equals( groupId.getValue() ) )
- {
- config.setContextName( contextRoot.getValue() );
- }
- }
- else
- {
- getLog().info(
- "Found incomplete ear configuration in " + reactorProject.getGroupId() +
- ":" + reactorProject.getGroupId() + " found " +
- warDefinitions[index].toString() );
- }
- }
- }
- }
- }
- if ( config.getContextName() == null && Constants.PROJECT_PACKAGING_WAR.equals( project.getPackaging() ) )
- {
- if ( wtpContextName == null )
- {
- config.setContextName( project.getArtifactId() );
- }
- else
- {
- config.setContextName( wtpContextName );
- }
- }
- }
-
- /**
- * Write any extra configuration information for the Eclipse project. This is an extension point, called before the
- * main configurations are written. <br/> <b> NOTE: This could change the config! </b>
- *
- * @param config
- * @throws MojoExecutionException
- */
- protected void writeExtraConfiguration( EclipseWriterConfig config )
- throws MojoExecutionException
- {
- // extension point.
- }
-
- private void assertNotEmpty( String string, String elementName )
- throws MojoExecutionException
- {
- if ( string == null )
- {
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.missingelement", elementName ) ); //$NON-NLS-1$
- }
- }
-
- protected void fillDefaultNatures( String packaging )
- {
- projectnatures = new ArrayList();
-
- if ( wtpVersionFloat >= 1.0f )
- {
- projectnatures.add( NATURE_WST_FACET_CORE_NATURE ); // WTP 1.0 nature
- }
-
- if ( isJavaProject )
- {
- projectnatures.add( NATURE_JDT_CORE_JAVA );
- }
-
- if ( wtpVersionFloat >= 0.7f )
- {
- projectnatures.add( NATURE_WST_MODULE_CORE_NATURE ); // WTP 0.7/1.0 nature
-
- if ( isJavaProject )
- {
- projectnatures.add( NATURE_JEM_WORKBENCH_JAVA_EMF ); // WTP 0.7/1.0 nature
- }
- }
-
- if ( pde )
- {
- projectnatures.add( NATURE_PDE_PLUGIN );
- }
-
- }
-
- protected void fillDefaultClasspathContainers( String packaging )
- {
- classpathContainers = new ArrayList();
-
- if ( getWorkspaceConfiguration().getDefaultClasspathContainer() != null )
- {
- getLog().info(
- "Adding default classpath contaigner: " +
- getWorkspaceConfiguration().getDefaultClasspathContainer() );
- classpathContainers.add( getWorkspaceConfiguration().getDefaultClasspathContainer() );
- }
- if ( pde )
- {
- classpathContainers.add( REQUIRED_PLUGINS_CONTAINER );
- }
- }
-
- protected void fillDefaultBuilders( String packaging )
- {
- buildcommands = new ArrayList();
-
- if ( wtpVersionFloat == 0.7f )
- {
- buildcommands.add( new BuildCommand( BUILDER_WST_COMPONENT_STRUCTURAL ) ); // WTP 0.7 builder
- }
-
- if ( isJavaProject )
- {
- buildcommands.add( new BuildCommand( BUILDER_JDT_CORE_JAVA ) );
- }
-
- if ( wtpVersionFloat >= 1.5f )
- {
- buildcommands.add( new BuildCommand( BUILDER_WST_FACET ) ); // WTP 1.5 builder
- }
-
- if ( wtpVersionFloat >= 0.7f )
- {
- buildcommands.add( new BuildCommand( BUILDER_WST_VALIDATION ) ); // WTP 0.7/1.0 builder
- }
-
- if ( wtpVersionFloat == 0.7f )
- {
- // WTP 0.7 builder
- buildcommands.add( new BuildCommand( BUILDER_WST_COMPONENT_STRUCTURAL_DEPENDENCY_RESOLVER ) );
- }
-
- if ( pde )
- {
- buildcommands.add( new BuildCommand( BUILDER_PDE_MANIFEST ) );
- buildcommands.add( new BuildCommand( BUILDER_PDE_SCHEMA ) );
- }
- }
-
- public EclipseSourceDir[] buildDirectoryList( MavenProject project, File basedir, File buildOutputDirectory )
- throws MojoExecutionException
- {
- File projectBaseDir = project.getFile().getParentFile();
-
- // avoid duplicated entries
- Set directories = new TreeSet();
-
- extractSourceDirs( directories, project.getCompileSourceRoots(), basedir, projectBaseDir, false, null );
-
- String relativeOutput = IdeUtils.toRelativeAndFixSeparator( projectBaseDir, buildOutputDirectory, false );
-
- extractResourceDirs( directories, project.getBuild().getResources(), project, basedir, projectBaseDir, false,
- relativeOutput );
-
- // If using the standard output location, don't mix the test output into it.
- String testOutput = null;
- boolean useStandardOutputDir =
- buildOutputDirectory.equals( new File( project.getBuild().getOutputDirectory() ) );
- if ( useStandardOutputDir )
- {
- getLog().debug(
- "testOutput toRelativeAndFixSeparator " + projectBaseDir + " , " +
- project.getBuild().getTestOutputDirectory() );
- testOutput =
- IdeUtils.toRelativeAndFixSeparator( projectBaseDir,
- new File( project.getBuild().getTestOutputDirectory() ), false );
- getLog().debug( "testOutput after toRelative : " + testOutput );
- }
-
- extractSourceDirs( directories, project.getTestCompileSourceRoots(), basedir, projectBaseDir, true, testOutput );
-
- extractResourceDirs( directories, project.getBuild().getTestResources(), project, basedir, projectBaseDir,
- true, testOutput );
-
- return (EclipseSourceDir[]) directories.toArray( new EclipseSourceDir[directories.size()] );
- }
-
- private void extractSourceDirs( Set directories, List sourceRoots, File basedir, File projectBaseDir, boolean test,
- String output )
- throws MojoExecutionException
- {
- for ( Iterator it = sourceRoots.iterator(); it.hasNext(); )
- {
-
- File sourceRootFile = new File( (String) it.next() );
- getLog().debug( "Processing source dir: " + sourceRootFile );
-
- if ( sourceRootFile.isDirectory() )
- {
- String sourceRoot =
- IdeUtils.toRelativeAndFixSeparator( projectBaseDir, sourceRootFile,
- !projectBaseDir.equals( basedir ) );
-
- directories.add( new EclipseSourceDir( sourceRoot, output, false, test, null, null, false ) );
- }
- }
- }
-
- void extractResourceDirs( Set directories, List resources, MavenProject project, File basedir,
- File workspaceProjectBaseDir, boolean test, final String output )
- throws MojoExecutionException
- {
- for ( Iterator it = resources.iterator(); it.hasNext(); )
- {
- Resource resource = (Resource) it.next();
-
- getLog().debug( "Processing resource dir: " + resource.getDirectory() );
-
- String includePattern = null;
- String excludePattern = null;
-
- if ( resource.getIncludes().size() != 0 )
- {
- includePattern = StringUtils.join( resource.getIncludes().iterator(), "|" );
- }
-
- if ( resource.getExcludes().size() != 0 )
- {
- excludePattern = StringUtils.join( resource.getExcludes().iterator(), "|" );
- }
-
- // TODO: figure out how to merge if the same dir is specified twice
- // with different in/exclude patterns.
-
- File resourceDirectory = new File( /* basedir, */resource.getDirectory() );
-
- if ( !resourceDirectory.exists() || !resourceDirectory.isDirectory() )
- {
- getLog().debug( "Resource dir: " + resourceDirectory + " either missing or not a directory." );
- continue;
- }
-
- String resourceDir =
- IdeUtils.toRelativeAndFixSeparator( workspaceProjectBaseDir, resourceDirectory,
- !workspaceProjectBaseDir.equals( basedir ) );
- String thisOutput = output;
- if ( thisOutput != null )
- {
- // sometimes thisOutput is already an absolute path
- File outputFile = new File( thisOutput );
- if ( !outputFile.isAbsolute() )
- {
- outputFile = new File( workspaceProjectBaseDir, thisOutput );
- }
- // create output dir if it doesn't exist
- outputFile.mkdirs();
-
- if ( !StringUtils.isEmpty( resource.getTargetPath() ) )
- {
- outputFile = new File( outputFile, resource.getTargetPath() );
- // create output dir if it doesn't exist
- outputFile.mkdirs();
- }
-
- getLog().debug(
- "Making relative and fixing separator: { " + workspaceProjectBaseDir + ", " +
- outputFile + ", false }." );
- thisOutput = IdeUtils.toRelativeAndFixSeparator( workspaceProjectBaseDir, outputFile, false );
- }
-
- getLog().debug(
- "Adding eclipse source dir: { " + resourceDir + ", " + thisOutput + ", true, " + test +
- ", " + includePattern + ", " + excludePattern + " }." );
-
- directories.add( new EclipseSourceDir( resourceDir, thisOutput, true, test, includePattern, excludePattern,
- resource.isFiltering() ) );
- }
- }
-
- /**
- * Calculate the project name template from the fields {@link #projectNameTemplate},
- * {@link #addVersionToProjectName} and {@link #addGroupIdToProjectName}
- *
- * @return the project name template that should be used after considering the plugin configuration
- */
- private String calculateProjectNameTemplate()
- {
- if ( getProjectNameTemplate() != null )
- {
- if ( isAddVersionToProjectName() || isAddGroupIdToProjectName() )
- {
- getLog().warn(
- "projectNameTemplate definition overrides "
- + "addVersionToProjectName or addGroupIdToProjectName" );
- }
- return getProjectNameTemplate();
- }
- else if ( isAddVersionToProjectName() && isAddGroupIdToProjectName() )
- {
- return IdeUtils.PROJECT_NAME_WITH_GROUP_AND_VERSION_TEMPLATE;
- }
- else if ( isAddVersionToProjectName() )
- {
- return IdeUtils.PROJECT_NAME_WITH_VERSION_TEMPLATE;
- }
- else if ( isAddGroupIdToProjectName() )
- {
- return IdeUtils.PROJECT_NAME_WITH_GROUP_TEMPLATE;
- }
- return IdeUtils.PROJECT_NAME_DEFAULT_TEMPLATE;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getProjectNameForArifact( Artifact artifact )
- {
- IdeDependency[] workspaceArtefacts = getWorkspaceArtefacts();
- for ( int index = 0; workspaceArtefacts != null && index < workspaceArtefacts.length; index++ )
- {
- IdeDependency workspaceArtefact = workspaceArtefacts[index];
- if ( workspaceArtefact.isAddedToClasspath() &&
- workspaceArtefact.getGroupId().equals( artifact.getGroupId() ) &&
- workspaceArtefact.getArtifactId().equals( artifact.getArtifactId() ) )
- {
- if ( workspaceArtefact.getVersion().equals( artifact.getVersion() ) )
- {
- return workspaceArtefact.getEclipseProjectName();
- }
- }
- }
- return IdeUtils.getProjectName( calculateProjectNameTemplate(), artifact );
- }
-
- /**
- * {@inheritDoc}
- */
- protected IdeDependency[] getWorkspaceArtefacts()
- {
- return getWorkspaceConfiguration().getWorkspaceArtefacts();
- }
-
- public WorkspaceConfiguration getWorkspaceConfiguration()
- {
- if ( workspaceConfiguration == null )
- {
- workspaceConfiguration = new WorkspaceConfiguration();
- if ( workspace != null )
- {
- workspaceConfiguration.setWorkspaceDirectory( new File( workspace ) );
- }
- new ReadWorkspaceLocations().init( getLog(), workspaceConfiguration, project, wtpdefaultserver );
- }
- return workspaceConfiguration;
- }
-
- public List getExcludes()
- {
- return excludes;
- }
-
- /**
- * Utility method that locates a project in the workspace for the given artifact.
- *
- * @param artifact the artifact a project should produce.
- * @return <code>true</code> if the artifact is produced by a reactor projectart.
- */
- private boolean isAvailableAsAWorkspaceProject( Artifact artifact )
- {
- IdeDependency[] workspaceArtefacts = getWorkspaceArtefacts();
- for ( int index = 0; workspaceArtefacts != null && index < workspaceArtefacts.length; index++ )
- {
- IdeDependency workspaceArtefact = workspaceArtefacts[index];
- if ( workspaceArtefact.getGroupId().equals( artifact.getGroupId() ) &&
- workspaceArtefact.getArtifactId().equals( artifact.getArtifactId() ) )
- {
- if ( workspaceArtefact.getVersion().equals( artifact.getVersion() ) )
- {
- workspaceArtefact.setAddedToClasspath( true );
- getLog().debug( "Using workspace project: " + workspaceArtefact.getEclipseProjectName() );
- return true;
- }
- else
- {
- getLog().info(
- "Artifact " +
- artifact.getId() +
- " already available as a workspace project, but with different version. Expected: " +
- artifact.getVersion() + ", found: " + workspaceArtefact.getVersion() );
- }
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.maven.plugin.ide.AbstractIdeSupportMojo#doDependencyResolution()
- */
- protected IdeDependency[] doDependencyResolution()
- throws MojoExecutionException
- {
-
- return super.doDependencyResolution();
- }
-
- /**
- * Checks if jar has to be resolved for the given artifact
- *
- * @param art the artifact to check
- * @return true if resolution should happen
- */
- protected boolean hasToResolveJar( Artifact art )
- {
- return !( getUseProjectReferences() && isAvailableAsAReactorProject( art ) ) ||
- ( limitProjectReferencesToWorkspace && !( getUseProjectReferences() && isAvailableAsAWorkspaceProject( art ) ) );
- }
-
- /**
- * Checks if a projects reference has to be used for the given artifact
- *
- * @param art the artifact to check
- * @return true if a project reference has to be used.
- */
- protected boolean useProjectReference( Artifact art )
- {
- boolean isReactorProject = getUseProjectReferences() && isAvailableAsAReactorProject( art );
- boolean isWorkspaceProject = getUseProjectReferences() && isAvailableAsAWorkspaceProject( art );
- return ( isReactorProject && !limitProjectReferencesToWorkspace ) || // default
- ( limitProjectReferencesToWorkspace && isWorkspaceProject ) || // limitProjectReferencesToWorkspace
- ( !isReactorProject && isWorkspaceProject ); // default + workspace projects
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseProjectWriter.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseProjectWriter.java
deleted file mode 100644
index 070b9b3e8b..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseProjectWriter.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.maven.plugin.eclipse;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.maven.model.Resource;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.eclipse.BuildCommand;
-import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter;
-import org.apache.maven.plugin.ide.IdeDependency;
-import org.apache.maven.plugin.ide.IdeUtils;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
-import org.codehaus.plexus.util.xml.XMLWriter;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-/**
- * Writes eclipse .project file.
- *
- * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @author <a href="mailto:kenney@neonics.com">Kenney Westerhof</a>
- * @author <a href="mailto:fgiust@apache.org">Fabrizio Giustina</a>
- * @version $Id: EclipseProjectWriter.java 616816 2008-01-30 17:23:08Z aheritier $
- */
-public class EclipseProjectWriter
- extends AbstractEclipseWriter
-{
- private static final String ELT_NAME = "name"; //$NON-NLS-1$
-
- private static final String ELT_BUILD_COMMAND = "buildCommand"; //$NON-NLS-1$
-
- private static final String ELT_BUILD_SPEC = "buildSpec"; //$NON-NLS-1$
-
- private static final String ELT_NATURE = "nature"; //$NON-NLS-1$
-
- private static final String ELT_NATURES = "natures"; //$NON-NLS-1$
-
- private static final String FILE_DOT_PROJECT = ".project"; //$NON-NLS-1$
-
- /**
- * Constant for links to files.
- */
- private static final int LINK_TYPE_FILE = 1;
-
- /**
- * Constant for links to directories.
- */
- private static final int LINK_TYPE_DIRECTORY = 2;
-
- /**
- * @see org.apache.tuscany.sca.maven.plugin.eclipse.writers.EclipseWriter#write()
- */
- public void write()
- throws MojoExecutionException
- {
-
- Set projectnatures = new LinkedHashSet();
- Set buildCommands = new LinkedHashSet();
-
- File dotProject = new File( config.getEclipseProjectDirectory(), FILE_DOT_PROJECT );
-
- if ( dotProject.exists() )
- {
-
- log.info( Messages.getString( "EclipsePlugin.keepexisting", dotProject.getAbsolutePath() ) ); //$NON-NLS-1$
-
- // parse existing file in order to keep manually-added entries
- Reader reader = null;
- try
- {
- reader = new InputStreamReader( new FileInputStream( dotProject ), "UTF-8" );
- Xpp3Dom dom = Xpp3DomBuilder.build( reader );
-
- Xpp3Dom naturesElement = dom.getChild( ELT_NATURES );
- if ( naturesElement != null )
- {
- Xpp3Dom[] existingNatures = naturesElement.getChildren( ELT_NATURE );
- for ( int j = 0; j < existingNatures.length; j++ )
- {
- // adds all the existing natures
- projectnatures.add( existingNatures[j].getValue() );
- }
- }
-
- Xpp3Dom buildSpec = dom.getChild( ELT_BUILD_SPEC );
- if ( buildSpec != null )
- {
- Xpp3Dom[] existingBuildCommands = buildSpec.getChildren( ELT_BUILD_COMMAND );
- for ( int j = 0; j < existingBuildCommands.length; j++ )
- {
- Xpp3Dom buildCommandName = existingBuildCommands[j].getChild( ELT_NAME );
- if ( buildCommandName != null )
- {
- buildCommands.add( new BuildCommand( existingBuildCommands[j] ) );
- }
- }
- }
- }
- catch ( XmlPullParserException e )
- {
- log.warn( Messages.getString( "EclipsePlugin.cantparseexisting", dotProject.getAbsolutePath() ) ); //$NON-NLS-1$
- }
- catch ( IOException e )
- {
- log.warn( Messages.getString( "EclipsePlugin.cantparseexisting", dotProject.getAbsolutePath() ) ); //$NON-NLS-1$
- }
- finally
- {
- IOUtil.close( reader );
- }
- }
-
- // adds new entries after the existing ones
- for ( Iterator iter = config.getProjectnatures().iterator(); iter.hasNext(); )
- {
- projectnatures.add( iter.next() );
- }
-
- for ( Iterator iter = config.getBuildCommands().iterator(); iter.hasNext(); )
- {
- buildCommands.add( (BuildCommand) iter.next() );
- }
-
- Writer w;
-
- try
- {
- w = new OutputStreamWriter( new FileOutputStream( dotProject ), "UTF-8" );
- }
- catch ( IOException ex )
- {
- throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$
- }
-
- XMLWriter writer = new PrettyPrintXMLWriter( w );
-
- writer.startElement( "projectDescription" ); //$NON-NLS-1$
-
- writer.startElement( ELT_NAME );
- writer.writeText( config.getEclipseProjectName() );
- writer.endElement();
-
- // TODO: this entire element might be dropped if the comment is null.
- // but as the maven1 eclipse plugin does it, it's better to be safe than sorry
- // A eclipse developer might want to look at this.
- writer.startElement( "comment" ); //$NON-NLS-1$
-
- if ( config.getProject().getDescription() != null )
- {
- writer.writeText( config.getProject().getDescription() );
- }
-
- writer.endElement();
-
- writer.startElement( "projects" ); //$NON-NLS-1$
-
- // referenced projects should not be added for plugins
- if ( !config.isPde() )
- {
- for ( int j = 0; j < config.getDepsOrdered().length; j++ )
- {
- IdeDependency dep = config.getDepsOrdered()[j];
- if ( dep.isReferencedProject() )
- {
- writer.startElement( "project" ); //$NON-NLS-1$
- writer.writeText( dep.getEclipseProjectName() );
- writer.endElement();
- }
- }
- }
-
- writer.endElement(); // projects
-
- writer.startElement( ELT_BUILD_SPEC );
-
- for ( Iterator it = buildCommands.iterator(); it.hasNext(); )
- {
- ( (BuildCommand) it.next() ).print( writer );
- }
-
- writer.endElement(); // buildSpec
-
- writer.startElement( ELT_NATURES );
-
- for ( Iterator it = projectnatures.iterator(); it.hasNext(); )
- {
- writer.startElement( ELT_NATURE );
- writer.writeText( (String) it.next() );
- writer.endElement(); // name
- }
-
- writer.endElement(); // natures
-
- /*
- boolean addLinks = !config.getProjectBaseDir().equals( config.getEclipseProjectDirectory() );
-
- if ( addLinks || ( config.isPde() && config.getDepsOrdered().length > 0 ) )
- {
- writer.startElement( "linkedResources" ); //$NON-NLS-1$
-
- if ( addLinks )
- {
-
- addFileLink( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
- config.getProject().getFile() );
-
- addSourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
- config.getProject().getCompileSourceRoots() );
- addResourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
- config.getProject().getBuild().getResources() );
-
- addSourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
- config.getProject().getTestCompileSourceRoots() );
- addResourceLinks( writer, config.getProjectBaseDir(), config.getEclipseProjectDirectory(),
- config.getProject().getBuild().getTestResources() );
-
- }
-
- if ( config.isPde() )
- {
- for ( int j = 0; j < config.getDepsOrdered().length; j++ )
- {
- IdeDependency dep = config.getDepsOrdered()[j];
-
- if ( dep.isAddedToClasspath() && !dep.isProvided() && !dep.isReferencedProject() &&
- !dep.isTestDependency() && !dep.isOsgiBundle() )
- {
- String name = dep.getFile().getName();
- addLink( writer, name, StringUtils.replace( IdeUtils.getCanonicalPath( dep.getFile() ), "\\",
- "/" ), LINK_TYPE_FILE );
- }
- }
- }
-
- writer.endElement(); // linkedResources
- }
- */
-
- writer.endElement(); // projectDescription
-
- IOUtil.close( w );
- }
-
- private void addFileLink( XMLWriter writer, File projectBaseDir, File basedir, File file )
- throws MojoExecutionException
- {
- if ( file.isFile() )
- {
- String name = IdeUtils.toRelativeAndFixSeparator( projectBaseDir, file, true );
- String location = IdeUtils.getCanonicalPath( file ).replaceAll( "\\\\", "/" ); //$NON-NLS-1$ //$NON-NLS-2$
-
- addLink( writer, name, location, LINK_TYPE_FILE );
- }
- else
- {
- log.warn( Messages.getString( "EclipseProjectWriter.notafile", file ) ); //$NON-NLS-1$
- }
- }
-
- private void addSourceLinks( XMLWriter writer, File projectBaseDir, File basedir, List sourceRoots )
- throws MojoExecutionException
- {
- for ( Iterator it = sourceRoots.iterator(); it.hasNext(); )
- {
- String sourceRootString = (String) it.next();
- File sourceRoot = new File( sourceRootString );
-
- if ( sourceRoot.isDirectory() )
- {
- String name = IdeUtils.toRelativeAndFixSeparator( projectBaseDir, sourceRoot, true );
- String location = IdeUtils.getCanonicalPath( sourceRoot ).replaceAll( "\\\\", "/" ); //$NON-NLS-1$ //$NON-NLS-2$
-
- addLink( writer, name, location, LINK_TYPE_DIRECTORY );
- }
- }
- }
-
- private void addResourceLinks( XMLWriter writer, File projectBaseDir, File basedir, List sourceRoots )
- throws MojoExecutionException
- {
- for ( Iterator it = sourceRoots.iterator(); it.hasNext(); )
- {
- String resourceDirString = ( (Resource) it.next() ).getDirectory();
- File resourceDir = new File( resourceDirString );
-
- if ( resourceDir.isDirectory() )
- {
- String name = IdeUtils.toRelativeAndFixSeparator( projectBaseDir, resourceDir, true );
- String location = IdeUtils.getCanonicalPath( resourceDir ).replaceAll( "\\\\", "/" ); //$NON-NLS-1$ //$NON-NLS-2$
-
- addLink( writer, name, location, LINK_TYPE_DIRECTORY );
- }
- }
- }
-
- /**
- * @param writer
- * @param name
- * @param location
- */
- private void addLink( XMLWriter writer, String name, String location, int type )
- {
- writer.startElement( "link" ); //$NON-NLS-1$
-
- writer.startElement( ELT_NAME );
- writer.writeText( name );
- writer.endElement(); // name
-
- writer.startElement( "type" ); //$NON-NLS-1$
- writer.writeText( Integer.toString( type ) );
- writer.endElement(); // type
-
- writer.startElement( "location" ); //$NON-NLS-1$
-
- writer.writeText( location );
-
- writer.endElement(); // location
-
- writer.endElement(); // link
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/Messages.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/Messages.java
deleted file mode 100644
index 553cae6256..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/Messages.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.maven.plugin.eclipse;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author <a href="mailto:fgiust@users.sourceforge.net">Fabrizio Giustina</a>
- * @version $Id: Messages.java 485864 2006-12-11 20:41:36Z fgiust $
- */
-public class Messages
-{
-
- private static final String BUNDLE_NAME = "org.apache.tuscany.sca.maven.plugin.eclipse.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
-
- private Messages()
- {
- }
-
- public static String getString( String key )
- {
- try
- {
- return RESOURCE_BUNDLE.getString( key );
- }
- catch ( MissingResourceException e )
- {
- return '!' + key + '!';
- }
- }
-
- public static String getString( String key, Object[] params )
- {
- try
- {
- return MessageFormat.format( RESOURCE_BUNDLE.getString( key ), params );
- }
- catch ( MissingResourceException e )
- {
- return '!' + key + '!';
- }
- }
-
- public static String getString( String key, Object param )
- {
- return getString( key, new Object[] { param } );
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ArtifactAggregation.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ArtifactAggregation.java
deleted file mode 100644
index 062c935ad9..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ArtifactAggregation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.tools.bundle.plugin;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.maven.artifact.Artifact;
-
-
-public class ArtifactAggregation {
- private String symbolicName;
- private String version;
- private List<ArtifactMember> artifactMemebers = new ArrayList<ArtifactMember>();
- private transient List<Artifact> artifacts = new ArrayList<Artifact>();
-
- public List<Artifact> getArtifacts() {
- return artifacts;
- }
-
- public String getSymbolicName() {
- return symbolicName;
- }
-
- public void setSymbolicName(String symbolicName) {
- this.symbolicName = symbolicName;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public List<ArtifactMember> getArtifactMembers() {
- return artifactMemebers;
- }
-
- public void setArtifactMembers(List<ArtifactMember> artifacts) {
- this.artifactMemebers = artifacts;
- }
-
- public String toString() {
- return symbolicName + ";version=\"" + version + "\"\n" + artifactMemebers;
- }
-
- public boolean matches(Artifact artifact) {
- for(ArtifactMember m: artifactMemebers) {
- if(m.matches(artifact)) {
- return true;
- }
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ArtifactMember.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ArtifactMember.java
deleted file mode 100644
index 19315aa19f..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ArtifactMember.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.tools.bundle.plugin;
-
-import org.apache.maven.artifact.Artifact;
-
-public class ArtifactMember {
- private String groupId;
- private String artifactId;
- private String version;
-
- public String getGroupId() {
- return groupId;
- }
-
- public void setGroupId(String groupId) {
- this.groupId = groupId;
- }
-
- public String getArtifactId() {
- return artifactId;
- }
-
- public void setArtifactId(String artifactId) {
- this.artifactId = artifactId;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public String toString() {
- return groupId + ":" + artifactId + ":" + version;
- }
-
- public boolean matches(Artifact artifact) {
- return groupId.equals(artifact.getGroupId()) && (artifactId == null || artifactId.equals("")
- || artifactId.equals("*") || artifactId.equals(artifact.getArtifactId()))
- && (version == null || version.equals("") || version.equals("*") || version.equals(artifact.getVersion()));
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java
deleted file mode 100644
index 6c97a34676..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.tools.bundle.plugin;
-
-import static org.osgi.framework.Constants.BUNDLE_CLASSPATH;
-import static org.osgi.framework.Constants.BUNDLE_MANIFESTVERSION;
-import static org.osgi.framework.Constants.BUNDLE_NAME;
-import static org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME;
-import static org.osgi.framework.Constants.BUNDLE_VERSION;
-import static org.osgi.framework.Constants.DYNAMICIMPORT_PACKAGE;
-import static org.osgi.framework.Constants.EXPORT_PACKAGE;
-import static org.osgi.framework.Constants.IMPORT_PACKAGE;
-
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-import java.util.logging.Logger;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.apache.maven.artifact.versioning.ArtifactVersion;
-import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-import org.osgi.framework.Version;
-
-/**
- * Common functions used by the plugin.
- *
- * @version $Rev$ $Date$
- */
-final class BundleUtil {
- private final static Logger logger = Logger.getLogger(BundleUtil.class.getName());
- /**
- * Returns the name of a bundle, or null if the given file is not a bundle.
- *
- * @param file
- * @return
- * @throws IOException
- */
- static String getBundleSymbolicName(File file) throws IOException {
- if (!file.exists()) {
- return null;
- }
- String bundleName = null;
- if (file.isDirectory()) {
- File mf = new File(file, "META-INF/MANIFEST.MF");
- if (mf.isFile()) {
- Manifest manifest = new Manifest(new FileInputStream(mf));
- bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- }
- } else {
- JarFile jar = new JarFile(file, false);
- Manifest manifest = jar.getManifest();
- bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- jar.close();
- }
- if (bundleName == null) {
- return bundleName;
- }
- int sc = bundleName.indexOf(';');
- if (sc != -1) {
- bundleName = bundleName.substring(0, sc);
- }
- return bundleName;
- }
-
- /**
- * Generate a Bundle manifest for a set of JAR files.
- *
- * @param jarFiles
- * @param name
- * @param symbolicName
- * @param version
- * @param dir
- * @return
- * @throws IllegalStateException
- */
- static Manifest libraryManifest(Set<File> jarFiles, String name, String symbolicName, String version, String dir)
- throws IllegalStateException {
- try {
-
- // List exported packages and bundle classpath entries
- StringBuffer classpath = new StringBuffer();
- Set<String> exportedPackages = new HashSet<String>();
- for (File jarFile : jarFiles) {
- addPackages(jarFile, exportedPackages, version);
- if (dir != null) {
- classpath.append(dir).append("/");
- }
- classpath.append(jarFile.getName());
- classpath.append(",");
- }
-
- // Generate export-package and import-package declarations
- StringBuffer exports = new StringBuffer();
- StringBuffer imports = new StringBuffer();
- Set<String> pkgs = new HashSet<String>();
- for (String export : exportedPackages) {
- String packageName = packageName(export);
- if (!pkgs.contains(packageName)) {
- // Add corresponding import declaration
-// imports.append(export);
-// imports.append(',');
- pkgs.add(packageName);
- exports.append(export);
- exports.append(',');
- } else {
- logger.warning("Duplicate package skipped: " + export);
- }
- }
-
- // Create a manifest
- Manifest manifest = new Manifest();
- Attributes attributes = manifest.getMainAttributes();
- attributes.putValue("Manifest-Version", "1.0");
- attributes.putValue(BUNDLE_MANIFESTVERSION, "2");
- attributes.putValue(BUNDLE_SYMBOLICNAME, symbolicName);
- attributes.putValue(BUNDLE_NAME, name);
- attributes.putValue(BUNDLE_VERSION, version);
- attributes.putValue(DYNAMICIMPORT_PACKAGE, "*");
- if (exports.length() > 1) {
- attributes.putValue(EXPORT_PACKAGE, exports.substring(0, exports.length() - 1));
- }
- if (imports.length() > 1) {
- attributes.putValue(IMPORT_PACKAGE, imports.substring(0, imports.length() - 1));
- }
- if (classpath.length() > 1) {
- attributes.putValue(BUNDLE_CLASSPATH, classpath.substring(0, classpath.length() - 1));
- }
-
- return manifest;
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- }
-
- /**
- * Write a bundle manifest.
- *
- * @param manifest
- * @param out
- * @throws IOException
- */
- static void write(Manifest manifest, OutputStream out) throws IOException {
- DataOutputStream dos = new DataOutputStream(out);
- Attributes attributes = manifest.getMainAttributes();
- write(attributes, "Manifest-Version", dos);
- write(attributes, BUNDLE_MANIFESTVERSION, dos);
- write(attributes, BUNDLE_SYMBOLICNAME, dos);
- write(attributes, BUNDLE_NAME, dos);
- write(attributes, BUNDLE_VERSION, dos);
- write(attributes, DYNAMICIMPORT_PACKAGE, dos);
- write(attributes, BUNDLE_CLASSPATH, dos);
- write(attributes, IMPORT_PACKAGE, dos);
- write(attributes, EXPORT_PACKAGE, dos);
- dos.flush();
- }
-
- /**
- * Add packages to be exported out of a JAR file.
- *
- * @param jarFile
- * @param packages
- * @throws IOException
- */
- private static void addPackages(File jarFile, Set<String> packages, String version) throws IOException {
- if (getBundleSymbolicName(jarFile) == null) {
- String ver = ";version=" + version;
- addAllPackages(jarFile, packages, ver);
- } else {
- addExportedPackages(jarFile, packages);
- }
- }
-
- /**
- * Write manifest attributes.
- *
- * @param attributes
- * @param key
- * @param dos
- * @throws IOException
- */
- private static void write(Attributes attributes, String key, DataOutputStream dos) throws IOException {
- String value = attributes.getValue(key);
- if (value == null) {
- return;
- }
- StringBuffer line = new StringBuffer();
- line.append(key);
- line.append(": ");
- line.append(new String(value.getBytes("UTF8")));
- line.append("\r\n");
- int l = line.length();
- if (l > 72) {
- for (int i = 70; i < l - 2;) {
- line.insert(i, "\r\n ");
- i += 72;
- l += 3;
- }
- }
- dos.writeBytes(line.toString());
- }
-
- /**
- * Strip an OSGi export, only retain the package name and version.
- *
- * @param export
- * @return
- */
- private static String stripExport(String export) {
- int sc = export.indexOf(';');
- if (sc == -1) {
- return export;
- }
- String base = export.substring(0, sc);
- int v = export.indexOf("version=");
- if (v != -1) {
- sc = export.indexOf(';', v + 1);
- if (sc != -1) {
- return base + ";" + export.substring(v, sc);
- } else {
- return base + ";" + export.substring(v);
- }
- } else {
- return base;
- }
- }
-
- /**
- * Add all the packages out of a JAR.
- *
- * @param jarFile
- * @param packages
- * @param version
- * @throws IOException
- */
- private static void addAllPackages(File jarFile, Set<String> packages, String version) throws IOException {
- ZipInputStream is = new ZipInputStream(new FileInputStream(jarFile));
- ZipEntry entry;
- while ((entry = is.getNextEntry()) != null) {
- String entryName = entry.getName();
- if (!entry.isDirectory() && entryName != null
- && entryName.length() > 0
- && !entryName.startsWith(".")
- && entryName.endsWith(".class") // Exclude resources from Export-Package
- && entryName.lastIndexOf("/") > 0
- && Character.isJavaIdentifierStart(entryName.charAt(0))) {
- String pkg = entryName.substring(0, entryName.lastIndexOf("/")).replace('/', '.');
- if (!pkg.endsWith(".enum")) {
- packages.add(pkg + version);
- }
- }
- }
- is.close();
- }
-
- /**
- * Returns the name of the exported package in the given export.
- * @param export
- * @return
- */
- private static String packageName(String export) {
- int sc = export.indexOf(';');
- if (sc != -1) {
- export = export.substring(0, sc);
- }
- return export;
- }
-
- /**
- * Add the packages exported by a bundle.
- *
- * @param file
- * @param packages
- * @return
- * @throws IOException
- */
- private static void addExportedPackages(File file, Set<String> packages) throws IOException {
- if (!file.exists()) {
- return;
- }
-
- // Read the export-package declaration and get a list of the packages available in a JAR
- Set<String> existingPackages = null;
- String exports = null;
- if (file.isDirectory()) {
- File mf = new File(file, "META-INF/MANIFEST.MF");
- if (mf.isFile()) {
- Manifest manifest = new Manifest(new FileInputStream(mf));
- exports = manifest.getMainAttributes().getValue(EXPORT_PACKAGE);
- }
- } else {
- JarFile jar = new JarFile(file, false);
- Manifest manifest = jar.getManifest();
- exports = manifest.getMainAttributes().getValue(EXPORT_PACKAGE);
- jar.close();
- existingPackages = new HashSet<String>();
- addAllPackages(file, existingPackages, "");
- }
- if (exports == null) {
- return;
- }
-
- // Parse the export-package declaration, and extract the individual packages
- StringBuffer buffer = new StringBuffer();
- boolean q = false;
- for (int i = 0, n = exports.length(); i < n; i++) {
- char c = exports.charAt(i);
- if (c == '\"') {
- q = !q;
- }
- if (!q) {
- if (c == ',') {
-
- // Add the exported package to the set, after making sure it really exists in
- // the JAR
- String export = buffer.toString();
- if (existingPackages == null || existingPackages.contains(packageName(export))) {
- packages.add(stripExport(export));
- }
- buffer = new StringBuffer();
- continue;
- }
- }
- buffer.append(c);
- }
- if (buffer.length() != 0) {
-
- // Add the exported package to the set, after making sure it really exists in
- // the JAR
- String export = buffer.toString();
- if (existingPackages == null || existingPackages.contains(packageName(export))) {
- packages.add(stripExport(export));
- }
- }
- }
-
- /**
- * Convert the maven version into OSGi version
- * @param mavenVersion
- * @return
- */
- static String osgiVersion(String mavenVersion) {
- ArtifactVersion ver = new DefaultArtifactVersion(mavenVersion);
- String qualifer = ver.getQualifier();
- if (qualifer != null) {
- StringBuffer buf = new StringBuffer(qualifer);
- for (int i = 0; i < buf.length(); i++) {
- char c = buf.charAt(i);
- if (Character.isLetterOrDigit(c) || c == '-' || c == '_') {
- // Keep as-is
- } else {
- buf.setCharAt(i, '_');
- }
- }
- qualifer = buf.toString();
- }
- Version osgiVersion =
- new Version(ver.getMajorVersion(), ver.getMinorVersion(), ver.getIncrementalVersion(), qualifer);
- String version = osgiVersion.toString();
- return version;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ModuleBundlesBuildMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ModuleBundlesBuildMojo.java
deleted file mode 100644
index bd6368aaa0..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ModuleBundlesBuildMojo.java
+++ /dev/null
@@ -1,828 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.tools.bundle.plugin;
-
-import static org.apache.tuscany.sca.tools.bundle.plugin.BundleUtil.write;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.ArtifactUtils;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
-import org.apache.maven.project.ProjectBuildingException;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
-
-/**
- * A maven plugin that generates a modules directory containing OSGi bundles for all the project's module dependencies.
- *
- * @version $Rev$ $Date$
- * @goal generate-modules
- * @phase generate-resources
- * @requiresDependencyResolution test
- * @description Generate a modules directory containing OSGi bundles for all the project's module dependencies.
- */
-public class ModuleBundlesBuildMojo extends AbstractMojo {
-
- /**
- * The project to create a distribution for.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- private MavenProject project;
-
- /**
- * Project builder -- builds a model from a pom.xml
- *
- * @component role="org.apache.maven.project.MavenProjectBuilder"
- * @required
- * @readonly
- */
- private MavenProjectBuilder mavenProjectBuilder;
- /**
- * Used to look up Artifacts in the remote repository.
- *
- * @component
- */
- private org.apache.maven.artifact.factory.ArtifactFactory factory;
-
- /**
- * Used to look up Artifacts in the remote repository.
- *
- * @component
- */
- private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
-
- /**
- * @component role="org.apache.maven.artifact.metadata.ArtifactMetadataSource"
- * hint="maven"
- * @required
- * @readonly
- */
- private ArtifactMetadataSource artifactMetadataSource;
-
- /**
- * Location of the local repository.
- *
- * @parameter expression="${localRepository}"
- * @readonly
- * @required
- */
- private org.apache.maven.artifact.repository.ArtifactRepository local;
-
- /**
- * List of Remote Repositories used by the resolver
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- * @readonly
- * @required
- */
- private java.util.List remoteRepos;
-
- /**
- * Target directory.
- *
- * @parameter expression="${project.build.directory}/modules"
- */
- private File targetDirectory;
-
- /**
- * @parameter default-value="features"
- */
- private String featuresName = "features";
-
- /**
- * Directories containing artifacts to exclude.
- *
- * @parameter
- */
- private File[] excludeDirectories;
-
- /**
- * Directories containing groupids to exclude.
- *
- * @parameter
- */
- private String[] excludeGroupIds;
-
- /**
- * Directories containing groupids to include.
- *
- * @parameter
- */
- private String[] includeGroupIds;
-
- /**
- * Set to true to generate configurations under a folder named as the distro
- *
- * @parameter default-value="true"
- */
- private boolean useDistributionName = true;
-
- /**
- * Set to true to generate a PDE target platform configuration.
- *
- * @parameter default-value="true"
- */
- private boolean generateTargetPlatform = true;
-
- /**
- * OSGi execution environment
- */
- private String executionEnvironment;
-
- /**
- * A list of Eclipse features to be added to the target definition
- * @parameter
- */
- private String[] eclipseFeatures;
-
- /**
- * If we use the running eclipse as the default location for the target
- * @parameter default-value="true"
- */
- private boolean useDefaultLocation = true;
-
- /**
- * Set to true to generate a plugin.xml.
- *
- * @parameter default-value="false"
- */
- private boolean generatePlugin;
-
- /**
- * Generate a configuration/config.ini for equinox
- * @parameter default-value="true"
- */
- private boolean generateConfig = true;
-
- /**
- * @parameter default-value="true"
- */
- private boolean generateBundleStart = true;
-
- /**
- * Generete manifest.jar
- * @parameter default-value="true"
- */
- private boolean generateManifestJar = true;
-
- /**
- * @parameter default-value="tuscany-sca-manifest.jar"
- */
- private String manifestJarName = "tuscany-sca-manifest.jar";
-
- /**
- * @parameter default-value="tuscany-sca-equinox-manifest.jar"
- */
- private String equinoxManifestJarName = "tuscany-sca-equinox-manifest.jar";
-
-
- /**
- * @parameter default-value="true"
- */
- private boolean generateAntScript = true;
-
- /**
- * @parameter
- */
- private ArtifactAggregation[] artifactAggregations;
-
- private static final String XML_PI = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
- private static final String ASL_HEADER =
- "<!--"
- + "\n * Licensed to the Apache Software Foundation (ASF) under one"
- + "\n * or more contributor license agreements. See the NOTICE file"
- + "\n * distributed with this work for additional information"
- + "\n * regarding copyright ownership. The ASF licenses this file"
- + "\n * to you under the Apache License, Version 2.0 (the"
- + "\n * \"License\"); you may not use this file except in compliance"
- + "\n * with the License. You may obtain a copy of the License at"
- + "\n * "
- + "\n * http://www.apache.org/licenses/LICENSE-2.0"
- + "\n * "
- + "\n * Unless required by applicable law or agreed to in writing,"
- + "\n * software distributed under the License is distributed on an"
- + "\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY"
- + "\n * KIND, either express or implied. See the License for the"
- + "\n * specific language governing permissions and limitations"
- + "\n * under the License."
- + "\n-->";
-
- /**
- * Group the artifacts by distribution poms
- */
- private class ProjectSet {
- // Distribution projects
- private Map<String, MavenProject> projects;
- // Key: the pom artifact id
- // Value: the names for the artifacts
- private Map<String, Set<String>> nameMap = new HashMap<String, Set<String>>();
-
- private Map<String, String> artifactToNameMap = new HashMap<String, String>();
-
- public ProjectSet(List<MavenProject> projects) {
- super();
- this.projects = new HashMap<String, MavenProject>();
- for (MavenProject p : projects) {
- this.projects.put(p.getArtifactId(), p);
- }
- }
-
- private MavenProject getProject(String artifactId) {
- return projects.get(artifactId);
- }
-
- private void add(Artifact artifact, String name) {
- String key = ArtifactUtils.versionlessKey(artifact);
- for (MavenProject p : projects.values()) {
- Artifact a = (Artifact)p.getArtifactMap().get(key);
- if (a != null) {
- Set<String> names = nameMap.get(p.getArtifactId());
- if (names == null) {
- names = new HashSet<String>();
- nameMap.put(p.getArtifactId(), names);
- }
- names.add(name);
- }
- }
- artifactToNameMap.put(key, name);
- }
- }
-
- public void execute() throws MojoExecutionException {
- Log log = getLog();
-
- try {
-
- // Create the target directory
- File root;
- if (targetDirectory == null) {
- root = new File(project.getBuild().getDirectory(), "plugins/");
- } else {
- root = targetDirectory;
- }
- root.mkdirs();
-
- // Build sets of exclude directories and included/excluded/groupids
- Set<String> excludedFileNames = new HashSet<String>();
- if (excludeDirectories != null) {
- for (File f : excludeDirectories) {
- if (f.isDirectory()) {
- for (String n : f.list()) {
- excludedFileNames.add(n);
- }
- }
- }
- }
- Set<String> includedGroupIds = new HashSet<String>();
- if (includeGroupIds != null) {
- for (String g : includeGroupIds) {
- includedGroupIds.add(g);
- }
- }
- Set<String> excludedGroupIds = new HashSet<String>();
- if (excludeGroupIds != null) {
- for (String g : excludeGroupIds) {
- excludedGroupIds.add(g);
- }
- }
-
- // Find all the distribution poms
- List<MavenProject> poms = new ArrayList<MavenProject>();
- poms.add(project);
- if (useDistributionName) {
- for (Object o : project.getArtifacts()) {
- Artifact artifact = (Artifact)o;
- if ("pom".equals(artifact.getType()) && artifact.getGroupId().equals(project.getGroupId())
- && artifact.getArtifactId().startsWith("tuscany-feature-")) {
- log.info("Dependent distribution: " + artifact);
- MavenProject pomProject = buildProject(artifact);
- poms.add(pomProject);
- // log.info(pomProject.getArtifactMap().toString());
- }
- }
- }
-
- // Process all the dependency artifacts
- ProjectSet bundleSymbolicNames = new ProjectSet(poms);
- ProjectSet bundleLocations = new ProjectSet(poms);
- ProjectSet jarNames = new ProjectSet(poms);
- for (Object o : project.getArtifacts()) {
- Artifact artifact = (Artifact)o;
-
- // Only consider Compile and Runtime dependencies
- if (!(Artifact.SCOPE_COMPILE.equals(artifact.getScope()) || Artifact.SCOPE_RUNTIME.equals(artifact
- .getScope())
- || Artifact.SCOPE_PROVIDED.equals(artifact.getScope()) || (generateTargetPlatform && Artifact.SCOPE_TEST
- .equals(artifact.getScope())))) {
- log.info("Skipping artifact: " + artifact);
- continue;
- }
-
- // Only consider JAR and WAR files
- if (!"jar".equals(artifact.getType()) && !"war".equals(artifact.getType())) {
- continue;
- }
-
- // Exclude artifact if its groupId is excluded or if it's not included
- if (excludedGroupIds.contains(artifact.getGroupId())) {
- log.debug("Artifact groupId is excluded: " + artifact);
- continue;
- }
- if (!includedGroupIds.isEmpty()) {
- if (!includedGroupIds.contains(artifact.getGroupId())) {
- log.debug("Artifact groupId is not included: " + artifact);
- continue;
- }
- }
-
- File artifactFile = artifact.getFile();
- if (!artifactFile.exists()) {
- log.warn("Artifact doesn't exist: " + artifact);
- continue;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Processing artifact: " + artifact);
- }
-
- // Get the bundle name if the artifact is an OSGi bundle
- String bundleName = null;
- try {
- bundleName = BundleUtil.getBundleSymbolicName(artifact.getFile());
- } catch (IOException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
-
- if (bundleName != null) {
-
- // Exclude artifact if its file name is excluded
- if (excludedFileNames.contains(artifactFile.getName())) {
- log.debug("Artifact file is excluded: " + artifact);
- continue;
- }
-
- // Copy an OSGi bundle as is
- log.info("Adding OSGi bundle artifact: " + artifact);
- copyFile(artifactFile, root);
- bundleSymbolicNames.add(artifact, bundleName);
- bundleLocations.add(artifact, artifactFile.getName());
- jarNames.add(artifact, artifactFile.getName());
-
- } else if ("war".equals(artifact.getType())) {
-
- // Exclude artifact if its file name is excluded
- if (excludedFileNames.contains(artifactFile.getName())) {
- log.debug("Artifact file is excluded: " + artifact);
- continue;
- }
-
- // Copy a WAR as is
- log.info("Adding WAR artifact: " + artifact);
- copyFile(artifactFile, root);
-
- } else {
-
- // String version = BundleUtil.osgiVersion(artifact.getVersion());
- // String symbolicName = (artifact.getGroupId() + "." + artifact.getArtifactId());
- // String dirName = symbolicName + "_" + version;
-
- String dirName = artifactFile.getName().substring(0, artifactFile.getName().length() - 4);
- File dir = new File(root, dirName);
-
- // Exclude artifact if its file name is excluded
- if (excludedFileNames.contains(dir.getName())) {
- log.debug("Artifact file is excluded: " + artifact);
- continue;
- }
-
- if (artifactAggregations != null) {
- boolean aggregated = false;
- for (ArtifactAggregation group : artifactAggregations) {
- if (group.matches(artifact)) {
- group.getArtifacts().add(artifact);
- aggregated = true;
- break;
- }
- }
- if (aggregated) {
- continue;
- }
- }
-
- // Create a bundle directory for a non-OSGi JAR
- log.info("Adding JAR artifact: " + artifact);
- String version = BundleUtil.osgiVersion(artifact.getVersion());
-
- Set<File> jarFiles = new HashSet<File>();
- jarFiles.add(artifactFile);
- String symbolicName = (artifact.getGroupId() + "." + artifact.getArtifactId());
- Manifest mf = BundleUtil.libraryManifest(jarFiles, symbolicName, symbolicName, version, null);
- File file = new File(dir, "META-INF");
- file.mkdirs();
- file = new File(file, "MANIFEST.MF");
-
- FileOutputStream fos = new FileOutputStream(file);
- write(mf, fos);
- fos.close();
- copyFile(artifactFile, dir);
- bundleSymbolicNames.add(artifact, symbolicName);
- bundleLocations.add(artifact, dir.getName());
- jarNames.add(artifact, dirName + "/" + artifactFile.getName());
- }
- }
-
- if (artifactAggregations != null) {
- for (ArtifactAggregation group : artifactAggregations) {
- if (group.getArtifacts().isEmpty()) {
- continue;
- }
- String symbolicName = group.getSymbolicName();
- String version = group.getVersion();
- File dir = new File(root, symbolicName + "-" + version);
- dir.mkdir();
- Set<File> jarFiles = new HashSet<File>();
- Artifact artifact = null;
- for (Artifact a : group.getArtifacts()) {
- log.info("Aggragating JAR artifact: " + a);
- artifact = a;
- jarFiles.add(a.getFile());
- copyFile(a.getFile(), dir);
- jarNames.add(a, symbolicName + "-" + version + "/" + a.getFile().getName());
- }
- Manifest mf = BundleUtil.libraryManifest(jarFiles, symbolicName, symbolicName, version, null);
- File file = new File(dir, "META-INF");
- file.mkdirs();
- file = new File(file, "MANIFEST.MF");
-
- FileOutputStream fos = new FileOutputStream(file);
- write(mf, fos);
- fos.close();
- bundleSymbolicNames.add(artifact, symbolicName);
- bundleLocations.add(artifact, dir.getName());
- }
- }
-
- // Generate a PDE target
- if (generateTargetPlatform) {
- generatePDETarget(bundleSymbolicNames, root, log);
- }
-
- // Generate a plugin.xml referencing the PDE target
- if (generatePlugin) {
- File pluginxml = new File(project.getBasedir(), "plugin.xml");
- FileOutputStream pluginXMLFile = new FileOutputStream(pluginxml);
- writePluginXML(new PrintStream(pluginXMLFile));
- pluginXMLFile.close();
- }
-
- if (generateConfig) {
- generateEquinoxConfig(bundleLocations, root, log);
- }
-
- if (generateManifestJar) {
- generateManifestJar(jarNames, root, log);
- generateEquinoxLauncherManifestJar(jarNames, root, log);
- }
-
- if (generateAntScript) {
- generateANTPath(jarNames, root, log);
- }
-
- } catch (Exception e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
-
- }
-
- private void generateANTPath(ProjectSet jarNames, File root, Log log) throws FileNotFoundException, IOException {
- for (Map.Entry<String, Set<String>> e : jarNames.nameMap.entrySet()) {
- Set<String> jars = e.getValue();
- File feature = new File(root, "../" + featuresName + "/" + (useDistributionName ? trim(e.getKey()) : ""));
- feature.mkdirs();
- File antPath = new File(feature, "build-path.xml");
- log.info("Generating ANT build path: " + antPath.getCanonicalPath());
- FileOutputStream fos = new FileOutputStream(antPath);
- PrintStream ps = new PrintStream(fos);
- // ps.println(XML_PI);
- ps.println(ASL_HEADER);
- String name = trim(e.getKey());
- ps.println("<project name=\"tuscany."+name+"\">");
- ps.println(" <property name=\"tuscany.distro\" value=\"" + name + "\"/>");
- ps.println(" <property name=\"tuscany.manifest\" value=\"" + new File(feature, manifestJarName).getCanonicalPath()
- + "\"/>");
- ps.println(" <path id=\"" + "tuscany.path" + "\">");
- ps.println(" <fileset dir=\"" + root.getCanonicalPath() + "\">");
- for (String jar : jars) {
- ps.println(" <include name=\"" + jar + "\"/>");
- }
- ps.println(" </fileset>");
- ps.println(" </path>");
- ps.println("</project>");
- }
- }
-
- private void generateManifestJar(ProjectSet jarNames, File root, Log log) throws FileNotFoundException, IOException {
- for (Map.Entry<String, Set<String>> e : jarNames.nameMap.entrySet()) {
- MavenProject pom = jarNames.getProject(e.getKey());
- Set<String> jars = e.getValue();
- File feature = new File(root, "../" + featuresName + "/" + (useDistributionName ? trim(e.getKey()) : ""));
- feature.mkdirs();
- File mfJar = new File(feature, manifestJarName);
- log.info("Generating manifest jar: " + mfJar.getCanonicalPath());
- FileOutputStream fos = new FileOutputStream(mfJar);
- Manifest mf = new Manifest();
- StringBuffer cp = new StringBuffer();
- String path = (useDistributionName ? "../../" : "../") + root.getName();
- for (String jar : jars) {
- cp.append(path).append('/').append(jar).append(' ');
- }
- if (cp.length() > 0) {
- cp.deleteCharAt(cp.length() - 1);
- }
- Attributes attrs = mf.getMainAttributes();
- attrs.putValue("Manifest-Version", "1.0");
- attrs.putValue("Implementation-Title", pom.getName());
- attrs.putValue("Implementation-Vendor", "The Apache Software Foundation");
- attrs.putValue("Implementation-Vendor-Id", "org.apache");
- attrs.putValue("Implementation-Version", pom.getVersion());
- attrs.putValue("Class-Path", cp.toString());
- attrs.putValue("Main-Class", "org.apache.tuscany.sca.node.launcher.NodeMain");
- JarOutputStream jos = new JarOutputStream(fos, mf);
- addFileToJar(jos, "META-INF/LICENSE", getClass().getResource("LICENSE.txt"));
- addFileToJar(jos, "META-INF/NOTICE", getClass().getResource("NOTICE.txt"));
- jos.close();
- }
- }
-
- private void generateEquinoxLauncherManifestJar(ProjectSet jarNames, File root, Log log) throws Exception {
- String equinoxLauncher = "org.apache.tuscany.sca:tuscany-node-launcher-equinox";
- Artifact artifact = (Artifact)project.getArtifactMap().get(equinoxLauncher);
- if (artifact == null) {
- return;
- }
- Set artifacts = resolveTransitively(artifact).getArtifacts();
- File feature = new File(root, "../" + featuresName + "/");
- feature.mkdirs();
- File mfJar = new File(feature, equinoxManifestJarName);
- log.info("Generating equinox manifest jar: " + mfJar.getCanonicalPath());
- FileOutputStream fos = new FileOutputStream(mfJar);
- Manifest mf = new Manifest();
- StringBuffer cp = new StringBuffer();
- String path = "../" + root.getName();
-
- for (Object o : artifacts) {
- Artifact a = (Artifact)o;
- if (!Artifact.SCOPE_TEST.equals(a.getScope())) {
- String id = ArtifactUtils.versionlessKey(a);
- String jar = jarNames.artifactToNameMap.get(id);
- if (jar != null) {
- cp.append(path).append('/').append(jar).append(' ');
- }
- }
- }
- if (cp.length() > 0) {
- cp.deleteCharAt(cp.length() - 1);
- }
- Attributes attrs = mf.getMainAttributes();
- attrs.putValue("Manifest-Version", "1.0");
- attrs.putValue("Implementation-Title", artifact.getId());
- attrs.putValue("Implementation-Vendor", "The Apache Software Foundation");
- attrs.putValue("Implementation-Vendor-Id", "org.apache");
- attrs.putValue("Implementation-Version", artifact.getVersion());
- attrs.putValue("Class-Path", cp.toString());
- attrs.putValue("Main-Class", "org.apache.tuscany.sca.node.equinox.launcher.NodeMain");
- JarOutputStream jos = new JarOutputStream(fos, mf);
- addFileToJar(jos, "META-INF/LICENSE", getClass().getResource("LICENSE.txt"));
- addFileToJar(jos, "META-INF/NOTICE", getClass().getResource("NOTICE.txt"));
- jos.close();
- }
-
- private void generateEquinoxConfig(ProjectSet bundleLocations, File root, Log log) throws IOException {
- for (Map.Entry<String, Set<String>> e : bundleLocations.nameMap.entrySet()) {
- Set<String> locations = e.getValue();
- File feature = new File(root, "../" + featuresName + "/" + (useDistributionName ? trim(e.getKey()) : ""));
- File config = new File(feature, "configuration");
- config.mkdirs();
- File ini = new File(config, "config.ini");
- log.info("Generating configuation: " + ini.getCanonicalPath());
- FileOutputStream fos = new FileOutputStream(ini);
- PrintStream ps = new PrintStream(fos);
- ps.print("osgi.bundles=");
- for (String f : locations) {
- ps.print(f);
- if (generateBundleStart) {
- ps.print("@:start,");
- } else {
- ps.println(",");
- }
- }
- ps.println();
- ps.println("eclipse.ignoreApp=true");
- // Do not shutdown
- ps.println("osgi.noShutdown=true");
- // Start a default console
- ps.println("osgi.console=");
- ps.close();
- }
- }
-
- private void generatePDETarget(ProjectSet bundleSymbolicNames, File root, Log log) throws FileNotFoundException,
- IOException {
- for (Map.Entry<String, Set<String>> e : bundleSymbolicNames.nameMap.entrySet()) {
- Set<String> bundles = e.getValue();
- String name = trim(e.getKey());
- File feature = new File(root, "../" + featuresName + "/" + (useDistributionName ? name : ""));
- feature.mkdirs();
- File target = new File(feature, "tuscany.target");
- log.info("Generating target definition: " + target.getCanonicalPath());
- FileOutputStream targetFile = new FileOutputStream(target);
- if (!bundles.contains("org.eclipse.osgi")) {
- bundles.add("org.eclipse.osgi");
- }
- writeTarget(new PrintStream(targetFile), name, bundles, eclipseFeatures);
- targetFile.close();
- }
- }
-
- private MavenProject buildProject(Artifact artifact) throws ProjectBuildingException,
- InvalidDependencyVersionException, ArtifactResolutionException, ArtifactNotFoundException {
- MavenProject pomProject =
- mavenProjectBuilder.buildFromRepository(artifact, this.remoteRepos, this.local);
- if (pomProject.getDependencyArtifacts() == null) {
- pomProject.setDependencyArtifacts(pomProject
- .createArtifacts(factory,
- null, // Artifact.SCOPE_TEST,
- new ScopeArtifactFilter(Artifact.SCOPE_TEST)));
- }
- ArtifactResolutionResult result =
- resolver.resolveTransitively(pomProject.getDependencyArtifacts(),
- pomProject.getArtifact(),
- remoteRepos,
- local,
- artifactMetadataSource);
- pomProject.setArtifacts(result.getArtifacts());
- return pomProject;
- }
-
- private ArtifactResolutionResult resolveTransitively(Artifact artifact) throws ArtifactResolutionException, ArtifactNotFoundException {
- Artifact originatingArtifact = factory.createBuildArtifact("dummy", "dummy", "1.0", "jar");
-
- return resolver.resolveTransitively(Collections.singleton(artifact),
- originatingArtifact,
- local,
- remoteRepos,
- artifactMetadataSource,
- null);
- }
-
- /**
- * Convert tuscany-feature-xyz to feature-xyz
- * @param artifactId
- * @return
- */
- private String trim(String artifactId) {
- if (artifactId.startsWith("tuscany-feature-")) {
- return artifactId.substring("tuscany-feature-".length());
- } else {
- return artifactId;
- }
- }
-
- private static void copyFile(File jar, File dir) throws FileNotFoundException, IOException {
- byte[] buf = new byte[4096];
- File jarFile = new File(dir, jar.getName());
- FileInputStream in = new FileInputStream(jar);
- FileOutputStream out = new FileOutputStream(jarFile);
- for (;;) {
- int len = in.read(buf);
- if (len > 0) {
- out.write(buf, 0, len);
- } else {
- break;
- }
- }
- in.close();
- out.close();
- }
-
- private static void addFileToJar(JarOutputStream out, String entryName, URL file) throws FileNotFoundException, IOException {
- byte[] buf = new byte[4096];
- InputStream in = file.openStream();
- out.putNextEntry(new ZipEntry(entryName));
- for (;;) {
- int len = in.read(buf);
- if (len > 0) {
- out.write(buf, 0, len);
- } else {
- break;
- }
- }
- in.close();
- out.closeEntry();
- }
-
- private void writeTarget(PrintStream ps, String pom, Set<String> ids, String[] features) {
- ps.println(XML_PI);
- ps.println("<?pde version=\"3.2\"?>");
- ps.println(ASL_HEADER);
-
- ps.println("<target name=\"Eclipse Target - " + pom + "\">");
-
- if (executionEnvironment != null) {
- ps.println(" <targetJRE>");
- ps.println(" <execEnv>" + executionEnvironment + "</execEnv>");
- ps.println(" </targetJRE>");
- }
-
- if (useDefaultLocation) {
- ps.println(" <location useDefault=\"true\"/>");
- } else {
- ps.println(" <location path=\"" + targetDirectory + "\"/>");
- }
-
- // ps.println("<content useAllPlugins=\"true\">");
- ps.println(" <content>");
- ps.println(" <plugins>");
- for (String id : ids) {
- ps.println(" <plugin id=\"" + id + "\"/>");
- }
- ps.println(" </plugins>");
- ps.println(" <features>");
- if (features != null) {
- for (String f : features) {
- ps.println(" <feature id=\"" + f + "\"/>");
- }
- }
- ps.println(" </features>");
- if (useDefaultLocation) {
- ps.println(" <extraLocations>");
- // Not sure why the extra path needs to the plugins folder
- ps.println(" <location path=\"" + targetDirectory + "\"/>");
- ps.println(" </extraLocations>");
- }
- ps.println(" </content>");
-
- ps.println("</target>");
-
- }
-
- private static void writePluginXML(PrintStream ps) {
- ps.println(XML_PI);
- ps.println("<?pde version=\"3.2\"?>");
- ps.println(ASL_HEADER);
- ps.println("<plugin>");
- ps.println("<extension point = \"org.eclipse.pde.core.targets\">");
- ps.println("<target");
- ps.println("id=\"org.apache.tuscany.sca.target\"");
- ps.println("name=\"Apache Tuscany Eclipse Target\"");
- ps.println("path=\"tuscany.target\"/>");
- ps.println("</extension>");
- ps.println("</plugin>");
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
deleted file mode 100644
index e183e7e197..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.tools.bundle.plugin;
-
-import static org.apache.tuscany.sca.tools.bundle.plugin.BundleUtil.write;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.jar.Manifest;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.project.MavenProject;
-
-/**
- * A Maven plugin that builds an OSGi bundle for the project's third-party dependencies.
- *
- * @version $Rev$ $Date$
- * @goal assemble-thirdparty-bundle
- * @phase generate-resources
- * @requiresDependencyResolution test
- * @description Build an OSGi bundle for the project's third party dependencies
- */
-public class ThirdPartyBundleBuildMojo extends AbstractMojo {
-
- /**
- * The project to build the bundle for.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- private MavenProject project;
-
- /**
- * The bundle symbolic name
- *
- * @parameter
- */
- private String symbolicName;
-
- public void execute() throws MojoExecutionException {
- Log log = getLog();
-
- String projectGroupId = project.getGroupId();
- Set<File> jarFiles = new HashSet<File>();
- for (Object o : project.getArtifacts()) {
- Artifact artifact = (Artifact)o;
-
- if (!(Artifact.SCOPE_COMPILE.equals(artifact.getScope()) || Artifact.SCOPE_RUNTIME.equals(artifact
- .getScope()))) {
- if (log.isDebugEnabled()) {
- log.debug("Skipping artifact: " + artifact);
- }
- continue;
- }
- if (!"jar".equals(artifact.getType())) {
- continue;
- }
- if (projectGroupId.equals(artifact.getGroupId())) {
- continue;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Artifact: " + artifact);
- }
- String bundleName = null;
- try {
- bundleName = BundleUtil.getBundleSymbolicName(artifact.getFile());
- } catch (IOException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
- if (bundleName == null || true) {
- if (artifact.getFile().exists()) {
- log.info("Adding third party jar: " + artifact);
- jarFiles.add(artifact.getFile());
- } else {
- log.warn("Third party jar not found: " + artifact);
- }
- }
- }
-
- try {
- String version = BundleUtil.osgiVersion(project.getVersion());
-
- Manifest mf = BundleUtil.libraryManifest(jarFiles, project.getName(), symbolicName, version, "lib");
- File file = new File(project.getBasedir(), "META-INF");
- file.mkdir();
- file = new File(file, "MANIFEST.MF");
- if (log.isDebugEnabled()) {
- log.debug("Generating " + file);
- }
-
- FileOutputStream fos = new FileOutputStream(file);
- write(mf, fos);
- fos.close();
-
- File lib = new File(project.getBasedir(), "lib");
- if (lib.isDirectory()) {
- for (File c : lib.listFiles()) {
- c.delete();
- }
- }
- lib.mkdir();
- byte[] buf = new byte[4096];
- for (File jar : jarFiles) {
- File jarFile = new File(lib, jar.getName());
- if (log.isDebugEnabled()) {
- log.debug("Copying " + jar + " to " + jarFile);
- }
- FileInputStream in = new FileInputStream(jar);
- FileOutputStream out = new FileOutputStream(jarFile);
- for (;;) {
- int len = in.read(buf);
- if (len > 0) {
- out.write(buf, 0, len);
- } else {
- break;
- }
- }
- in.close();
- out.close();
- }
- } catch (Exception e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/maven/plugin/eclipse/messages.properties b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/maven/plugin/eclipse/messages.properties
deleted file mode 100644
index b016c69065..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/maven/plugin/eclipse/messages.properties
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-EclipsePlugin.missingpom=There must be a POM in the current working directory for the Eclipse plugin to work.
-EclipsePlugin.pompackaging=Not running eclipse plugin goal for pom project
-EclipsePlugin.notadir=Not a directory: "{0}"
-EclipsePlugin.cantcreatedir=Can''t create directory "{0}"
-EclipsePlugin.erroropeningfile=Exception while opening file.
-EclipsePlugin.cantwritetofile=Unable to write to file: {0}
-EclipsePlugin.cantfindresource=Unable to resolve resource location: {0}
-EclipsePlugin.cantreadfile=Unable to read file: {0}
-EclipsePlugin.keepexisting=File {0} already exists.\n Additional settings will be preserved, run mvn eclipse:clean if you want old settings to be removed.
-EclipsePlugin.cantparseexisting=Unable to parse existing file: {0}. Settings will not be preserved.
-EclipsePlugin.cantresolvesources=Cannot resolve source artifact. Artifact id: {0} (Message: {1})
-EclipsePlugin.wrote=Wrote Eclipse project for "{0}" to {1}.
-EclipsePlugin.missingelement=Missing element from the project descriptor: "{0}"
-EclipsePlugin.includenotsupported=This plugin currently doesn't support include patterns for resources. Adding the entire directory.
-EclipsePlugin.excludenotsupported=This plugin currently doesn't support exclude patterns for resources. Adding the entire directory.
-EclipsePlugin.artifactpathisnull=The artifact path was null. Artifact id: {0}
-EclipsePlugin.artifactissystemscoped=The artifact has scope ''system''. Artifact id: {0}. System path: {1}
-EclipsePlugin.unsupportedwtp=Unsupported WTP version: {0}. This plugin currently supports only the following versions: {1}.
-EclipsePlugin.wtpversion=Adding support for WTP version {0}.
-EclipsePlugin.missingjrecontainer=You did specify a list of classpath containers without the base org.eclipse.jdt.launching.JRE_CONTAINER.\n If you specify custom classpath containers you should also add org.eclipse.jdt.launching.JRE_CONTAINER to the list
-EclipsePlugin.deprecatedpar=Plugin parameter "{0}" is deprecated, please use "{1}"
-EclipsePlugin.cantcopyartifact=Can''t copy artifact "{0}".
-EclipsePlugin.foundadir={0} is a directory, ignoring.
-
-EclipseSettingsWriter.wrotesettings=Wrote settings to {0}
-EclipseSettingsWriter.cannotcreatesettings=Cannot create settings file
-EclipseSettingsWriter.errorwritingsettings=Error writing settings file
-EclipseSettingsWriter.usingdefaults=Not writing settings - defaults suffice
-
-EclipseClasspathWriter.lookingforsources=Looking for source archive for artifact {0}
-EclipseClasspathWriter.sourcesavailable=Sources attachment for artifact {0} set to {1}
-
-EclipseProjectWriter.notafile=Not adding a file link to {0}; it is not a file
-
-EclipseCleanMojo.failedtodelete=Failed to delete {0} file: {0}
-EclipseCleanMojo.nofilefound=No {0} file found
-EclipseCleanMojo.deletingFile=Deleting file: {0}
-EclipseCleanMojo.deletingDirectory=Deleting directory: {0}
-
-EclipseOSGiManifestWriter.nomanifestfile=The references manifest file doesn''t exist, plugin dependencies will not be updated: {0}
-
-IdeDependency.cantreadfile=Unable to read file: {0}
-
-Rad6LibCopier.cantdeletefile=Failed to delete file: {0}
-
-MyEclipseSpringBeansWriter.springVersionNotFound=Spring must be declared in the project's dependencies to generate .springBeans file.
-
-sourcesnotavailable=\n Sources for some artifacts are not available.\n List of artifacts without a source archive:
-sourcesnotdownloaded=\n Sources for some artifacts are not available.\n Please run the same goal with the -DdownloadSources=true parameter in order to check remote repositories for sources.\n List of artifacts without a source archive:
-sourcesmissingitem=\n o {0}
-javadocnotavailable=\n Javadoc for some artifacts is not available.\n List of artifacts without a javadoc archive:
-javadocnotdownloaded=\n Javadoc for some artifacts is not available.\n Please run the same goal with the -DdownloadJavadocs=true parameter in order to check remote repositories for javadoc.\n List of artifacts without a javadoc archive:
-javadocmissingitem=\n o {0}
-errorresolving=Error resolving {0} artifact. Artifact id: {1} (Message: {2})
-artifactresolution=An error occurred during dependency resolution of the following artifact:\n {0}:{1}:{2}\nCaused by: {3}
-artifactdownload=An error occurred during dependency resolution.\n Failed to retrieve {0}:{1}-{2}\nCaused by: {3}
-cantcanonicalize=Can''t canonicalize system path: {0}
-unabletoparseversion={0}: unable to parse version ''{1}'' for dependency ''{2}'': {3}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/tools/bundle/plugin/LICENSE.txt b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/tools/bundle/plugin/LICENSE.txt
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/tools/bundle/plugin/LICENSE.txt
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/tools/bundle/plugin/NOTICE.txt b/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/tools/bundle/plugin/NOTICE.txt
deleted file mode 100644
index 644a49d98b..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-bundle-plugin/src/main/resources/org/apache/tuscany/sca/tools/bundle/plugin/NOTICE.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/LICENSE b/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/NOTICE b/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/README b/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/README
deleted file mode 100644
index d53760029f..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/README
+++ /dev/null
@@ -1,46 +0,0 @@
-Tuscany SCA Dependency Lister
-=============================
-
-Makes use of the extension Maven dependency support to list out all of the
-dependencis in the module where the plugin is used. The module is
-analysed and a report (dependency.txt) is written into the modules directory including
-each dependency and the path through the maven transitive dependencies that caused
-the original dependency to be included. For example, Here is a line which lists
-a a jar dependency, the phase in which it was found, the module being processed
-and he path that causes the dependency
-
-DEPENDENCY PHASE MODULE PATH TO DEPENDENCY
-jaxb-api-2.1.jar compile Apache Tuscany SCA Atom+RSS Feed Aggregator Sample Webapp tuscany-host-webapp-1.1-incubating-SNAPSHOT tuscany-host-embedded-1.1-incubating-SNAPSHOT tuscany-core-databinding-1.1-incubating-SNAPSHOT tuscany-databinding-jaxb-1.1-incubating-SNAPSHOT jaxb-api-2.1
-
-It is often convenient to further analyse these entries using the spreadsheet of your
-choice so the columns are tab separated to allow for easy conversion.
-
-The plugin can be included in a module using the following,
-
-<plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-dependency-lister</artifactId>
- <version>1.1-incubating-SNAPSHOT</version>
- <executions>
- <execution>
- <goals>
- <goal>execute</goal>
- </goals>
- </execution>
- </executions>
-</plugin>
-
-If you include this at the top level of you project and have it run for each model you
-will get a report for each model independently. For example, in the Tuscany SCA project
-the plugin is included in the pom.xml files at the sca level under the profile
-"dependecies" so to generate a dependencies report for the Tuscany SCA project:
-
-cd sca
-mvn -o -Pdependencies -Dmaven.test.skip=true
-
-Once you have dependency.txt files in your modules
-the you favourite command line tools can be used to concatenate and sort them
-to get a full picture of the dependencies in you project, for example, with linux you
-could do,
-
-find . -name dependency.txt -exec cat '{}' >> deptotal.txt \;
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/pom.xml b/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/pom.xml
deleted file mode 100644
index d5651a59fa..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-maven-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-maven-dependency-lister</artifactId>
- <packaging>maven-plugin</packaging>
- <name>Apache Tuscany SCA Dependency Lister Maven Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0.7</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.0.7</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-settings</artifactId>
- <version>2.0.7</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- <version>2.0.7</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- <version>2.0.7</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-dependency-tree</artifactId>
- <version>1.0</version>
- </dependency>
-
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/src/main/java/org/apache/tuscany/tools/sca/dependency/lister/plugin/DependencyListerMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/src/main/java/org/apache/tuscany/tools/sca/dependency/lister/plugin/DependencyListerMojo.java
deleted file mode 100644
index b904ac4804..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-dependency-lister/src/main/java/org/apache/tuscany/tools/sca/dependency/lister/plugin/DependencyListerMojo.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.sca.dependency.lister.plugin;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactCollector;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
-import org.apache.maven.settings.Settings;
-import org.apache.maven.shared.dependency.tree.DependencyNode;
-import org.apache.maven.shared.dependency.tree.DependencyTree;
-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder;
-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
-
-/**
- * @version $Rev: 588816 $ $Date: 2007-10-27 01:22:38 +0100 (Sat, 27 Oct 2007) $
- * @goal execute
- * @phase generate-sources
- * @requiresDependencyResolution test
- * @description List dependencies for an SCA project
- */
-public class DependencyListerMojo extends AbstractMojo {
- /**
- * The project to create a build for.
- *
- * @parameter expression="${project}"
- * @required
- */
- private MavenProject project;
-
- /**
- * Used for resolving artifacts
- *
- * @component
- */
- private ArtifactResolver artifactResolver;
-
- /**
- * Factory for creating artifact objects
- *
- * @component
- */
- private ArtifactFactory artifactFactory;
-
- /**
- * @component
- */
- private ArtifactMetadataSource artifactMetadataSource;
-
- /**
- * @component
- */
- private DependencyTreeBuilder dependencyTreeBuilder;
-
- /**
- * @component
- */
- private ArtifactCollector collector;
-
- /**
- * @component
- */
- private MavenProjectBuilder mavenProjectBuilder;
-
- /**
- * The local repository where the artifacts are located
- *
- * @parameter expression="${localRepository}"
- * @required
- */
- private ArtifactRepository localRepository;
-
- /**
- * The remote repositories where artifacts are located
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- */
- private List remoteRepositories;
-
- /**
- * The current user system settings for use in Maven.
- *
- * @parameter expression="${settings}"
- * @required
- * @readonly
- */
- private Settings settings;
-
-
- /**
- * The build.xml file to generate.
- * @parameter expression="${basedir}/target/dependency.txt"
- */
- private String buildFile;
-
- public void execute() throws MojoExecutionException {
-
- System.out.println("Analysing " + buildFile);
-
- // Open the target build.xml file
- File targetFile = new File(buildFile);
- PrintWriter pw;
- try {
- pw = new PrintWriter(new FileOutputStream(targetFile));
- } catch (FileNotFoundException e) {
- System.out.println(e.toString());
- return;
- }
-
- DependencyTree dependencyTree;
-
- try
- {
- dependencyTree = dependencyTreeBuilder.buildDependencyTree( project, localRepository, artifactFactory,
- artifactMetadataSource, collector );
- }
- catch ( DependencyTreeBuilderException e )
- {
- throw new MojoExecutionException( "Can't build dependency tree", e );
- }
-
- // processNode(dependencyTree.getRootNode(), "--", pw);
-
- for (Artifact artifact: (List<Artifact>)project.getTestArtifacts()) {
- pw.println( artifact.getFile().getName() + "\t" +
- artifact.getScope() + "\t" +
- project.getName() + "\t" +
- findArtifactPath(dependencyTree.getRootNode(), artifact));
- }
-
- pw.close();
- }
-
- private void processNode(DependencyNode node, String indent, PrintWriter pw){
-
- pw.println(indent + node.getArtifact().getScope() + " " + node.getArtifact().toString());
-
- Iterator it = node.getChildren().iterator();
- while ( it.hasNext() )
- {
- DependencyNode child = (DependencyNode) it.next();
-
- processNode(child, indent + "--", pw);
- }
- }
-
- private String findArtifactPath(DependencyNode node, Artifact artifact){
- String path = null;
-
- Iterator it = node.getChildren().iterator();
- while ( it.hasNext() && (path == null) )
- {
- DependencyNode child = (DependencyNode) it.next();
-
- if (child.getArtifact().getArtifactId().equals(artifact.getArtifactId())) {
- path = child.getArtifact().getArtifactId() + "-" + child.getArtifact().getVersion();
- } else {
- path = findArtifactPath(child, artifact);
-
- if (path != null){
- path = child.getArtifact().getArtifactId() + "-" + child.getArtifact().getVersion() + "\t" + path;
- }
- }
- }
-
- return path;
- }
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/LICENSE b/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/NOTICE b/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/pom.xml b/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/pom.xml
deleted file mode 100644
index e2fae8c108..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/pom.xml
+++ /dev/null
@@ -1,304 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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</groupId>
- <artifactId>apache</artifactId>
- <version>4</version>
- </parent>
-
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-eclipse-compiler</artifactId>
- <packaging>jar</packaging>
- <name>Apache Tuscany SCA Eclipse Compiler Plugin</name>
- <version>2.0-M1</version>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.0.8</version>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-settings</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-api</artifactId>
- <version>1.5.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>core</artifactId>
- <version>3.3.0-v_771</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.core</groupId>
- <artifactId>resources</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.core</groupId>
- <artifactId>runtime</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.core</groupId>
- <artifactId>filesystem</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse</groupId>
- <artifactId>text</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- <version>3.3.0-v20070530</version>
- <scope>compile</scope>
- </dependency>
-
-<!--
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>resources</artifactId>
- <version>3.3.0-v20070604</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.core</groupId>
- <artifactId>expressions</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.core</groupId>
- <artifactId>filesystem</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.core</groupId>
- <artifactId>runtime</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>runtime</artifactId>
- <version>3.3.100-v20070530</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>expressions</artifactId>
- <version>3.3.0-v20070606-0010</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.core</groupId>
- <artifactId>runtime</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>filesystem</artifactId>
- <version>1.1.0-v20070606</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>text</artifactId>
- <version>3.3.0-v20070606-0010</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.core</groupId>
- <artifactId>commands</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>commands</artifactId>
- <version>3.3.0-I20070605-0010</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- <version>1.0.0-v20070606</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- <version>3.3.0-v20070426</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>app</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
--->
- </dependencies>
-
- <build>
- <defaultGoal>install</defaultGoal>
-
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>${notice.dir}</directory>
- <targetPath>META-INF</targetPath>
- <filtering>true</filtering>
- <includes>
- <include>LICENSE</include>
- <include>NOTICE</include>
- </includes>
- </resource>
- </resources>
-
- <pluginManagement>
- <plugins>
-
- <!-- compiler plugin configuration -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
-
- <!-- jar plugin configuration -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.1</version>
- <configuration>
- <archive>
- <manifestEntries>
- <Extension-Name>${project.artifactId}</Extension-Name>
- <Specification-Title>${name}</Specification-Title>
- <Specification-Vendor>The Apache Software Foundation</Specification-Vendor>
- <Specification-Version>${version}</Specification-Version>
- <Implementation-Title>${name}</Implementation-Title>
- <Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id>
- <Implementation-Vendor>The Apache Software Foundation</Implementation-Vendor>
- <Implementation-Version>${version}</Implementation-Version>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
-
- </plugins>
- </pluginManagement>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/ClassLoaderNameEnvironment.java b/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/ClassLoaderNameEnvironment.java
deleted file mode 100644
index 4b3f84edf4..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/ClassLoaderNameEnvironment.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.tools.maven.compiler;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
-import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
-import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
-
-/**
- * An implementation of INameEnvironment based on a ClassLoader.
- *
- * @version $Rev: $ $Date: $
- */
-class ClassLoaderNameEnvironment implements INameEnvironment {
- private final static char fileSeparator = System.getProperty("file.separator").charAt(0);
-
- private ClassLoader classLoader;
- private List<String> sourceLocations;
- private Map<String, File> sourceFiles;
-
- ClassLoaderNameEnvironment(ClassLoader classLoader, List<String> sourceLocations) {
- this.classLoader = classLoader;
- this.sourceLocations = sourceLocations;
- sourceFiles = new HashMap<String, File>();
- }
-
- public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
- StringBuffer className = new StringBuffer();
- for (char[] name: compoundTypeName) {
- if (className.length() != 0) {
- className.append('.');
- }
- className.append(name);
- }
- return nameAnswer(className.toString());
- }
-
- public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) {
- StringBuffer className = new StringBuffer();
- for (char[] name: packageName) {
- if (className.length() != 0) {
- className.append('.');
- }
- className.append(name);
- }
- if (className.length() != 0) {
- className.append('.');
- }
- className.append(typeName);
- return nameAnswer(className.toString());
- }
-
- public boolean isPackage(char[][] parentPackageName, char[] packageName) {
- StringBuffer fullPackageName = new StringBuffer();
- if (parentPackageName != null) {
- for (char[] name: parentPackageName) {
- if (fullPackageName.length() != 0) {
- fullPackageName.append('.');
- }
- fullPackageName.append(name);
- }
- }
- if (fullPackageName.length() != 0) {
- fullPackageName.append('.');
- }
- fullPackageName.append(packageName);
- return isPackage(fullPackageName.toString());
- }
-
- public void cleanup() {
- }
-
- /**
- * Returns the source file for the given class name.
- *
- * @param className
- * @return
- */
- private File sourceFile(String className) {
- File sourceFile = (File)sourceFiles.get(className);
- if (sourceFile != null) {
- return sourceFile;
- }
- String sourceName = className.replace('.', fileSeparator) + ".java";
- sourceFile = sourceFileInSourceLocations(sourceName);
- sourceFiles.put(className, sourceFile);
- return sourceFile;
- }
-
- /**
- * Returns the source file for the given source path relative to the source locations.
- *
- * @param className
- * @return
- */
- private File sourceFileInSourceLocations(String relativePath) {
- for (String sourceLocation : sourceLocations) {
- File sourceFile = new File(sourceLocation, relativePath);
- if (sourceFile.exists()) {
- return sourceFile;
- }
- }
- return null;
- }
-
- /**
- * Returns true if the given name is a package name.
- *
- * @param name
- * @return
- */
- private boolean isPackage(String name) {
- if (sourceFile(name) != null) {
- return false;
- }
- String resourceName = '/' + name.replace('.', '/') + ".class";
- InputStream is = classLoader.getResourceAsStream(resourceName);
- if (is == null) {
- return true;
- } else {
- try {
- is.close();
- } catch (IOException e) {}
- return false;
- }
- }
-
- /**
- * Find the NameAnswer for by the given class name.
- *
- * @param className
- * @return
- */
- private NameEnvironmentAnswer nameAnswer(String className) {
- try {
- File sourceFile = sourceFile(className);
- if (sourceFile != null) {
- ICompilationUnit compilationUnit = new FileCompilationUnit(sourceFile.getAbsolutePath(), className);
- return new NameEnvironmentAnswer(compilationUnit, null);
- }
-
- String resourceName = className.replace('.', '/') + ".class";
- InputStream is = classLoader.getResourceAsStream(resourceName);
- if (is == null) {
- return null;
- }
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- byte[] b = new byte[2048];
- for (;;) {
- int n = is.read(b);
- if (n <= 0) {
- break;
- }
- bos.write(b, 0, n);
- }
- byte[] classBytes = bos.toByteArray();
-
- ClassFileReader classFileReader = new ClassFileReader(classBytes, className.toCharArray(), true);
- return new NameEnvironmentAnswer(classFileReader, null);
-
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- } catch (ClassFormatException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/CompilerRequestor.java b/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/CompilerRequestor.java
deleted file mode 100644
index 3df4b4d602..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/CompilerRequestor.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.tools.maven.compiler;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.List;
-
-import org.codehaus.plexus.compiler.CompilerError;
-import org.eclipse.jdt.core.compiler.IProblem;
-import org.eclipse.jdt.internal.compiler.ClassFile;
-import org.eclipse.jdt.internal.compiler.CompilationResult;
-import org.eclipse.jdt.internal.compiler.ICompilerRequestor;
-
-class CompilerRequestor implements ICompilerRequestor {
- private String outputDirectory;
- private boolean showWarnings;
- private List<CompilerError> compilerErrors;
-
- public CompilerRequestor(String outputDirectory, boolean showWarnings, List<CompilerError> compilerErrors) {
- this.outputDirectory = outputDirectory;
- this.showWarnings = showWarnings;
- this.compilerErrors = compilerErrors;
- }
-
- public void acceptResult(CompilationResult result) {
- boolean hasErrors = false;
- if (result.hasProblems()) {
-
- // Convert JDT IProblems into plexus CompilerErrors
- for (IProblem problem: result.getProblems()) {
- if (problem.isWarning()) {
- if (showWarnings) {
- compilerErrors.add(new CompilerError(new String(problem.getOriginatingFileName()),
- false,
- problem.getSourceLineNumber(),
- problem.getSourceStart(),
- problem.getSourceLineNumber(),
- problem.getSourceEnd(),
- problem.getMessage()));
- }
-
- } else if (problem.isError()) {
- hasErrors = true;
- compilerErrors.add(new CompilerError(new String(problem.getOriginatingFileName()),
- true,
- problem.getSourceLineNumber(),
- problem.getSourceStart(),
- problem.getSourceLineNumber(),
- problem.getSourceEnd(),
- problem.getMessage()));
-
- }
- }
- }
-
- // Write the class files
- if (!hasErrors) {
- ClassFile[] classFiles = result.getClassFiles();
- for (ClassFile classFile: classFiles) {
-
- // Create file and parent directories
- StringBuffer className = new StringBuffer();
- for (char[] name: classFile.getCompoundName()) {
- if (className.length() != 0) {
- className.append('.');
- }
- className.append(name);
- }
- File file = new File(outputDirectory, className.toString().replace('.', '/') + ".class");
- if (!file.getParentFile().exists()) {
- file.getParentFile().mkdirs();
- }
-
- // Write class file contents
- FileOutputStream fos = null;
- try {
- fos = new FileOutputStream(file);
- fos.write(classFile.getBytes());
- } catch (FileNotFoundException e) {
- throw new IllegalArgumentException(e);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- } finally {
- if (fos != null) {
- try {
- fos.close();
- } catch (IOException e) {}
- }
- }
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/FileCompilationUnit.java b/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/FileCompilationUnit.java
deleted file mode 100644
index 08ed7f034e..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/FileCompilationUnit.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.tools.maven.compiler;
-
-import java.io.CharArrayWriter;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.StringTokenizer;
-
-import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
-
-/**
- * An implementation of ICompilationUnit that wraps a File.
- *
- * @version $Rev: $ $Date: $
- */
-class FileCompilationUnit implements ICompilationUnit {
- private final static char fileSeparator = System.getProperty("file.separator").charAt(0);
- private String className;
- private String sourceFile;
-
- FileCompilationUnit(String sourceFile, String className) {
- this.className = className;
- this.sourceFile = sourceFile;
- }
-
- public char[] getContents() {
- try {
- InputStreamReader reader = new InputStreamReader(new FileInputStream(sourceFile));
- CharArrayWriter writer = new CharArrayWriter();
- char[] b = new char[2048];
- for (;;) {
- int n = reader.read(b);
- if (n <= 0) {
- break;
- }
- writer.write(b, 0, n);
- }
- return writer.toCharArray();
-
- } catch (FileNotFoundException e) {
- throw new IllegalArgumentException(e);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public char[] getFileName() {
- return (className.replace('.', fileSeparator) + ".java").toCharArray();
- }
-
- public char[] getMainTypeName() {
- int dot = className.lastIndexOf('.');
- if (dot > 0) {
- return className.substring(dot + 1).toCharArray();
- }
- return className.toCharArray();
- }
-
- public char[][] getPackageName() {
- StringTokenizer tokens = new StringTokenizer(className, ".");
- char[][] packageName = new char[tokens.countTokens() - 1][];
- for (int i = 0; i < packageName.length; i++) {
- String token = tokens.nextToken();
- packageName[i] = token.toCharArray();
- }
- return packageName;
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/JavaCompiler.java b/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/JavaCompiler.java
deleted file mode 100644
index f628a38e95..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/JavaCompiler.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.tools.maven.compiler;
-
-import static org.codehaus.plexus.compiler.CompilerOutputStyle.ONE_OUTPUT_FILE_PER_INPUT_FILE;
-import static org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies.proceedWithAllProblems;
-import static org.eclipse.jdt.internal.compiler.impl.CompilerOptions.GENERATE;
-import static org.eclipse.jdt.internal.compiler.impl.CompilerOptions.IGNORE;
-import static org.eclipse.jdt.internal.compiler.impl.CompilerOptions.OPTION_Encoding;
-import static org.eclipse.jdt.internal.compiler.impl.CompilerOptions.OPTION_LineNumberAttribute;
-import static org.eclipse.jdt.internal.compiler.impl.CompilerOptions.OPTION_LocalVariableAttribute;
-import static org.eclipse.jdt.internal.compiler.impl.CompilerOptions.OPTION_ReportDeprecation;
-import static org.eclipse.jdt.internal.compiler.impl.CompilerOptions.OPTION_Source;
-import static org.eclipse.jdt.internal.compiler.impl.CompilerOptions.OPTION_SourceFileAttribute;
-import static org.eclipse.jdt.internal.compiler.impl.CompilerOptions.OPTION_TargetPlatform;
-import static org.eclipse.jdt.internal.compiler.impl.CompilerOptions.WARNING;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.sca.tools.maven.compiler.osgi.BundleResolver;
-import org.apache.tuscany.sca.tools.maven.compiler.osgi.BundleUtil;
-import org.codehaus.plexus.compiler.AbstractCompiler;
-import org.codehaus.plexus.compiler.CompilerConfiguration;
-import org.codehaus.plexus.compiler.CompilerError;
-import org.codehaus.plexus.compiler.CompilerException;
-import org.eclipse.jdt.internal.compiler.Compiler;
-import org.eclipse.jdt.internal.compiler.ICompilerRequestor;
-import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
-import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.osgi.framework.BundleException;
-
-/**
- * A custom Plexus Java compiler plugin that uses the Eclipse compiler.
- *
- * @version $Rev: $ $Date: $
- */
-public class JavaCompiler extends AbstractCompiler {
-
- public JavaCompiler() {
- super(ONE_OUTPUT_FILE_PER_INPUT_FILE, ".java", ".class", null);
- }
-
- public List<CompilerError> compile(CompilerConfiguration configuration) throws CompilerException {
- BundleResolver stateController = new BundleResolver(getLogger());
-
- getLogger().info("Invoking Tuscany Eclipse JDT compiler");
-
- List<URL> urls = new ArrayList<URL>();
- try {
- for (String entry : (List<String>)configuration.getClasspathEntries()) {
- urls.add(new File(entry).toURI().toURL());
- }
- } catch (MalformedURLException e) {
- throw new CompilerException(e.getMessage(), e);
- }
-
- ClassLoader classLoader = new URLClassLoader(urls.toArray(new URL[urls.size()]));
-
- // Determine compiler configuration
- Map<String, String> settings = new HashMap<String, String>();
- String sourceVersion = configuration.getSourceVersion();
- if (sourceVersion != null && sourceVersion.length() != 0) {
- settings.put(OPTION_Source, sourceVersion);
- }
- String targetVersion = configuration.getTargetVersion();
- if (targetVersion != null && targetVersion.length() != 0) {
- settings.put(OPTION_TargetPlatform, targetVersion);
- }
- settings.put(OPTION_LineNumberAttribute, GENERATE);
- settings.put(OPTION_SourceFileAttribute, GENERATE);
- if (configuration.isDebug()) {
- settings.put(OPTION_LocalVariableAttribute, GENERATE);
- }
- if (configuration.getSourceEncoding() != null && !(configuration.getSourceEncoding().length() == 0)) {
- settings.put(OPTION_Encoding, configuration.getSourceEncoding());
- }
- if (configuration.isShowDeprecation()) {
- settings.put(OPTION_ReportDeprecation, WARNING);
- } else {
- settings.put(OPTION_ReportDeprecation, IGNORE);
- }
-
- // Create a compiler
- List<CompilerError> compilerErrors = new ArrayList<CompilerError>();
- INameEnvironment nameEnvironment =
- new ClassLoaderNameEnvironment(classLoader, configuration.getSourceLocations());
- ICompilerRequestor requestor =
- new CompilerRequestor(configuration.getOutputLocation(), configuration.isShowWarnings(), compilerErrors);
- Compiler compiler =
- new Compiler(nameEnvironment, proceedWithAllProblems(), new CompilerOptions(settings), requestor,
- new DefaultProblemFactory(Locale.getDefault()));
-
- // Create compilation units for the source files
- List<FileCompilationUnit> compilationUnits = new ArrayList<FileCompilationUnit>();
-
- // Go over the input source locations
- List<String> sourceLocations = (List<String>)configuration.getSourceLocations();
- for (String sourceLocation : sourceLocations) {
-
- // Exclude nested source locations
- List<String> excludeLocations = new ArrayList<String>();
- for (String nestedLocation : sourceLocations) {
- if (nestedLocation != sourceLocation && nestedLocation.startsWith(sourceLocation)) {
- excludeLocations.add(nestedLocation);
- }
- }
-
- // List source files in each source location
- for (String sourceFile : (Set<String>)getSourceFilesForSourceRoot(configuration, sourceLocation)) {
-
- // Exclude files from excluded nested locations
- boolean excluded = false;
- for (String excludeLocation : excludeLocations) {
- if (sourceFile.startsWith(excludeLocation)) {
- excluded = true;
- }
- }
- if (!excluded) {
-
- // Create a compilation unit for the source file
- FileCompilationUnit compilationUnit =
- new FileCompilationUnit(sourceFile, makeClassName(sourceFile, sourceLocation));
- compilationUnits.add(compilationUnit);
- }
- }
- }
-
- // Compile all the compilation units
- getLogger().info("Compiling " + compilationUnits.size() + " to " + configuration.getOutputLocation());
- compiler.compile((ICompilationUnit[])compilationUnits.toArray(new ICompilationUnit[compilationUnits.size()]));
-
- // getLogger().info(configuration.getCustomCompilerArguments().toString());
- boolean osgi = "true".equals(configuration.getCustomCompilerArguments().get("-osgi"));
- File proj = new File(configuration.getOutputLocation());
-
- String symbol = null;
- try {
- // Don't trigger the resolution for test-compile
- if (!"test-classes".equals(proj.getName())) {
- symbol = BundleUtil.getBundleSymbolicName(proj);
- }
- } catch (IOException e1) {
- symbol = null;
- }
-
- if (osgi && symbol != null) {
- getLogger().info("Resolving OSGi bundle: "+symbol);
- for (String entry : (List<String>)configuration.getClasspathEntries()) {
- try {
- File cp = new File(entry);
- if (cp.exists()) {
- stateController.addBundle(cp);
- }
- } catch (BundleException e) {
- getLogger().error(e.getMessage(), e);
- }
- }
-
- stateController.resolveState();
- BundleDescription b = stateController.getBundleDescription(proj);
- if (b != null) {
- try {
- stateController.assertResolved(b);
- getLogger().info("OSGi bundle is resolved: " + b.getSymbolicName());
- } catch (BundleException e) {
- stateController.analyzeErrors(b);
- if(getLogger().isDebugEnabled()) {
- getLogger().debug(stateController.reportErrors(b));
- }
- // FIXME: For now, only a warning is reported
- // throw new CompilerException(e.getMessage(), e);
- }
- }
- }
-
- return compilerErrors;
- }
-
- public String[] createCommandLine(CompilerConfiguration config) throws CompilerException {
- return null;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleResolver.java b/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleResolver.java
deleted file mode 100644
index 06f26f7e65..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleResolver.java
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.tools.maven.compiler.osgi;
-
-import static org.eclipse.osgi.service.resolver.ResolverError.IMPORT_PACKAGE_USES_CONFLICT;
-import static org.eclipse.osgi.service.resolver.ResolverError.MISSING_FRAGMENT_HOST;
-import static org.eclipse.osgi.service.resolver.ResolverError.MISSING_IMPORT_PACKAGE;
-import static org.eclipse.osgi.service.resolver.ResolverError.MISSING_REQUIRE_BUNDLE;
-import static org.eclipse.osgi.service.resolver.ResolverError.REQUIRE_BUNDLE_USES_CONFLICT;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.logging.Logger;
-import org.eclipse.osgi.service.resolver.BundleDescription;
-import org.eclipse.osgi.service.resolver.BundleSpecification;
-import org.eclipse.osgi.service.resolver.ExportPackageDescription;
-import org.eclipse.osgi.service.resolver.HostSpecification;
-import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
-import org.eclipse.osgi.service.resolver.ResolverError;
-import org.eclipse.osgi.service.resolver.State;
-import org.eclipse.osgi.service.resolver.StateObjectFactory;
-import org.eclipse.osgi.service.resolver.VersionConstraint;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-
-public class BundleResolver {
- private static final String PROP_MAVEN_PROJECT = "MavenProject";
- private static final String PROP_MANIFEST = "BundleManifest";
-
- private StateObjectFactory factory = StateObjectFactory.defaultFactory;
- private State state;
- private long id = 0;
- private Logger logger;
-
- public static BundleDescription[] getDependentBundles(BundleDescription root) {
- if (root == null)
- return new BundleDescription[0];
- BundleDescription[] imported = getImportedBundles(root);
- BundleDescription[] required = getRequiredBundles(root);
- BundleDescription[] dependents = new BundleDescription[imported.length + required.length];
- System.arraycopy(imported, 0, dependents, 0, imported.length);
- System.arraycopy(required, 0, dependents, imported.length, required.length);
- return dependents;
- }
-
- public static BundleDescription[] getImportedBundles(BundleDescription root) {
- if (root == null)
- return new BundleDescription[0];
- ExportPackageDescription[] packages = root.getResolvedImports();
- List<BundleDescription> resolvedImports = new ArrayList<BundleDescription>(packages.length);
- for (int i = 0; i < packages.length; i++)
- if (!root.getLocation().equals(packages[i].getExporter().getLocation()) && !resolvedImports
- .contains(packages[i].getExporter()))
- resolvedImports.add(packages[i].getExporter());
- return (BundleDescription[])resolvedImports.toArray(new BundleDescription[resolvedImports.size()]);
- }
-
- public static BundleDescription[] getRequiredBundles(BundleDescription root) {
- if (root == null)
- return new BundleDescription[0];
- return root.getResolvedRequires();
- }
-
- public BundleResolver(Logger logger) {
- this.logger = logger;
- this.state = factory.createState(true);
- Properties props = new Properties();
- props.putAll(System.getProperties());
- BundleUtil.loadVMProfile(props);
- state.setPlatformProperties(props);
- URL url = Bundle.class.getProtectionDomain().getCodeSource().getLocation();
-
- File osgi = toFile(url);
- try {
- addBundle(osgi);
- } catch (BundleException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- private long getNextId() {
- return ++id;
- }
-
- public BundleDescription addBundle(File bundleLocation) throws BundleException {
- return addBundle(bundleLocation, false);
- }
-
- public BundleDescription addBundle(File bundleLocation, boolean override) throws BundleException {
- if (bundleLocation == null || !bundleLocation.exists())
- throw new IllegalArgumentException("bundleLocation not found: " + bundleLocation);
- Dictionary manifest = loadManifestAttributes(bundleLocation);
- if (manifest == null) {
- // throw new BundleException("manifest not found in " + bundleLocation);
- return null;
- }
- return addBundle(manifest, bundleLocation, override);
- }
-
- public BundleDescription addBundle(File manifestLocation, File bundleLocation, boolean override)
- throws BundleException {
- if (bundleLocation == null || !bundleLocation.exists())
- throw new IllegalArgumentException("bundleLocation not found: " + bundleLocation);
- Dictionary manifest = loadManifestAttributes(manifestLocation);
- if (manifest == null)
- throw new IllegalArgumentException("manifest not found in " + manifestLocation);
- return addBundle(manifest, bundleLocation, override);
- }
-
- private Dictionary loadManifestAttributes(File bundleLocation) {
- Manifest m = loadManifest(bundleLocation);
- if (m == null) {
- return null;
- }
-
- return manifestToProperties(m.getMainAttributes());
- }
-
- public Manifest loadManifest(File bundleLocation) {
- try {
- return BundleUtil.getManifest(bundleLocation);
- } catch (IOException e) {
- e.printStackTrace();
- return null;
- }
- }
-
- private Properties manifestToProperties(Attributes d) {
- Iterator iter = d.keySet().iterator();
- Properties result = new Properties();
- while (iter.hasNext()) {
- Attributes.Name key = (Attributes.Name)iter.next();
- result.put(key.toString(), d.get(key));
- }
- return result;
- }
-
- private BundleDescription addBundle(Dictionary enhancedManifest, File bundleLocation, boolean override)
- throws BundleException {
-
- BundleDescription descriptor =
- factory.createBundleDescription(state, enhancedManifest, bundleLocation.getAbsolutePath(), getNextId());
-
- setUserProperty(descriptor, PROP_MANIFEST, enhancedManifest);
- if (override) {
- BundleDescription[] conflicts = state.getBundles(descriptor.getSymbolicName());
- if (conflicts != null) {
- for (BundleDescription conflict : conflicts) {
- state.removeBundle(conflict);
- logger
- .warn(conflict.toString() + " has been replaced by another bundle with the same symbolic name "
- + descriptor.toString());
- }
- }
- }
-
- state.addBundle(descriptor);
- return descriptor;
- }
-
- public BundleDescription getResolvedBundle(String bundleId) {
- BundleDescription[] description = state.getBundles(bundleId);
- if (description == null)
- return null;
- for (int i = 0; i < description.length; i++) {
- if (description[i].isResolved())
- return description[i];
- }
- return null;
- }
-
- public void resolveState() {
- state.resolve(false);
-
- if (logger.isDebugEnabled()) {
- StringBuilder sb = new StringBuilder("Resolved OSGi state\n");
- for (BundleDescription bundle : state.getBundles()) {
- if (!bundle.isResolved()) {
- sb.append("[X] ");
- } else {
- sb.append("[V] ");
- }
- sb.append(bundle).append(": (").append(bundle.getLocation());
- sb.append(")\n");
- for (ResolverError error : state.getResolverErrors(bundle)) {
- sb.append(" ").append(error.toString()).append('\n');
- }
- }
- logger.debug(sb.toString());
- }
- }
-
- public State getState() {
- return state;
- }
-
- public BundleDescription[] getBundles() {
- return state.getBundles();
- }
-
- public ResolverError[] getResolverErrors(BundleDescription bundle) {
- Set<ResolverError> errors = new LinkedHashSet<ResolverError>();
- getRelevantErrors(errors, bundle);
- return (ResolverError[])errors.toArray(new ResolverError[errors.size()]);
- }
-
- private void getRelevantErrors(Set<ResolverError> errors, BundleDescription bundle) {
- ResolverError[] bundleErrors = state.getResolverErrors(bundle);
- for (int j = 0; j < bundleErrors.length; j++) {
- ResolverError error = bundleErrors[j];
- errors.add(error);
-
- VersionConstraint constraint = error.getUnsatisfiedConstraint();
- if (constraint instanceof BundleSpecification || constraint instanceof HostSpecification) {
- BundleDescription[] requiredBundles = state.getBundles(constraint.getName());
- for (int i = 0; i < requiredBundles.length; i++) {
- getRelevantErrors(errors, requiredBundles[i]);
- }
- }
- }
- }
-
- private void logError(BundleDescription bundle, int level, Object object) {
- StringBuffer msg = new StringBuffer();
- for (int i = 0; i < level; i++) {
- msg.append("--");
- }
- msg.append("> [").append(bundle.getSymbolicName()).append("] ");
- msg.append(object);
- logger.error(msg.toString());
- }
-
- public void analyzeErrors(BundleDescription bundle) {
- analyzeErrors(bundle, new HashSet<BundleDescription>(), 1);
- }
-
- private void analyzeErrors(BundleDescription bundle, Set<BundleDescription> bundles, int level) {
- if (bundles.contains(bundle)) {
- return;
- }
- bundles.add(bundle);
- ResolverError[] errors = state.getResolverErrors(bundle);
- for (ResolverError error : errors) {
- logError(bundle, level, error);
- VersionConstraint constraint = error.getUnsatisfiedConstraint();
- switch (error.getType()) {
- case MISSING_IMPORT_PACKAGE:
- ImportPackageSpecification pkgSpec = (ImportPackageSpecification)constraint;
- for (BundleDescription b : getBundles()) {
- for (ExportPackageDescription pkg : b.getExportPackages()) {
- if (pkg.getName().equals(pkgSpec.getName())) {
- if (pkgSpec.getVersionRange().isIncluded(pkg.getVersion())) {
- if (!pkg.getExporter().isResolved()) {
- logError(b, level, "Bundle unresolved: " + pkg);
- analyzeErrors(pkg.getExporter(), bundles, level + 1);
- }
- } else {
- logError(b, level, "Version mismatch: " + pkgSpec + " " + pkg);
- }
- }
- }
- }
- break;
- case MISSING_REQUIRE_BUNDLE:
- case MISSING_FRAGMENT_HOST:
- // BundleSpecification bundleSpec = (BundleSpecification)constraint;
- for (BundleDescription b : getBundles()) {
- if (b == bundle) {
- continue;
- }
- if (b.getSymbolicName().equals(constraint.getName())) {
- if (constraint.getVersionRange().isIncluded(b.getVersion())) {
- // There must be something wrong in the bundle
- analyzeErrors(b, bundles, level);
- } else {
- logError(bundle, level, "Version mismatch: " + constraint + " " + b);
- }
- }
- }
- break;
- case IMPORT_PACKAGE_USES_CONFLICT:
- case REQUIRE_BUNDLE_USES_CONFLICT:
- default:
- logger.error(reportErrors(bundle));
- break;
- }
- }
-
- }
-
- public Set<ResolverError> getAllErrors() {
- BundleDescription[] bundles = state.getBundles();
- Set<ResolverError> errors = new LinkedHashSet<ResolverError>();
- for (int i = 0; i < bundles.length; i++) {
- BundleDescription bundle = bundles[i];
- ResolverError[] bundleErrors = state.getResolverErrors(bundle);
- if (bundleErrors != null) {
- errors.addAll(Arrays.asList(bundleErrors));
- }
- }
- return errors;
- }
-
- public List<BundleDescription> getDependencies(BundleDescription desc) {
- Set<Long> bundleIds = new LinkedHashSet<Long>();
- addBundleAndDependencies(desc, bundleIds, true);
- List<BundleDescription> dependencies = new ArrayList<BundleDescription>();
- for (long bundleId : bundleIds) {
- if (desc.getBundleId() != bundleId) {
- BundleDescription dependency = state.getBundle(bundleId);
- BundleDescription supplier = dependency.getSupplier().getSupplier();
- HostSpecification host = supplier.getHost();
- if (host == null || !desc.equals(host.getSupplier())) {
- dependencies.add(dependency);
- }
- }
- }
- return dependencies;
- }
-
- /**
- * Code below is copy&paste from org.eclipse.pde.internal.core.DependencyManager
- * which seems to calculate runtime dependencies. In particular, it adds
- * fragments' dependencies to the host bundle (see TychoTest#testFragment unit test).
- * This may or may not cause problems...
- *
- * RequiredPluginsClasspathContainer#computePluginEntries has the logic to
- * calculate compile-time dependencies in IDE.
- *
- * TODO find the code used by PDE/Build
- */
- private static void addBundleAndDependencies(BundleDescription desc, Set<Long> bundleIds, boolean includeOptional) {
- if (desc != null && bundleIds.add(new Long(desc.getBundleId()))) {
- BundleSpecification[] required = desc.getRequiredBundles();
- for (int i = 0; i < required.length; i++) {
- if (includeOptional || !required[i].isOptional())
- addBundleAndDependencies((BundleDescription)required[i].getSupplier(), bundleIds, includeOptional);
- }
- ImportPackageSpecification[] importedPkgs = desc.getImportPackages();
- for (int i = 0; i < importedPkgs.length; i++) {
- ExportPackageDescription exporter = (ExportPackageDescription)importedPkgs[i].getSupplier();
- // Continue if the Imported Package is unresolved of the package is optional and don't want optional packages
- if (exporter == null || (!includeOptional && Constants.RESOLUTION_OPTIONAL.equals(importedPkgs[i]
- .getDirective(Constants.RESOLUTION_DIRECTIVE))))
- continue;
- addBundleAndDependencies(exporter.getExporter(), bundleIds, includeOptional);
- }
- BundleDescription[] fragments = desc.getFragments();
- for (int i = 0; i < fragments.length; i++) {
- if (!fragments[i].isResolved())
- continue;
- String id = fragments[i].getSymbolicName();
- if (!"org.eclipse.ui.workbench.compatibility".equals(id)) //$NON-NLS-1$
- addBundleAndDependencies(fragments[i], bundleIds, includeOptional);
- }
- HostSpecification host = desc.getHost();
- if (host != null)
- addBundleAndDependencies((BundleDescription)host.getSupplier(), bundleIds, includeOptional);
- }
- }
-
- public BundleDescription getBundleDescription(MavenProject project) {
- String location = project.getFile().getParentFile().getAbsolutePath();
- return state.getBundleByLocation(location);
- }
-
- public BundleDescription getBundleDescription(File location) {
- String absolutePath = location.getAbsolutePath();
- return state.getBundleByLocation(absolutePath);
- }
-
- private static void setUserProperty(BundleDescription desc, String name, Object value) {
- Object userObject = desc.getUserObject();
-
- if (userObject != null && !(userObject instanceof Map)) {
- throw new IllegalStateException("Unexpected user object " + desc.toString());
- }
-
- Map props = (Map)userObject;
- if (props == null) {
- props = new HashMap();
- desc.setUserObject(props);
- }
-
- props.put(name, value);
- }
-
- private static Object getUserProperty(BundleDescription desc, String name) {
- Object userObject = desc.getUserObject();
- if (userObject instanceof Map) {
- return ((Map)userObject).get(name);
- }
- return null;
- }
-
- public MavenProject getMavenProject(BundleDescription desc) {
- return (MavenProject)getUserProperty(desc, PROP_MAVEN_PROJECT);
- }
-
- public void assertResolved(BundleDescription desc) throws BundleException {
- if (!desc.isResolved()) {
- throw new BundleException("Bundle cannot be resolved: " + desc);
- }
- }
-
- public String reportErrors(BundleDescription desc) {
- StringBuffer msg = new StringBuffer();
- msg.append("Bundle ").append(desc.getSymbolicName()).append(" cannot be resolved: \n");
- BundleDescription[] bundles = state.getBundles();
- int index = 0;
- for (BundleDescription b : bundles) {
- if (b.isResolved()) {
- continue;
- }
- ResolverError[] errors = state.getResolverErrors(b);
- if (errors.length > 0) {
- msg.append(" ").append("[").append(index++).append("] ").append(b.getSymbolicName()).append("\n");
- }
- for (int i = 0; i < errors.length; i++) {
- ResolverError error = errors[i];
- msg.append(" -->").append(error).append("\n");
- }
- }
- return msg.toString();
- }
-
- public String getManifestAttribute(BundleDescription desc, String attr) {
- Dictionary mf = (Dictionary)getUserProperty(desc, PROP_MANIFEST);
- if (mf != null) {
- return (String)mf.get(attr);
- }
- return null;
- }
-
- private static File toFile(URL url) {
- if (url.getProtocol().equals("file") == false) {
- return null;
- } else {
- String filename = url.getFile().replace('/', File.separatorChar).replace("%20", " ");
- return new File(filename);
- }
- }
-
- /*
- public static void main(String[] args) throws Exception {
- BundleResolver resolver = new BundleResolver(new ConsoleLogger(Logger.LEVEL_INFO, "tuscany"));
-
- String home = System.getProperty("user.home");
- File jar =
- new File(new File(home),
- ".m2/repository/org/apache/tuscany/sca/tuscany-sca-api/1.4-EQUINOX-SNAPSHOT/tuscany-sca-api-1.4-EQUINOX-SNAPSHOT.jar");
- BundleDescription bundle = resolver.addBundle(jar);
- resolver.resolveState();
- resolver.assertResolved(bundle);
- }
- */
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleUtil.java b/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleUtil.java
deleted file mode 100644
index be8ee92fb6..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/java/org/apache/tuscany/sca/tools/maven/compiler/osgi/BundleUtil.java
+++ /dev/null
@@ -1,618 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.tools.maven.compiler.osgi;
-
-import static org.osgi.framework.Constants.BUNDLE_CLASSPATH;
-import static org.osgi.framework.Constants.BUNDLE_MANIFESTVERSION;
-import static org.osgi.framework.Constants.BUNDLE_NAME;
-import static org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME;
-import static org.osgi.framework.Constants.BUNDLE_VERSION;
-import static org.osgi.framework.Constants.DYNAMICIMPORT_PACKAGE;
-import static org.osgi.framework.Constants.EXPORT_PACKAGE;
-import static org.osgi.framework.Constants.IMPORT_PACKAGE;
-
-import java.io.BufferedInputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.apache.maven.artifact.versioning.ArtifactVersion;
-import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-import org.eclipse.osgi.framework.internal.core.Constants;
-import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
-import org.eclipse.osgi.util.ManifestElement;
-import org.osgi.framework.Version;
-
-/**
- * Common functions used by the plugin.
- *
- * @version $Rev$ $Date$
- */
-public final class BundleUtil {
-
- /**
- * Returns the name of a bundle, or null if the given file is not a bundle.
- *
- * @param file
- * @return
- * @throws IOException
- */
- public static String getBundleSymbolicName(File file) throws IOException {
- if (!file.exists()) {
- return null;
- }
- String bundleName = null;
- if (file.isDirectory()) {
- File mf = new File(file, JarFile.MANIFEST_NAME);
- if (!mf.isFile()) {
- mf = new File(file, "../../" + JarFile.MANIFEST_NAME);
- }
- if (mf.isFile()) {
- Manifest manifest = new Manifest(new FileInputStream(mf));
- bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- }
- } else {
- JarFile jar = new JarFile(file, false);
- Manifest manifest = jar.getManifest();
- bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- jar.close();
- }
- if (bundleName == null) {
- return bundleName;
- }
- int sc = bundleName.indexOf(';');
- if (sc != -1) {
- bundleName = bundleName.substring(0, sc);
- }
- return bundleName;
- }
-
- static Manifest getManifest(File file) throws IOException {
- if (!file.exists()) {
- return null;
- }
- Manifest manifest = null;
- String bundleName = null;
- if (file.isDirectory()) {
- File mf = new File(file, JarFile.MANIFEST_NAME);
- if (!mf.isFile()) {
- mf = new File(file, "../../" + JarFile.MANIFEST_NAME);
- }
- if (mf.isFile()) {
- manifest = new Manifest(new FileInputStream(mf));
- bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- }
- } else {
- JarFile jar = new JarFile(file, false);
- manifest = jar.getManifest();
- bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- jar.close();
- }
- if (bundleName != null) {
- return manifest;
- }
-
- if (file.isFile()) {
- Set<File> jars = new HashSet<File>();
- jars.add(file);
- String name = file.getName();
- manifest = libraryManifest(jars, name, name, jarVersion(name), null);
- }
- return manifest;
- }
-
- /**
- * Generate a Bundle manifest for a set of JAR files.
- *
- * @param jarFiles
- * @param name
- * @param symbolicName
- * @param version
- * @param dir
- * @return
- * @throws IllegalStateException
- */
- static Manifest libraryManifest(Set<File> jarFiles, String name, String symbolicName, String version, String dir)
- throws IllegalStateException {
- try {
-
- // List exported packages and bundle classpath entries
- StringBuffer classpath = new StringBuffer();
- Set<String> exportedPackages = new HashSet<String>();
- for (File jarFile : jarFiles) {
- addPackages(jarFile, exportedPackages, version);
- if (dir != null) {
- classpath.append(dir).append("/");
- classpath.append(jarFile.getName());
- } else {
- classpath.append("\"external:");
- classpath.append(jarFile.getPath().replace(File.separatorChar, '/'));
- classpath.append("\"");
- }
- classpath.append(",");
- }
-
- // Generate export-package and import-package declarations
- StringBuffer exports = new StringBuffer();
- StringBuffer imports = new StringBuffer();
- Set<String> importedPackages = new HashSet<String>();
- for (String export : exportedPackages) {
-
- // Add export declaration
- exports.append(export);
- exports.append(',');
-
- // Add corresponding import declaration
- String packageName = packageName(export);
- if (!importedPackages.contains(packageName)) {
- importedPackages.add(packageName);
- imports.append(packageName);
- imports.append(',');
- }
- }
-
- // Create a manifest
- Manifest manifest = new Manifest();
- Attributes attributes = manifest.getMainAttributes();
- attributes.putValue("Manifest-Version", "1.0");
- attributes.putValue(BUNDLE_MANIFESTVERSION, "2");
- attributes.putValue(BUNDLE_SYMBOLICNAME, symbolicName);
- attributes.putValue(BUNDLE_NAME, name);
- attributes.putValue(BUNDLE_VERSION, version);
- attributes.putValue(DYNAMICIMPORT_PACKAGE, "*");
- if (exports.length() > 1) {
- attributes.putValue(EXPORT_PACKAGE, exports.substring(0, exports.length() - 1));
- }
- if (imports.length() > 1) {
- attributes.putValue(IMPORT_PACKAGE, imports.substring(0, imports.length() - 1));
- }
- if (classpath.length() > 1) {
- attributes.putValue(BUNDLE_CLASSPATH, classpath.substring(0, classpath.length() - 1));
- }
-
- return manifest;
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- }
-
- /**
- * Write a bundle manifest.
- *
- * @param manifest
- * @param out
- * @throws IOException
- */
- static void write(Manifest manifest, OutputStream out) throws IOException {
- DataOutputStream dos = new DataOutputStream(out);
- Attributes attributes = manifest.getMainAttributes();
- write(attributes, "Manifest-Version", dos);
- write(attributes, BUNDLE_MANIFESTVERSION, dos);
- write(attributes, BUNDLE_SYMBOLICNAME, dos);
- write(attributes, BUNDLE_NAME, dos);
- write(attributes, BUNDLE_VERSION, dos);
- write(attributes, DYNAMICIMPORT_PACKAGE, dos);
- write(attributes, BUNDLE_CLASSPATH, dos);
- write(attributes, IMPORT_PACKAGE, dos);
- write(attributes, EXPORT_PACKAGE, dos);
- dos.flush();
- }
-
- /**
- * Add packages to be exported out of a JAR file.
- *
- * @param jarFile
- * @param packages
- * @throws IOException
- */
- private static void addPackages(File jarFile, Set<String> packages, String version) throws IOException {
- if (getBundleSymbolicName(jarFile) == null) {
- String ver = ";version=" + version;
- addAllPackages(jarFile, packages, ver);
- } else {
- addExportedPackages(jarFile, packages);
- }
- }
-
- /**
- * Write manifest attributes.
- *
- * @param attributes
- * @param key
- * @param dos
- * @throws IOException
- */
- private static void write(Attributes attributes, String key, DataOutputStream dos) throws IOException {
- String value = attributes.getValue(key);
- if (value == null) {
- return;
- }
- StringBuffer line = new StringBuffer();
- line.append(key);
- line.append(": ");
- line.append(new String(value.getBytes("UTF8")));
- line.append("\r\n");
- int l = line.length();
- if (l > 72) {
- for (int i = 70; i < l - 2;) {
- line.insert(i, "\r\n ");
- i += 72;
- l += 3;
- }
- }
- dos.writeBytes(line.toString());
- }
-
- /**
- * Strip an OSGi export, only retain the package name and version.
- *
- * @param export
- * @return
- */
- private static String stripExport(String export) {
- int sc = export.indexOf(';');
- if (sc == -1) {
- return export;
- }
- String base = export.substring(0, sc);
- int v = export.indexOf("version=");
- if (v != -1) {
- sc = export.indexOf(';', v + 1);
- if (sc != -1) {
- return base + ";" + export.substring(v, sc);
- } else {
- return base + ";" + export.substring(v);
- }
- } else {
- return base;
- }
- }
-
- /**
- * Add all the packages out of a JAR.
- *
- * @param jarFile
- * @param packages
- * @param version
- * @throws IOException
- */
- private static void addAllPackages(File jarFile, Set<String> packages, String version) throws IOException {
- ZipInputStream is = new ZipInputStream(new FileInputStream(jarFile));
- ZipEntry entry;
- while ((entry = is.getNextEntry()) != null) {
- String entryName = entry.getName();
- if (!entry.isDirectory() && entryName != null
- && entryName.length() > 0
- && !entryName.startsWith(".")
- && entryName.endsWith(".class") // Exclude resources from Export-Package
- && entryName.lastIndexOf("/") > 0
- && Character.isJavaIdentifierStart(entryName.charAt(0))) {
- String pkg = entryName.substring(0, entryName.lastIndexOf("/")).replace('/', '.');
- if (!pkg.endsWith(".enum")) {
- packages.add(pkg + version);
- }
- }
- }
- is.close();
- }
-
- /**
- * Returns the name of the exported package in the given export.
- * @param export
- * @return
- */
- private static String packageName(String export) {
- int sc = export.indexOf(';');
- if (sc != -1) {
- export = export.substring(0, sc);
- }
- return export;
- }
-
- /**
- * Add the packages exported by a bundle.
- *
- * @param file
- * @param packages
- * @return
- * @throws IOException
- */
- private static void addExportedPackages(File file, Set<String> packages) throws IOException {
- if (!file.exists()) {
- return;
- }
-
- // Read the export-package declaration and get a list of the packages available in a JAR
- Set<String> existingPackages = null;
- String exports = null;
- if (file.isDirectory()) {
- File mf = new File(file, "META-INF/MANIFEST.MF");
- if (mf.isFile()) {
- Manifest manifest = new Manifest(new FileInputStream(mf));
- exports = manifest.getMainAttributes().getValue(EXPORT_PACKAGE);
- }
- } else {
- JarFile jar = new JarFile(file, false);
- Manifest manifest = jar.getManifest();
- exports = manifest.getMainAttributes().getValue(EXPORT_PACKAGE);
- jar.close();
- existingPackages = new HashSet<String>();
- addAllPackages(file, existingPackages, "");
- }
- if (exports == null) {
- return;
- }
-
- // Parse the export-package declaration, and extract the individual packages
- StringBuffer buffer = new StringBuffer();
- boolean q = false;
- for (int i = 0, n = exports.length(); i < n; i++) {
- char c = exports.charAt(i);
- if (c == '\"') {
- q = !q;
- }
- if (!q) {
- if (c == ',') {
-
- // Add the exported package to the set, after making sure it really exists in
- // the JAR
- String export = buffer.toString();
- if (existingPackages == null || existingPackages.contains(packageName(export))) {
- packages.add(stripExport(export));
- }
- buffer = new StringBuffer();
- continue;
- }
- }
- buffer.append(c);
- }
- if (buffer.length() != 0) {
-
- // Add the exported package to the set, after making sure it really exists in
- // the JAR
- String export = buffer.toString();
- if (existingPackages == null || existingPackages.contains(packageName(export))) {
- packages.add(stripExport(export));
- }
- }
- }
-
- /**
- * starting with -, then some digits, then . or - or _, then some digits again
- *
- */
- private static Pattern pattern = Pattern.compile("-(\\d)+((\\.|-|_)(\\d)+)*");
-
- /**
- * Returns the version number to use for the given JAR file.
- *
- * @param fileName
- * @return
- */
- static String jarVersion(String fileName) {
- String name = fileName;
- int index = name.lastIndexOf('.');
- if (index != -1) {
- // Trim the extension
- name = name.substring(0, index);
- }
-
- Matcher matcher = pattern.matcher(name);
- String version = "0.0.0";
- if (matcher.find()) {
- version = matcher.group();
- version = version.substring(1);
- }
- return version;
- }
-
- /**
- * Convert the maven version into OSGi version
- * @param mavenVersion
- * @return
- */
- static String osgiVersion(String mavenVersion) {
- ArtifactVersion ver = new DefaultArtifactVersion(mavenVersion);
- String qualifer = ver.getQualifier();
- if (qualifer != null) {
- StringBuffer buf = new StringBuffer(qualifer);
- for (int i = 0; i < buf.length(); i++) {
- char c = buf.charAt(i);
- if (Character.isLetterOrDigit(c) || c == '-' || c == '_') {
- // Keep as-is
- } else {
- buf.setCharAt(i, '_');
- }
- }
- qualifer = buf.toString();
- }
- Version osgiVersion =
- new Version(ver.getMajorVersion(), ver.getMinorVersion(), ver.getIncrementalVersion(), qualifer);
- String version = osgiVersion.toString();
- return version;
- }
-
- private static String J2SE = "J2SE-";
- private static String JAVASE = "JavaSE-";
- private static String PROFILE_EXT = ".profile";
-
- public static void loadVMProfile(Properties properties) {
- Properties profileProps = findVMProfile(properties);
- String systemExports = properties.getProperty(Constants.OSGI_FRAMEWORK_SYSTEM_PACKAGES);
- // set the system exports property using the vm profile; only if the property is not already set
- if (systemExports == null) {
- systemExports = profileProps.getProperty(Constants.OSGI_FRAMEWORK_SYSTEM_PACKAGES);
- if (systemExports != null)
- properties.put(Constants.OSGI_FRAMEWORK_SYSTEM_PACKAGES, systemExports);
- }
- // set the org.osgi.framework.bootdelegation property according to the java profile
- String type = properties.getProperty(Constants.OSGI_JAVA_PROFILE_BOOTDELEGATION); // a null value means ignore
- String profileBootDelegation = profileProps.getProperty(Constants.OSGI_BOOTDELEGATION);
- if (Constants.OSGI_BOOTDELEGATION_OVERRIDE.equals(type)) {
- if (profileBootDelegation == null)
- properties.remove(Constants.OSGI_BOOTDELEGATION); // override with a null value
- else
- properties.put(Constants.OSGI_BOOTDELEGATION, profileBootDelegation); // override with the profile value
- } else if (Constants.OSGI_BOOTDELEGATION_NONE.equals(type))
- properties.remove(Constants.OSGI_BOOTDELEGATION); // remove the bootdelegation property in case it was set
- // set the org.osgi.framework.executionenvironment property according to the java profile
- if (properties.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT) == null) {
- // get the ee from the java profile; if no ee is defined then try the java profile name
- String ee =
- profileProps.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, profileProps
- .getProperty(Constants.OSGI_JAVA_PROFILE_NAME));
- if (ee != null)
- properties.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, ee);
- }
- }
-
- private static Properties findVMProfile(Properties properties) {
- Properties result = new Properties();
- // Find the VM profile name using J2ME properties
- String j2meConfig = properties.getProperty(Constants.J2ME_MICROEDITION_CONFIGURATION);
- String j2meProfiles = properties.getProperty(Constants.J2ME_MICROEDITION_PROFILES);
- String vmProfile = null;
- String javaEdition = null;
- Version javaVersion = null;
- if (j2meConfig != null && j2meConfig.length() > 0 && j2meProfiles != null && j2meProfiles.length() > 0) {
- // save the vmProfile based off of the config and profile
- // use the last profile; assuming that is the highest one
- String[] j2meProfileList = ManifestElement.getArrayFromList(j2meProfiles, " ");
- if (j2meProfileList != null && j2meProfileList.length > 0)
- vmProfile = j2meConfig + '_' + j2meProfileList[j2meProfileList.length - 1];
- } else {
- // No J2ME properties; use J2SE properties
- // Note that the CDC spec appears not to require VM implementations to set the
- // javax.microedition properties!! So we will try to fall back to the
- // java.specification.name property, but this is pretty ridiculous!!
- String javaSpecVersion = properties.getProperty("java.specification.version");
- // set the profile and EE based off of the java.specification.version
- // TODO We assume J2ME Foundation and J2SE here. need to support other profiles J2EE ...
- if (javaSpecVersion != null) {
- StringTokenizer st = new StringTokenizer(javaSpecVersion, " _-");
- javaSpecVersion = st.nextToken();
- String javaSpecName = properties.getProperty("java.specification.name");
- if ("J2ME Foundation Specification".equals(javaSpecName))
- vmProfile = "CDC-" + javaSpecVersion + "_Foundation-" + javaSpecVersion; //$NON-NLS-2$
- else {
- // look for JavaSE if 1.6 or greater; otherwise look for J2SE
- Version v16 = new Version("1.6");
- javaEdition = J2SE;
- try {
- javaVersion = new Version(javaSpecVersion);
- if (v16.compareTo(javaVersion) <= 0)
- javaEdition = JAVASE;
- } catch (IllegalArgumentException e) {
- // do nothing
- }
- vmProfile = javaEdition + javaSpecVersion;
- }
- }
- }
- URL url = null;
- // check for the java profile property for a url
- String propJavaProfile = FrameworkProperties.getProperty(Constants.OSGI_JAVA_PROFILE);
- if (propJavaProfile != null)
- try {
- // we assume a URL
- url = new URL(propJavaProfile);
- } catch (MalformedURLException e1) {
- // try using a relative path in the system bundle
- url = findInSystemBundle(propJavaProfile);
- }
- if (url == null && vmProfile != null) {
- // look for a profile in the system bundle based on the vm profile
- String javaProfile = vmProfile + PROFILE_EXT;
- url = findInSystemBundle(javaProfile);
- if (url == null)
- url = getNextBestProfile(javaEdition, javaVersion);
- }
- if (url == null)
- // the profile url is still null then use the osgi min profile in OSGi by default
- url = findInSystemBundle("OSGi_Minimum-1.1.profile");
- if (url != null) {
- InputStream in = null;
- try {
- in = url.openStream();
- result.load(new BufferedInputStream(in));
- } catch (IOException e) {
- // TODO consider logging ...
- } finally {
- if (in != null)
- try {
- in.close();
- } catch (IOException ee) {
- // do nothing
- }
- }
- }
- // set the profile name if it does not provide one
- if (result.getProperty(Constants.OSGI_JAVA_PROFILE_NAME) == null)
- if (vmProfile != null)
- result.put(Constants.OSGI_JAVA_PROFILE_NAME, vmProfile.replace('_', '/'));
- else
- // last resort; default to the absolute minimum profile name for the framework
- result.put(Constants.OSGI_JAVA_PROFILE_NAME, "OSGi/Minimum-1.1");
- return result;
- }
-
- private static URL getNextBestProfile(String javaEdition, Version javaVersion) {
- if (javaVersion == null || (javaEdition != J2SE && javaEdition != JAVASE))
- return null; // we cannot automatically choose the next best profile unless this is a J2SE or JavaSE vm
- URL bestProfile = findNextBestProfile(javaEdition, javaVersion);
- if (bestProfile == null && javaEdition == JAVASE)
- // if this is a JavaSE VM then search for a lower J2SE profile
- bestProfile = findNextBestProfile(J2SE, javaVersion);
- return bestProfile;
- }
-
- private static URL findNextBestProfile(String javaEdition, Version javaVersion) {
- URL result = null;
- int minor = javaVersion.getMinor();
- do {
- result = findInSystemBundle(javaEdition + javaVersion.getMajor() + "." + minor + PROFILE_EXT);
- minor = minor - 1;
- } while (result == null && minor > 0);
- return result;
- }
-
- private static URL findInSystemBundle(String entry) {
- ClassLoader loader = BundleUtil.class.getClassLoader();
- return loader == null ? ClassLoader.getSystemResource(entry) : loader.getResource(entry);
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/resources/META-INF/plexus/components.xml b/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/resources/META-INF/plexus/components.xml
deleted file mode 100644
index 4332d3f205..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-eclipse-compiler/src/main/resources/META-INF/plexus/components.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-set>
- <components>
- <component>
- <role>org.codehaus.plexus.compiler.Compiler</role>
- <role-hint>tuscany-eclipse</role-hint>
- <implementation>org.apache.tuscany.sca.tools.maven.compiler.JavaCompiler</implementation>
- </component>
- </components>
-</component-set>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/LICENSE b/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/NOTICE b/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/pom.xml b/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/pom.xml
deleted file mode 100644
index 1d50138a8d..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/pom.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-maven-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-maven-incremental-build</artifactId>
- <packaging>maven-plugin</packaging>
- <name>Apache Tuscany SCA Incremental Build Generator Maven Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-settings</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core</artifactId>
- <version>2.0.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-invoker</artifactId>
- <version>2.0.7</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-api</artifactId>
- <version>1.5.3</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-manager</artifactId>
- <version>1.5.3</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-javac</artifactId>
- <version>1.5.3</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>LATEST</version>
- <configuration>
- <goalPrefix>incremental</goalPrefix>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/src/main/java/org/apache/tuscany/sca/tools/incremental/build/plugin/IncrementalBuildMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/src/main/java/org/apache/tuscany/sca/tools/incremental/build/plugin/IncrementalBuildMojo.java
deleted file mode 100644
index 3a6870732b..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-incremental-build/src/main/java/org/apache/tuscany/sca/tools/incremental/build/plugin/IncrementalBuildMojo.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.tools.incremental.build.plugin;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.model.Resource;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.settings.Settings;
-import org.apache.maven.shared.invoker.DefaultInvocationRequest;
-import org.apache.maven.shared.invoker.InvocationResult;
-import org.apache.maven.shared.invoker.Invoker;
-import org.apache.maven.shared.invoker.MavenInvocationException;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.cli.CommandLineException;
-
-/**
- * @version $Rev$ $Date$
- * @goal build
- * @phase validate
- * @requiresDependencyResolution test
- * @description Incrementally build project modules that depend on modified modules.
- */
-public class IncrementalBuildMojo extends AbstractMojo {
-
- /**
- * Keep track of modified projects.
- */
- private static Set<String> modifiedProjectIDs = new HashSet<String>();
-
- /**
- * The current user system settings for use in Maven.
- *
- * @parameter expression="${settings}"
- * @required
- * @readonly
- */
- private Settings settings;
-
- /**
- * Used to invoke Maven builds.
- *
- * @component
- */
- private Invoker invoker;
-
- /**
- * The target directory of the compiler if fork is true.
- *
- * @parameter expression="${project.build.directory}"
- * @required
- * @readonly
- */
- private File buildDirectory;
-
- /**
- * The project to create a build for.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- private MavenProject project;
-
- private File outputFile;
-
- public void execute() throws MojoExecutionException {
- String projectID = id(project);
- outputFile = getOutputFile();
-
- File testMarkerFile = new File(project.getBasedir().getPath() + "/.test");
-
- List<String> goals = new ArrayList<String>();
- String type = project.getArtifact().getType();
- if ("pom".equals(type)) {
-
- // Always install pom modules
- goals.add("install");
-
- } else {
-
- // Check if anything has changed in the project
- boolean changed = false;
- boolean testChanged = false;
- boolean testFailed = false;
- if (new File(project.getBasedir().getPath() + "/.modified").exists()) {
- getLog().info("Found .modified marker file.");
- changed = true;
- } else {
- changed = areSourcesStale() || areResourcesStale() || isPOMStale();
- }
- if (changed) {
- modifiedProjectIDs.add(projectID);
- } else {
- testChanged = areTestSourcesStale() || areTestResourcesStale();
- }
-
- // Check if a project has compile dependencies on the modified projects
- // and will need to be recompiled, or has runtime or test dependencies
- // on the modified projects and needs to be retested
- if (changed) {
- goals.add("clean");
- goals.add("install");
- getLog().info("Project " + projectID + " has changed and will be recompiled.");
-
- } else {
- for (Artifact artifact : (List<Artifact>)project.getCompileArtifacts()) {
- String artifactID = id(artifact);
- if (modifiedProjectIDs.contains(artifactID)) {
- getLog().info("Project " + projectID + " depends on modified project " + artifactID + " and will be recompiled.");
- goals.add("clean");
- goals.add("install");
- break;
- }
- }
-
- if (goals.isEmpty()) {
- List<Artifact> artifacts = new ArrayList<Artifact>();
- artifacts.addAll(project.getRuntimeArtifacts());
- artifacts.addAll(project.getTestArtifacts());
- for (Artifact artifact : artifacts) {
- String artifactID = id(artifact);
- if (modifiedProjectIDs.contains(artifactID)) {
- getLog().info("Project " + projectID + " depends on modified project " + artifactID + " and will be retested.");
- goals.add("test");
- break;
- }
- }
- }
- }
-
- if (testChanged && goals.isEmpty()) {
- getLog().info("Project " + projectID + " has changed and will be retested.");
- goals.add("test");
- }
-
- if (goals.isEmpty()) {
- if (testMarkerFile.exists()) {
- testFailed = true;
- getLog().info("Project " + projectID + " contains failed tests and will be retested.");
- goals.add("test");
- }
- }
- }
-
- // Invoke Maven with the necessary goals
- if (!goals.isEmpty()) {
- DefaultInvocationRequest request = new DefaultInvocationRequest();
- request.setGoals(goals);
- // FIXME: The maven invoker doesn't handle the directory names with spaces
- // request.setLocalRepositoryDirectory(new File(localRepository.getBasedir()));
- request.setInteractive(false);
- request.setShowErrors(false);
- request.setRecursive(false);
- // request.setDebug(true);
- request.setOffline(settings.isOffline());
- request.setBaseDirectory(project.getBasedir());
- request.setPomFile(project.getFile());
-
- boolean success = false;
- try {
- try {
- InvocationResult result = invoker.execute(request);
-
- CommandLineException cle = result.getExecutionException();
- if (cle != null) {
- throw new MojoExecutionException(cle.getMessage(), cle);
- }
-
- int ec = result.getExitCode();
- if (ec != 0) {
- throw new MojoExecutionException("Maven invocation exit code: " + ec);
- }
-
- success = true;
-
-
-
- } catch (MavenInvocationException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
- } finally {
-
- // Create or delete a .test marker file to keep track of the latest
- // test result status and trigger testing again next time the build
- // is run
- if (!success) {
- try {
- if (!testMarkerFile.exists()) {
- testMarkerFile.createNewFile();
- }
- } catch (IOException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
- } else {
- if (testMarkerFile.exists()) {
- testMarkerFile.delete();
- }
- }
- }
- } else {
- getLog().info("The project is up-to-date. No build is required.");
- }
- }
-
- private File getOutputFile() {
- File basedir = buildDirectory;
- String finalName = project.getBuild().getFinalName();
- String classifier = project.getArtifact().getClassifier();
- if (classifier == null) {
- classifier = "";
- } else if (classifier.trim().length() > 0 && !classifier.startsWith("-")) {
- classifier = "-" + classifier;
- }
-
- String pkg = project.getPackaging();
- if ("maven-plugin".equals(pkg)) {
- pkg = "jar";
- }
- return new File(basedir, finalName + classifier + "." + pkg);
- }
-
- /**
- * Test if any of the resources are stale
- * @param resources
- * @param outputDirectory
- * @return
- * @throws MojoExecutionException
- */
- private boolean areStale(List<Resource> resources, String outputDirectory) throws MojoExecutionException {
-
- for (Resource resource: resources) {
-
- File resourceDirectory = new File(resource.getDirectory());
- if (!resourceDirectory.exists()) {
- continue;
- }
-
- DirectoryScanner scanner = new DirectoryScanner();
-
- scanner.setBasedir(resource.getDirectory());
- if (resource.getIncludes() != null && !resource.getIncludes().isEmpty()) {
- scanner.setIncludes((String[])resource.getIncludes().toArray(new String[]{}));
- } else {
- scanner.setIncludes(new String[]{"**/**"});
- }
- if (resource.getExcludes() != null && !resource.getExcludes().isEmpty()) {
- scanner.setExcludes((String[])resource.getExcludes().toArray(new String[]{}));
- }
-
- scanner.addDefaultExcludes();
- scanner.scan();
-
- List<String> includedFiles = Arrays.asList(scanner.getIncludedFiles());
- String targetPath = resource.getTargetPath();
- for (String source: includedFiles) {
- String target;
- if (source.endsWith(".java")) {
- target = source.substring(0, source.length() - 5) + ".class";
- } else {
- target = source;
- }
-
- String destination;
- if (targetPath != null) {
- destination = targetPath + "/" + target;
- } else {
- destination = target;
- }
-
- File sourceFile = new File(resource.getDirectory(), source);
- File destinationFile = new File(outputDirectory, destination);
-
- if (!destinationFile.exists()) {
- getLog().info("Source file " + sourceFile + ".");
- getLog().info("Target file " + destinationFile + " could not be found.");
- return true;
- } else {
- if (sourceFile.lastModified() > destinationFile.lastModified()) {
- getLog().info("Source file " + sourceFile + " has changed.");
- getLog().info("Target file " + destinationFile + " is stale.");
- return true;
- } else if (sourceFile.lastModified() > outputFile.lastModified()) {
- getLog().info("Source file " + sourceFile + " has changed.");
- getLog().info("Target build output file " + outputFile + " is stale.");
- return true;
- } else if (outputFile.lastModified() == 0) {
- getLog().info("Target build output file " + outputFile + " could not be found.");
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Test if the POM resource is stale.
- *
- * @return
- */
- private boolean isPOMStale() {
- File pom = project.getFile();
- if (pom.lastModified() > outputFile.lastModified()) {
- getLog().info("File " + pom + " has changed.");
- getLog().info("Target build output file " + pom + " is stale.");
- return true;
- } else if (outputFile.lastModified() == 0) {
- getLog().info("Target build output file " + outputFile + " could not be found.");
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Test if the project resources are stale.
- *
- * @return
- * @throws MojoExecutionException
- */
- private boolean areResourcesStale() throws MojoExecutionException {
- return areStale(project.getResources(), project.getBuild().getOutputDirectory());
- }
-
- /**
- * Test if the project sources are stale.
- *
- * @return
- * @throws MojoExecutionException
- */
- private boolean areSourcesStale() throws MojoExecutionException {
- List<Resource> resources = new ArrayList<Resource>();
- for (String root: (List<String>)project.getCompileSourceRoots()) {
- if (new File(root).exists()) {
- Resource resource = new Resource();
- resource.setDirectory(root);
- resource.addInclude("*.java");
- resources.add(resource);
- }
- }
- return areStale(resources, project.getBuild().getOutputDirectory());
- }
-
- /**
- * Tests if the project test resources are stale.
- *
- * @return
- * @throws MojoExecutionException
- */
- private boolean areTestResourcesStale() throws MojoExecutionException {
- return areStale(project.getTestResources(), project.getBuild().getTestOutputDirectory());
- }
-
- /**
- * Tests if the project test sources are stale.
- *
- * @return
- * @throws MojoExecutionException
- */
- private boolean areTestSourcesStale() throws MojoExecutionException {
- List<Resource> resources = new ArrayList<Resource>();
- for (String root: (List<String>)project.getTestCompileSourceRoots()) {
- if (new File(root).exists()) {
- Resource resource = new Resource();
- resource.setDirectory(root);
- resources.add(resource);
- }
- }
- return areStale(resources, project.getBuild().getTestOutputDirectory());
- }
-
- /**
- * Returns the qualified id of a Maven artifact .
- * @param p a Maven artifact
- * @return a qualified id
- */
- private static String id(Artifact a) {
- return a.getGroupId() + ':' + a.getArtifactId();
- }
-
- /**
- * Returns the qualified id of a Maven project.
- * @param p a Maven project
- * @return a qualified id
- */
- private static String id(MavenProject p) {
- return p.getGroupId() + ':' + p.getArtifactId();
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/LICENSE b/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/NOTICE b/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/pom.xml b/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/pom.xml
deleted file mode 100644
index a6ff3f411c..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-maven-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-maven-java2wsdl</artifactId>
- <packaging>maven-plugin</packaging>
- <name>Apache Tuscany SCA Java2WSDL Maven Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-java2wsdl</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/plugin/Java2WSDLGeneratorMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/plugin/Java2WSDLGeneratorMojo.java
deleted file mode 100644
index 620e32a6fd..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/plugin/Java2WSDLGeneratorMojo.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.plugin;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.tuscany.tools.java2wsdl.generate.Java2WSDLGeneratorFactory;
-import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption;
-
-/**
- * @version $Rev$ $Date$
- * @goal generate
- * @phase generate-sources
- * @description Generate WSDL from a given Java class / interface
- */
-public class Java2WSDLGeneratorMojo extends AbstractMojo
-{
-
- /**
- * The name of the class for which the WSDL must be generated
- * @parameter
- *
- */
- private String sourceClassName;
-
- /**
- * The location where the WSDLs should be generated into
- * @parameter expression="${project.build.directory}\\java2wsdl-wsdl"
- */
- private String targetLocation;
-
- /**
- * The name of the WSDL file
- * @parameter
- */
- private String wsdlFilename;
-
-
- /**
- * Classpaths to be included
- * @parameter
- *
- */
- String[] classpaths;
-
- /**
- * The name of the service
- * @parameter
- */
- private String serviceName;
-
- /**
- * The binding style for the service
- * @parameter
- */
- private String bindingStyle;
-
- /**
- * The binding use option
- * @parameter
- */
- private String bindingUse;
-
- /**
- * The soap address
- * @parameter
- */
- private String soapAddress;
-
- public void execute() throws MojoExecutionException
- {
- try
- {
- Java2WSDLGeneratorFactory.getInstance().createGenerator().generateWSDL(createOptionsMap ());
- }
- catch ( Exception e )
- {
- throw new MojoExecutionException("Exception in Java2WSDL Maven Plugin ", e);
- }
- }
-
- protected Map createOptionsMap()
- {
- Map optionsMap = new Hashtable();
-
- optionsMap.put(Java2WSDLConstants.CLASSNAME_OPTION,
- new Java2WSDLCommandLineOption(Java2WSDLConstants.CLASSNAME_OPTION, new String[]{sourceClassName}));
-
- if ( targetLocation != null )
- {
- optionsMap.put(Java2WSDLConstants.OUTPUT_LOCATION_OPTION,
- new Java2WSDLCommandLineOption(Java2WSDLConstants.OUTPUT_LOCATION_OPTION, new String[]{targetLocation}));
- }
-
- if ( wsdlFilename != null )
- {
- optionsMap.put(Java2WSDLConstants.OUTPUT_FILENAME_OPTION,
- new Java2WSDLCommandLineOption(Java2WSDLConstants.OUTPUT_FILENAME_OPTION, new String[]{wsdlFilename}));
- }
-
- if ( classpaths != null && classpaths.length > 0 )
- {
- optionsMap.put(Java2WSDLConstants.CLASSPATH_OPTION,
- new Java2WSDLCommandLineOption(Java2WSDLConstants.CLASSPATH_OPTION, classpaths));
- }
-
- if ( serviceName != null )
- {
- optionsMap.put(Java2WSDLConstants.SERVICE_NAME_OPTION,
- new Java2WSDLCommandLineOption(Java2WSDLConstants.SERVICE_NAME_OPTION, new String[]{serviceName}));
- }
-
- if ( bindingStyle != null )
- {
- optionsMap.put(Java2WSDLConstants.STYLE_OPTION,
- new Java2WSDLCommandLineOption(Java2WSDLConstants.STYLE_OPTION, new String[]{bindingStyle}));
- }
-
- if ( bindingUse != null )
- {
- optionsMap.put(Java2WSDLConstants.USE_OPTION,
- new Java2WSDLCommandLineOption(Java2WSDLConstants.USE_OPTION, new String[]{bindingUse}));
- }
-
- if ( soapAddress != null )
- {
- optionsMap.put(Java2WSDLConstants.LOCATION_OPTION,
- new Java2WSDLCommandLineOption(Java2WSDLConstants.LOCATION_OPTION, new String[]{soapAddress}));
- }
-
- return optionsMap;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/LICENSE b/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/NOTICE b/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/pom.xml b/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/pom.xml
deleted file mode 100644
index 17b1ed337f..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-maven-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-maven-osgi-junit</artifactId>
- <packaging>maven-plugin</packaging>
- <name>Apache Tuscany SCA OSGi JUnit Maven Plugin</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven.surefire</groupId>
- <artifactId>surefire-booter</artifactId>
- <version>2.4.3</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core</artifactId>
- <version>2.0.8</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-toolchain</artifactId>
- <version>1.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/ForkConfiguration.java b/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/ForkConfiguration.java
deleted file mode 100644
index 30282c908b..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/ForkConfiguration.java
+++ /dev/null
@@ -1,239 +0,0 @@
-package org.apache.tuscany.sca.maven.plugin.surefire;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.jar.JarEntry;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-
-import org.apache.maven.surefire.booter.SurefireBooterForkException;
-import org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.cli.Commandline;
-import org.apache.maven.surefire.util.UrlUtils;
-import org.codehaus.plexus.util.StringUtils;
-
-/**
- * Derived from surefire-booter 2.4.3
- * Configuration for forking tests.
- *
- */
-@SuppressWarnings("unchecked")
-public class ForkConfiguration {
- public static final String FORK_ONCE = "once";
-
- public static final String FORK_ALWAYS = "always";
-
- public static final String FORK_NEVER = "never";
-
- private String forkMode;
-
- private boolean useSystemClassLoader;
- private boolean useManifestOnlyJar;
-
- private Properties systemProperties;
-
- private String jvmExecutable;
-
- private String argLine;
-
- private Map environmentVariables;
-
- private File workingDirectory;
-
- private boolean debug;
-
- private String debugLine;
-
- public void setForkMode(String forkMode) {
- if ("pertest".equalsIgnoreCase(forkMode)) {
- this.forkMode = FORK_ALWAYS;
- } else if ("none".equalsIgnoreCase(forkMode)) {
- this.forkMode = FORK_NEVER;
- } else if (forkMode.equals(FORK_NEVER) || forkMode.equals(FORK_ONCE) || forkMode.equals(FORK_ALWAYS)) {
- this.forkMode = forkMode;
- } else {
- throw new IllegalArgumentException("Fork mode " + forkMode + " is not a legal value");
- }
- }
-
- public boolean isForking() {
- return !FORK_NEVER.equals(forkMode);
- }
-
- public void setUseSystemClassLoader(boolean useSystemClassLoader) {
- this.useSystemClassLoader = useSystemClassLoader;
- }
-
- public boolean isUseSystemClassLoader() {
- return useSystemClassLoader;
- }
-
- public void setSystemProperties(Properties systemProperties) {
- this.systemProperties = (Properties)systemProperties.clone();
- }
-
- public void setJvmExecutable(String jvmExecutable) {
- this.jvmExecutable = jvmExecutable;
- }
-
- public void setArgLine(String argLine) {
- this.argLine = argLine;
- }
-
- public void setDebugLine(String debugLine) {
- this.debugLine = debugLine;
- }
-
- public void setEnvironmentVariables(Map environmentVariables) {
- this.environmentVariables = new HashMap(environmentVariables);
- }
-
- public void setWorkingDirectory(File workingDirectory) {
- this.workingDirectory = workingDirectory;
- }
-
- public String getForkMode() {
- return forkMode;
- }
-
- public Properties getSystemProperties() {
- return systemProperties;
- }
-
- /**
- * @throws SurefireBooterForkException
- * @deprecated use the 2-arg alternative.
- */
- public Commandline createCommandLine(List classPath) throws SurefireBooterForkException {
- return createCommandLine(classPath, false);
- }
-
- public Commandline createCommandLine(List classPath, boolean useJar) throws SurefireBooterForkException {
- Commandline cli = new Commandline();
-
- cli.setExecutable(jvmExecutable);
-
- if (argLine != null) {
- cli.createArg().setLine(argLine);
- }
-
- if (environmentVariables != null) {
- Iterator iter = environmentVariables.keySet().iterator();
-
- while (iter.hasNext()) {
- String key = (String)iter.next();
-
- String value = (String)environmentVariables.get(key);
-
- cli.addEnvironment(key, value);
- }
- }
-
- if (debugLine != null && !"".equals(debugLine)) {
- cli.createArg().setLine(debugLine);
- }
-
- if (useJar) {
- File jarFile;
- try {
- jarFile = createJar(classPath);
- } catch (IOException e) {
- throw new SurefireBooterForkException("Error creating archive file", e);
- }
-
- cli.createArg().setValue("-jar");
-
- cli.createArg().setValue(jarFile.getAbsolutePath());
- } else {
- cli.createArg().setValue("-classpath");
-
- cli.createArg().setValue(StringUtils.join(classPath.iterator(), File.pathSeparator));
-
- cli.createArg().setValue(OSGiSurefireBooter.class.getName());
- }
-
- cli.setWorkingDirectory(workingDirectory.getAbsolutePath());
-
- return cli;
- }
-
- /**
- * Create a jar with just a manifest containing a Main-Class entry for SurefireBooter and a Class-Path entry
- * for all classpath elements.
- *
- * @param classPath List&lt;String> of all classpath elements.
- * @return
- * @throws IOException
- */
- private File createJar(List classPath) throws IOException {
- File file = File.createTempFile("surefirebooter", ".jar");
- if (!debug) {
- file.deleteOnExit();
- }
- FileOutputStream fos = new FileOutputStream(file);
- JarOutputStream jos = new JarOutputStream(fos);
- jos.setLevel(JarOutputStream.STORED);
- JarEntry je = new JarEntry("META-INF/MANIFEST.MF");
- jos.putNextEntry(je);
-
- Manifest man = new Manifest();
-
- // we can't use StringUtils.join here since we need to add a '/' to
- // the end of directory entries - otherwise the jvm will ignore them.
- String cp = "";
- for (Iterator it = classPath.iterator(); it.hasNext();) {
- String el = (String)it.next();
- // NOTE: if File points to a directory, this entry MUST end in '/'.
- cp += UrlUtils.getURL(new File(el)).toExternalForm() + " ";
- }
-
- man.getMainAttributes().putValue("Manifest-Version", "1.0");
- man.getMainAttributes().putValue("Class-Path", cp.trim());
- man.getMainAttributes().putValue("Main-Class", OSGiSurefireBooter.class.getName());
-
- man.write(jos);
- jos.close();
-
- return file;
- }
-
- public void setDebug(boolean debug) {
- this.debug = debug;
- }
-
- public boolean isDebug() {
- return debug;
- }
-
- public void setUseManifestOnlyJar(boolean useManifestOnlyJar) {
- this.useManifestOnlyJar = useManifestOnlyJar;
- }
-
- public boolean isUseManifestOnlyJar() {
- return useManifestOnlyJar;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/OSGiSurefireBooter.java b/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/OSGiSurefireBooter.java
deleted file mode 100644
index 2bc14d4241..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/OSGiSurefireBooter.java
+++ /dev/null
@@ -1,984 +0,0 @@
-package org.apache.tuscany.sca.maven.plugin.surefire;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.apache.maven.surefire.Surefire;
-import org.apache.maven.surefire.booter.SurefireBooterForkException;
-import org.apache.maven.surefire.booter.SurefireExecutionException;
-import org.apache.maven.surefire.booter.output.FileOutputConsumerProxy;
-import org.apache.maven.surefire.booter.output.ForkingStreamConsumer;
-import org.apache.maven.surefire.booter.output.OutputConsumer;
-import org.apache.maven.surefire.booter.output.StandardOutputConsumer;
-import org.apache.maven.surefire.booter.output.SupressFooterOutputConsumerProxy;
-import org.apache.maven.surefire.booter.output.SupressHeaderOutputConsumerProxy;
-import org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.IOUtil;
-import org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.StringUtils;
-import org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.cli.Commandline;
-import org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.cli.StreamConsumer;
-import org.apache.maven.surefire.testset.TestSetFailedException;
-import org.apache.maven.surefire.util.NestedRuntimeException;
-import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * Derived from surefire-booter 2.4.3
- */
-public class OSGiSurefireBooter {
- private static final String TEST_SUITE_PROPERTY_PREFIX = "testSuite.";
- private static final String REPORT_PROPERTY_PREFIX = "report.";
- private static final String PARAMS_SUFIX = ".params";
- private static final String TYPES_SUFIX = ".types";
-
- /**
- * A classloader that delegates an OSGi bundle
- */
- static class BundleClassLoader extends ClassLoader {
- private Bundle bundle;
-
- public BundleClassLoader(Bundle bundle, ClassLoader parent) {
- super(parent);
- 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 {
- return bundle.getResources(name);
- }
-
- }
-
- private List reports = new ArrayList();
-
- /**
- * Test classpath
- */
- private List classPathUrls = new ArrayList();
-
- /**
- * surefire provider classpath
- */
- private List surefireClassPathUrls = new ArrayList();
-
- /**
- * surefire boot classpath
- */
- private List surefireBootClassPathUrls = new ArrayList();
-
- private List testSuites = new ArrayList();
-
- private boolean failIfNoTests = false;
-
- private int forkedProcessTimeoutInSeconds = 0;
-
- private boolean redirectTestOutputToFile = false;
-
- // ----------------------------------------------------------------------
- //
- // ----------------------------------------------------------------------
-
- private ForkConfiguration forkConfiguration;
-
- public static final int TESTS_SUCCEEDED_EXIT_CODE = 0;
-
- public static final int TESTS_FAILED_EXIT_CODE = 255;
-
- public static final int NO_TESTS_EXIT_CODE = 254;
-
- private static Method assertionStatusMethod;
-
- /**
- * @deprecated because the OSGi classloader is really isolated - no parent.
- */
- private boolean childDelegation = true;
-
- private File reportsDirectory;
-
- /**
- * This field is set to true if it's running from main. It's used to help decide what classloader to use.
- */
- private final boolean isForked;
-
- /**
- * Whether to enable assertions or not (can be affected by the fork arguments, and the ability to do so based on the
- * JVM).
- */
- private boolean enableAssertions;
-
- static {
- try {
- assertionStatusMethod =
- ClassLoader.class.getMethod("setDefaultAssertionStatus", new Class[] {boolean.class});
- } catch (NoSuchMethodException e) {
- assertionStatusMethod = null;
- }
- }
-
- public OSGiSurefireBooter() {
- isForked = false;
- }
-
- private OSGiSurefireBooter(boolean isForked) {
- this.isForked = isForked;
- }
-
- // ----------------------------------------------------------------------
- // Accessors
- // ----------------------------------------------------------------------
-
- public void addReport(String report) {
- addReport(report, null);
- }
-
- public void addReport(String report, Object[] constructorParams) {
- reports.add(new Object[] {report, constructorParams});
- }
-
- public void addTestSuite(String suiteClassName, Object[] constructorParams) {
- testSuites.add(new Object[] {suiteClassName, constructorParams});
- }
-
- public void addClassPathUrl(String path) {
- if (!classPathUrls.contains(path)) {
- classPathUrls.add(path);
- }
- }
-
- public void addSurefireClassPathUrl(String path) {
- if (!surefireClassPathUrls.contains(path)) {
- surefireClassPathUrls.add(path);
- }
- }
-
- public void addSurefireBootClassPathUrl(String path) {
- if (!surefireBootClassPathUrls.contains(path)) {
- surefireBootClassPathUrls.add(path);
- }
- }
-
- /**
- * Setting this to true will cause a failure if there are no tests to run
- *
- * @param redirectTestOutputToFile
- */
- public void setFailIfNoTests(boolean failIfNoTests) {
- this.failIfNoTests = failIfNoTests;
- }
-
- /**
- * When forking, setting this to true will make the test output to be saved in a file instead of showing it on the
- * standard output
- *
- * @param redirectTestOutputToFile
- */
- public void setRedirectTestOutputToFile(boolean redirectTestOutputToFile) {
- this.redirectTestOutputToFile = redirectTestOutputToFile;
- }
-
- /**
- * Set the directory where reports will be saved
- *
- * @param reportsDirectory the directory
- */
- public void setReportsDirectory(File reportsDirectory) {
- this.reportsDirectory = reportsDirectory;
- }
-
- /**
- * Get the directory where reports will be saved
- */
- public File getReportsDirectory() {
- return reportsDirectory;
- }
-
- public void setForkConfiguration(ForkConfiguration forkConfiguration) {
- this.forkConfiguration = forkConfiguration;
- }
-
- public boolean isForking() {
- return forkConfiguration.isForking();
- }
-
- public int run() throws SurefireBooterForkException, SurefireExecutionException {
- int result;
-
- if (ForkConfiguration.FORK_NEVER.equals(forkConfiguration.getForkMode())) {
- result = runSuitesInProcess();
- } else if (ForkConfiguration.FORK_ONCE.equals(forkConfiguration.getForkMode())) {
- result = runSuitesForkOnce();
- } else if (ForkConfiguration.FORK_ALWAYS.equals(forkConfiguration.getForkMode())) {
- result = runSuitesForkPerTestSet();
- } else {
- throw new SurefireExecutionException("Unknown forkmode: " + forkConfiguration.getForkMode(), null);
- }
- return result;
- }
-
- private int runSuitesInProcess(String testSet, Properties results) throws SurefireExecutionException {
- if (testSuites.size() != 1) {
- throw new IllegalArgumentException("Cannot only specify testSet for single test suites");
- }
-
- // TODO: replace with plexus
-
- // noinspection CatchGenericClass,OverlyBroadCatchBlock
- ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
- start();
- try {
- ClassLoader testsClassLoader =
- useSystemClassLoader() ? ClassLoader.getSystemClassLoader() : createClassLoader(classPathUrls,
- null,
- childDelegation);
-
- // TODO: assertions = true shouldn't be required for this CL if we had proper separation (see TestNG)
- ClassLoader surefireClassLoader = createClassLoader(surefireClassPathUrls, testsClassLoader);
-
- Class surefireClass = surefireClassLoader.loadClass(Surefire.class.getName());
-
- Object surefire = surefireClass.newInstance();
-
- Method run =
- surefireClass.getMethod("run", new Class[] {List.class, Object[].class, String.class,
- ClassLoader.class, ClassLoader.class, Properties.class,
- Boolean.class});
-
- Thread.currentThread().setContextClassLoader(testsClassLoader);
-
- Integer result =
- (Integer)run.invoke(surefire, new Object[] {reports, testSuites.get(0), testSet, surefireClassLoader,
- testsClassLoader, results, new Boolean(failIfNoTests)});
-
- return result.intValue();
- } catch (InvocationTargetException e) {
- throw new SurefireExecutionException(e.getTargetException().getMessage(), e.getTargetException());
- } catch (Exception e) {
- throw new SurefireExecutionException("Unable to instantiate and execute Surefire", e);
- } finally {
- stop();
- Thread.currentThread().setContextClassLoader(oldContextClassLoader);
- }
- }
-
- private int runSuitesInProcess() throws SurefireExecutionException {
- // TODO: replace with plexus
-
- // noinspection CatchGenericClass,OverlyBroadCatchBlock
- ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
- start();
-
- try {
- // The test classloader must be constructed first to avoid issues with commons-logging until we properly
- // separate the TestNG classloader
- ClassLoader testsClassLoader;
- String testClassPath = getTestClassPathAsString();
- System.setProperty("surefire.test.class.path", testClassPath);
- if (useManifestOnlyJar()) {
- // testsClassLoader = getClass().getClassLoader(); // ClassLoader.getSystemClassLoader()
- testsClassLoader = createClassLoader(classPathUrls, null, childDelegation);
- // SUREFIRE-459, trick the app under test into thinking its classpath was conventional (instead of a single manifest-only jar)
- System.setProperty("surefire.real.class.path", System.getProperty("java.class.path"));
- System.setProperty("java.class.path", testClassPath);
- } else {
- testsClassLoader = createClassLoader(classPathUrls, null, childDelegation);
- }
-
- ClassLoader surefireClassLoader = createClassLoader(surefireClassPathUrls, testsClassLoader);
-
- Class surefireClass = surefireClassLoader.loadClass(Surefire.class.getName());
-
- Object surefire = surefireClass.newInstance();
-
- Method run =
- surefireClass.getMethod("run", new Class[] {List.class, List.class, ClassLoader.class,
- ClassLoader.class, Boolean.class});
-
- Thread.currentThread().setContextClassLoader(testsClassLoader);
-
- Integer result =
- (Integer)run.invoke(surefire, new Object[] {reports, testSuites, surefireClassLoader, testsClassLoader,
- new Boolean(failIfNoTests)});
-
- return result.intValue();
- } catch (InvocationTargetException e) {
- throw new SurefireExecutionException(e.getTargetException().getMessage(), e.getTargetException());
- } catch (Exception e) {
- throw new SurefireExecutionException("Unable to instantiate and execute Surefire", e);
- } finally {
- stop();
- Thread.currentThread().setContextClassLoader(oldContextClassLoader);
- }
- }
-
- private String getTestClassPathAsString() {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < classPathUrls.size(); i++) {
- sb.append(classPathUrls.get(i)).append(File.pathSeparatorChar);
- }
- return sb.toString();
- }
-
- private int runSuitesForkOnce() throws SurefireBooterForkException {
- return forkSuites(testSuites, true, true);
- }
-
- private int runSuitesForkPerTestSet() throws SurefireBooterForkException {
- ClassLoader testsClassLoader;
- ClassLoader surefireClassLoader;
- try {
- testsClassLoader = createClassLoader(classPathUrls, null, false);
- // TODO: assertions = true shouldn't be required if we had proper separation (see TestNG)
- surefireClassLoader = createClassLoader(surefireClassPathUrls, testsClassLoader, false);
- } catch (MalformedURLException e) {
- throw new SurefireBooterForkException("Unable to create classloader to find test suites", e);
- }
-
- int globalResult = 0;
-
- boolean showHeading = true;
- Properties properties = new Properties();
- for (Iterator i = testSuites.iterator(); i.hasNext();) {
- Object[] testSuite = (Object[])i.next();
-
- Map testSets = getTestSets(testSuite, testsClassLoader, surefireClassLoader);
-
- for (Iterator j = testSets.keySet().iterator(); j.hasNext();) {
- Object testSet = j.next();
- boolean showFooter = !j.hasNext() && !i.hasNext();
- int result = forkSuite(testSuite, testSet, showHeading, showFooter, properties);
- if (result > globalResult) {
- globalResult = result;
- }
- showHeading = false;
- }
- }
-
- return globalResult;
- }
-
- private Map getTestSets(Object[] testSuite, ClassLoader testsClassLoader, ClassLoader surefireClassLoader)
- throws SurefireBooterForkException {
- String className = (String)testSuite[0];
-
- Object[] params = (Object[])testSuite[1];
-
- Object suite;
- try {
- suite = Surefire.instantiateObject(className, params, surefireClassLoader);
- } catch (TestSetFailedException e) {
- throw new SurefireBooterForkException(e.getMessage(), e.getCause());
- } catch (ClassNotFoundException e) {
- throw new SurefireBooterForkException("Unable to find class for test suite '" + className + "'", e);
- } catch (NoSuchMethodException e) {
- throw new SurefireBooterForkException("Unable to find appropriate constructor for test suite '" + className
- + "': "
- + e.getMessage(), e);
- }
-
- Map testSets;
- try {
- Method m = suite.getClass().getMethod("locateTestSets", new Class[] {ClassLoader.class});
-
- testSets = (Map)m.invoke(suite, new Object[] {testsClassLoader});
- } catch (IllegalAccessException e) {
- throw new SurefireBooterForkException("Error obtaining test sets", e);
- } catch (NoSuchMethodException e) {
- throw new SurefireBooterForkException("Error obtaining test sets", e);
- } catch (InvocationTargetException e) {
- throw new SurefireBooterForkException(e.getTargetException().getMessage(), e.getTargetException());
- }
- return testSets;
- }
-
- private int forkSuites(List testSuites, boolean showHeading, boolean showFooter) throws SurefireBooterForkException {
- Properties properties = new Properties();
-
- setForkProperties(testSuites, properties);
-
- return fork(properties, showHeading, showFooter);
- }
-
- private int forkSuite(Object[] testSuite,
- Object testSet,
- boolean showHeading,
- boolean showFooter,
- Properties properties) throws SurefireBooterForkException {
- setForkProperties(Collections.singletonList(testSuite), properties);
-
- if (testSet instanceof String) {
- properties.setProperty("testSet", (String)testSet);
- }
-
- return fork(properties, showHeading, showFooter);
- }
-
- private void setForkProperties(List testSuites, Properties properties) {
- addPropertiesForTypeHolder(reports, properties, REPORT_PROPERTY_PREFIX);
- addPropertiesForTypeHolder(testSuites, properties, TEST_SUITE_PROPERTY_PREFIX);
-
- for (int i = 0; i < classPathUrls.size(); i++) {
- String url = (String)classPathUrls.get(i);
- properties.setProperty("classPathUrl." + i, url);
- }
-
- for (int i = 0; i < surefireClassPathUrls.size(); i++) {
- String url = (String)surefireClassPathUrls.get(i);
- properties.setProperty("surefireClassPathUrl." + i, url);
- }
-
- properties.setProperty("childDelegation", String.valueOf(childDelegation));
- properties.setProperty("enableAssertions", String.valueOf(enableAssertions));
- properties.setProperty("useSystemClassLoader", String.valueOf(useSystemClassLoader()));
- properties.setProperty("useManifestOnlyJar", String.valueOf(useManifestOnlyJar()));
- properties.setProperty("failIfNoTests", String.valueOf(failIfNoTests));
- properties.setProperty("mainBundleName", mainBundleName);
- }
-
- private File writePropertiesFile(String name, Properties properties) throws IOException {
- File file = File.createTempFile(name, "tmp");
- if (!forkConfiguration.isDebug()) {
- file.deleteOnExit();
- }
-
- writePropertiesFile(file, name, properties);
-
- return file;
- }
-
- private void writePropertiesFile(File file, String name, Properties properties) throws IOException {
- FileOutputStream out = new FileOutputStream(file);
-
- try {
- properties.store(out, name);
- } finally {
- IOUtil.close(out);
- }
- }
-
- private void addPropertiesForTypeHolder(List typeHolderList, Properties properties, String propertyPrefix) {
- for (int i = 0; i < typeHolderList.size(); i++) {
- Object[] report = (Object[])typeHolderList.get(i);
-
- String className = (String)report[0];
- Object[] params = (Object[])report[1];
-
- properties.setProperty(propertyPrefix + i, className);
-
- if (params != null) {
- String paramProperty = convert(params[0]);
- String typeProperty = params[0].getClass().getName();
- for (int j = 1; j < params.length; j++) {
- paramProperty += "|";
- typeProperty += "|";
- if (params[j] != null) {
- paramProperty += convert(params[j]);
- typeProperty += params[j].getClass().getName();
- }
- }
- properties.setProperty(propertyPrefix + i + PARAMS_SUFIX, paramProperty);
- properties.setProperty(propertyPrefix + i + TYPES_SUFIX, typeProperty);
- }
- }
- }
-
- private static String convert(Object param) {
- if (param instanceof File[]) {
- File[] files = (File[])param;
- return "[" + StringUtils.join(files, ",") + "]";
- } else if (param instanceof Properties) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- try {
- ((Properties)param).store(baos, "");
- return new String(baos.toByteArray(), "8859_1");
- } catch (Exception e) {
- throw new RuntimeException("bug in property conversion", e);
- }
- } else {
- return param.toString();
- }
- }
-
- private final boolean useSystemClassLoader() {
- return forkConfiguration.isUseSystemClassLoader() && (isForked || forkConfiguration.isForking());
- }
-
- private final boolean useManifestOnlyJar() {
- return forkConfiguration.isUseSystemClassLoader() && forkConfiguration.isUseManifestOnlyJar();
- }
-
- private int fork(Properties properties, boolean showHeading, boolean showFooter) throws SurefireBooterForkException {
- File surefireProperties;
- File systemProperties = null;
- try {
- surefireProperties = writePropertiesFile("surefire", properties);
- if (forkConfiguration.getSystemProperties() != null) {
- systemProperties = writePropertiesFile("surefire", forkConfiguration.getSystemProperties());
- }
- } catch (IOException e) {
- throw new SurefireBooterForkException("Error creating properties files for forking", e);
- }
-
- /*
- System.out.println("cp: " + classPathUrls);
- System.out.println("scp: " + surefireClassPathUrls);
- System.out.println("sbcp: " + surefireBootClassPathUrls);
- */
-
- List bootClasspath = new ArrayList(surefireBootClassPathUrls.size() + classPathUrls.size());
-
- bootClasspath.addAll(surefireBootClassPathUrls);
-
- if (useSystemClassLoader()) {
- bootClasspath.addAll(classPathUrls);
- }
-
- Commandline cli =
- forkConfiguration.createCommandLine(bootClasspath, useManifestOnlyJar());
-
- cli.createArg().setFile(surefireProperties);
-
- if (systemProperties != null) {
- cli.createArg().setFile(systemProperties);
- }
-
- ForkingStreamConsumer out = getForkingStreamConsumer(showHeading, showFooter, redirectTestOutputToFile);
-
- StreamConsumer err;
-
- if (redirectTestOutputToFile) {
- err = out;
- } else {
- err = getForkingStreamConsumer(showHeading, showFooter, redirectTestOutputToFile);
- }
-
- if (forkConfiguration.isDebug()) {
- System.out.println("Forking command line: " + cli);
- }
-
- int returnCode;
-
- try {
- returnCode =
- org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.cli.CommandLineUtils
- .executeCommandLine(cli, out, err, forkedProcessTimeoutInSeconds);
- } catch (org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.cli.CommandLineException e) {
- throw new SurefireBooterForkException("Error while executing forked tests.", e);
- }
-
- if (redirectTestOutputToFile) {
- // ensure the FileOutputConsumerProxy flushes/closes the output file
- try {
- out.getOutputConsumer().testSetCompleted();
- } catch (Exception e) {
- // the FileOutputConsumerProxy might throw an IllegalStateException but that's not of interest now
- }
- }
-
- if (surefireProperties != null && surefireProperties.exists()) {
- FileInputStream inStream = null;
- try {
- inStream = new FileInputStream(surefireProperties);
-
- properties.load(inStream);
- } catch (FileNotFoundException e) {
- throw new SurefireBooterForkException("Unable to reload properties file from forked process", e);
- } catch (IOException e) {
- throw new SurefireBooterForkException("Unable to reload properties file from forked process", e);
- } finally {
- IOUtil.close(inStream);
- }
- }
-
- return returnCode;
- }
-
- private ClassLoader createClassLoader(List classPathUrls, ClassLoader parent) throws MalformedURLException {
- return createClassLoader(classPathUrls, parent, false);
- }
-
- private ClassLoader createClassLoader(List classPathUrls, ClassLoader parent, boolean childDelegation)
- throws MalformedURLException {
- Set<URL> urls = new HashSet<URL>();
-
- for (Iterator i = classPathUrls.iterator(); i.hasNext();) {
- String url = (String)i.next();
-
- if (url != null) {
- File f = new File(url);
- urls.add(f.toURI().toURL());
- }
- }
- return bundleClassLoader;
- }
-
- private static List processStringList(String stringList) {
- String sl = stringList;
-
- if (sl.startsWith("[") && sl.endsWith("]")) {
- sl = sl.substring(1, sl.length() - 1);
- }
-
- List list = new ArrayList();
-
- String[] stringArray = StringUtils.split(sl, ",");
-
- for (int i = 0; i < stringArray.length; i++) {
- list.add(stringArray[i].trim());
- }
- return list;
- }
-
- private static Properties loadProperties(File file) throws IOException {
- Properties p = new Properties();
-
- if (file != null && file.exists()) {
- FileInputStream inStream = new FileInputStream(file);
- try {
- p.load(inStream);
- } finally {
- IOUtil.close(inStream);
- }
- }
-
- return p;
- }
-
- private static void setSystemProperties(File file) throws IOException {
- Properties p = loadProperties(file);
-
- for (Iterator i = p.keySet().iterator(); i.hasNext();) {
- String key = (String)i.next();
-
- System.setProperty(key, p.getProperty(key));
- }
- }
-
- private static Object[] constructParamObjects(String paramProperty, String typeProperty) {
- Object[] paramObjects = null;
- if (paramProperty != null) {
- // bit of a glitch that it need sto be done twice to do an odd number of vertical bars (eg |||, |||||).
- String[] params =
- StringUtils.split(StringUtils.replace(StringUtils.replace(paramProperty, "||", "| |"), "||", "| |"),
- "|");
- String[] types =
- StringUtils
- .split(StringUtils.replace(StringUtils.replace(typeProperty, "||", "| |"), "||", "| |"), "|");
-
- paramObjects = new Object[params.length];
-
- for (int i = 0; i < types.length; i++) {
- if (types[i].trim().length() == 0) {
- params[i] = null;
- } else if (types[i].equals(String.class.getName())) {
- paramObjects[i] = params[i];
- } else if (types[i].equals(File.class.getName())) {
- paramObjects[i] = new File(params[i]);
- } else if (types[i].equals(File[].class.getName())) {
- List stringList = processStringList(params[i]);
- File[] fileList = new File[stringList.size()];
- for (int j = 0; j < stringList.size(); j++) {
- fileList[j] = new File((String)stringList.get(j));
- }
- paramObjects[i] = fileList;
- } else if (types[i].equals(ArrayList.class.getName())) {
- paramObjects[i] = processStringList(params[i]);
- } else if (types[i].equals(Boolean.class.getName())) {
- paramObjects[i] = Boolean.valueOf(params[i]);
- } else if (types[i].equals(Integer.class.getName())) {
- paramObjects[i] = Integer.valueOf(params[i]);
- } else if (types[i].equals(Properties.class.getName())) {
- final Properties result = new Properties();
- final String value = params[i];
- try {
- ByteArrayInputStream bais = new ByteArrayInputStream(value.getBytes("8859_1"));
- result.load(bais);
- } catch (Exception e) {
- throw new RuntimeException("bug in property conversion", e);
- }
- paramObjects[i] = result;
- } else {
- // TODO: could attempt to construct with a String constructor if needed
- throw new IllegalArgumentException("Unknown parameter type: " + types[i]);
- }
- }
- }
- return paramObjects;
- }
-
- /**
- * This method is invoked when Surefire is forked - this method parses and organizes the arguments passed to it and
- * then calls the Surefire class' run method. <p/> The system exit code will be 1 if an exception is thrown.
- *
- * @param args
- */
- public static void main(String[] args) throws Throwable {
- // noinspection CatchGenericClass,OverlyBroadCatchBlock
- try {
- if (args.length > 1) {
- setSystemProperties(new File(args[1]));
- }
-
- File surefirePropertiesFile = new File(args[0]);
- Properties p = loadProperties(surefirePropertiesFile);
-
- SortedMap classPathUrls = new TreeMap();
-
- SortedMap surefireClassPathUrls = new TreeMap();
-
- OSGiSurefireBooter surefireBooter = new OSGiSurefireBooter(true);
-
- ForkConfiguration forkConfiguration = new ForkConfiguration();
- forkConfiguration.setForkMode("never");
- surefireBooter.setForkConfiguration(forkConfiguration);
-
- for (Enumeration e = p.propertyNames(); e.hasMoreElements();) {
- String name = (String)e.nextElement();
-
- if (name.startsWith(REPORT_PROPERTY_PREFIX) && !name.endsWith(PARAMS_SUFIX)
- && !name.endsWith(TYPES_SUFIX)) {
- String className = p.getProperty(name);
-
- String params = p.getProperty(name + PARAMS_SUFIX);
- String types = p.getProperty(name + TYPES_SUFIX);
- surefireBooter.addReport(className, constructParamObjects(params, types));
- } else if (name.startsWith(TEST_SUITE_PROPERTY_PREFIX) && !name.endsWith(PARAMS_SUFIX)
- && !name.endsWith(TYPES_SUFIX)) {
- String className = p.getProperty(name);
-
- String params = p.getProperty(name + PARAMS_SUFIX);
- String types = p.getProperty(name + TYPES_SUFIX);
- surefireBooter.addTestSuite(className, constructParamObjects(params, types));
- } else if (name.startsWith("classPathUrl.")) {
- classPathUrls.put(Integer.valueOf(name.substring(name.indexOf('.') + 1)), p.getProperty(name));
- } else if (name.startsWith("surefireClassPathUrl.")) {
- surefireClassPathUrls.put(Integer.valueOf(name.substring(name.indexOf('.') + 1)), p
- .getProperty(name));
- } else if (name.startsWith("surefireBootClassPathUrl.")) {
- surefireBooter.addSurefireBootClassPathUrl(p.getProperty(name));
- } else if ("childDelegation".equals(name)) {
- surefireBooter.childDelegation = Boolean.valueOf(p.getProperty("childDelegation")).booleanValue();
- } else if ("enableAssertions".equals(name)) {
- surefireBooter.enableAssertions = Boolean.valueOf(p.getProperty("enableAssertions")).booleanValue();
- } else if ("useSystemClassLoader".equals(name)) {
- surefireBooter.forkConfiguration.setUseSystemClassLoader(Boolean.valueOf(p
- .getProperty("useSystemClassLoader")).booleanValue());
- } else if ("useManifestOnlyJar".equals(name)) {
- surefireBooter.forkConfiguration.setUseManifestOnlyJar(Boolean.valueOf(p
- .getProperty("useManifestOnlyJar")).booleanValue());
- } else if ("failIfNoTests".equals(name)) {
- surefireBooter.setFailIfNoTests(Boolean.valueOf(p.getProperty("failIfNoTests")).booleanValue());
- } else if ("mainBundleName".equals(name)) {
- surefireBooter.setMainBundleName(p.getProperty("mainBundleName"));
- }
- }
-
- for (Iterator cpi = classPathUrls.keySet().iterator(); cpi.hasNext();) {
- String url = (String)classPathUrls.get(cpi.next());
- surefireBooter.addClassPathUrl(url);
- }
-
- for (Iterator scpi = surefireClassPathUrls.keySet().iterator(); scpi.hasNext();) {
- String url = (String)surefireClassPathUrls.get(scpi.next());
- surefireBooter.addSurefireClassPathUrl(url);
- }
-
- String testSet = p.getProperty("testSet");
- int result;
- if (testSet != null) {
- result = surefireBooter.runSuitesInProcess(testSet, p);
- } else {
- result = surefireBooter.runSuitesInProcess();
- }
-
- surefireBooter.writePropertiesFile(surefirePropertiesFile, "surefire", p);
-
- // noinspection CallToSystemExit
- System.exit(result);
- } catch (Throwable t) {
- // Just throwing does getMessage() and a local trace - we want to call printStackTrace for a full trace
- // noinspection UseOfSystemOutOrSystemErr
- t.printStackTrace(System.err);
- // noinspection ProhibitedExceptionThrown,CallToSystemExit
- System.exit(1);
- }
- }
-
- public void setChildDelegation(boolean childDelegation) {
- this.childDelegation = childDelegation;
- }
-
- private ForkingStreamConsumer getForkingStreamConsumer(boolean showHeading,
- boolean showFooter,
- boolean redirectTestOutputToFile) {
- OutputConsumer outputConsumer = new StandardOutputConsumer();
-
- if (redirectTestOutputToFile) {
- outputConsumer = new FileOutputConsumerProxy(outputConsumer, getReportsDirectory());
- }
-
- if (!showHeading) {
- outputConsumer = new SupressHeaderOutputConsumerProxy(outputConsumer);
- }
- if (!showFooter) {
- outputConsumer = new SupressFooterOutputConsumerProxy(outputConsumer);
- }
-
- return new ForkingStreamConsumer(outputConsumer);
- }
-
- public void setEnableAssertions(boolean enableAssertions) {
- this.enableAssertions = enableAssertions;
- }
-
- public void setForkedProcessTimeoutInSeconds(int forkedProcessTimeoutInSeconds) {
- this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds;
- }
-
- private String mainBundleName;
-
- public void setMainBundleName(String mainBundleName) {
- this.mainBundleName = mainBundleName;
- }
-
- private EquinoxHost host;
- private BundleClassLoader bundleClassLoader;
-
- public EquinoxHost start() {
- Set<URL> urls = new HashSet<URL>();
-
- // Merge the two classpaths so that all of them will be OSGi-enabled
- Set<String> cps = new HashSet<String>(classPathUrls);
- cps.addAll(surefireClassPathUrls);
-
- for (String url: cps) {
- if (url != null) {
- File f = new File(url);
- try {
- urls.add(f.toURI().toURL());
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- }
- }
-
- host = new EquinoxHost(urls);
- BundleContext context = host.start();
- Bundle mainBundle = null;
- for (Bundle bundle : context.getBundles()) {
- // Fragement bundle cannot be used to load class, use the main bundle
- if (mainBundleName.equals(bundle.getSymbolicName())) {
- mainBundle = bundle;
- break;
- }
- }
-
- bundleClassLoader = new BundleClassLoader(mainBundle, null);
- if (assertionStatusMethod != null) {
- try {
- Object[] args = new Object[] {enableAssertions ? Boolean.TRUE : Boolean.FALSE};
- assertionStatusMethod.invoke(bundleClassLoader, args);
- } catch (IllegalAccessException e) {
- throw new NestedRuntimeException("Unable to access the assertion enablement method", e);
- } catch (InvocationTargetException e) {
- throw new NestedRuntimeException("Unable to invoke the assertion enablement method", e);
- }
- }
-
- return host;
- }
-
- public void stop() {
- if (host != null) {
- host.stop();
- host = null;
- bundleClassLoader = null;
- }
- }
-
- /**
- * Returns a string representation of the given bundle.
- *
- * @param b
- * @param verbose
- * @return
- */
- static String string(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();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/OSGiSurefirePlugin.java b/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/OSGiSurefirePlugin.java
deleted file mode 100644
index 89cfdc38b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/maven/plugin/surefire/OSGiSurefirePlugin.java
+++ /dev/null
@@ -1,1306 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.maven.plugin.surefire;
-
-import static org.osgi.framework.Constants.BUNDLE_MANIFESTVERSION;
-import static org.osgi.framework.Constants.BUNDLE_NAME;
-import static org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME;
-import static org.osgi.framework.Constants.BUNDLE_VERSION;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.ArtifactUtils;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
-import org.apache.maven.artifact.versioning.ArtifactVersion;
-import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.execution.MavenSession;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.surefire.booter.SurefireBooterForkException;
-import org.apache.maven.surefire.booter.SurefireExecutionException;
-import org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.StringUtils;
-import org.apache.maven.surefire.report.BriefConsoleReporter;
-import org.apache.maven.surefire.report.BriefFileReporter;
-import org.apache.maven.surefire.report.ConsoleReporter;
-import org.apache.maven.surefire.report.DetailedConsoleReporter;
-import org.apache.maven.surefire.report.FileReporter;
-import org.apache.maven.surefire.report.ForkingConsoleReporter;
-import org.apache.maven.surefire.report.XMLReporter;
-import org.apache.maven.toolchain.Toolchain;
-import org.apache.maven.toolchain.ToolchainManager;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Version;
-
-/**
- * Derived from maven-surefire-plugin 2.4.3
- * Run tests using Surefire.
- *
- * @requiresDependencyResolution test
- * @goal test
- * @phase test
- */
-public class OSGiSurefirePlugin extends AbstractMojo {
-
- /**
- * Set this to 'true' to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite
- * convenient on occasion.
- *
- * @parameter expression="${skipTests}"
- * @since 2.4
- */
- protected boolean skipTests;
-
- /**
- * DEPRECATED This old parameter is just like skipTests, but bound to the old property maven.test.skip.exec.
- * Use -DskipTests instead; it's shorter.
- *
- * @deprecated
- * @parameter expression="${maven.test.skip.exec}"
- * @since 2.3
- */
- protected boolean skipExec;
-
- /**
- * Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, especially if you
- * enable it using the "maven.test.skip" property, because maven.test.skip disables both running the
- * tests and compiling the tests. Consider using the skipTests parameter instead.
- *
- * @parameter expression="${maven.test.skip}"
- */
- protected boolean skip;
-
- /**
- * Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on
- * occasion.
- *
- * @parameter expression="${maven.test.failure.ignore}"
- */
- protected boolean testFailureIgnore;
-
- /**
- * The base directory of the project being tested. This can be obtained in your unit test by
- * System.getProperty("basedir").
- *
- * @parameter expression="${basedir}"
- * @required
- */
- protected File basedir;
-
- /**
- * The directory containing generated test classes of the project being tested.
- *
- * @parameter expression="${project.build.testOutputDirectory}"
- * @required
- */
- protected File testClassesDirectory;
-
- /**
- * The directory containing generated classes of the project being tested.
- *
- * @parameter expression="${project.build.outputDirectory}"
- * @required
- */
- protected File classesDirectory;
-
- /**
- * The Maven Project Object
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- protected MavenProject project;
-
- /**
- * The classpath elements of the project being tested.
- *
- * @parameter expression="${project.testClasspathElements}"
- * @required
- * @readonly
- */
- protected List classpathElements;
-
- /**
- * Additional elements to be appended to the classpath.
- *
- * @parameter
- * @since 2.4
- */
- protected List additionalClasspathElements;
-
- /**
- * Base directory where all reports are written to.
- *
- * @parameter expression="${project.build.directory}/surefire-osgi-reports"
- */
- protected File reportsDirectory;
-
- /**
- * The test source directory containing test class sources.
- *
- * @parameter expression="${project.build.testSourceDirectory}"
- * @required
- * @since 2.2
- */
- protected File testSourceDirectory;
-
- /**
- * Specify this parameter to run individual tests by file name, overriding the <code>includes/excludes</code>
- * parameters. Each pattern you specify here will be used to create an
- * include pattern formatted like <code>**&#47;${test}.java</code>, so you can just type "-Dtest=MyTest"
- * to run a single test called "foo/MyTest.java". This parameter will override the TestNG suiteXmlFiles
- * parameter.
- *
- * @parameter expression="${test}"
- */
- protected String test;
-
- /**
- * List of patterns (separated by commas) used to specify the tests that should be included in testing. When not
- * specified and when the <code>test</code> parameter is not specified, the default includes will be
- * <code>**&#47;Test*.java **&#47;*Test.java **&#47;*TestCase.java</code>. This parameter is ignored if
- * TestNG suiteXmlFiles are specified.
- *
- * @parameter
- */
- protected List includes;
-
- /**
- * List of patterns (separated by commas) used to specify the tests that should be excluded in testing. When not
- * specified and when the <code>test</code> parameter is not specified, the default excludes will be
- * <code>**&#47;*$*</code> (which excludes all inner classes). This parameter is ignored if
- * TestNG suiteXmlFiles are specified.
- *
- * @parameter
- */
- protected List excludes;
-
- /**
- * ArtifactRepository of the localRepository. To obtain the directory of localRepository in unit tests use
- * System.setProperty( "localRepository").
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
- */
- protected ArtifactRepository localRepository;
-
- /**
- * List of System properties to pass to the JUnit tests.
- *
- * @parameter
- */
- protected Properties systemProperties;
-
- /**
- * List of properties for configuring all TestNG related configurations. This is the new
- * preferred method of configuring TestNG.
- *
- * @parameter
- * @since 2.4
- */
- protected Properties properties;
-
- /**
- * Map of of plugin artifacts.
- *
- * @parameter expression="${plugin.artifactMap}"
- * @required
- * @readonly
- */
- protected Map pluginArtifactMap;
-
- /**
- * @parameter expression="${plugin.groupId}"
- * @required
- * @readonly
- */
- protected String pluginGroupId;
- /**
- * @parameter expression="${plugin.artifactId}"
- * @required
- * @readonly
- */
- protected String pluginArtifactId;
- /**
- * @parameter expression="${plugin.version}"
- * @required
- * @readonly
- */
- protected String pluginVersion;
-
- /**
- * Map of of project artifacts.
- *
- * @parameter expression="${project.artifactMap}"
- * @required
- * @readonly
- */
- protected Map projectArtifactMap;
-
- /**
- * Option to print summary of test suites or just print the test cases that has errors.
- *
- * @parameter expression="${surefire.printSummary}" default-value="true"
- */
- protected boolean printSummary;
-
- /**
- * Selects the formatting for the test report to be generated. Can be set as brief or plain.
- *
- * @parameter expression="${surefire.reportFormat}" default-value="brief"
- */
- protected String reportFormat;
-
- /**
- * Option to generate a file test report or just output the test report to the console.
- *
- * @parameter expression="${surefire.useFile}" default-value="true"
- */
- protected boolean useFile;
-
- /**
- * When forking, set this to true to redirect the unit test standard output to a file (found in
- * reportsDirectory/testName-output.txt).
- *
- * @parameter expression="${maven.test.redirectTestOutputToFile}" default-value="false"
- * @since 2.3
- */
- protected boolean redirectTestOutputToFile;
-
- /**
- * Set this to "true" to cause a failure if there are no tests to run. Defaults to false.
- *
- * @parameter expression="${failIfNoTests}"
- * @since 2.4
- */
- protected Boolean failIfNoTests;
-
- /**
- * Option to specify the forking mode. Can be "never", "once" or "always". "none" and "pertest" are also accepted
- * for backwards compatibility.
- *
- * @parameter expression="${forkMode}" default-value="once"
- * @since 2.1
- */
- protected String forkMode;
-
- /**
- * Option to specify the jvm (or path to the java executable) to use with the forking options. For the default, the
- * jvm will be the same as the one used to run Maven.
- *
- * @parameter expression="${jvm}"
- * @since 2.1
- */
- protected String jvm;
-
- /**
- * Arbitrary JVM options to set on the command line.
- *
- * @parameter expression="${argLine}"
- * @since 2.1
- */
- protected String argLine;
-
- /**
- * Attach a debugger to the forked JVM. If set to "true", the process will suspend and
- * wait for a debugger to attach on port 5005. If set to some other string, that
- * string will be appended to the argLine, allowing you to configure arbitrary
- * debuggability options (without overwriting the other options specified in the argLine).
- *
- * @parameter expression="${maven.surefire.debug}"
- * @since 2.4
- */
- protected String debugForkedProcess;
-
- /**
- * Kill the forked test process after a certain number of seconds. If set to 0,
- * wait forever for the process, never timing out.
- *
- * @parameter expression="${surefire.timeout}"
- * @since 2.4
- */
- protected int forkedProcessTimeoutInSeconds;
-
- /**
- * Additional environments to set on the command line.
- *
- * @parameter
- * @since 2.1.3
- */
- protected Map environmentVariables = new HashMap();
-
- /**
- * Command line working directory.
- *
- * @parameter expression="${basedir}"
- * @since 2.1.3
- */
- protected File workingDirectory;
-
- /**
- * When false it makes tests run using the standard classloader delegation instead of the default Maven isolated
- * classloader. Only used when forking (forkMode is not "none").<br/> Setting it to false helps with some problems
- * caused by conflicts between xml parsers in the classpath and the Java 5 provider parser.
- *
- * @parameter expression="${childDelegation}" default-value="false"
- * @since 2.1
- */
- protected boolean childDelegation;
-
- /**
- * (TestNG only) Groups for this test. Only classes/methods/etc decorated with one of the groups specified here will be included
- * in test run, if specified. This parameter is overridden if suiteXmlFiles are specified.
- *
- * @parameter expression="${groups}"
- * @since 2.2
- */
- protected String groups;
-
- /**
- * (TestNG only) Excluded groups. Any methods/classes/etc with one of the groups specified in this list will specifically not be
- * run. This parameter is overridden if suiteXmlFiles are specified.
- *
- * @parameter expression="${excludedGroups}"
- * @since 2.2
- */
- protected String excludedGroups;
-
- /**
- * (TestNG only) List of TestNG suite xml file locations, seperated by commas. Note that suiteXmlFiles is incompatible
- * with several other parameters on this plugin, like includes/excludes. This parameter is ignored if
- * the "test" parameter is specified (allowing you to run a single test instead of an entire suite).
- *
- * @parameter
- * @since 2.2
- */
- protected File[] suiteXmlFiles;
-
- /**
- * Allows you to specify the name of the JUnit artifact. If not set, <code>junit:junit</code> will be used.
- *
- * @parameter expression="${junitArtifactName}" default-value="junit:junit"
- * @since 2.3.1
- */
- protected String junitArtifactName;
-
- /**
- * Allows you to specify the name of the TestNG artifact. If not set, <code>org.testng:testng</code> will be used.
- *
- * @parameter expression="${testNGArtifactName}" default-value="org.testng:testng"
- * @since 2.3.1
- */
- protected String testNGArtifactName;
-
- /**
- * (TestNG only) The attribute thread-count allows you to specify how many threads should be allocated for this execution. Only
- * makes sense to use in conjunction with parallel.
- *
- * @parameter expression="${threadCount}"
- * @since 2.2
- */
- protected int threadCount;
-
- /**
- * (TestNG only) When you use the parallel attribute, TestNG will try to run all your test methods in separate threads, except for
- * methods that depend on each other, which will be run in the same thread in order to respect their order of
- * execution.
- *
- * @parameter expression="${parallel}"
- * @todo test how this works with forking, and console/file output parallelism
- * @since 2.2
- */
- protected String parallel;
-
- /**
- * Whether to trim the stack trace in the reports to just the lines within the test, or show the full trace.
- *
- * @parameter expression="${trimStackTrace}" default-value="true"
- * @since 2.2
- */
- protected boolean trimStackTrace;
-
- /**
- * Resolves the artifacts needed.
- *
- * @component
- */
- protected ArtifactResolver artifactResolver;
-
- /**
- * Creates the artifact
- *
- * @component
- */
- protected ArtifactFactory artifactFactory;
-
- /**
- * The plugin remote repositories declared in the pom.
- *
- * @parameter expression="${project.pluginArtifactRepositories}"
- * @since 2.2
- */
- protected List remoteRepositories;
-
- /**
- * For retrieval of artifact's metadata.
- *
- * @component
- */
- protected ArtifactMetadataSource metadataSource;
-
- protected static final String BRIEF_REPORT_FORMAT = "brief";
-
- protected static final String PLAIN_REPORT_FORMAT = "plain";
-
- protected Properties originalSystemProperties;
-
- /**
- * Flag to disable the generation of report files in xml format.
- *
- * @parameter expression="${disableXmlReport}" default-value="false"
- * @since 2.2
- */
- protected boolean disableXmlReport;
-
- /**
- * Option to pass dependencies to the system's classloader instead of using an isolated class loader when forking.
- * Prevents problems with JDKs which implement the service provider lookup mechanism by using the system's
- * classloader. Default value is "true".
- *
- * @parameter expression="${surefire.useSystemClassLoader}"
- * @since 2.3
- */
- protected Boolean useSystemClassLoader;
-
- /**
- * By default, Surefire forks your tests using a manifest-only jar; set this parameter
- * to "false" to force it to launch your tests with a plain old Java classpath.
- * (See http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html
- * for a more detailed explanation of manifest-only jars and their benefits.)
- *
- * Default value is "true". Beware, setting this to "false" may cause your tests to
- * fail on Windows if your classpath is too long.
- *
- * @parameter expression="${surefire.useManifestOnlyJar}" default-value="true"
- * @since 2.4.3
- */
- protected boolean useManifestOnlyJar;
-
- /**
- * By default, Surefire enables JVM assertions for the execution of your test cases. To disable the assertions, set
- * this flag to <code>false</code>.
- *
- * @parameter expression="${enableAssertions}" default-value="true"
- * @since 2.3.1
- */
- protected boolean enableAssertions;
-
- /**
- * The current build session instance.
- *
- * @parameter expression="${session}"
- * @required
- * @readonly
- */
- protected MavenSession session;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
- if (project.getPackaging().equals("pom")) {
- return;
- }
-
- if (verifyParameters()) {
- OSGiSurefireBooter surefireBooter = constructSurefireBooter();
-
- Log log = getLog();
- Set<String> jarFiles = new HashSet<String>();
-
- /*
- for (Object o : project.getArtifacts()) {
- Artifact a = (Artifact)o;
- if ("pom".equals(a.getType())) {
- // Skip pom projects
- continue;
- }
- try {
- if (log.isDebugEnabled()) {
- log.debug("Adding: " + a);
- }
- jarFiles.add(a.getFile().toURI().toURL());
- } catch (MalformedURLException e) {
- getLog().error(e);
- }
- }
- */
-
- /*
- * Add org.apache.tuscany.sca:tuscany-extensibility-osgi module
- */
- String aid = "tuscany-extensibility-equinox";
- Artifact ext = getArtifact("org.apache.tuscany.sca", aid);
- if (log.isDebugEnabled()) {
- log.debug("Adding: " + ext);
- }
- jarFiles.add(ext.getFile().getAbsolutePath());
-
-
- String name = project.getBuild().getFinalName();
- String mainBundleName = null;
- File mainJar = new File(project.getBuild().getDirectory(), name + "-osgi.jar");
- File testJar = new File(project.getBuild().getDirectory(), name + "-osgi-tests.jar");
- try {
- Manifest manifest = createMainBundle();
- mainBundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- int sc = mainBundleName.indexOf(';');
- if (sc != -1) {
- mainBundleName = mainBundleName.substring(0, sc);
- }
- generateJar(classesDirectory, mainJar, manifest);
- Manifest testManifest = createTestFragment(manifest);
- generateJar(testClassesDirectory, testJar, testManifest);
- jarFiles.add(mainJar.getAbsolutePath());
- jarFiles.add(testJar.getAbsolutePath());
- } catch (IOException e) {
- getLog().error(e);
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Main bundle: " + mainBundleName);
- }
- surefireBooter.setMainBundleName(mainBundleName);
- for (String url : jarFiles) {
- surefireBooter.addClassPathUrl(url);
- }
-
- getLog().info("Surefire report directory: " + reportsDirectory);
-
- int result;
- try {
- result = surefireBooter.run();
- } catch (SurefireBooterForkException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- } catch (SurefireExecutionException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
-
- if (originalSystemProperties != null && !surefireBooter.isForking()) {
- // restore system properties, only makes sense when not forking..
- System.setProperties(originalSystemProperties);
- }
-
- if (result == 0)
- return;
-
- String msg;
-
- if (result == OSGiSurefireBooter.NO_TESTS_EXIT_CODE) {
- if ((failIfNoTests == null) || !failIfNoTests.booleanValue())
- return;
- // TODO: i18n
- throw new MojoFailureException(
- "No tests were executed! (Set -DfailIfNoTests=false to ignore this error.)");
- } else {
- // TODO: i18n
- msg =
- "There are test failures.\n\nPlease refer to " + reportsDirectory
- + " for the individual test results.";
-
- }
-
- if (testFailureIgnore) {
- getLog().error(msg);
- } else {
- throw new MojoFailureException(msg);
- }
- }
- }
-
- protected boolean verifyParameters() throws MojoFailureException {
- if (skip || skipTests || skipExec) {
- getLog().info("Tests are skipped.");
- return false;
- }
-
- if (!testClassesDirectory.exists()) {
- if (failIfNoTests != null && failIfNoTests.booleanValue()) {
- throw new MojoFailureException("No tests to run!");
- }
- getLog().info("No tests to run.");
- return false;
- }
-
- if (useSystemClassLoader != null && ForkConfiguration.FORK_NEVER.equals(forkMode)) {
- getLog().warn("useSystemClassloader setting has no effect when not forking");
- }
-
- return true;
- }
-
- /**
- * Converts old TestNG configuration parameters over to new properties based configuration
- * method. (if any are defined the old way)
- */
- private void convertTestNGParameters() {
- if (properties == null) {
- properties = new Properties();
- }
-
- if (this.parallel != null) {
- properties.setProperty("parallel", this.parallel);
- }
- if (this.excludedGroups != null) {
- properties.setProperty("excludegroups", this.excludedGroups);
- }
- if (this.groups != null) {
- properties.setProperty("groups", this.groups);
- }
-
- if (this.threadCount > 0) {
- properties.setProperty("threadcount", new Integer(this.threadCount).toString());
- }
- }
-
- private OSGiSurefireBooter constructSurefireBooter() throws MojoExecutionException, MojoFailureException {
- OSGiSurefireBooter surefireBooter = new OSGiSurefireBooter();
-
- // Build up the surefire boot classpath
- // * org.apache.tuscany.sca:tuscany-maven-surefire-osgi-plugin (non-transitive
- // to exclude maven dependencies
- // * org.apache.tuscany.sca:tuscany-node-launcher-equinox (transitive)
- // * org.apache.maven.surefire:surefire-booter (transitive)
- // Get the artifact for the OSGi surefire plugin
- Artifact osgiArtifact =
- artifactFactory.createArtifact(pluginGroupId,
- pluginArtifactId,
- pluginVersion,
- Artifact.SCOPE_TEST,
- "maven-plugin");
- try {
- artifactResolver.resolve(osgiArtifact, remoteRepositories, localRepository);
- surefireBooter.addSurefireBootClassPathUrl(osgiArtifact.getFile().getAbsolutePath());
- } catch (Exception e) {
- throw new MojoExecutionException("Unable to resolve " + osgiArtifact);
- }
-
- Artifact launcher = (Artifact) pluginArtifactMap.get("org.apache.tuscany.sca:tuscany-node-launcher-equinox");
-
- // Look up the surefire-booter
- Artifact surefireArtifact = (Artifact)pluginArtifactMap.get("org.apache.maven.surefire:surefire-booter");
- if (surefireArtifact == null) {
- throw new MojoExecutionException("Unable to locate surefire-booter in the list of plugin artifacts");
- }
-
- surefireArtifact.isSnapshot(); // TODO: this is ridiculous, but it fixes getBaseVersion to be -SNAPSHOT if
- // needed
-
- Artifact junitArtifact;
- Artifact testNgArtifact;
- try {
- addArtifact(surefireBooter, surefireArtifact);
- addArtifact(surefireBooter, launcher);
-
- junitArtifact = (Artifact)projectArtifactMap.get(junitArtifactName);
- // SUREFIRE-378, junit can have an alternate artifact name
- if (junitArtifact == null && "junit:junit".equals(junitArtifactName)) {
- junitArtifact = (Artifact)projectArtifactMap.get("junit:junit-dep");
- }
-
- // TODO: this is pretty manual, but I'd rather not require the plugin > dependencies section right now
- testNgArtifact = (Artifact)projectArtifactMap.get(testNGArtifactName);
-
- if (testNgArtifact != null) {
- VersionRange range = VersionRange.createFromVersionSpec("[4.7,)");
- if (!range.containsVersion(new DefaultArtifactVersion(testNgArtifact.getVersion()))) {
- throw new MojoFailureException(
- "TestNG support requires version 4.7 or above. You have declared version " + testNgArtifact
- .getVersion());
- }
-
- convertTestNGParameters();
-
- if (this.testClassesDirectory != null) {
- properties.setProperty("testng.test.classpath", testClassesDirectory.getAbsolutePath());
- }
-
- addArtifact(surefireBooter, testNgArtifact);
-
- // The plugin uses a JDK based profile to select the right testng. We might be explicity using a
- // different one since its based on the source level, not the JVM. Prune using the filter.
- addProvider(surefireBooter, "surefire-testng", surefireArtifact.getBaseVersion(), testNgArtifact);
- } else if (junitArtifact != null && junitArtifact.getBaseVersion().startsWith("4")) {
- addProvider(surefireBooter, "surefire-junit4", surefireArtifact.getBaseVersion(), null);
- } else {
- // add the JUnit provider as default - it doesn't require JUnit to be present,
- // since it supports POJO tests.
- addProvider(surefireBooter, "surefire-junit", surefireArtifact.getBaseVersion(), null);
- }
- } catch (ArtifactNotFoundException e) {
- throw new MojoExecutionException("Unable to locate required surefire provider dependency: " + e
- .getMessage(), e);
- } catch (InvalidVersionSpecificationException e) {
- throw new MojoExecutionException("Error determining the TestNG version requested: " + e.getMessage(), e);
- } catch (ArtifactResolutionException e) {
- throw new MojoExecutionException("Error to resolving surefire provider dependency: " + e.getMessage(), e);
- }
-
- if (suiteXmlFiles != null && suiteXmlFiles.length > 0 && test == null) {
- if (testNgArtifact == null) {
- throw new MojoExecutionException("suiteXmlFiles is configured, but there is no TestNG dependency");
- }
-
- // TODO: properties should be passed in here too
- surefireBooter.addTestSuite("org.apache.maven.surefire.testng.TestNGXmlTestSuite",
- new Object[] {suiteXmlFiles, testSourceDirectory.getAbsolutePath(),
- testNgArtifact.getVersion(), testNgArtifact.getClassifier(),
- properties, reportsDirectory});
- } else {
- List includes;
- List excludes;
-
- if (test != null) {
- // Check to see if we are running a single test. The raw parameter will
- // come through if it has not been set.
-
- // FooTest -> **/FooTest.java
-
- includes = new ArrayList();
-
- excludes = new ArrayList();
-
- if (failIfNoTests == null) {
- failIfNoTests = Boolean.TRUE;
- }
-
- String[] testRegexes = StringUtils.split(test, ",");
-
- for (int i = 0; i < testRegexes.length; i++) {
- String testRegex = testRegexes[i];
- if (testRegex.endsWith(".java")) {
- testRegex = testRegex.substring(0, testRegex.length() - 5);
- }
- // Allow paths delimited by '.' or '/'
- testRegex = testRegex.replace('.', '/');
- includes.add("**/" + testRegex + ".java");
- }
- } else {
- includes = this.includes;
-
- excludes = this.excludes;
-
- // defaults here, qdox doesn't like the end javadoc value
- // Have to wrap in an ArrayList as surefire expects an ArrayList instead of a List for some reason
- if (includes == null || includes.size() == 0) {
- includes =
- new ArrayList(Arrays
- .asList(new String[] {"**/Test*.java", "**/*Test.java", "**/*TestCase.java"}));
- }
- if (excludes == null || excludes.size() == 0) {
- excludes = new ArrayList(Arrays.asList(new String[] {"**/*$*"}));
- }
- }
-
- if (testNgArtifact != null) {
- surefireBooter.addTestSuite("org.apache.maven.surefire.testng.TestNGDirectoryTestSuite",
- new Object[] {testClassesDirectory, includes, excludes,
- testSourceDirectory.getAbsolutePath(),
- testNgArtifact.getVersion(), testNgArtifact.getClassifier(),
- properties, reportsDirectory});
- } else {
- String junitDirectoryTestSuite;
- if (junitArtifact != null && junitArtifact.getBaseVersion() != null
- && junitArtifact.getBaseVersion().startsWith("4")) {
- junitDirectoryTestSuite = "org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite";
- } else {
- junitDirectoryTestSuite = "org.apache.maven.surefire.junit.JUnitDirectoryTestSuite";
- }
-
- // fall back to JUnit, which also contains POJO support. Also it can run
- // classes compiled against JUnit since it has a dependency on JUnit itself.
- surefireBooter.addTestSuite(junitDirectoryTestSuite, new Object[] {testClassesDirectory, includes,
- excludes});
- }
- }
-
- // ----------------------------------------------------------------------
- //
- // ----------------------------------------------------------------------
-
- getLog().debug("Test Classpath :");
-
- classpathElements.remove(classesDirectory.getAbsolutePath());
- classpathElements.remove(testClassesDirectory.getAbsolutePath());
- /*
- // Check if we need to add configured classes/test classes directories here.
- // If they are configured, we should remove the default to avoid conflicts.
- if (!project.getBuild().getOutputDirectory().equals(classesDirectory.getAbsolutePath())) {
- classpathElements.remove(project.getBuild().getOutputDirectory());
- classpathElements.add(classesDirectory.getAbsolutePath());
- }
- if (!project.getBuild().getTestOutputDirectory().equals(testClassesDirectory.getAbsolutePath())) {
- classpathElements.remove(project.getBuild().getTestOutputDirectory());
- classpathElements.add(testClassesDirectory.getAbsolutePath());
- }
- */
-
- for (Iterator i = classpathElements.iterator(); i.hasNext();) {
- String classpathElement = (String)i.next();
-
- getLog().debug(" " + classpathElement);
-
- surefireBooter.addClassPathUrl(classpathElement);
- }
-
- Toolchain tc = getToolchain();
-
- if (tc != null) {
- getLog().info("Toolchain in surefire-plugin: " + tc);
- if (ForkConfiguration.FORK_NEVER.equals(forkMode)) {
- forkMode = ForkConfiguration.FORK_ONCE;
- }
- if (jvm != null) {
- getLog().warn("Toolchains are ignored, 'executable' parameter is set to " + jvm);
- } else {
- jvm = tc.findTool("java"); //NOI18N
- }
- }
-
- if (additionalClasspathElements != null) {
- for (Iterator i = additionalClasspathElements.iterator(); i.hasNext();) {
- String classpathElement = (String)i.next();
-
- getLog().debug(" " + classpathElement);
-
- surefireBooter.addClassPathUrl(classpathElement);
- }
- }
-
- // ----------------------------------------------------------------------
- // Forking
- // ----------------------------------------------------------------------
-
- ForkConfiguration fork = new ForkConfiguration();
-
- fork.setForkMode(forkMode);
-
- processSystemProperties(!fork.isForking());
-
- if (getLog().isDebugEnabled()) {
- showMap(systemProperties, "system property");
- }
-
- if (fork.isForking()) {
- useSystemClassLoader = useSystemClassLoader == null ? Boolean.TRUE : useSystemClassLoader;
- fork.setUseSystemClassLoader(useSystemClassLoader.booleanValue());
- fork.setUseManifestOnlyJar(useManifestOnlyJar);
-
- fork.setSystemProperties(systemProperties);
-
- if ("true".equals(debugForkedProcess)) {
- debugForkedProcess =
- "-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005";
- }
-
- fork.setDebugLine(debugForkedProcess);
-
- if (jvm == null || "".equals(jvm)) {
- // use the same JVM as the one used to run Maven (the "java.home" one)
- jvm = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
- getLog().debug("Using JVM: " + jvm);
- }
-
- fork.setJvmExecutable(jvm);
-
- if (workingDirectory != null) {
- fork.setWorkingDirectory(workingDirectory);
- } else {
- fork.setWorkingDirectory(basedir);
- }
-
- fork.setArgLine(argLine);
-
- fork.setEnvironmentVariables(environmentVariables);
-
- if (getLog().isDebugEnabled()) {
- showMap(environmentVariables, "environment variable");
-
- fork.setDebug(true);
- }
-
- if (argLine != null) {
- List args = Arrays.asList(argLine.split(" "));
- if (args.contains("-da") || args.contains("-disableassertions")) {
- enableAssertions = false;
- }
- }
- }
-
- surefireBooter.setFailIfNoTests(failIfNoTests == null ? false : failIfNoTests.booleanValue());
-
- surefireBooter.setForkedProcessTimeoutInSeconds(forkedProcessTimeoutInSeconds);
-
- surefireBooter.setRedirectTestOutputToFile(redirectTestOutputToFile);
-
- surefireBooter.setForkConfiguration(fork);
-
- surefireBooter.setChildDelegation(childDelegation);
-
- surefireBooter.setEnableAssertions(enableAssertions);
-
- surefireBooter.setReportsDirectory(reportsDirectory);
-
- addReporters(surefireBooter, fork.isForking());
-
- return surefireBooter;
- }
-
- private void showMap(Map map, String setting) {
- for (Iterator i = map.keySet().iterator(); i.hasNext();) {
- String key = (String)i.next();
- String value = (String)map.get(key);
- getLog().debug("Setting " + setting + " [" + key + "]=[" + value + "]");
- }
- }
-
- private void addProvider(OSGiSurefireBooter surefireBooter,
- String provider,
- String version,
- Artifact filteredArtifact) throws ArtifactNotFoundException, ArtifactResolutionException {
- Artifact providerArtifact =
- artifactFactory.createDependencyArtifact("org.apache.maven.surefire", provider, VersionRange
- .createFromVersion(version), "jar", null, Artifact.SCOPE_TEST);
- ArtifactResolutionResult result = resolveArtifact(filteredArtifact, providerArtifact);
-
- for (Iterator i = result.getArtifacts().iterator(); i.hasNext();) {
- Artifact artifact = (Artifact)i.next();
-
- String key = ArtifactUtils.versionlessKey(artifact);
- if("junit:junit".equals(key) || "jnuit:junit-dep".equals(key)) {
- // Skip junit as it will be pulled from the test case dependencies
- continue;
- }
- getLog().debug("Adding to surefire test classpath: " + artifact.getFile().getAbsolutePath());
-
- surefireBooter.addSurefireClassPathUrl(artifact.getFile().getAbsolutePath());
- }
- }
-
- private ArtifactResolutionResult resolveArtifact(Artifact filteredArtifact, Artifact providerArtifact)
- throws ArtifactResolutionException, ArtifactNotFoundException {
- ArtifactFilter filter = null;
- if (filteredArtifact != null) {
- filter =
- new ExcludesArtifactFilter(Collections.singletonList(filteredArtifact.getGroupId() + ":"
- + filteredArtifact.getArtifactId()));
- }
-
- Artifact originatingArtifact = artifactFactory.createBuildArtifact("dummy", "dummy", "1.0", "jar");
-
- return artifactResolver.resolveTransitively(Collections.singleton(providerArtifact),
- originatingArtifact,
- localRepository,
- remoteRepositories,
- metadataSource,
- filter);
- }
-
- private void addArtifact(OSGiSurefireBooter surefireBooter, Artifact surefireArtifact)
- throws ArtifactNotFoundException, ArtifactResolutionException {
- ArtifactResolutionResult result = resolveArtifact(null, surefireArtifact);
-
- for (Iterator i = result.getArtifacts().iterator(); i.hasNext();) {
- Artifact artifact = (Artifact)i.next();
-
- getLog().debug("Adding to surefire booter test classpath: " + artifact.getFile().getAbsolutePath());
-
- surefireBooter.addSurefireBootClassPathUrl(artifact.getFile().getAbsolutePath());
- }
- }
-
- protected void processSystemProperties(boolean setInSystem) {
- if (systemProperties == null) {
- systemProperties = new Properties();
- }
-
- originalSystemProperties = (Properties)System.getProperties().clone();
-
- // We used to take all of our system properties and dump them in with the
- // user specified properties for SUREFIRE-121, causing SUREFIRE-491.
- // Not gonna do THAT any more... but I'm leaving this code here in case
- // we need it later when we try to fix SUREFIRE-121 again.
-
- // Get the properties from the MavenSession instance to make embedded use work correctly
- Properties userSpecifiedProperties = (Properties)session.getExecutionProperties().clone();
- userSpecifiedProperties.putAll(systemProperties);
- //systemProperties = userSpecifiedProperties;
-
- systemProperties.setProperty("basedir", basedir.getAbsolutePath());
- systemProperties.setProperty("user.dir", workingDirectory.getAbsolutePath());
-
- systemProperties.setProperty("localRepository", localRepository.getBasedir());
-
- if (setInSystem) {
- // Add all system properties configured by the user
- Iterator iter = systemProperties.keySet().iterator();
-
- while (iter.hasNext()) {
- String key = (String)iter.next();
-
- String value = systemProperties.getProperty(key);
-
- System.setProperty(key, value);
- }
- }
- }
-
- /**
- * <p>
- * Adds Reporters that will generate reports with different formatting.
- * <p>
- * The Reporter that will be added will be based on the value of the parameter useFile, reportFormat, and
- * printSummary.
- *
- * @param surefireBooter The surefire booter that will run tests.
- * @param forking
- */
- private void addReporters(OSGiSurefireBooter surefireBooter, boolean forking) {
- Boolean trimStackTrace = Boolean.valueOf(this.trimStackTrace);
- if (useFile) {
- if (printSummary) {
- if (forking) {
- surefireBooter.addReport(ForkingConsoleReporter.class.getName(), new Object[] {trimStackTrace});
- } else {
- surefireBooter.addReport(ConsoleReporter.class.getName(), new Object[] {trimStackTrace});
- }
- }
-
- if (BRIEF_REPORT_FORMAT.equals(reportFormat)) {
- surefireBooter.addReport(BriefFileReporter.class.getName(), new Object[] {reportsDirectory,
- trimStackTrace});
- } else if (PLAIN_REPORT_FORMAT.equals(reportFormat)) {
- surefireBooter.addReport(FileReporter.class.getName(), new Object[] {reportsDirectory, trimStackTrace});
- }
- } else {
- if (BRIEF_REPORT_FORMAT.equals(reportFormat)) {
- surefireBooter.addReport(BriefConsoleReporter.class.getName(), new Object[] {trimStackTrace});
- } else if (PLAIN_REPORT_FORMAT.equals(reportFormat)) {
- surefireBooter.addReport(DetailedConsoleReporter.class.getName(), new Object[] {trimStackTrace});
- }
- }
-
- if (!disableXmlReport) {
- surefireBooter.addReport(XMLReporter.class.getName(), new Object[] {reportsDirectory, trimStackTrace});
- }
- }
-
- /**
- * @return SurefirePlugin Returns the skipExec.
- */
- public boolean isSkipExec() {
- return this.skipTests;
- }
-
- /**
- * @param skipExec the skipExec to set
- */
- public void setSkipExec(boolean skipExec) {
- this.skipTests = skipExec;
- }
-
- //TODO remove the part with ToolchainManager lookup once we depend on
- //3.0.9 (have it as prerequisite). Define as regular component field then.
- private Toolchain getToolchain() {
- Toolchain tc = null;
- try {
- if (session != null) //session is null in tests..
- {
- ToolchainManager toolchainManager =
- (ToolchainManager)session.getContainer().lookup(ToolchainManager.ROLE);
- if (toolchainManager != null) {
- tc = toolchainManager.getToolchainFromBuildContext("jdk", session);
- }
- }
- } catch (ComponentLookupException componentLookupException) {
- //just ignore, could happen in pre-3.0.9 builds..
- }
- return tc;
- }
-
- protected Artifact getArtifact(String groupId, String artifactId) throws MojoExecutionException {
- Artifact artifact;
- VersionRange vr;
- try {
- vr = VersionRange.createFromVersionSpec(project.getVersion());
- } catch (InvalidVersionSpecificationException e1) {
- vr = VersionRange.createFromVersion(project.getVersion());
- }
- artifact = artifactFactory.createDependencyArtifact(groupId, artifactId, vr, "jar", null, Artifact.SCOPE_TEST);
-
- try {
- artifactResolver.resolve(artifact, remoteRepositories, localRepository);
- } catch (ArtifactResolutionException e) {
- throw new MojoExecutionException("Unable to resolve artifact.", e);
- } catch (ArtifactNotFoundException e) {
- throw new MojoExecutionException("Unable to find artifact.", e);
- }
-
- return artifact;
- }
-
- private void generateJar(File root, File jar, Manifest mf) throws IOException {
- getLog().info("Generating " + jar.toString());
- FileOutputStream fos = new FileOutputStream(jar);
- JarOutputStream jos = mf != null ? new JarOutputStream(fos, mf) : new JarOutputStream(fos);
- addDir(jos, root, root);
- jos.close();
- }
-
- /**
- * Convert the maven version into OSGi version
- * @param mavenVersion
- * @return
- */
- static String osgiVersion(String mavenVersion) {
- ArtifactVersion ver = new DefaultArtifactVersion(mavenVersion);
- String qualifer = ver.getQualifier();
- if (qualifer != null) {
- StringBuffer buf = new StringBuffer(qualifer);
- for (int i = 0; i < buf.length(); i++) {
- char c = buf.charAt(i);
- if (Character.isLetterOrDigit(c) || c == '-' || c == '_') {
- // Keep as-is
- } else {
- buf.setCharAt(i, '_');
- }
- }
- qualifer = buf.toString();
- }
- Version osgiVersion =
- new Version(ver.getMajorVersion(), ver.getMinorVersion(), ver.getIncrementalVersion(), qualifer);
- String version = osgiVersion.toString();
- return version;
- }
-
- private Manifest createMainBundle() throws IOException {
- File mf = new File(project.getBasedir(), "META-INF/MANIFEST.MF");
- Manifest manifest = null;
- if (mf.isFile()) {
- manifest = new Manifest(new FileInputStream(mf));
- String bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- if (bundleName != null) {
- return manifest;
- }
- }
- if (manifest == null) {
- manifest = new Manifest();
- }
- Attributes attributes = manifest.getMainAttributes();
- attributes.putValue("Manifest-Version", "1.0");
- attributes.putValue(BUNDLE_MANIFESTVERSION, "2");
- attributes.putValue(BUNDLE_SYMBOLICNAME, project.getGroupId() + "." + project.getArtifactId());
- attributes.putValue(BUNDLE_NAME, project.getName());
- attributes.putValue(BUNDLE_VERSION, osgiVersion(project.getVersion()));
- attributes.putValue(Constants.DYNAMICIMPORT_PACKAGE, "*");
- return manifest;
- }
-
- private Manifest createTestFragment(Manifest mf) {
- // Create a manifest
- Manifest manifest = new Manifest();
- Attributes attributes = manifest.getMainAttributes();
- attributes.putValue("Manifest-Version", "1.0");
- attributes.putValue(BUNDLE_MANIFESTVERSION, "2");
- String host = mf.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
- int sc = host.indexOf(';');
- if (sc != -1) {
- host = host.substring(0, sc);
- }
- attributes.putValue(BUNDLE_SYMBOLICNAME, host + ".tests");
- attributes.putValue(BUNDLE_NAME, mf.getMainAttributes().getValue(BUNDLE_NAME) + " Tests");
- attributes.putValue(BUNDLE_VERSION, mf.getMainAttributes().getValue(BUNDLE_VERSION));
- attributes.putValue(Constants.FRAGMENT_HOST, host + ";bundle-version=\""
- + mf.getMainAttributes().getValue(BUNDLE_VERSION)
- + "\"");
- // The main bundle may not have the dependency on JUNIT
- attributes.putValue(Constants.DYNAMICIMPORT_PACKAGE, "*");
- return manifest;
- }
-
- private void addDir(JarOutputStream jos, File root, File dir) throws IOException, FileNotFoundException {
- for (File file : dir.listFiles()) {
- if (file.isDirectory()) {
- addDir(jos, root, file);
- } else if (file.isFile()) {
- // getLog().info(file.toString());
- String uri = root.toURI().relativize(file.toURI()).toString();
- if ("META-INF/MANIFEST.MF".equals(uri)) {
- continue;
- }
- ZipEntry entry = new ZipEntry(uri);
- jos.putNextEntry(entry);
- byte[] buf = new byte[4096];
- FileInputStream in = new FileInputStream(file);
- for (;;) {
- int len = in.read(buf);
- if (len > 0) {
- jos.write(buf, 0, len);
- } else {
- break;
- }
- }
- in.close();
- jos.closeEntry();
- }
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/LICENSE b/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/LICENSE
deleted file mode 100644
index 6e529a25c4..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/NOTICE b/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/NOTICE
deleted file mode 100644
index 51042eab05..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/pom.xml b/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/pom.xml
deleted file mode 100644
index d8f910ed17..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/pom.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-maven-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-maven-web-junit</artifactId>
- <packaging>maven-plugin</packaging>
- <name>Apache Tuscany SCA Web JUnit Maven Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>4.0-alpha2</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0.7</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.0.7</version>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java
deleted file mode 100644
index d1afe2c995..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.sca.web.junit.plugin;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
-
-/**
- * @version $Rev$ $Date$
- * @goal generate
- * @phase process-resources
- * @requiresDependencyResolution runtime
- * @description Generate the web.xml and geronimo-web.xml
- */
-public class WebJUnitGeneratorMojo extends AbstractMojo {
- private final static String ASL_HEADER =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "\n<!--"
- + "\n * Licensed to the Apache Software Foundation (ASF) under one"
- + "\n * or more contributor license agreements. See the NOTICE file"
- + "\n * distributed with this work for additional information"
- + "\n * regarding copyright ownership. The ASF licenses this file"
- + "\n * to you under the Apache License, Version 2.0 (the"
- + "\n * \"License\"); you may not use this file except in compliance"
- + "\n * with the License. You may obtain a copy of the License at"
- + "\n * "
- + "\n * http://www.apache.org/licenses/LICENSE-2.0"
- + "\n * "
- + "\n * Unless required by applicable law or agreed to in writing,"
- + "\n * software distributed under the License is distributed on an"
- + "\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY"
- + "\n * KIND, either express or implied. See the License for the"
- + "\n * specific language governing permissions and limitations"
- + "\n * under the License. "
- + "\n-->";
-
- private final static String GERONIMO_WEB_XML =
- ASL_HEADER + "\n<web-app xmlns=\"http://geronimo.apache.org/xml/ns/j2ee/web-2.0\""
- + "\n xmlns:d=\"http://geronimo.apache.org/xml/ns/deployment-1.2\">"
- // + "\n <context-root>${context.root}</context-root>"
- + "\n <d:environment>"
- + "\n <d:moduleId>"
- + "\n <d:groupId>${groupId}</d:groupId>"
- + "\n <d:artifactId>${artifactId}</d:artifactId>"
- + "\n <d:version>${version}</d:version>"
- + "\n <d:type>war</d:type>"
- + "\n </d:moduleId>"
- + "\n <d:inverse-classloading />"
- + "\n </d:environment>"
- + "\n</web-app>\n";
-
- private final static String WEB_XML =
- ASL_HEADER + "\n<!DOCTYPE web-app PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\" \"http://java.sun.com/dtd/web-app_2_3.dtd\">"
- + "\n<web-app>"
- + "\n <display-name>${display-name}</display-name>"
- + "\n <filter>"
- + "\n <filter-name>tuscany</filter-name>"
- + "\n <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>"
- + "\n </filter>"
- + "\n <filter>"
- + "\n <filter-name>junit</filter-name>"
- + "\n <filter-class>org.apache.tuscany.sca.host.webapp.junit.JUnitServletFilter</filter-class>"
- + "\n <init-param>"
- + "\n <param-name>junit.tests.path</param-name>"
- + "\n <param-value>${junit.tests.path}</param-value>"
- + "\n </init-param>"
- + "\n </filter>"
- + "\n <filter-mapping>"
- + "\n <filter-name>tuscany</filter-name>"
- + "\n <url-pattern>/*</url-pattern>"
- + "\n </filter-mapping>"
- + "\n <filter-mapping>"
- + "\n <filter-name>junit</filter-name>"
- + "\n <url-pattern>/junit/*</url-pattern>"
- + "\n </filter-mapping>"
- + "\n</web-app>\n";
-
- /**
- * @parameter
- */
- private String testsPath;
-
- /**
- * @parameter
- */
- private boolean geronimo;
-
- /**
- * The project to create a build for.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- private MavenProject project;
-
- public void execute() throws MojoExecutionException {
- File base =
- new File(project.getBasedir(), "target" + File.separator
- + project.getBuild().getFinalName()
- + File.separator
- + "WEB-INF");
- base.mkdirs();
- // Create the dir to work around the complaint from maven-war-plugin on non-existent folders
- new File(project.getBasedir(), "target/classes/META-INF".replace('/', File.separatorChar)).mkdirs();
- File webxml = new File(base, "web.xml");
- getLog().info("Generating " + webxml.toString());
-
- String name = project.getName();
- if (name == null) {
- name = project.getGroupId() + "-" + project.getArtifactId();
- }
- String content = setParameter(WEB_XML, "display-name", name);
-
- if (testsPath == null) {
- testsPath = "/WEB-INF/classes/";
- }
- content = setParameter(content, "junit.tests.path", testsPath);
-
- try {
- FileWriter writer = new FileWriter(webxml);
- writer.append(content);
- writer.close();
- } catch (IOException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
-
- if (geronimo) {
- File geronimoxml = new File(base, "geronimo-web.xml");
- getLog().info("Generating " + geronimoxml.toString());
- content = setParameter(GERONIMO_WEB_XML, "groupId", project.getGroupId());
- content = setParameter(content, "artifactId", project.getArtifactId());
- content = setParameter(content, "version", project.getVersion());
- // content = setParameter(content, "context.root", "/" + project.getBuild().getFinalName());
- try {
- geronimoxml.getParentFile().mkdirs();
- FileWriter writer = new FileWriter(geronimoxml);
- writer.append(content);
- writer.close();
- } catch (IOException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
- }
-
- // Workaround: maven-war-plugin doesn't like non-existing folders
- // create target/test-classes
- new File(project.getBasedir(), "target" + File.separator + "test-classes").mkdirs();
-
- }
-
- private String setParameter(String xml, String name, String value) {
- String pattern = "${" + name + "}";
- int index = xml.indexOf(pattern);
- if (index != -1) {
- String content = xml.substring(0, index) + value + xml.substring(index + pattern.length());
- return content;
- }
- return xml;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitMojo.java
deleted file mode 100644
index 658d65d7c3..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitMojo.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.sca.web.junit.plugin;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import org.apache.commons.logging.LogFactory;
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.StatusLine;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
-
-/**
- * @version $Rev$ $Date$
- * @goal test
- * @phase integration-test
- * @requiresDependencyResolution test
- * @description Run the unit test over HTTP
- */
-public class WebJUnitMojo extends AbstractMojo {
- /**
- * The project to create a build for.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- private MavenProject project;
-
- /**
- * The test cases to run
- * @parameter
- */
- private String testCases[];
-
- /**
- * The URL for the web site
- * @parameter
- */
- private String url;
-
- /**
- * Timeout for the HTTP connection
- * @parameter
- */
- private int timeout = 300000; // 5 minutes
-
- /**
- * To avoid throwing exceptions because we want the stop container plugin to be executed
- * @parameter
- */
- private boolean ignoreErrors = true;
-
- public void execute() throws MojoExecutionException {
- if (project.getPackaging().equals("pom")) {
- return;
- }
-
- reset();
-
- if (url == null) {
- url = "http://localhost:8080/" + project.getBuild().getFinalName() + "/junit?op=runAll";
- }
-
- if (testCases != null) {
- StringBuffer buf = new StringBuffer(url);
- for (int i = 0; i < testCases.length; i++) {
- if (i == 0) {
- buf.append('?');
- }
- buf.append(testCases[i]);
- if (i != testCases.length - 1) {
- buf.append(',');
- }
- }
- url = buf.toString();
- }
-
- getLog().info("Connecting to " + url);
-
- int runs = 0, errors = 0, failures = 0;
- String xml = "";
-
- try {
- HttpClient client = new DefaultHttpClient();
- HttpGet httpget = new HttpGet(url);
- httpget.getParams().setParameter("http.socket.timeout", new Integer(timeout));
-
- // Execute HTTP request
- HttpResponse response = client.execute(httpget);
-
- StatusLine status = response.getStatusLine();
- if (status.getStatusCode() != HttpStatus.SC_OK) {
- if (!ignoreErrors) {
- throw new MojoExecutionException(status.getStatusCode() + ": " + status.getReasonPhrase());
- }
- getLog().error(status.getStatusCode() + ": " + status.getReasonPhrase());
- return;
- }
- Header header = response.getFirstHeader("junit.errors");
- errors = header == null ? 0 : Integer.parseInt(header.getValue());
- header = response.getFirstHeader("junit.failures");
- failures = header == null ? 0 : Integer.parseInt(header.getValue());
- header = response.getFirstHeader("junit.runs");
- runs = header == null ? 0 : Integer.parseInt(header.getValue());
- getLog().info("Runs: " + runs + ", Failures: " + failures + ", Errors: " + errors);
-
- // Get hold of the response entity
- HttpEntity entity = response.getEntity();
-
- // If the response does not enclose an entity, there is no need
- // to bother about connection release
- if (entity != null) {
- BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent()));
- try {
- StringBuffer sb = new StringBuffer();
- while (true) {
- String line = reader.readLine();
- if (line == null) {
- break;
- }
- sb.append(line);
- }
- xml = sb.toString();
- getLog().debug(xml);
-
- } catch (IOException ex) {
-
- // In case of an IOException the connection will be released
- // back to the connection manager automatically
- throw ex;
-
- } catch (RuntimeException ex) {
-
- // In case of an unexpected exception you may want to abort
- // the HTTP request in order to shut down the underlying
- // connection and release it back to the connection manager.
- httpget.abort();
- throw ex;
-
- } finally {
-
- // Closing the input stream will trigger connection release
- reader.close();
-
- }
-
- }
- } catch (Exception e) {
- if (!ignoreErrors) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
- getLog().error(e);
- }
- if (errors != 0 || failures != 0) {
- if (!ignoreErrors) {
- throw new MojoExecutionException(xml);
- }
- getLog().error(xml);
- }
-
- }
-
- /**
- * A workaround to avoid logging conflict with Geronimo
- */
- private static void reset() {
- LogFactory.releaseAll();
-
- // Restore a reasonable default log impl
- System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
-
- // Make SimpleLog look more like Maven logs
- System.setProperty("org.apache.commons.logging.simplelog.showShortLogname", "false");
-
- // Restore default Geronimo bootstrap behavior
- System.getProperties().remove("geronimo.bootstrap.logging.enabled");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/LICENSE b/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/NOTICE b/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/pom.xml b/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/pom.xml
deleted file mode 100644
index 0ce2fdcbaa..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-maven-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-maven-wsdl2java</artifactId>
- <packaging>maven-plugin</packaging>
- <name>Apache Tuscany SCA WSDL2Java Maven Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>2.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-wsdl2java</artifactId>
- <version>2.0-M1</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java b/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java
deleted file mode 100644
index 8021692521..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.wsdl2java.plugin;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator;
-
-/**
- * @version $Rev$ $Date$
- * @goal generate
- * @phase generate-sources
- * @description Generate SDO interface classes from an XML Schema
- */
-public class WSDL2JavaGeneratorMojo extends AbstractMojo {
- /**
- * The directory containing WSDL files; defaults to ${basedir}/src/main/wsdl
- * @parameter expression="${basedir}/src/main/wsdl"
- */
- private String wsdlDir;
-
- /**
- * Name of the WSDL file; if omitted all files in the directory are processed
- * @parameter
- */
- private File wsdlFile;
-
- /**
- * The Java package to generate into. By default the value is derived from the schema URI.
- *
- * @parameter
- */
- private String javaPackage;
-
- /**
- * The directory to generate into; defaults to ${project.build.directory}/wsdl2java-source
- *
- * @parameter expression="${project.build.directory}/wsdl2java-source"
- */
- private String targetDirectory;
-
- /**
- * The directory to generate into; defaults to ${project.build.directory}/wsdl2java-source
- *
- * @parameter
- */
- private WSDLFileOption[] wsdlFiles;
-
- /**
- * @parameter expression="${project.compileSourceRoots}"
- * @readonly
- */
- private List compilerSourceRoots;
-
- public void execute() throws MojoExecutionException {
-
- if(null != wsdlFiles){
- for(int i=0; i< wsdlFiles.length ; ++i ){
- System.err.println("wsdlFiles" + wsdlFiles[i].getFileName());
- WSDLFileOption wf = wsdlFiles[i];
-
- if(null == wf.getTargetDirectory())
- wf.setTargetDirectory(targetDirectory);
- if(null == wf.getJavaPackage()){
- wf.setJavaPackage(javaPackage);
- }
- if(wf.getFileName() == null || wf.getFileName().length() ==0){
- throw new MojoExecutionException("no fileName specfied for wsdl.");
- }
- if(!wf.getFileName().canRead() || !wf.getFileName().isFile()){
-
- throw new MojoExecutionException("file can not be read:"+wf.getFileName());
- }
-
- }
- }else{
-
-
-
- if (wsdlFile == null) {
-
- File[] files = new File(wsdlDir).listFiles(FILTER);
-
- wsdlFiles= new WSDLFileOption[files.length];
- for(int i= files.length -1; i> -1; --i){
-
-
- wsdlFiles[i] = new WSDLFileOption();
- wsdlFiles[i].setFileName(files[i]);
- wsdlFiles[i].setJavaPackage(javaPackage);
- wsdlFiles[i].setPorts(null);
- wsdlFiles[i].setTargetDirectory(targetDirectory);
-
-
- }
-
- } else {
- wsdlFiles= new WSDLFileOption[]{new WSDLFileOption()};
- wsdlFiles[0].setFileName(wsdlFile);
- wsdlFiles[0].setJavaPackage(javaPackage);
- wsdlFiles[0].setPorts(null);
- wsdlFiles[0].setTargetDirectory(targetDirectory);
- }
- }
-
- int genOptions = 0;
-
- for (int i = 0; i < wsdlFiles.length; i++) {
- File file = wsdlFiles[i].getFileName();
- File marker = new File(targetDirectory, ".gen#" + file.getName()+".wsdl2java");
- if (file.lastModified() > marker.lastModified()) {
- getLog().info("Generating Java service interfaces from " + file);
- WSDL2JavaGenerator.generateFromWSDL(file.toString(), wsdlFiles[i].getPorts(), wsdlFiles[i].getTargetDirectory(), wsdlFiles[i].getJavaPackage(), null, genOptions);
- }
- try {
- marker.createNewFile();
- } catch (IOException e) {
- throw new MojoExecutionException(e.getMessage(), e);
- }
- marker.setLastModified(System.currentTimeMillis());
- }
-
- compilerSourceRoots.add(targetDirectory);
- }
-
- private static final FileFilter FILTER = new FileFilter() {
- public boolean accept(File pathname) {
- return (pathname.isFile() || !pathname.isHidden());
- }
- };
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDLFileOption.java b/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDLFileOption.java
deleted file mode 100644
index cc10c351b1..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/maven-wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDLFileOption.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.wsdl2java.plugin;
-
-import java.io.File;
-
-public class WSDLFileOption {
- /**
- * Name of the WSDL file; if omitted all files in the directory are processed
- *
- */
- private File fileName;
-
- /**
- * The Java package to generate into. By default the value is derived from the schema URI.
- *
- *
- */
- private String javaPackage;
-
- /**
- * The directory to generate into; defaults to ${project.build.directory}/wsdl2java-source
- *
- *
- */
- private String targetDirectory;
-
- /**
- * @parameter expression="${project.compileSourceRoots}"
- * @readonly
- */
-
- private String ports[];
-
- /**
- * @parameter expression="${project.compileSourceRoots}"
- * @readonly
- */
-
-
- public WSDLFileOption(){}
-
- public String getJavaPackage() {
- return javaPackage;
- }
-
- public void setJavaPackage(String javaPackage) {
- this.javaPackage = javaPackage;
- }
-
-
- public String[] getPorts() {
- return ports;
- }
-
- public void setPorts(String[] ports) {
- this.ports = ports;
- }
-
- public String getTargetDirectory() {
- return targetDirectory;
- }
-
- public void setTargetDirectory(String targetDirectory) {
- this.targetDirectory = targetDirectory;
- }
-
- public File getFileName() {
- return fileName;
- }
-
- public void setFileName(File fileName) {
- this.fileName = fileName;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/maven/pom.xml b/tags/java/sca/2.0-M1/tools/maven/pom.xml
deleted file mode 100644
index cf7b01b30a..0000000000
--- a/tags/java/sca/2.0-M1/tools/maven/pom.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <packaging>pom</packaging>
- <artifactId>tuscany-sca-maven-tools</artifactId>
- <name>Apache Tuscany SCA Maven Tools</name>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>maven-ant-generator</module>
- <module>maven-bundle-plugin</module>
- <module>maven-osgi-junit</module>
- <module>maven-dependency-lister</module>
- <module>maven-eclipse-compiler</module>
- <module>maven-incremental-build</module>
- <module>maven-java2wsdl</module>
- <module>maven-web-junit</module>
- <module>maven-wsdl2java</module>
- </modules>
- </profile>
- </profiles>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/pom.xml b/tags/java/sca/2.0-M1/tools/pom.xml
deleted file mode 100644
index 38e8b3eff7..0000000000
--- a/tags/java/sca/2.0-M1/tools/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-sca-tools</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Tools</name>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>sdo</module>
- <module>maven</module>
-<!--
- <module>eclipse</module>
- <module>runtime-inspector</module>
--->
- </modules>
- </profile>
- <profile>
- <id>eclipse</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>sdo</module>
- <module>maven</module>
-<!--
- <module>eclipse</module>
- <module>runtime-inspector</module>
--->
- </modules>
- </profile>
- </profiles>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/LICENSE b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/NOTICE b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/pom.xml b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/pom.xml
deleted file mode 100644
index fb651e1850..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/pom.xml
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-sdo-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-java2wsdl</artifactId>
- <name>Apache Tuscany SCA Java2WSDL Tool</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-impl</artifactId>
- <version>1.1.1</version>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0-2</version>
- </dependency>
-
- <dependency>
- <groupId>wsdl4j</groupId>
- <artifactId>wsdl4j</artifactId>
- <version>1.6.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.neethi</groupId>
- <artifactId>neethi</artifactId>
- <version>2.0.4</version>
- <exclusions>
- <exclusion>
- <groupId>wsdl4j</groupId>
- <artifactId>wsdl4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-java2wsdl</artifactId>
- <version>1.4.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-codegen</artifactId>
- <version>1.4.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.emf</groupId>
- <artifactId>codegen</artifactId>
- <version>2.2.3</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.emf</groupId>
- <artifactId>codegen-ecore</artifactId>
- <version>2.2.3</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>
- <version>1.0</version>
- <executions>
- <execution>
- <id>add-test-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/sdo-source</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-plugin</artifactId>
- <version>1.1.1</version>
- <executions>
- <execution>
- <id>generate-sdo</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/test/resources/CreditScoreDocLit.wsdl
- </schemaFile>
- <javaPackage>org.example.creditscore.doclit</javaPackage>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <!-- temporarily using indiana state univ as eclipse site diesnt have 2.2.2 at the moment -->
- <id>indiana</id>
- <url>http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/maven2/
- </url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java
deleted file mode 100644
index 60afe70534..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.apache.axis2.description.java2wsdl.Java2WSDLUtils;
-import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption;
-
-/**
- * This class encapsulates the parameters that effect the generation of the WSDL. For example they contain all user settings such as source class,
- * target location etc.
- *
- */
-public class GenerationParameters implements TuscanyJava2WSDLConstants {
- public static final String WSDL_FILENAME_SUFFIX = ".wsdl";
-
- public static final String XSD_IMPORT_DELIMITER = "[,]";
-
- private Map cmdLineOptions = null;
-
- private File outputFile = null;
-
- private FileOutputStream outputFileStream = null;
-
- private String sourceClassName = null;
-
- private ArrayList extraClasses;
-
- private ArrayList factoryClassNames;
-
- private String attrFormDefault = null;
-
- private String elementFormDefault = null;
-
- private String targetNamespace = null;
-
- private String targetNamespacePrefix = null;
-
- private String schemaTargetNamespace = null;
-
- private String schemaTargetNamespacePrefix = null;
-
- private String outputFileName = null;
-
- private ClassLoader classLoader = null;
-
- private String serviceName = null;
-
- private String style = DOCUMENT;
-
- private String use = LITERAL;
-
- private String locationUri = DEFAULT_LOCATION_URL;
-
- private Map schemaLocationMap = null;
-
- public GenerationParameters(Map cmdLineOptions) throws Exception {
- this.cmdLineOptions = cmdLineOptions;
- loadParameters();
- }
-
- protected void loadParameters() throws Exception {
- initializeSourceClassName();
- resolveFileOutputStream();
- resolveClassLoader4InputClasspath();
- loadSchemaLocationMap();
- initializeOtherParams();
- }
-
- private Java2WSDLCommandLineOption loadOption(String shortOption, String longOption) {
- // short option gets precedence
- Java2WSDLCommandLineOption option = null;
- if (longOption != null) {
- option = (Java2WSDLCommandLineOption) cmdLineOptions.get(longOption);
- if (option != null) {
- return option;
- }
- }
- if (shortOption != null) {
- option = (Java2WSDLCommandLineOption) cmdLineOptions.get(shortOption);
- }
-
- return option;
- }
-
- protected void initializeSourceClassName() throws Exception {
- Java2WSDLCommandLineOption option = loadOption(CLASSNAME_OPTION, CLASSNAME_OPTION_LONG);
- sourceClassName = option == null ? null : option.getOptionValue();
-
- if (sourceClassName == null || sourceClassName.equals("")) {
- throw new Exception("class name must be present!");
- }
- }
-
- /**
- * @throws Exception
- */
- protected void resolveFileOutputStream() throws Exception {
- File outputFolder;
- Java2WSDLCommandLineOption option = loadOption(OUTPUT_LOCATION_OPTION, OUTPUT_LOCATION_OPTION_LONG);
- String outputFolderName = option == null ? System.getProperty("user.dir") : option.getOptionValue();
-
- outputFolder = new File(outputFolderName);
- if (!outputFolder.exists()) {
- outputFolder.mkdirs();
- } else if (!outputFolder.isDirectory()) {
- throw new Exception("The specified location " + outputFolderName + "is not a folder");
- }
-
- option = loadOption(OUTPUT_FILENAME_OPTION, OUTPUT_FILENAME_OPTION_LONG);
- String outputFileName = option == null ? null : option.getOptionValue();
- // derive a file name from the class name if the filename is not specified
- if (outputFileName == null) {
- outputFileName = Java2WSDLUtils.getSimpleClassName(sourceClassName) + WSDL_FILENAME_SUFFIX;
- }
-
- // first create a file in the given location
- File outputFile = new File(outputFolder, outputFileName);
- try {
- if (!outputFile.exists()) {
- outputFile.createNewFile();
- }
- outputFileStream = new FileOutputStream(outputFile);
- } catch (IOException e) {
- throw new Exception(e);
- }
- }
-
- protected void addToSchemaLocationMap(String optionValue) throws Exception {
- // option value will be of the form [namespace, schemalocation]
- // hence we take the two substrings starting after '[' and upto ',' and
- // starting after ',' and upto ']'
- getSchemaLocationMap().put(optionValue.substring(1, optionValue.indexOf(COMMA)),
- optionValue.substring(optionValue.indexOf(COMMA) + 1, optionValue.length() - 1));
- }
-
- protected void loadSchemaLocationMap() throws Exception {
- Java2WSDLCommandLineOption option = loadOption(IMPORT_XSD_OPTION, IMPORT_XSD_OPTION_LONG);
-
- if (option != null) {
- ArrayList optionValues = option.getOptionValues();
-
- for (int count = 0; count < optionValues.size(); ++count) {
- addToSchemaLocationMap(((String) optionValues.get(count)).trim());
- }
- }
- }
-
- protected void resolveClassLoader4InputClasspath() throws Exception {
- URL[] urls = null;
- Java2WSDLCommandLineOption option = loadOption(CLASSPATH_OPTION, CLASSPATH_OPTION_LONG);
-
- if (option != null) {
- ArrayList optionValues = option.getOptionValues();
- urls = new URL[optionValues.size()];
- String[] classPathEntries = (String[]) optionValues.toArray(new String[optionValues.size()]);
-
- try {
- for (int i = 0; i < classPathEntries.length; i++) {
- String classPathEntry = classPathEntries[i];
- // this should be a file(or a URL)
- if (Java2WSDLUtils.isURL(classPathEntry)) {
- urls[i] = new URL(classPathEntry);
- } else {
- urls[i] = new File(classPathEntry).toURL();
- }
- }
- } catch (MalformedURLException e) {
- throw new Exception(e);
- }
-
- } else {
- //Default to pwd
- urls = new URL[1];
- File pwd = new File(".");
- urls[0] = pwd.toURL();
- }
-
- classLoader = new URLClassLoader(urls, Thread.currentThread().getContextClassLoader());
- }
-
- protected void initializeOtherParams() {
- // set the other parameters to the builder
- Java2WSDLCommandLineOption option =
- loadOption(SCHEMA_TARGET_NAMESPACE_OPTION, SCHEMA_TARGET_NAMESPACE_OPTION_LONG);
- schemaTargetNamespace = (option == null) ? null : option.getOptionValue();
-
- option = loadOption(SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION, SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION_LONG);
- schemaTargetNamespacePrefix = (option == null) ? null : option.getOptionValue();
-
- option = loadOption(TARGET_NAMESPACE_OPTION, TARGET_NAMESPACE_OPTION_LONG);
- targetNamespace = (option == null) ? null : option.getOptionValue();
-
- option = loadOption(TARGET_NAMESPACE_PREFIX_OPTION, TARGET_NAMESPACE_PREFIX_OPTION_LONG);
- targetNamespacePrefix = (option == null) ? null : option.getOptionValue();
-
- option = loadOption(SERVICE_NAME_OPTION, SERVICE_NAME_OPTION_LONG);
- serviceName = (option == null) ? Java2WSDLUtils.getSimpleClassName(sourceClassName) : option.getOptionValue();
-
- option = loadOption(STYLE_OPTION, STYLE_OPTION);
- style = (option == null) ? null : option.getOptionValue();
-
- option = loadOption(LOCATION_OPTION, LOCATION_OPTION);
- locationUri = (option == null) ? null : option.getOptionValue();
-
- option = loadOption(USE_OPTION, USE_OPTION);
- use = (option == null) ? null : option.getOptionValue();
-
- option = loadOption(ATTR_FORM_DEFAULT_OPTION, ATTR_FORM_DEFAULT_OPTION_LONG);
- attrFormDefault = (option == null) ? null : option.getOptionValue();
-
- option = loadOption(ELEMENT_FORM_DEFAULT_OPTION, ELEMENT_FORM_DEFAULT_OPTION_LONG);
- elementFormDefault = option == null ? null : option.getOptionValue();
-
- option = loadOption(TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION, TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION_LONG);
- extraClasses = option == null ? new ArrayList() : option.getOptionValues();
-
- option = loadOption(TuscanyJava2WSDLConstants.FACTORY_CLASSNAMES_OPTION, TuscanyJava2WSDLConstants.FACTORY_CLASSNAMES_OPTION_LONG);
- factoryClassNames = option == null ? new ArrayList() : option.getOptionValues();
- }
-
- public ClassLoader getClassLoader() {
- return classLoader;
- }
-
- public void setClassLoader(ClassLoader classLoader) {
- this.classLoader = classLoader;
- }
-
- public String getLocationUri() {
- if (locationUri == null) {
- locationUri = DEFAULT_LOCATION_URL;
- }
- return locationUri;
- }
-
- public void setLocationUri(String locationUri) {
- this.locationUri = locationUri;
- }
-
- public FileOutputStream getOutputFileStream() {
- return outputFileStream;
- }
-
- public void setOutputFileStream(FileOutputStream outputFileStream) {
- this.outputFileStream = outputFileStream;
- }
-
- public String getSchemaTargetNamespace() throws Exception {
- if (schemaTargetNamespace == null || schemaTargetNamespace.trim().equals("")) {
- // This amounts to assuming we want the wrapper elements in the same TNS
- // as the WSDL definitions.
- //
- // If the user neither specifies a TNS nor a SchemaTNS then both of these two
- // will continue to default to the same NS calculated from the input class' package name.
- //
- // The wrapper elements aren't really interesting outside the context of the WSDL types
- // section, so it seems reasonable to think that a user who cares to select a non-default
- // TNS for the WSDL definitions might want the wrapper elements defined in that same
- // NS.
- //
- // The user can always override this default.
-
- this.schemaTargetNamespace = this.getTargetNamespace();
- }
- return schemaTargetNamespace;
- }
-
- public void setSchemaTargetNamespace(String schemaTargetNamespace) {
- this.schemaTargetNamespace = schemaTargetNamespace;
- }
-
- public String getSchemaTargetNamespacePrefix() {
- if (schemaTargetNamespacePrefix == null || schemaTargetNamespacePrefix.trim().equals("")) {
- this.schemaTargetNamespacePrefix = SCHEMA_NAMESPACE_PRFIX;
- }
-
- return schemaTargetNamespacePrefix;
- }
-
- public void setSchemaTargetNamespacePrefix(String schemaTargetNamespacePrefix) {
- this.schemaTargetNamespacePrefix = schemaTargetNamespacePrefix;
- }
-
- public String getServiceName() {
- if (serviceName == null) {
- serviceName = Java2WSDLUtils.getSimpleClassName(getSourceClassName());
- }
- return serviceName;
- }
-
- public void setServiceName(String serviceName) {
- this.serviceName = serviceName;
- }
-
- public String getSourceClassName() {
- return sourceClassName;
- }
-
- public void setSourceClassName(String sourceClassName) {
- this.sourceClassName = sourceClassName;
- }
-
- public String getStyle() {
- if (style == null) {
- style = DOCUMENT;
- }
- return style;
- }
-
- public void setStyle(String style) {
- this.style = style;
- }
-
- public String getTargetNamespace() throws Exception {
- if (targetNamespace == null) {
- targetNamespace = Java2WSDLUtils.namespaceFromClassName(this.sourceClassName, this.classLoader).toString();
- }
- return targetNamespace;
- }
-
- public void setTargetNamespace(String targetNamespace) {
- this.targetNamespace = targetNamespace;
- }
-
- public String getTargetNamespacePrefix() {
- return targetNamespacePrefix;
- }
-
- public void setTargetNamespacePrefix(String targetNamespacePrefix) {
- this.targetNamespacePrefix = targetNamespacePrefix;
- }
-
- public String getUse() {
- if (use == null) {
- use = LITERAL;
- }
- return use;
- }
-
- public void setUse(String use) {
- this.use = use;
- }
-
- public Map getSchemaLocationMap() {
- if (schemaLocationMap == null) {
- schemaLocationMap = new Hashtable();
- }
- return schemaLocationMap;
- }
-
- public void setSchemaLocationMap(Map schemaLocationMap) {
- this.schemaLocationMap = schemaLocationMap;
- }
-
- public String getAttrFormDefault() {
- if (attrFormDefault == null) {
- attrFormDefault = FORM_DEFAULT_UNQUALIFIED;
- }
- return attrFormDefault;
- }
-
- public void setAttrFormDefault(String attrFormDefault) {
- this.attrFormDefault = attrFormDefault;
- }
-
- public String getElementFormDefault() {
- if (elementFormDefault == null) {
- elementFormDefault = FORM_DEFAULT_QUALIFIED;
- }
- return elementFormDefault;
- }
-
- public void setElementFormDefault(String elementFormDefault) {
- this.elementFormDefault = elementFormDefault;
- }
-
- public ArrayList getExtraClasses() {
- return extraClasses;
- }
-
- public void setExtraClasses(ArrayList extraClasses) {
- this.extraClasses = extraClasses;
- }
-
- public ArrayList getFactoryClassNames() {
- return factoryClassNames;
- }
-
- public void setFactoryClassNames(ArrayList factoryClassNames) {
- this.factoryClassNames = factoryClassNames;
- }
-
- // Not a command-line parameter, but will be useful for printing status message
- protected File getOutputFile() {
- return outputFile;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java
deleted file mode 100644
index a890dd624d..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOptionParser;
-
-/**
- * This class provides the tooling abstraction to Tuscany Java2WSDL and can be
- * invoked from command line with the following options as with Axis2 Java2WSDL
- */
-public class Java2WSDL {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // parse the cmd line args
- Java2WSDLCommandLineOptionParser commandLineOptionParser = new Java2WSDLCommandLineOptionParser(args);
-
- // validate the arguments
- validateCommandLineOptions(commandLineOptionParser);
-
- Java2WSDLGeneratorFactory.getInstance().createGenerator().generateWSDL(commandLineOptionParser.getAllOptions());
-
- // Uncomment the following statement to directly run the Axis2 tool
- // without
- // runAxis2Tool(args);
- }
-
- private static void runAxis2Tool(String[] args) {
- org.apache.ws.java2wsdl.Java2WSDL.main(args);
- }
-
- private static void validateCommandLineOptions(Java2WSDLCommandLineOptionParser parser) {
- if (parser.getAllOptions().size() == 0) {
- printUsage();
- } else if (parser.getInvalidOptions(new TuscanyJava2WSDLOptionsValidator()).size() > 0) {
- printUsage();
- }
-
- }
-
- public static void printUsage() {
- System.out.println("Usage java2wsdl -cn <fully qualified class name> : class file name");
- System.out.println("-o <output Location> : output file location");
- System.out.println("-cp <class path uri> : list of classpath entries - (urls)");
- System.out.println("-tn <target namespace> : target namespace");
- System.out.println("-tp <target namespace prefix> : target namespace prefix");
- System.out.println("-stn <schema target namespace> : target namespace for schema");
- System.out.println("-stp <schema target namespace prefix> : target namespace prefix for schema");
- System.out.println("-sn <service name> : service name");
- System.out.println("-of <output file name> : output file name for the WSDL");
- System.out.println("-st <binding style> : style for the WSDL");
- System.out.println("-u <binding use> : use for the WSDL");
- System.out.println("-l <soap address> : address of the port for the WSDL");
- System.out
- .println("-ixsd [<schema namespace 1>,<schema loc 1>] [<schema namespace 2>,<schema loc 2>] ... [<schema namespace N>,<schema loc N>] : schemas to be imported (without a comma in between brackets)");
- System.out.println("-efd <unqualified> : Setting for elementFormDefault (defaults to qualified)");
- System.out.println("-afd <unqualified> : Setting for attributeFormDefault (defaults to qualified)");
- System.out
- .println("-fcn <Generated SDO Factory classname 1> <Generated SDO Factory classname 2> ... <Generated SDO Factory classname N> (without a comma in between) ");
-
- System.out
- .println("-xc <extra class> : Extra class for which schematype must be generated. " + "\t\tUse as : -xc class1 -xc class2 ...");
- System.exit(0);
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java
deleted file mode 100644
index 9c8ff9df9e..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.io.OutputStream;
-import java.util.Map;
-
-/**
- * This is the Java2WSDL Generator facade that will be used by Tuscany
- * components for Java to WSDL conversion.
- *
- */
-public interface Java2WSDLGenerator {
- public void generateWSDL(String[] args);
-
- public void generateWSDL(Map commandLineOptions);
-
- public void addWSDLGenListener(WSDLGenListener l);
-
- public void removeWSDLGenListener(WSDLGenListener l);
-
- public Map getCommandLineOptions();
-
- public void setCommandLineOptoins(Map cmdLineOpts);
-
- public OutputStream getOutputStream();
-
- public void setOutputStream(OutputStream outStream);
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java
deleted file mode 100644
index e8f3db95b0..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.util.Vector;
-
-/**
- * Factory that creates Java2WSDL Generators. Presently the there is a Default
- * Generator that wraps around the AXIS2 Java2WSDL implementation. The factory
- * can be extended to create generators that wrap around other implementations
- * if required.
- */
-
-public class Java2WSDLGeneratorFactory {
- /*
- * singleton instance of this factory class
- */
- private static Java2WSDLGeneratorFactory factory = null;
-
- /**
- * code for the default generator
- */
- public static final int DEFAULT_GENERATOR = 0;
-
- /**
- * Default Generator class name
- */
- public static final String DEFAULT_GENERATOR_CLASSNAME = "org.apache.tuscany.tools.java2wsdl.generate.Java2WSDLGeneratorImpl";
-
- /**
- * list of generator classnames in a position that corresponds to their
- * code. For example the default generator's code is 0 and hence this
- * generator's classname is stored at index '0' of the list
- */
- protected Vector<String> generatorClassNames = new Vector<String>();
-
- /**
- * @return the singleton instance of this generator factory
- */
- public static Java2WSDLGeneratorFactory getInstance() {
- if (factory == null) {
- factory = new Java2WSDLGeneratorFactory();
- }
- return factory;
- }
-
- private Java2WSDLGeneratorFactory() {
- generatorClassNames.addElement(DEFAULT_GENERATOR_CLASSNAME);
- }
-
- public Java2WSDLGenerator createGenerator() {
- return createGenerator(DEFAULT_GENERATOR);
- }
-
- /**
- * creates an instance of a Java2WSDL Generator based on the input type
- *
- * @param genType
- * type of the generator to be created
- * @return an instance of a Java2WSDL Generator
- */
- public Java2WSDLGenerator createGenerator(int genType) {
- try {
- return (Java2WSDLGenerator) (Class.forName(generatorClassNames
- .elementAt(genType)).newInstance());
- } catch (Exception e) {
- System.out
- .println(" Unable to create Java2WSDL generator due to .....");
- System.out.println(e);
- return null;
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java
deleted file mode 100644
index f60f7b8ca5..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.io.OutputStream;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.util.XMLPrettyPrinter;
-import org.apache.ws.java2wsdl.Java2WSDL;
-import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption;
-import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOptionParser;
-import org.apache.ws.java2wsdl.utils.Java2WSDLOptionsValidator;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This is an implementation of the Java2WSDLGenerator facade. This
- * implementation is a decorator around the Axis2 implementation of the
- * Java2WSDL conversion. The WSDL generation is divided into phases that are
- * stringed up as a template method. The phases are - User Input Validation -
- * WSDL Java Model Generation - Serialization of WSDL Java Model The function of
- * each phase is accomplished by delegation to the appropriate classes in Axis2.
- * At the start and end of each phase an event is published to subscribers
- * denoting the start and end of the phase. Such a splitting up of the Java2WSDL
- * conversion into phases has been designed to enable interceptors to modify the
- * model or apply transformations to the output. Typically the interceptors can
- * subscribe to the start and end events of these phases and hence be able to
- * intercept. Note: This class contains substantial AXIS2 Java2WSDL code
- * refactored into it. These will be removed as and when the Axis2 code is
- * fixed.
- */
-public class Java2WSDLGeneratorImpl implements Java2WSDLGenerator, TuscanyJava2WSDLConstants {
- private List<WSDLGenListener> genPhaseListeners = new Vector<WSDLGenListener>();
- private GenerationParameters genParams = null;
- private Map<String, Java2WSDLCommandLineOption> commandLineOptions = null;
- private TuscanyJava2WSDLBuilder java2WsdlBuilder;
- private OutputStream outputStream = null;
-
- public Java2WSDLGeneratorImpl() {
-
- }
-
- private void multicastGenPhaseCompletionEvent(int genPhase) {
- WSDLGenEvent event = new WSDLGenEvent(this, genPhase);
- Iterator iterator = genPhaseListeners.iterator();
- while (iterator.hasNext()) {
- ((WSDLGenListener)iterator.next()).WSDLGenPhaseCompleted(event);
- }
- }
-
- private void initJava2WSDLBuilder() throws Exception {
- // Now we are done with loading the basic values - time to create the
- // builder
- java2WsdlBuilder = new TuscanyJava2WSDLBuilder(genParams);
- }
-
- protected boolean validateInputArgs(String[] args) {
- boolean isValid = true;
- Java2WSDLCommandLineOptionParser parser = new Java2WSDLCommandLineOptionParser(args);
- if (parser.getAllOptions().size() == 0) {
- Java2WSDL.printUsage();
- isValid = false;
- } else if (parser.getInvalidOptions(new Java2WSDLOptionsValidator()).size() > 0) {
- Java2WSDL.printUsage();
- isValid = false;
- }
-
- if (isValid) {
- commandLineOptions = parser.getAllOptions();
- }
-
- return isValid;
- }
-
- public boolean buildWSDLDocument() throws Exception {
- boolean isComplete = true;
- initJava2WSDLBuilder();
- java2WsdlBuilder.buildWSDL();
-
- return isComplete;
- }
-
- public boolean serializeWSDLDocument() throws Exception {
- boolean isComplete = true;
-
- if (getOutputStream() == null) {
- setOutputStream(genParams.getOutputFileStream());
- }
-
- // transform the OMElement
- OMElement om = java2WsdlBuilder.getWsdlDocument();
- XMLPrettyPrinter.prettify(om, getOutputStream());
-
- return isComplete;
-
- }
-
- /*
- * This is the template method that splits the Java2WSDL generation cycle
- * into phase / steps.
- *
- * @see tuscany.tools.Java2WSDLGeneratorIfc#generateWSDL(java.lang.String[])
- */
- public void generateWSDL(Map commandLineOptions) {
- try {
- // load the user options into an easy to access abstraction
- genParams = new GenerationParameters(commandLineOptions);
-
- // if the WSDL Model generation was successful
- if (buildWSDLDocument()) {
- // multicast event for generation of WSDL model
- multicastGenPhaseCompletionEvent(WSDLGenListener.WSDL_MODEL_CREATION);
- // if the Serialization of the generated (and fixed) model
- // is successful
- if (serializeWSDLDocument()) {
- // multicast event for writing of the WSDL Model to
- // supplied output stream
- multicastGenPhaseCompletionEvent(WSDLGenListener.WSDL_MODEL_WRITING);
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void generateWSDL(String[] args) {
- // if the argument input are found to be valid
- if (validateInputArgs(args)) {
- // multicast event for input args validation complete
- multicastGenPhaseCompletionEvent(WSDLGenListener.INPUT_ARGS_VALIDATION);
- generateWSDL(commandLineOptions);
- }
- }
-
- public void addWSDLGenListener(WSDLGenListener l) {
- genPhaseListeners.add(l);
-
- }
-
- public void removeWSDLGenListener(WSDLGenListener l) {
- genPhaseListeners.remove(l);
- }
-
- public Map getCommandLineOptions() {
- return commandLineOptions;
- }
-
- public void setCommandLineOptoins(Map cmdLineOpts) {
- commandLineOptions = cmdLineOpts;
- }
-
- public OutputStream getOutputStream() {
- return outputStream;
- }
-
- public void setOutputStream(OutputStream outStream) {
- outputStream = outStream;
- }
-
- public TuscanyJava2WSDLBuilder getJava2WsdlBuilder() {
- return java2WsdlBuilder;
- }
-
- public void setJava2WsdlBuilder(TuscanyJava2WSDLBuilder java2WsdlBuilder) {
- this.java2WsdlBuilder = java2WsdlBuilder;
- }
-
- //
- // Works recursively with node's entire subtree
- // There's no tie to fields in this object so I made this public.
- //
- public static void removeTextNodes(Node node) {
-
- if (node == null)
- return;
-
- if (node.getNodeType() == Node.TEXT_NODE) {
- node.getParentNode().removeChild(node);
- } else {
- int origNumNodes;
- NodeList children = null;
- do {
- children = node.getChildNodes();
- origNumNodes = children.getLength();
-
- for (int i = 0; i < origNumNodes; i++) {
- removeTextNodes(children.item(i));
- }
- } while (node.getChildNodes().getLength() != origNumNodes);
- }
- }
-
- protected void printGenerationMessage() {
- System.out.println("");
- System.out.println("Generating " + genParams.getOutputFile()
- + " from Java class "
- + genParams.getSourceClassName()
- + ".");
- System.out.println("");
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java
deleted file mode 100644
index 897700ffd9..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.io.StringReader;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axis2.description.java2wsdl.Java2WSDLUtils;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.ws.commons.schema.XmlSchemaComplexType;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaForm;
-import org.apache.ws.commons.schema.XmlSchemaGroupBase;
-import org.apache.ws.commons.schema.XmlSchemaImport;
-import org.apache.ws.commons.schema.XmlSchemaInclude;
-import org.apache.ws.commons.schema.XmlSchemaSequence;
-import org.apache.ws.commons.schema.XmlSchemaType;
-import org.apache.ws.commons.schema.utils.NamespaceMap;
-import org.codehaus.jam.JClass;
-import org.codehaus.jam.JProperty;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Type;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XSDHelper;
-
-public class SchemaBuilder implements TuscanyJava2WSDLConstants {
- public static final String NAME_SPACE_PREFIX = "stn_";
-
- private static int prefixCount = 1;
-
- public static final String MIXED = "mixed";
-
- public static final String GROUP = "group";
-
- protected String attrFormDefault = null;
-
- protected String elementFormDefault = null;
-
- protected XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection();
-
- private Hashtable schemaMap = new Hashtable();
-
- protected Hashtable targetNamespacePrefixMap = new Hashtable();
-
- protected TuscanyTypeTable typeTable = new TuscanyTypeTable();
-
- protected Map schemaLocationMap = null;
-
- private ClassLoader classLoader = null;
-
- private ArrayList factoryClassNames = null;
-
- private HelperContext helperContext = null;
-
- private XSDHelper xsdHelper = null;
-
- private Set<String> registeredSDOFactories = new HashSet<String>();
-
- boolean alreadyPrintedDefaultSDOFactoryFound = false;
-
- boolean alreadyPrintedDefaultSDOFactoryNotFound = false;
-
- protected SchemaBuilder(XmlSchemaCollection schemaCollection,
- Hashtable schemaMap,
- Hashtable nsPrefixMap,
- TuscanyTypeTable typeTable,
- String attrFormDef,
- String eleFormDef,
- Map schemaLocMap,
- ClassLoader classLoader,
- ArrayList factoryClassNames) {
- this.schemaMap = schemaMap;
- this.xmlSchemaCollection = schemaCollection;
- this.targetNamespacePrefixMap = nsPrefixMap;
- this.typeTable = typeTable;
- this.schemaLocationMap = schemaLocMap;
- this.classLoader = classLoader;
- this.attrFormDefault = attrFormDef;
- this.elementFormDefault = eleFormDef;
- this.factoryClassNames = factoryClassNames;
-
- // Register the types in the generated SDO factories
- this.helperContext = org.apache.tuscany.sdo.api.SDOUtil.createHelperContext();
- this.xsdHelper = helperContext.getXSDHelper();
-
- Class factoryClass = null;
- for (Object factoryClassName : this.factoryClassNames) {
- try {
- factoryClass = Class.forName((String)factoryClassName, true, classLoader);
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- System.out.println("");
- System.out.println("Generated SDO Factory class with name: " + factoryClassName + " could not be loaded. Exiting.");
- throw new IllegalArgumentException(e);
- }
- registerSDOFactory(factoryClass);
- }
- }
-
- private boolean isSDO(JClass javaType) throws Exception {
-
- Class sdoClass = Class.forName(javaType.getQualifiedName(), true, classLoader);
-
- return DataObject.class.isAssignableFrom(sdoClass);
- }
-
- private void buildComplexTypeContents_JavaType(JClass javaType,
- XmlSchemaComplexType complexType,
- XmlSchema xmlSchema) throws Exception {
- JProperty[] properties = javaType.getDeclaredProperties();
-
- for (int i = 0; i < properties.length; i++) {
- JProperty property = properties[i];
- String propertyName = property.getType().getQualifiedName();
- boolean isArryType = property.getType().isArrayType();
- if (isArryType) {
- propertyName = property.getType().getArrayComponentType().getQualifiedName();
- }
-
- if (typeTable.isSimpleType(propertyName)) {
- XmlSchemaElement elt1 = new XmlSchemaElement();
- elt1.setName(getCorrectName(property.getSimpleName()));
- elt1.setSchemaTypeName(typeTable.getSimpleSchemaTypeName(propertyName));
- ((XmlSchemaGroupBase) complexType.getParticle()).getItems().add(elt1);
- if (isArryType) {
- elt1.setMaxOccurs(Long.MAX_VALUE);
- elt1.setMinOccurs(0);
- }
- } else {
- QName schemaTypeName = null;
- if (isArryType) {
- schemaTypeName = generateSchema(property.getType().getArrayComponentType());
- } else {
- schemaTypeName = generateSchema(property.getType());
- }
-
- XmlSchemaElement elt1 = new XmlSchemaElement();
- elt1.setName(getCorrectName(property.getSimpleName()));
- elt1.setSchemaTypeName(schemaTypeName);
- ((XmlSchemaGroupBase) complexType.getParticle()).getItems().add(elt1);
-
- if (isArryType) {
- elt1.setMaxOccurs(Long.MAX_VALUE);
- elt1.setMinOccurs(0);
- }
-
- addImports(xmlSchema,
- schemaTypeName);
- }
- }
- }
-
- protected QName buildSchema_JavaType(JClass javaType) throws Exception {
- QName schemaTypeName = typeTable.getComplexSchemaTypeName(javaType, this.classLoader);
- if (schemaTypeName == null) {
- String simpleName = javaType.getSimpleName();
-
- String packageName = javaType.getContainingPackage().getQualifiedName();
-
- String targetNameSpace =
- Java2WSDLUtils.schemaNamespaceFromClassName(javaType.getQualifiedName(), this.classLoader)
- .toString();
-
- XmlSchema xmlSchema = getXmlSchema(targetNameSpace);
- String targetNamespacePrefix = (String) targetNamespacePrefixMap.get(targetNameSpace);
-
- schemaTypeName = new QName(targetNameSpace, simpleName, targetNamespacePrefix);
- XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema);
- complexType.setName(simpleName);
-
- XmlSchemaSequence sequence = new XmlSchemaSequence();
- complexType.setParticle(sequence);
-
- createGlobalElement(xmlSchema,
- complexType,
- schemaTypeName);
- xmlSchema.getItems().add(complexType);
- xmlSchema.getSchemaTypes().add(schemaTypeName,
- complexType);
-
- // adding this type to the table
- // typeTable.addComplexScheam(name, complexType.getQName());
- typeTable.addComplexSchemaType(targetNameSpace,
- simpleName,
- schemaTypeName);
- buildComplexTypeContents_JavaType(javaType,
- complexType,
- xmlSchema);
- }
- return schemaTypeName;
- }
-
- protected QName buildSchema_SDO(Type dataType) // throws Exception
- {
- QName schemaTypeName = typeTable.getComplexSchemaTypeName(dataType.getURI(),
- dataType.getName());
-
- if (schemaTypeName == null) {
- // We can't load the XSDs into an XSDHelper and match them against the static SDOs; they will
- // never match. Instead let's take an all-or-nothing approach and say, if we've got this NS
- // in our map then we assume we have this Type as well in the corresponding XSD file.
- //
- boolean inXSDForm = schemaLocationMap.get(dataType.getURI()) != null;
-
- if (inXSDForm) {
- // if schemalocations for XSD has been specified, include them
-
- // External XSDs will be handled in processing the schema TNS of the wrapper elements.
- // This is partly because SDO codegen needs some modification in this area
- // So we won't bother including the external XSDs here at all.
- //
- // includeExtXSD(dataType);
- } else {
- List<Type> typeList = new Vector<Type>();
- typeList.add(dataType);
-
- // the xsdhelper returns a string that contains the schemas for this type
- String schemaDefns = xsdHelper.generate(typeList, schemaLocationMap);
-
- // extract the schema elements and store them in the schema map
- extractSchemas(schemaDefns);
- }
- // since the XSDHelper will not return the type name, create it and store it in typetable
- schemaTypeName = new QName(dataType.getURI(), dataType.getName(), generatePrefix());
- typeTable.addComplexSchemaType(dataType.getURI(),
- dataType.getName(),
- schemaTypeName);
-
- }
- return schemaTypeName;
- }
-
- /**
- * Identify the java type (pojo versus sdo) and build the schema accordingly
- *
- * @param javaType reference to the class
- * @return
- * @throws Exception
- */
- public QName generateSchema(JClass javaType) throws Exception {
- if (isSDO(javaType)) {
- Type dataType = createDataObject(javaType).getType();
- return buildSchema_SDO(dataType);
- } else {
- return buildSchema_JavaType(javaType);
- }
- }
-
- private XmlSchema getXmlSchema(String targetNamespace) {
- XmlSchema xmlSchema;
-
- if ((xmlSchema = (XmlSchema) schemaMap.get(targetNamespace)) == null) {
- String targetNamespacePrefix = generatePrefix();
-
- xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection);
- xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting());
- xmlSchema.setElementFormDefault(getElementFormDefaultSetting());
-
- targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix);
- schemaMap.put(targetNamespace, xmlSchema);
-
- NamespaceMap prefixmap = new NamespaceMap();
- prefixmap.put(TuscanyTypeTable.XS_URI_PREFIX, TuscanyTypeTable.XML_SCHEMA_URI);
- prefixmap.put(targetNamespacePrefix, targetNamespace);
- xmlSchema.setNamespaceContext(prefixmap);
- }
- return xmlSchema;
- }
-
- /**
- * JAM convert first name of an attribute into UpperCase as an example if there is a instance variable called foo in a bean , then Jam give that
- * as Foo so this method is to correct that error
- *
- * @param wrongName
- * @return the right name, using English as the locale for case conversion
- */
- public static String getCorrectName(String wrongName) {
- if (wrongName.length() > 1) {
- return wrongName.substring(0, 1).toLowerCase(Locale.ENGLISH) + wrongName.substring(1, wrongName.length());
- } else {
- return wrongName.substring(0, 1).toLowerCase(Locale.ENGLISH);
- }
- }
-
- private String addImports(XmlSchema xmlSchema, QName schemaTypeName) {
- String prefix = null;
- String[] prefixes = xmlSchema.getNamespaceContext().getDeclaredPrefixes();
- for (int count = 0; count < prefixes.length; ++count) {
- if (schemaTypeName.getNamespaceURI().
- equals(xmlSchema.getNamespaceContext().getNamespaceURI(prefixes[count])) ) {
- return prefixes[count];
- }
- }
-
- XmlSchemaImport importElement = new XmlSchemaImport();
- importElement.setNamespace(schemaTypeName.getNamespaceURI());
- xmlSchema.getItems().add(importElement);
- prefix = generatePrefix();
- //it is safe to cast like this since it was this class that instantiated the
- //NamespaceContext and assigned it to an instance of a NamespaceMap (see method getXmlSchema)
- ((NamespaceMap)xmlSchema.getNamespaceContext()).put(prefix,
- schemaTypeName.getNamespaceURI());
-
- return prefix;
- }
-
- private String formGlobalElementName(String typeName) {
- String firstChar = typeName.substring(0, 1);
- return typeName.replaceFirst(firstChar, firstChar.toLowerCase());
- }
-
- private void createGlobalElement(XmlSchema xmlSchema, XmlSchemaComplexType complexType, QName elementName) {
- XmlSchemaElement globalElement = new XmlSchemaElement();
- globalElement.setSchemaTypeName(complexType.getQName());
- globalElement.setName(formGlobalElementName(complexType.getName()));
- globalElement.setQName(elementName);
-
- xmlSchema.getItems().add(globalElement);
- xmlSchema.getElements().add(elementName, globalElement);
- }
-
- private DataObject createDataObject(JClass sdoClass) throws Exception {
- Class sdoType = Class.forName(sdoClass.getQualifiedName(), true, classLoader);
-
- //register the factory
- detectAndRegisterFactory(sdoType);
-
- //create data object
- Constructor constructor = sdoType.getDeclaredConstructor(new Class[0]);
- constructor.setAccessible(true);
- Object instance = constructor.newInstance(new Object[0]);
- return (DataObject) instance;
- }
-
- private String generatePrefix() {
- return NAME_SPACE_PREFIX + prefixCount++;
- }
-
- private void includeExtXSD(Type dataType) {
- // now we know there is a type for which the XSD must come from outside
- // create a schema for the namespace of this type and add an include in it for
- // the xsd that is defined externally
- XmlSchema xmlSchema = getXmlSchema(dataType.getURI());
-
- // ideally there could be more than one external schema definitions for a namespace
- // and hence schemalocations will be a list of locations
- // List schemaLocations = (List)schemaLocationMap.get(dataType.getURI());
-
- // since as per the specs the input to XSDHelper is a map of <String, String> allowing
- // only one schemalocation for a namespace. So for now this single location will be
- // picked up and put into a list
- List schemaLocations = new Vector();
-
- if (schemaLocationMap.get(dataType.getURI()) != null) {
- schemaLocations.add(schemaLocationMap.get(dataType.getURI()));
- }
-
- if (schemaLocations.size() <= 0) {
- schemaLocations.add(DEFAULT_SCHEMA_LOCATION);
- }
-
- Iterator includesIterator = xmlSchema.getIncludes().getIterator();
- Iterator schemaLocIterator = schemaLocations.iterator();
- String aSchemaLocation = null;
- boolean includeExists = false;
- // include all external schema locations
- while (schemaLocIterator.hasNext()) {
- aSchemaLocation = (String) schemaLocIterator.next();
- while (includesIterator.hasNext()) {
- if (!includeExists
- && aSchemaLocation.equals(((XmlSchemaInclude) includesIterator.next()).getSchemaLocation())) {
- includeExists = true;
- }
- }
-
- if (!includeExists) {
- XmlSchemaInclude includeElement = new XmlSchemaInclude();
- includeElement.setSchemaLocation(aSchemaLocation);
- xmlSchema.getIncludes().add(includeElement);
- xmlSchema.getItems().add(includeElement);
- }
- }
-
- }
-
- private void extractSchemas(String schemaDefns) {
- // load each schema element and add it to the schema map
-
- String token = getToken(schemaDefns);
- int curIndex = schemaDefns.indexOf(token);
- int nextIndex = schemaDefns.indexOf(token,
- curIndex + token.length());
-
- while (curIndex != -1) {
- StringReader sr = null;
- if (nextIndex != -1)
- sr = new StringReader(schemaDefns.substring(curIndex,
- nextIndex));
- else
- sr = new StringReader(schemaDefns.substring(curIndex));
-
- XmlSchemaCollection collection = new XmlSchemaCollection();
- XmlSchema aSchema = collection.read(sr,
- null);
- addSchemaToMap(aSchema);
-
- curIndex = nextIndex;
- nextIndex = schemaDefns.indexOf(token,
- curIndex + token.length());
- }
- }
-
- private void addSchemaToMap(XmlSchema extractedSchema) {
- // check if a Schema object already exists in schema map for targetNamespace of this schema element
- // if it does then copy the contents of this schema element to the existing one, ensuring that
- // duplicate elements are not created. i.e. before adding some child element like 'include' or 'import'
- // check if it already exists, if it does don't add this
- XmlSchema existingSchema = (XmlSchema) schemaMap.get(extractedSchema.getTargetNamespace());
-
- if (existingSchema == null) {
- extractedSchema.setAttributeFormDefault(getAttrFormDefaultSetting());
- extractedSchema.setElementFormDefault(getElementFormDefaultSetting());
- schemaMap.put(extractedSchema.getTargetNamespace(), extractedSchema);
-
- } else {
- copySchemaItems(existingSchema,
- extractedSchema);
- }
- }
-
- private void copySchemaItems(XmlSchema existingSchema, XmlSchema aSchema) {
- // items to copy are imports, includes, elements, types ...
- // each item is checked if it is a duplicate entry and copied only if it isn't
- Iterator itemsIterator = aSchema.getItems().getIterator();
- Object schemaObject = null;
- XmlSchemaElement schemaElement = null;
- XmlSchemaType schemaType = null;
- XmlSchemaInclude schemaInclude = null;
- QName qName = null;
- List existingIncludes = getExistingIncludes(existingSchema);
-
- while (itemsIterator.hasNext()) {
- schemaObject = itemsIterator.next();
- if (schemaObject instanceof XmlSchemaElement) {
- schemaElement = (XmlSchemaElement) schemaObject;
- qName = schemaElement.getQName();
- // if the element does not exist in the existing schema
- if (existingSchema.getElementByName(qName) == null) {
- // add it to the existing schema
- existingSchema.getElements().add(qName, schemaElement);
- existingSchema.getItems().add(schemaElement);
- }
- } else if (schemaObject instanceof XmlSchemaType) {
- schemaType = (XmlSchemaType) itemsIterator.next();
- qName = schemaType.getQName();
- // if the element does not exist in the existing schema
- if (existingSchema.getElementByName(qName) == null) {
- // add it to the existing schema
- existingSchema.getSchemaTypes().add(qName, schemaType);
- existingSchema.getItems().add(schemaType);
- // add imports
- addImports(existingSchema, qName);
- }
- } else if (schemaObject instanceof XmlSchemaInclude) {
- schemaInclude = (XmlSchemaInclude) itemsIterator.next();
- if (!existingIncludes.contains(schemaInclude.getSchemaLocation())) {
- existingSchema.getIncludes().add(schemaInclude);
- existingSchema.getItems().add(schemaInclude);
- }
- }
- }
- }
-
- private List getExistingIncludes(XmlSchema xmlSchema) {
- List includeSchemaLocations = new Vector();
- Iterator iterator = xmlSchema.getIncludes().getIterator();
-
- while (iterator.hasNext()) {
- includeSchemaLocations.add(((XmlSchemaInclude) iterator.next()).getSchemaLocation());
- }
- return includeSchemaLocations;
- }
-
- private XmlSchemaForm getAttrFormDefaultSetting() {
- if (FORM_DEFAULT_UNQUALIFIED.equals(getAttrFormDefault())) {
- return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED);
- } else {
- return new XmlSchemaForm(XmlSchemaForm.QUALIFIED);
- }
- }
-
- private XmlSchemaForm getElementFormDefaultSetting() {
- if (FORM_DEFAULT_UNQUALIFIED.equals(getElementFormDefault())) {
- return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED);
- } else {
- return new XmlSchemaForm(XmlSchemaForm.QUALIFIED);
- }
- }
-
- private String getToken(String s) {
- // get the schema element name e.g. <xs:schema or <xsd:schema. We only know that 'schema' will be used
- // but not sure what suffix is used. Hence this method to get the actual element name used
- int i = s.indexOf(SCHEMA_ELEMENT_NAME);
- int j = s.substring(0,
- i).lastIndexOf("<");
- return s.substring(j,
- i + SCHEMA_ELEMENT_NAME.length());
- }
-
- public String getAttrFormDefault() {
- return attrFormDefault;
- }
-
- public void setAttrFormDefault(String attrFormDefault) {
- this.attrFormDefault = attrFormDefault;
- }
-
- public String getElementFormDefault() {
- return elementFormDefault;
- }
-
- public void setElementFormDefault(String elementFormDefault) {
- this.elementFormDefault = elementFormDefault;
- }
-
- private static String getPackageName(Class<?> cls) {
- String name = cls.getName();
- int index = name.lastIndexOf('.');
- return index == -1 ? "" : name.substring(0, index);
- }
-
- /**
- * Recognize the pattern of generated SDO type names vs. SDO factory names.
- * E.g. SDO class: test.sca.w2j.gen.Company will be associated with
- * SDO factory: test.sca.w2j.gen.GenFactory
- */
- private void detectAndRegisterFactory(Class sdoClass) {
- String pkgName = getPackageName(sdoClass);
-
- // Find last segment, e.g. from 'test.sca.w2j.gen' produce 'gen'.
- int lastDot = pkgName.lastIndexOf('.');
- String lastSegment = pkgName.substring(lastDot+1);
-
- String rest = lastSegment.substring(1);
- String firstChar = lastSegment.substring(0,1).toUpperCase();
-
- String factoryBaseName = pkgName + "." + firstChar + rest + "Factory";
-
- Class factoryClass = null;
- try {
- factoryClass = Class.forName(factoryBaseName, true, classLoader);
- if (!alreadyPrintedDefaultSDOFactoryFound) {
- System.out.println("Found default generated SDO Factory with name: " + factoryBaseName + "; Registering.");
- alreadyPrintedDefaultSDOFactoryFound = true;
- }
- registerSDOFactory(factoryClass);
- } catch (ClassNotFoundException e) {
- if (!alreadyPrintedDefaultSDOFactoryNotFound) {
- System.out.println("Did not find default generated SDO Factory with name: " + factoryBaseName + "; Continue." );
- alreadyPrintedDefaultSDOFactoryNotFound = true;
- }
- }
- }
-
- private void registerSDOFactory(Class factoryClass) {
- String factoryClassName = factoryClass.getName();
- if (!registeredSDOFactories.contains(factoryClassName)) {
- try {
- Field field = factoryClass.getField("INSTANCE");
- Object factoryImpl = field.get(null);
- Method method = factoryImpl.getClass().getMethod("register", new Class[] {HelperContext.class});
- method.invoke(factoryImpl, new Object[] {this.helperContext});
- } catch (Exception e) {
- e.printStackTrace();
- System.out.println("");
- System.out.println("Fatal error registering factoryClassName = " + factoryClassName);
- throw new IllegalArgumentException(e);
- }
- registeredSDOFactories.add(factoryClassName);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2OMBuilder.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2OMBuilder.java
deleted file mode 100644
index b793a8ea98..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2OMBuilder.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.io.ByteArrayInputStream;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-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.axiom.om.OMNode;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.codehaus.jam.JMethod;
-
-public class TuscanyJava2OMBuilder implements TuscanyJava2WSDLConstants {
-
- private TuscanyTypeTable typeTable = null;
-
- private static int prefixCount = 1;
-
- private static final String NAMESPACE_PREFIX = "ns";
-
- private JMethod method[];
-
- private Collection schemaCollection;
-
- private GenerationParameters generationParams;
-
- private OMNamespace ns1;
-
- private OMNamespace soap;
-
- private OMNamespace soap12;
-
- private OMNamespace tns;
-
- private OMNamespace wsdl;
-
- private OMNamespace mime;
-
- private OMNamespace http;
-
- public TuscanyJava2OMBuilder(JMethod[] method,
- Collection schemaCollection,
- TuscanyTypeTable typeTab,
- GenerationParameters genParams) {
- this.method = method;
- this.schemaCollection = schemaCollection;
- this.typeTable = typeTab;
- this.generationParams = genParams;
- }
-
- public OMElement generateOM() throws Exception {
- OMFactory fac = OMAbstractFactory.getOMFactory();
- wsdl = fac.createOMNamespace(WSDL_NAMESPACE, DEFAULT_WSDL_NAMESPACE_PREFIX);
- OMElement ele = fac.createOMElement("definitions", wsdl);
-
- ele.addAttribute("targetNamespace", generationParams.getTargetNamespace(), null);
- generateNamespaces(fac, ele);
- generateTypes(fac, ele);
- generateMessages(fac, ele);
- generatePortType(fac, ele);
- generateBinding(fac, ele);
- generateService(fac, ele);
- return ele;
- }
-
- private void generateNamespaces(OMFactory fac, OMElement defintions) throws Exception {
- soap = defintions.declareNamespace(URI_WSDL11_SOAP, SOAP11_PREFIX);
- tns =
- defintions.declareNamespace(generationParams.getTargetNamespace(), generationParams
- .getTargetNamespacePrefix());
- soap12 = defintions.declareNamespace(URI_WSDL12_SOAP, SOAP12_PREFIX);
- http = defintions.declareNamespace(HTTP_NAMESPACE, HTTP_PREFIX);
- mime = defintions.declareNamespace(MIME_NAMESPACE, MIME_PREFIX);
- }
-
- private void generateTypes(OMFactory fac, OMElement defintions) throws Exception {
- OMElement wsdlTypes = fac.createOMElement("types", wsdl);
- StringWriter writer = new StringWriter();
-
- // wrap the Schema elements with this start and end tags to create a
- // document root
- // under which the schemas can fall into
- writer.write("<xmlSchemas>");
- writeSchemas(writer);
- writer.write("</xmlSchemas>");
-
- XMLStreamReader xmlReader =
- XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(writer.toString().getBytes()));
-
- StAXOMBuilder staxOMBuilders = new StAXOMBuilder(fac, xmlReader);
- OMElement documentElement = staxOMBuilders.getDocumentElement();
-
- Iterator iterator = documentElement.getChildElements();
- while (iterator.hasNext()) {
- wsdlTypes.addChild((OMNode)iterator.next());
- }
- defintions.addChild(wsdlTypes);
- }
-
- private void writeSchemas(StringWriter writer) {
- Iterator iterator = schemaCollection.iterator();
- XmlSchema xmlSchema = null;
-
- while (iterator.hasNext()) {
- xmlSchema = (XmlSchema)iterator.next();
- // typeIterator = xmlSchema.getSchemaTypes().getValues();
- /*
- * while (typeIterator.hasNext()) {
- * xmlSchema.getItems().add((XmlSchemaObject) typeIterator.next()); }
- */
- xmlSchema.write(writer);
- }
- }
-
- private void generateMessages(OMFactory fac, OMElement definitions) throws Exception {
- Hashtable namespaceMap = new Hashtable();
- String namespacePrefix = null;
- String namespaceURI = null;
- QName messagePartType = null;
- for (int i = 0; i < method.length; i++) {
- JMethod jmethod = method[i];
-
- if (jmethod.isPublic()) {
- // Request Message
- OMElement requestMessge = fac.createOMElement(MESSAGE_LOCAL_NAME, wsdl);
- requestMessge.addAttribute(ATTRIBUTE_NAME, jmethod.getSimpleName() + MESSAGE_SUFFIX, null);
- definitions.addChild(requestMessge);
-
- // only if a type for the message part has already been defined
- if ((messagePartType =
- typeTable.getComplexSchemaTypeName(generationParams.getSchemaTargetNamespace(), jmethod
- .getSimpleName())) != null) {
- namespaceURI = messagePartType.getNamespaceURI();
- // avoid duplicate namespaces
- if ((namespacePrefix = (String)namespaceMap.get(namespaceURI)) == null) {
- namespacePrefix = generatePrefix();
- namespaceMap.put(namespaceURI, namespacePrefix);
- }
-
- OMElement requestPart = fac.createOMElement(PART_ATTRIBUTE_NAME, wsdl);
- requestMessge.addChild(requestPart);
- requestPart.addAttribute(ATTRIBUTE_NAME, "part1", null);
-
- requestPart.addAttribute(ELEMENT_ATTRIBUTE_NAME, namespacePrefix + COLON_SEPARATOR
- + jmethod.getSimpleName(), null);
- }
-
- // only if a type for the message part has already been defined
- if ((messagePartType =
- typeTable.getComplexSchemaTypeName(generationParams.getSchemaTargetNamespace(), jmethod
- .getSimpleName() + RESPONSE)) != null) {
- namespaceURI = messagePartType.getNamespaceURI();
- if ((namespacePrefix = (String)namespaceMap.get(namespaceURI)) == null) {
- namespacePrefix = generatePrefix();
- namespaceMap.put(namespaceURI, namespacePrefix);
- }
- // Response Message
- OMElement responseMessge = fac.createOMElement(MESSAGE_LOCAL_NAME, wsdl);
- responseMessge.addAttribute(ATTRIBUTE_NAME, jmethod.getSimpleName() + RESPONSE_MESSAGE, null);
- definitions.addChild(responseMessge);
- OMElement responsePart = fac.createOMElement(PART_ATTRIBUTE_NAME, wsdl);
- responseMessge.addChild(responsePart);
- responsePart.addAttribute(ATTRIBUTE_NAME, "part1", null);
-
- responsePart.addAttribute(ELEMENT_ATTRIBUTE_NAME, namespacePrefix + COLON_SEPARATOR
- + jmethod.getSimpleName()
- + RESPONSE, null);
- }
- }
- }
-
- // now add these unique namespaces to the the definitions element
- Enumeration enumeration = namespaceMap.keys();
- while (enumeration.hasMoreElements()) {
- namespaceURI = (String)enumeration.nextElement();
- definitions.declareNamespace(namespaceURI, (String)namespaceMap.get(namespaceURI));
- }
- }
-
- /**
- * Generate the porttypes
- */
- private void generatePortType(OMFactory fac, OMElement defintions) {
- JMethod jmethod = null;
- OMElement operation = null;
- OMElement message = null;
- OMElement portType = fac.createOMElement(PORT_TYPE_LOCAL_NAME, wsdl);
- defintions.addChild(portType);
- // changed default PortType name to match Java interface name
- // instead of appending "PortType".
- portType.addAttribute(ATTRIBUTE_NAME, generationParams.getServiceName(), null);
- // adding message refs
- for (int i = 0; i < method.length; i++) {
- jmethod = method[i];
-
- if (jmethod.isPublic()) {
- operation = fac.createOMElement(OPERATION_LOCAL_NAME, wsdl);
- portType.addChild(operation);
- operation.addAttribute(ATTRIBUTE_NAME, jmethod.getSimpleName(), null);
-
- message = fac.createOMElement(IN_PUT_LOCAL_NAME, wsdl);
- message.addAttribute(MESSAGE_LOCAL_NAME, tns.getPrefix() + COLON_SEPARATOR
- + jmethod.getSimpleName()
- + MESSAGE_SUFFIX, null);
- operation.addChild(message);
-
- if (!jmethod.getReturnType().isVoidType() ||
- jmethod.getAnnotation("org.oasisopen.sca.annotation.OneWay") == null) {
- message = fac.createOMElement(OUT_PUT_LOCAL_NAME, wsdl);
- message.addAttribute(MESSAGE_LOCAL_NAME, tns.getPrefix() + COLON_SEPARATOR
- + jmethod.getSimpleName()
- + RESPONSE_MESSAGE, null);
- operation.addChild(message);
- }
- }
- }
-
- }
-
- /**
- * Generate the service
- */
- public void generateService(OMFactory fac, OMElement defintions) {
- OMElement service = fac.createOMElement(SERVICE_LOCAL_NAME, wsdl);
- defintions.addChild(service);
- // Add "WebService" to the end of WSDL service name
- service.addAttribute(ATTRIBUTE_NAME, generationParams.getServiceName() + WSDL_SERVICE_SUFFIX, null);
- OMElement port = fac.createOMElement(PORT, wsdl);
- service.addChild(port);
- port.addAttribute(ATTRIBUTE_NAME, generationParams.getServiceName() + SOAP11PORT, null);
- port.addAttribute(BINDING_LOCAL_NAME, tns.getPrefix() + COLON_SEPARATOR
- + generationParams.getServiceName()
- + BINDING_NAME_SUFFIX, null);
- addExtensionElement(fac,
- port,
- soap,
- SOAP_ADDRESS,
- LOCATION,
- generationParams.getLocationUri() + generationParams.getServiceName());
-
- port = fac.createOMElement(PORT, wsdl);
- service.addChild(port);
- port.addAttribute(ATTRIBUTE_NAME, generationParams.getServiceName() + SOAP12PORT, null);
- port.addAttribute(BINDING_LOCAL_NAME, tns.getPrefix() + COLON_SEPARATOR
- + generationParams.getServiceName()
- + SOAP12BINDING_NAME_SUFFIX, null);
- addExtensionElement(fac,
- port,
- soap12,
- SOAP_ADDRESS,
- LOCATION,
- generationParams.getLocationUri() + generationParams.getServiceName());
- }
-
- /**
- * Generate the bindings
- */
- private void generateBinding(OMFactory fac, OMElement defintions) throws Exception {
- generateSoap11Binding(fac, defintions);
- generateSoap12Binding(fac, defintions);
- }
-
- private void generateSoap11Binding(OMFactory fac, OMElement defintions) throws Exception {
- OMElement binding = fac.createOMElement(BINDING_LOCAL_NAME, wsdl);
- defintions.addChild(binding);
- binding.addAttribute(ATTRIBUTE_NAME, generationParams.getServiceName() + BINDING_NAME_SUFFIX, null);
- // changed default PortType name to match Java interface name
- // instead of appending "PortType".
- binding.addAttribute("type", tns.getPrefix() + COLON_SEPARATOR + generationParams.getServiceName(), null);
-
- addExtensionElement(fac, binding, soap, BINDING_LOCAL_NAME, TRANSPORT, TRANSPORT_URI, STYLE, generationParams
- .getStyle());
-
- for (int i = 0; i < method.length; i++) {
- JMethod jmethod = method[i];
- if (jmethod.isPublic()) {
- OMElement operation = fac.createOMElement(OPERATION_LOCAL_NAME, wsdl);
- binding.addChild(operation);
-
- addExtensionElement(fac,
- operation,
- soap,
- OPERATION_LOCAL_NAME,
- SOAP_ACTION,
- URN_PREFIX + COLON_SEPARATOR + jmethod.getSimpleName(),
- STYLE,
- generationParams.getStyle());
- operation.addAttribute(ATTRIBUTE_NAME, jmethod.getSimpleName(), null);
-
- OMElement input = fac.createOMElement(IN_PUT_LOCAL_NAME, wsdl);
- addExtensionElement(fac,
- input,
- soap,
- SOAP_BODY,
- SOAP_USE,
- generationParams.getUse(),
- "namespace",
- generationParams.getTargetNamespace());
- operation.addChild(input);
-
- if (!jmethod.getReturnType().isVoidType()) {
- OMElement output = fac.createOMElement(OUT_PUT_LOCAL_NAME, wsdl);
- addExtensionElement(fac,
- output,
- soap,
- SOAP_BODY,
- SOAP_USE,
- generationParams.getUse(),
- "namespace",
- generationParams.getTargetNamespace());
- operation.addChild(output);
- }
- }
- }
- }
-
- private void generateSoap12Binding(OMFactory fac, OMElement defintions) throws Exception {
- OMElement binding = fac.createOMElement(BINDING_LOCAL_NAME, wsdl);
- defintions.addChild(binding);
- binding.addAttribute(ATTRIBUTE_NAME, generationParams.getServiceName() + SOAP12BINDING_NAME_SUFFIX, null);
- // changed default PortType name to match Java interface name
- // instead of appending "PortType".
- binding.addAttribute("type", tns.getPrefix() + COLON_SEPARATOR + generationParams.getServiceName(), null);
-
- addExtensionElement(fac, binding, soap12, BINDING_LOCAL_NAME, TRANSPORT, TRANSPORT_URI, STYLE, generationParams
- .getStyle());
-
- for (int i = 0; i < method.length; i++) {
- JMethod jmethod = method[i];
-
- if (jmethod.isPublic()) {
- OMElement operation = fac.createOMElement(OPERATION_LOCAL_NAME, wsdl);
- binding.addChild(operation);
- operation.declareNamespace(URI_WSDL12_SOAP, SOAP12_PREFIX);
-
- addExtensionElement(fac,
- operation,
- soap12,
- OPERATION_LOCAL_NAME,
- SOAP_ACTION,
- URN_PREFIX + COLON_SEPARATOR + jmethod.getSimpleName(),
- STYLE,
- generationParams.getStyle());
- operation.addAttribute(ATTRIBUTE_NAME, jmethod.getSimpleName(), null);
-
- OMElement input = fac.createOMElement(IN_PUT_LOCAL_NAME, wsdl);
- addExtensionElement(fac,
- input,
- soap12,
- SOAP_BODY,
- SOAP_USE,
- generationParams.getUse(),
- "namespace",
- generationParams.getTargetNamespace());
- operation.addChild(input);
-
- if (!jmethod.getReturnType().isVoidType()) {
- OMElement output = fac.createOMElement(OUT_PUT_LOCAL_NAME, wsdl);
- addExtensionElement(fac,
- output,
- soap12,
- SOAP_BODY,
- SOAP_USE,
- generationParams.getUse(),
- "namespace",
- generationParams.getTargetNamespace());
- operation.addChild(output);
- }
- }
- }
- }
-
- private void addExtensionElement(OMFactory fac,
- OMElement element,
- OMNamespace namespace,
- String name,
- String att1Name,
- String att1Value,
- String att2Name,
- String att2Value) {
- OMElement soapbinding = fac.createOMElement(name, namespace);
- element.addChild(soapbinding);
- soapbinding.addAttribute(att1Name, att1Value, null);
- soapbinding.addAttribute(att2Name, att2Value, null);
- }
-
- private void addExtensionElement(OMFactory fac,
- OMElement element,
- OMNamespace namespace,
- String name,
- String att1Name,
- String att1Value) {
- OMElement soapbinding = fac.createOMElement(name, namespace);
- element.addChild(soapbinding);
- soapbinding.addAttribute(att1Name, att1Value, null);
- }
-
- private String generatePrefix() {
- return NAMESPACE_PREFIX + prefixCount++;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java
deleted file mode 100644
index 18cfafa4e3..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
-
-public class TuscanyJava2WSDLBuilder implements Java2WSDLConstants {
-
- private OutputStream out;
- private String className;
- private ClassLoader classLoader;
- private String wsdlPrefix = "wsdl";
-
- // these apply for the WSDL
- private GenerationParameters generationParams;
-
- private OMElement wsdlDocument = null;
-
- public String getWsdlPrefix() {
- return wsdlPrefix;
- }
-
- public void setWsdlPrefix(String wsdlPrefix) {
- this.wsdlPrefix = wsdlPrefix;
- }
-
- public TuscanyJava2WSDLBuilder(GenerationParameters genParams) {
- this.generationParams = genParams;
- }
-
- /**
- * Externally visible generator method
- *
- * @throws Exception
- */
- public void buildWSDL() throws Exception {
- ArrayList excludeOpeartion = new ArrayList();
- excludeOpeartion.add("init");
- excludeOpeartion.add("setOperationContext");
- excludeOpeartion.add("destroy");
-
- TuscanyWSDLTypesGenerator typesGenerator = new TuscanyWSDLTypesGenerator(generationParams);
- typesGenerator.setExcludeMethods(excludeOpeartion);
- Collection schemaCollection = typesGenerator.buildWSDLTypes();
-
- TuscanyJava2OMBuilder java2OMBuilder =
- new TuscanyJava2OMBuilder(typesGenerator.getMethods(), schemaCollection, typesGenerator
- .getTypeTable(), generationParams);
-
- wsdlDocument = java2OMBuilder.generateOM();
- }
-
- public OMElement getWsdlDocument() {
- return wsdlDocument;
- }
-
- public void setWsdlDocument(OMElement wsdlDocument) {
- this.wsdlDocument = wsdlDocument;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java
deleted file mode 100644
index 3750dc27f5..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
-
-/**
- * This is a extension from the Axis2 Java2WSDLConstants to handle additions specific to Tuscany.
- * This class can be done away with once Axis2 is also enhanced to support these
- * additional options.
- *
- */
-public interface TuscanyJava2WSDLConstants extends Java2WSDLConstants
-{
- public static final char OPEN_BRACKET = '[';
- public static final char COMMA = ',';
- public static final char CLOSE_BRACKET = ']';
- public static final String DEFAULT_SCHEMA_LOCATION = "*.xsd";
- public static final String SCHEMA_ELEMENT_NAME = "schema";
-
- String FORM_DEFAULT_QUALIFIED = "qualified";
- String FORM_DEFAULT_UNQUALIFIED = "unqualified";
-
- //short options
- String IMPORT_XSD_OPTION = "ixsd"; //option for importing XSDs
- String ATTR_FORM_DEFAULT_OPTION = "afd";
- String ELEMENT_FORM_DEFAULT_OPTION = "efd";
- String EXTRA_CLASSES_DEFAULT_OPTION = "xc";
- String FACTORY_CLASSNAMES_OPTION = "fcn";
-
- //long options
- String IMPORT_XSD_OPTION_LONG = "import_xsd"; //option for importing XSDs
- String ATTR_FORM_DEFAULT_OPTION_LONG = "attributeFormDefault";
- String ELEMENT_FORM_DEFAULT_OPTION_LONG = "elementFormDefault";
- String EXTRA_CLASSES_DEFAULT_OPTION_LONG = "extraClasses";
- String FACTORY_CLASSNAMES_OPTION_LONG = "factoryClassNames";
-
- // This is a new creation, not an override.
- String WSDL_SERVICE_SUFFIX = "WebService";
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java
deleted file mode 100644
index d6cd8a7f57..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.util.ArrayList;
-
-import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption;
-import org.apache.ws.java2wsdl.utils.Java2WSDLOptionsValidator;
-
-/**
- * This class is an extension from the Axis2 implementation in order to handle
- * additional options specific to Tuscany. This class can be done away with once
- * Axis2 is also enhanced to support these additional options.
- */
-public class TuscanyJava2WSDLOptionsValidator extends Java2WSDLOptionsValidator implements TuscanyJava2WSDLConstants {
- @Override
- public boolean isInvalid(Java2WSDLCommandLineOption option) {
- boolean invalid;
- String optionType = option.getOptionType();
-
- invalid =
- !((IMPORT_XSD_OPTION).equalsIgnoreCase(optionType) || (IMPORT_XSD_OPTION_LONG).equalsIgnoreCase(optionType)
- || (TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION_LONG).equalsIgnoreCase(optionType)
- || (TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION).equalsIgnoreCase(optionType)
- || (TuscanyJava2WSDLConstants.FACTORY_CLASSNAMES_OPTION_LONG).equalsIgnoreCase(optionType)
- || (TuscanyJava2WSDLConstants.FACTORY_CLASSNAMES_OPTION).equalsIgnoreCase(optionType) || !super
- .isInvalid(option));
-
- invalid = validateImportXSDOption(invalid, option);
-
- return invalid;
- }
-
- private boolean validateImportXSDOption(boolean invalid, Java2WSDLCommandLineOption option) {
- String optionType = option.getOptionType();
- String schemaNSLocationPair = null;
-
- if (!invalid && (IMPORT_XSD_OPTION).equalsIgnoreCase(optionType)
- || (IMPORT_XSD_OPTION_LONG).equalsIgnoreCase(optionType)) {
- ArrayList optionValues = option.getOptionValues();
-
- for (int count = 0; count < optionValues.size(); ++count) {
- schemaNSLocationPair = ((String)optionValues.get(count)).trim();
- if ((schemaNSLocationPair.charAt(0) != OPEN_BRACKET) || (schemaNSLocationPair
- .charAt(schemaNSLocationPair.length() - 1) != CLOSE_BRACKET)
- || (schemaNSLocationPair.indexOf(COMMA) == -1))
-
- {
- System.out.println("Schema Namespace-Location pair option not specified properly!!");
- invalid = true;
- }
- }
- }
-
- return invalid;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java
deleted file mode 100644
index 03291428a2..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axis2.description.java2wsdl.bytecode.MethodTable;
-import org.apache.tuscany.sdo.util.DataObjectUtil;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.ws.commons.schema.XmlSchemaComplexType;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaForm;
-import org.apache.ws.commons.schema.XmlSchemaImport;
-import org.apache.ws.commons.schema.XmlSchemaInclude;
-import org.apache.ws.commons.schema.XmlSchemaSequence;
-import org.apache.ws.commons.schema.utils.NamespaceMap;
-import org.codehaus.jam.JClass;
-import org.codehaus.jam.JMethod;
-import org.codehaus.jam.JParameter;
-import org.codehaus.jam.JamClassIterator;
-import org.codehaus.jam.JamService;
-import org.codehaus.jam.JamServiceFactory;
-import org.codehaus.jam.JamServiceParams;
-
-public class TuscanySchemaGenerator implements TuscanyJava2WSDLConstants {
- public static final String NAME_SPACE_PREFIX = "stn_";
- public static final String PERIOD_SEPARATOR = ".";
- private static int prefixCount = 1;
-
- protected String attrFormDefault = null;
- protected String elementFormDefault = null;
- protected Hashtable targetNamespacePrefixMap = new Hashtable();
- protected Hashtable schemaMap = new Hashtable();
- protected Hashtable sdoAnnoMap = new Hashtable();
- protected XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection();
- private TuscanyTypeTable typeTable = new TuscanyTypeTable();
- protected SchemaBuilder schemaBuilder = null;
- protected Map schemaLocationMap = null;
-
- private ClassLoader classLoader;
- private String className;
-
- // to keep loaded method using JAM
- private JMethod methods[];
-
- // to store byte code method using Axis 1.x codes
- private MethodTable methodTable;
- private String schemaTargetNameSpace;
- private String schema_namespace_prefix;
- private Class clazz;
- private ArrayList excludeMethods = new ArrayList();
-
- public TuscanySchemaGenerator(ClassLoader loader,
- String className,
- String schematargetNamespace,
- String schematargetNamespacePrefix,
- Map schemaLocMap) throws Exception {
- DataObjectUtil.initRuntime();
- this.classLoader = loader;
- this.className = className;
- clazz = Class.forName(className, true, loader);
- methodTable = new MethodTable(clazz);
- this.schemaTargetNameSpace = schematargetNamespace;
- this.schema_namespace_prefix = schematargetNamespacePrefix;
- this.schemaLocationMap = schemaLocMap;
-
- initializeSchemaMap(this.schemaTargetNameSpace, this.schema_namespace_prefix);
- schemaBuilder =
- new SchemaBuilder(xmlSchemaCollection, schemaMap, targetNamespacePrefixMap, typeTable,
- getAttrFormDefault(), getElementFormDefault(), schemaLocMap, this.classLoader, null);
- }
-
- /**
- * Generates schema for all the parameters in method. First generates schema
- * for all different parameter type and later refers to them.
- *
- * @return Returns XmlSchema.
- * @throws Exception
- */
- public Collection buildWSDLTypes() throws Exception {
- JamServiceFactory factory = JamServiceFactory.getInstance();
- JamServiceParams jam_service_parms = factory.createServiceParams();
- // setting the classLoder
- // jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader));
- // it can possible to add the classLoader as well
- jam_service_parms.addClassLoader(classLoader);
- jam_service_parms.includeClass(className);
- JamService service = factory.createService(jam_service_parms);
-
- JamClassIterator jClassIter = service.getClasses();
- // all most all the time the ittr will have only one class in it
- while (jClassIter.hasNext()) {
- JClass jclass = (JClass)jClassIter.next();
- // serviceName = jclass.getSimpleName();
- // todo in the future , when we support annotation we can use this
- // JAnnotation[] annotations = jclass.getAnnotations();
-
- /**
- * Schema generation done in two stage 1. Load all the methods and
- * create type for methods parameters (if the parameters are Bean
- * then it will create Complex types for those , and if the
- * parameters are simple type which describe in SimpleTypeTable
- * nothing will happen) 2. In the next stage for all the methods
- * messages and port types will be created
- */
- methods = jclass.getDeclaredMethods();
-
- // since we do not support overload
- HashMap uniqueMethods = new HashMap();
- XmlSchemaComplexType methodSchemaType = null;
- XmlSchemaSequence sequence = null;
- for (int i = 0; i < methods.length; i++) {
- String methodName = methods[i].getSimpleName();
- JMethod jMethod = methods[i];
- // no need to think about this method , since that is system
- // config method
- if (excludeMethods.contains(jMethod.getSimpleName())) {
- continue;
- }
- // if (jMethod.getSimpleName().equals("init")
- // || "setOperationContext".equals(jMethod.getSimpleName())
- // || "destroy".equals(jMethod.getSimpleName()))
- // continue;
- if (uniqueMethods.get(jMethod.getSimpleName()) != null) {
- throw new Exception(" Sorry we don't support methods overloading !!!! ");
- }
-
- if (!jMethod.isPublic()) {
- // no need to generate Schema for non public methods
- continue;
- }
-
- uniqueMethods.put(jMethod.getSimpleName(), jMethod);
- JParameter[] paras = jMethod.getParameters();
- String parameterNames[] = null;
- if (paras.length > 0) {
- parameterNames = methodTable.getParameterNames(methodName);
- sequence = new XmlSchemaSequence();
-
- // create the schema type for the method wrapper
- methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName());
- methodSchemaType.setParticle(sequence);
- }
-
- for (int j = 0; j < paras.length; j++) {
- JParameter methodParameter = paras[j];
- JClass paraType = methodParameter.getType();
- generateSchemaForType(sequence, paraType, (parameterNames != null && parameterNames[j] != null)
- ? parameterNames[j] : methodParameter.getSimpleName());
- }
- // for its return type
- JClass returnType = jMethod.getReturnType();
- if (!returnType.isVoidType()) {
- methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName() + RESPONSE);
- sequence = new XmlSchemaSequence();
- methodSchemaType.setParticle(sequence);
- generateSchemaForType(sequence, returnType, "return");
- }
- }
- // generateWrapperElements(methods);
- }
- return schemaMap.values();
- }
-
- private QName generateSchemaForType(XmlSchemaSequence sequence, JClass type, String partName) throws Exception {
- boolean isArrayType = type.isArrayType();
- if (isArrayType) {
- type = type.getArrayComponentType();
- }
-
- String classTypeName = type.getQualifiedName();
-
- QName schemaTypeName = typeTable.getSimpleSchemaTypeName(classTypeName);
- if (schemaTypeName == null) {
- schemaTypeName = schemaBuilder.generateSchema(type);
- addContentToMethodSchemaType(sequence, schemaTypeName, partName, type.isArrayType());
- addImportORInclude((XmlSchema)schemaMap.get(schemaTargetNameSpace), schemaTypeName);
-
- } else {
- addContentToMethodSchemaType(sequence, schemaTypeName, partName, type.isArrayType());
- }
-
- return schemaTypeName;
- }
-
- private void addContentToMethodSchemaType(XmlSchemaSequence sequence,
- QName schemaTypeName,
- String paraName,
- boolean isArray) {
- XmlSchemaElement elt1 = new XmlSchemaElement();
- elt1.setName(paraName);
- elt1.setSchemaTypeName(schemaTypeName);
- sequence.getItems().add(elt1);
-
- if (isArray) {
- elt1.setMaxOccurs(Long.MAX_VALUE);
- elt1.setMinOccurs(0);
- }
- }
-
- private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) {
- XmlSchema xmlSchema = (XmlSchema)schemaMap.get(schemaTargetNameSpace);
- QName elementName = new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix);
- XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema);
-
- XmlSchemaElement globalElement = new XmlSchemaElement();
- globalElement.setSchemaType(complexType);
- globalElement.setName(formGlobalElementName(localPartName));
- globalElement.setQName(elementName);
-
- xmlSchema.getItems().add(globalElement);
- xmlSchema.getElements().add(elementName, globalElement);
-
- typeTable.addComplexSchemaType(this.schemaTargetNameSpace, globalElement.getName(), elementName);
-
- return complexType;
- }
-
- private String formGlobalElementName(String typeName) {
- String firstChar = typeName.substring(0, 1);
- return typeName.replaceFirst(firstChar, firstChar.toLowerCase());
- }
-
- public TuscanyTypeTable getTypeTable() {
- return typeTable;
- }
-
- public JMethod[] getMethods() {
- return methods;
- }
-
- private String generatePrefix() {
- return NAME_SPACE_PREFIX + prefixCount++;
- }
-
- public void setExcludeMethods(ArrayList excludeMethods) {
- this.excludeMethods = excludeMethods;
- }
-
- private void initializeSchemaMap(String targetNamespace, String targetNamespacePrefix) {
- XmlSchema xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection);
- xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting());
- xmlSchema.setElementFormDefault(getElementFormDefaultSetting());
-
- targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix);
- schemaMap.put(targetNamespace, xmlSchema);
-
- NamespaceMap prefixmap = new NamespaceMap();
- prefixmap.put(TuscanyTypeTable.XS_URI_PREFIX, TuscanyTypeTable.XML_SCHEMA_URI);
- prefixmap.put(targetNamespacePrefix, targetNamespace);
- xmlSchema.setNamespaceContext(prefixmap);
- }
-
- private void setFormDefaults() {
-
- }
-
- public Hashtable getSdoAnnoMap() {
- return sdoAnnoMap;
- }
-
- public void setSdoAnnoMap(Hashtable sdoAnnoMap) {
- this.sdoAnnoMap = sdoAnnoMap;
- }
-
- private void addImportORInclude(XmlSchema xmlSchema, QName schemaTypeName) {
- // decide whether there must be an import or an include
- if (xmlSchema.getTargetNamespace().equals(schemaTypeName.getNamespaceURI())) {
- XmlSchema containingSchema = (XmlSchema)schemaMap.get(schemaTypeName.getNamespaceURI());
- // if the type is not defined in the Schema then include
- if (containingSchema.getTypeByName(schemaTypeName) == null) {
- String schemaLocation = null;
- if ((schemaLocation = (String)schemaLocationMap.get(schemaTypeName.getNamespaceURI())) != null) {
- schemaLocation = DEFAULT_SCHEMA_LOCATION;
- }
-
- XmlSchemaInclude includeElement = new XmlSchemaInclude();
- includeElement.setSchemaLocation(schemaLocation);
-
- if (!xmlSchema.getIncludes().contains(includeElement)) {
- xmlSchema.getIncludes().add(includeElement);
- }
- }
- } else {
- if (!((NamespaceMap)xmlSchema.getNamespaceContext()).values().contains(schemaTypeName.getNamespaceURI())) {
- XmlSchemaImport importElement = new XmlSchemaImport();
- importElement.setNamespace(schemaTypeName.getNamespaceURI());
- xmlSchema.getItems().add(importElement);
- ((NamespaceMap)xmlSchema.getNamespaceContext()).put(generatePrefix(), schemaTypeName.getNamespaceURI());
- }
- }
- }
-
- private XmlSchemaForm getAttrFormDefaultSetting() {
- if (FORM_DEFAULT_UNQUALIFIED.equals(getAttrFormDefault())) {
- return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED);
- } else {
- return new XmlSchemaForm(XmlSchemaForm.QUALIFIED);
- }
- }
-
- private XmlSchemaForm getElementFormDefaultSetting() {
- if (FORM_DEFAULT_UNQUALIFIED.equals(getElementFormDefault())) {
- return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED);
- } else {
- return new XmlSchemaForm(XmlSchemaForm.QUALIFIED);
- }
- }
-
- public String getAttrFormDefault() {
- return attrFormDefault;
- }
-
- public void setAttrFormDefault(String attrFormDefault) {
- this.attrFormDefault = attrFormDefault;
- }
-
- public String getElementFormDefault() {
- return elementFormDefault;
- }
-
- public void setElementFormDefault(String elementFormDefault) {
- this.elementFormDefault = elementFormDefault;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java
deleted file mode 100644
index cb41c56b94..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.description.java2wsdl.Java2WSDLUtils;
-import org.codehaus.jam.JClass;
-
-import commonj.sdo.DataObject;
-
-public class TuscanyTypeTable
-{
- public static final String XML_SCHEMA_URI = "http://www.w3.org/2001/XMLSchema";
- public static final String XS_URI_PREFIX = "xs";
- public static final QName XS_QNAME = new QName(XML_SCHEMA_URI, "schema", XS_URI_PREFIX);
- public static final String DELIMITER = "#";
-
- private Hashtable<String, QName> simpleXSDTypes;
- private Hashtable<String, QName> complexXSDTypes;
-
- public static String asQualifiedName(String uri, String typeName)
- {
- return (uri + DELIMITER + typeName);
- }
-
-
- public TuscanyTypeTable()
- {
- simpleXSDTypes = new Hashtable<String, QName>();
- complexXSDTypes = new Hashtable<String, QName>();
- populateSimpleXSDTypes();
- populateStdSDOTypes();
- }
-
- private void populateStdSDOTypes()
- {
- simpleXSDTypes.put("Boolean",
- new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX));
- simpleXSDTypes.put("Byte",
- new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX));
- simpleXSDTypes.put("Bytes",
- new QName(XML_SCHEMA_URI, "hexBinary", XS_URI_PREFIX));
- simpleXSDTypes.put("Character",
- new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX));
- simpleXSDTypes.put("DataObject",
- new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
- simpleXSDTypes.put("Date",
- new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX));
- simpleXSDTypes.put("Day",
- new QName(XML_SCHEMA_URI, "gDay", XS_URI_PREFIX));
- simpleXSDTypes.put("Decimal",
- new QName(XML_SCHEMA_URI, "decimal", XS_URI_PREFIX));
- simpleXSDTypes.put("Double",
- new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX));
- simpleXSDTypes.put("Duration",
- new QName(XML_SCHEMA_URI, "duration", XS_URI_PREFIX));
- simpleXSDTypes.put("Float",
- new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX));
- simpleXSDTypes.put("Int",
- new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX));
- simpleXSDTypes.put("Integer",
- new QName(XML_SCHEMA_URI, "integer", XS_URI_PREFIX));
- simpleXSDTypes.put("Long",
- new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX));
- simpleXSDTypes.put("Month",
- new QName(XML_SCHEMA_URI, "gMonth", XS_URI_PREFIX));
- simpleXSDTypes.put("monthDay",
- new QName(XML_SCHEMA_URI, "gMonthDay", XS_URI_PREFIX));
- simpleXSDTypes.put("Object",
- new QName(XML_SCHEMA_URI, "anySimpleType", XS_URI_PREFIX));
- simpleXSDTypes.put("Short",
- new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX));
- simpleXSDTypes.put("String",
- new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX));
- simpleXSDTypes.put("Strings",
- new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX));
- simpleXSDTypes.put("Time",
- new QName(XML_SCHEMA_URI, "time", XS_URI_PREFIX));
- simpleXSDTypes.put("Year",
- new QName(XML_SCHEMA_URI, "gYear", XS_URI_PREFIX));
- simpleXSDTypes.put("YearMonth",
- new QName(XML_SCHEMA_URI, "gYearMonth", XS_URI_PREFIX));
- simpleXSDTypes.put("YearMonthDay",
- new QName(XML_SCHEMA_URI, "date", XS_URI_PREFIX));
- simpleXSDTypes.put("URI",
- new QName(XML_SCHEMA_URI, "anyURI", XS_URI_PREFIX));
- }
-
- private void populateSimpleXSDTypes() {
- //todo pls use the types from org.apache.ws.commons.schema.constants.Constants
- simpleXSDTypes.put("int",
- new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX));
- simpleXSDTypes.put("java.lang.String",
- new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX));
- simpleXSDTypes.put("boolean",
- new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX));
- simpleXSDTypes.put("float",
- new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX));
- simpleXSDTypes.put("double",
- new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX));
- simpleXSDTypes.put("short",
- new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX));
- simpleXSDTypes.put("long",
- new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX));
- simpleXSDTypes.put("byte",
- new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX));
- simpleXSDTypes.put("char",
- new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
- simpleXSDTypes.put("java.lang.Integer",
- new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX));
- simpleXSDTypes.put("java.lang.Double",
- new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX));
- simpleXSDTypes.put("java.lang.Float",
- new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX));
- simpleXSDTypes.put("java.lang.Long",
- new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX));
- simpleXSDTypes.put("java.lang.Character",
- new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
- simpleXSDTypes.put("java.lang.Boolean",
- new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX));
- simpleXSDTypes.put("java.lang.Byte",
- new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX));
- simpleXSDTypes.put("java.lang.Short",
- new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX));
- simpleXSDTypes.put("java.util.Date",
- new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX));
- simpleXSDTypes.put("java.util.Calendar",
- new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX));
- simpleXSDTypes.put("java.lang.Object",
- new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
- simpleXSDTypes.put("java.math.BigDecimal",
- new QName(XML_SCHEMA_URI, "decimal", XS_URI_PREFIX));
-
- // Any types
- simpleXSDTypes.put(OMElement.class.getName(),
- new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
- simpleXSDTypes.put(ArrayList.class.getName(),
- new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
- simpleXSDTypes.put(Vector.class.getName(),
- new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
- simpleXSDTypes.put(List.class.getName(),
- new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
-
- // I'm unsure what populateStdSDOTypes is supposed to be setting up,
- // given that I still have to do this to map "commonj.sdo.DataObject"
- // to xsd:anyType, but I'll do it anyway.
- //
- simpleXSDTypes.put(DataObject.class.getName(),
- new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
- }
-
- public QName getStdSdoType(String typename) {
- return (QName) simpleXSDTypes.get(typename);
- }
-
- public QName getComplexSchemaTypeName(String sdoURI, String sdoTypeName) {
- return (QName) complexXSDTypes.get(asQualifiedName(sdoURI, sdoTypeName));
- }
-
- public QName getComplexSchemaTypeName(JClass javaClass, ClassLoader cl) throws Exception {
- String namespace = Java2WSDLUtils.schemaNamespaceFromClassName(javaClass.getQualifiedName(), cl).toString();
- return (QName) complexXSDTypes.get(asQualifiedName(namespace, javaClass.getSimpleName()));
- }
-
- public boolean isSimpleType(String typeName) {
- Iterator keys = simpleXSDTypes.keySet().iterator();
- while (keys.hasNext()) {
- String s = (String) keys.next();
- if (s.equals(typeName)) {
- return true;
- }
- }
- return false;
- }
-
- public QName getSimpleSchemaTypeName(String typename) {
- return (QName) simpleXSDTypes.get(typename);
- }
-
- public void addSimpleSchemaType(String typeName, QName schemaType) {
- simpleXSDTypes.put(typeName, schemaType);
- }
-
- public void addComplexSchemaType(String namespaceURI, String name, QName schemaType) {
- complexXSDTypes.put(asQualifiedName(namespaceURI, name), schemaType);
- }
-
- public QName getQNamefortheType(String namespaceURI, String typeName) {
- if (XML_SCHEMA_URI.equals(namespaceURI)) {
- return getSimpleSchemaTypeName(typeName);
- } else {
- return getComplexSchemaTypeName(namespaceURI, typeName);
- }
- }
-}
-
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java
deleted file mode 100644
index 66c9100ef9..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axis2.description.java2wsdl.bytecode.MethodTable;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.ws.commons.schema.XmlSchemaComplexType;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaForm;
-import org.apache.ws.commons.schema.XmlSchemaImport;
-import org.apache.ws.commons.schema.XmlSchemaInclude;
-import org.apache.ws.commons.schema.XmlSchemaSequence;
-import org.apache.ws.commons.schema.utils.NamespaceMap;
-import org.codehaus.jam.JClass;
-import org.codehaus.jam.JMethod;
-import org.codehaus.jam.JParameter;
-import org.codehaus.jam.JamClassIterator;
-import org.codehaus.jam.JamService;
-import org.codehaus.jam.JamServiceFactory;
-import org.codehaus.jam.JamServiceParams;
-
-public class TuscanyWSDLTypesGenerator implements TuscanyJava2WSDLConstants {
- public static final String NAME_SPACE_PREFIX = "stn_";
-
- public static final String PERIOD_SEPARATOR = ".";
-
- private static int prefixCount = 1;
-
- protected GenerationParameters generationParams;
-
- protected Hashtable targetNamespacePrefixMap = new Hashtable();
-
- protected Hashtable schemaMap = new Hashtable();
-
- protected XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection();
-
- private TuscanyTypeTable typeTable = new TuscanyTypeTable();
-
- protected SchemaBuilder schemaBuilder = null;
-
- protected Map schemaLocationMap = null;
-
- // to keep loaded method using JAM
- private JMethod methods[];
-
- // to store byte code method using Axis 1.x codes
- private MethodTable methodTable;
-
- private Class clazz;
-
- private ArrayList excludeMethods = new ArrayList();
-
- boolean alreadyPrintedArrayWarningMessage = false;
-
- public TuscanyWSDLTypesGenerator(GenerationParameters genParams) throws Exception {
- this.generationParams = genParams;
-
- String inputClassName = generationParams.getSourceClassName();
-
- try {
- clazz = Class.forName(inputClassName, true, generationParams.getClassLoader());
- } catch (ClassNotFoundException cfne) {
- printInputSourceClassNotFoundMessage(inputClassName);
- throw new IllegalArgumentException("Input className not found:" + inputClassName, cfne);
- }
-
- methodTable = new MethodTable(clazz);
-
- initializeSchemaMap(generationParams.getSchemaTargetNamespace(), generationParams
- .getSchemaTargetNamespacePrefix());
-
- this.schemaLocationMap = generationParams.getSchemaLocationMap();
- schemaBuilder =
- new SchemaBuilder(xmlSchemaCollection, schemaMap, targetNamespacePrefixMap, typeTable, generationParams
- .getAttrFormDefault(), generationParams.getElementFormDefault(), generationParams
- .getSchemaLocationMap(), generationParams.getClassLoader(), generationParams.getFactoryClassNames());
- }
-
- /**
- * Generates schema for all the parameters in method. First generates schema
- * for all different parameter type and later refers to them.
- *
- * @return Returns XmlSchema.
- * @throws Exception
- */
- public Collection buildWSDLTypes() throws Exception {
- JamServiceFactory factory = JamServiceFactory.getInstance();
- JamServiceParams jam_service_parms = factory.createServiceParams();
- // setting the classLoder
- // jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader));
- // it can possible to add the classLoader as well
- jam_service_parms.addClassLoader(generationParams.getClassLoader());
- jam_service_parms.includeClass(generationParams.getSourceClassName());
-
- for (int count = 0; count < generationParams.getExtraClasses().size(); ++count) {
- jam_service_parms.includeClass((String)generationParams.getExtraClasses().get(count));
- }
-
- JamService service = factory.createService(jam_service_parms);
- QName extraSchemaTypeName = null;
- JamClassIterator jClassIter = service.getClasses();
- // all most all the time the ittr will have only one class in it
- while (jClassIter.hasNext()) {
- JClass jclass = (JClass)jClassIter.next();
- // serviceName = jclass.getSimpleName();
- // todo in the future , when we support annotation we can use this
- // JAnnotation[] annotations = jclass.getAnnotations();
-
- if (jclass.getQualifiedName().equals(generationParams.getSourceClassName())) {
- /**
- * Schema generation done in two stage 1. Load all the methods
- * and create type for methods parameters (if the parameters are
- * Bean then it will create Complex types for those , and if the
- * parameters are simple type which describe in SimpleTypeTable
- * nothing will happen) 2. In the next stage for all the methods
- * messages and port types will be created
- */
- methods = jclass.getDeclaredMethods();
- // short the elements in the array
- Arrays.sort(methods);
-
- // since we do not support overload
- HashMap uniqueMethods = new HashMap();
- XmlSchemaComplexType methodSchemaType;
- XmlSchemaSequence sequence = null;
-
- for (int i = 0; i < methods.length; i++) {
- JMethod jMethod = methods[i];
-
- String methodName = methods[i].getSimpleName();
- // no need to think about this method , since that is system
- // config method
- if (excludeMethods.contains(jMethod.getSimpleName())) {
- continue;
- }
-
- if (uniqueMethods.get(jMethod.getSimpleName()) != null) {
- throw new Exception(" Sorry we don't support methods overloading !!!! ");
- }
-
- if (!jMethod.isPublic()) {
- // no need to generate Schema for non public methods
- continue;
- }
- uniqueMethods.put(jMethod.getSimpleName(), jMethod);
- // create the schema type for the method wrapper
-
- uniqueMethods.put(jMethod.getSimpleName(), jMethod);
- JParameter[] paras = jMethod.getParameters();
- String parameterNames[] = null;
- // better to handle void types too
- parameterNames = methodTable.getParameterNames(methodName);
- sequence = new XmlSchemaSequence();
-
- methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName());
- methodSchemaType.setParticle(sequence);
-
- for (int j = 0; j < paras.length; j++) {
- JParameter methodParameter = paras[j];
- JClass paraType = methodParameter.getType();
- generateSchemaForType(sequence, paraType, (parameterNames != null && parameterNames[j] != null)
- ? parameterNames[j] : methodParameter.getSimpleName());
- }
- // for its return type
- JClass returnType = jMethod.getReturnType();
-
- // better to handle void types too
- methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName() + RESPONSE);
- sequence = new XmlSchemaSequence();
- methodSchemaType.setParticle(sequence);
- generateSchemaForType(sequence, returnType, "return");
- }
- } else {
- // generate the schema type for extra classes
- extraSchemaTypeName = typeTable.getSimpleSchemaTypeName(jclass.getQualifiedName());
- if (extraSchemaTypeName == null) {
- extraSchemaTypeName = schemaBuilder.generateSchema(jclass);
- }
- }
- }
- return schemaMap.values();
- }
-
- private QName generateSchemaForType(XmlSchemaSequence sequence, JClass type, String partName) throws Exception {
- if (type.isVoidType()) {
- return null;
- }
- boolean isArrayType = type.isArrayType();
- if (isArrayType) {
- type = type.getArrayComponentType();
- }
-
- String classTypeName = type.getQualifiedName();
-
- QName schemaTypeName = typeTable.getSimpleSchemaTypeName(classTypeName);
- if (schemaTypeName == null) {
- schemaTypeName = schemaBuilder.generateSchema(type);
- addContentToMethodSchemaType(sequence, schemaTypeName, partName, type.isArrayType());
- addImportORInclude((XmlSchema)schemaMap.get(generationParams.getSchemaTargetNamespace()), schemaTypeName);
-
- } else {
- addContentToMethodSchemaType(sequence, schemaTypeName, partName, type.isArrayType());
- }
-
- return schemaTypeName;
- }
-
- private void addContentToMethodSchemaType(XmlSchemaSequence sequence,
- QName schemaTypeName,
- String paraName,
- boolean isArray) {
- XmlSchemaElement elt1 = new XmlSchemaElement();
- elt1.setName(paraName);
- elt1.setSchemaTypeName(schemaTypeName);
- sequence.getItems().add(elt1);
-
- if (isArray) {
- // FIXME: lresende to check this
- if (!alreadyPrintedArrayWarningMessage) {
- alreadyPrintedArrayWarningMessage = true;
- System.out.println("Warning!: Array type detected as Java method parameter. The WSDL");
- System.out.println("will be generated anyway in spite of the fact that round-trip (WSDL2Java)");
- System.out.println("may not be handled in the expected manner. There may be runtime issues as ");
- System.out.println("well as array types are not necessarily supported yet.");
- System.out.println("");
- }
- elt1.setMaxOccurs(Long.MAX_VALUE);
- elt1.setMinOccurs(0);
- }
- }
-
- private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) throws Exception {
- XmlSchema xmlSchema = (XmlSchema)schemaMap.get(generationParams.getSchemaTargetNamespace());
- QName elementName =
- new QName(generationParams.getSchemaTargetNamespace(), localPartName, generationParams
- .getSchemaTargetNamespacePrefix());
- XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema);
-
- XmlSchemaElement globalElement = new XmlSchemaElement();
- globalElement.setSchemaType(complexType);
- globalElement.setName(localPartName);
- globalElement.setQName(elementName);
-
- xmlSchema.getItems().add(globalElement);
- xmlSchema.getElements().add(elementName, globalElement);
-
- typeTable.addComplexSchemaType(generationParams.getSchemaTargetNamespace(),
- globalElement.getName(),
- elementName);
-
- return complexType;
- }
-
- public TuscanyTypeTable getTypeTable() {
- return typeTable;
- }
-
- public JMethod[] getMethods() {
- return methods;
- }
-
- private String generatePrefix() {
- return NAME_SPACE_PREFIX + prefixCount++;
- }
-
- public void setExcludeMethods(ArrayList excludeMethods) {
- this.excludeMethods = excludeMethods;
- }
-
- private void initializeSchemaMap(String targetNamespace, String targetNamespacePrefix) {
- XmlSchema xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection);
- xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting());
- xmlSchema.setElementFormDefault(getElementFormDefaultSetting());
-
- targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix);
- schemaMap.put(targetNamespace, xmlSchema);
-
- NamespaceMap prefixmap = new NamespaceMap();
- prefixmap.put(TuscanyTypeTable.XS_URI_PREFIX, TuscanyTypeTable.XML_SCHEMA_URI);
- prefixmap.put(targetNamespacePrefix, targetNamespace);
- xmlSchema.setNamespaceContext(prefixmap);
- }
-
- /*
- * Adds to 'xmlSchema' an import or include of the XMLSchema containing
- * 'schemaTypeName'
- */
- private void addImportORInclude(XmlSchema xmlSchema, QName schemaTypeName) {
- // decide whether there must be an import or an include
- if (xmlSchema.getTargetNamespace().equals(schemaTypeName.getNamespaceURI())) {
- XmlSchema containingSchema = (XmlSchema)schemaMap.get(schemaTypeName.getNamespaceURI());
- // if the type is not defined in the Schema then include
- if (containingSchema.getTypeByName(schemaTypeName) == null) {
- String schemaLocation = null;
- // This looked backwards so I flipped it
- if ((schemaLocation = (String)schemaLocationMap.get(schemaTypeName.getNamespaceURI())) != null) {
- schemaLocation = DEFAULT_SCHEMA_LOCATION;
- }
-
- XmlSchemaInclude includeElement = new XmlSchemaInclude();
- includeElement.setSchemaLocation(schemaLocation);
-
- if (!xmlSchema.getIncludes().contains(includeElement)) {
- xmlSchema.getIncludes().add(includeElement);
- // Add this so it will be serialized
- xmlSchema.getItems().add(includeElement);
- }
- }
- } else {
- if (!((NamespaceMap)xmlSchema.getNamespaceContext()).values().contains(schemaTypeName.getNamespaceURI())) {
- XmlSchemaImport importElement = new XmlSchemaImport();
- importElement.setNamespace(schemaTypeName.getNamespaceURI());
-
- // Add schemaLocation on imports
- String schemaLocation = (String)schemaLocationMap.get(schemaTypeName.getNamespaceURI());
- importElement.setSchemaLocation(schemaLocation);
- xmlSchema.getItems().add(importElement);
- ((NamespaceMap)xmlSchema.getNamespaceContext()).put(generatePrefix(), schemaTypeName.getNamespaceURI());
- }
- }
- }
-
- private XmlSchemaForm getAttrFormDefaultSetting() {
- if (FORM_DEFAULT_UNQUALIFIED.equals(generationParams.getAttrFormDefault())) {
- return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED);
- } else {
- return new XmlSchemaForm(XmlSchemaForm.QUALIFIED);
- }
- }
-
- private XmlSchemaForm getElementFormDefaultSetting() {
- if (FORM_DEFAULT_UNQUALIFIED.equals(generationParams.getElementFormDefault())) {
- return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED);
- } else {
- return new XmlSchemaForm(XmlSchemaForm.QUALIFIED);
- }
- }
-
- private void printInputSourceClassNotFoundMessage(String inputClassName) {
- System.out.println("ERROR!!: The input class: " + inputClassName + " could not be found.");
- System.out.println("Please check the value you provided for the -cp <class path uri> option.");
- System.out.println("");
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java
deleted file mode 100644
index e30ada3af5..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.util.EventObject;
-
-public class WSDLGenEvent extends EventObject {
- /**
- *
- */
- private static final long serialVersionUID = -356100754190514245L;
- private int generationPhase = WSDLGenListener.UNKNOWN;
-
- public WSDLGenEvent(Object source, int genPhase) {
- super(source);
- this.generationPhase = genPhase;
- }
-
- public int getGenerationPhase() {
- return generationPhase;
- }
-
- public void setGenerationPhase(int generationPhase) {
- this.generationPhase = generationPhase;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java
deleted file mode 100644
index 788d162f34..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-public interface WSDLGenListener {
- public static int UNKNOWN = 0;
-
- public static int INPUT_ARGS_PARSING = 1;
-
- public static int INPUT_ARGS_VALIDATION = 2;
-
- public static int WSDL_MODEL_CREATION = 3;
-
- public static int WSDL_MODEL_WRITING = 4;
-
- public static String[] phaseAsString = { "Unknown",
- "Input Arguments Parsing", "Input Arguments Validation",
- "WSDL Model Creation", "WSDL Model Writing" };
-
- public void WSDLGenPhaseStarted(WSDLGenEvent event);
-
- public void WSDLGenPhaseCompleted(WSDLGenEvent event);
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java
deleted file mode 100644
index b30b8cd62b..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class XMLNameUtil {
-
- /**
- * Returns a valid Java name from an XML Name.
- *
- * @param name
- * @param isUpperCase
- * @return a valid Java name from an XML Name
- */
- public static String getJavaNameFromXMLName(String name, boolean isUpperCase) {
- List<String> parsedName = parseName(name, '_');
- StringBuilder result = new StringBuilder(64 * parsedName.size());
- for (String nameComponent: parsedName) {
- if (nameComponent.length() > 0) {
- if (result.length() > 0 || isUpperCase) {
- result.append(Character.toUpperCase(nameComponent.charAt(0)));
- result.append(nameComponent.substring(1));
- } else {
- result.append(nameComponent);
- }
- }
- }
-
- if (result.length() == 0) {
- return "_";
- }
- if (Character.isJavaIdentifierStart(result.charAt(0))) {
- return isUpperCase ? result.toString() : decapitalizeName(result.toString());
- }
- return "_" + result;
- }
-
- /**
- * Decapitalize a name.
- * @param name
- * @return a decapitalized name
- */
- public static String decapitalizeName(String name) {
- if (name.length() == 0) {
- return name;
- } else {
- String lowerName = name.toLowerCase();
- int i;
- for (i = 0; i < name.length(); i++) {
- if (name.charAt(i) == lowerName.charAt(i)) {
- break;
- }
- }
- if (i > 1 && i < name.length()) {
- --i;
- }
- return name.substring(0, i).toLowerCase() + name.substring(i);
- }
- }
-
- /**
- * Parse the given name.
- *
- * @param sourceName
- * @param separator
- * @return some stuff parsed from the name
- */
- private static List<String> parseName(String sourceName, char separator) {
- List<String> result = new ArrayList<String>();
- if (sourceName != null) {
- StringBuilder currentWord = new StringBuilder(64);
- boolean lastIsLower = false;
- int index;
- int length;
- for (index = 0, length = sourceName.length(); index < length; ++index) {
- char curChar = sourceName.charAt(index);
- if (!Character.isJavaIdentifierPart(curChar)) {
- curChar = separator;
- }
- if (Character.isUpperCase(curChar)
- || (!lastIsLower && Character.isDigit(curChar))
- || curChar == separator) {
-
- if (lastIsLower && currentWord.length() > 1
- || curChar == separator && currentWord.length() > 0) {
- result.add(currentWord.toString());
- currentWord = new StringBuilder(64);
- }
- lastIsLower = false;
- } else {
- if (!lastIsLower) {
- int currentWordLength = currentWord.length();
- if (currentWordLength > 1) {
- char lastChar = currentWord.charAt(--currentWordLength);
- currentWord.setLength(currentWordLength);
- result.add(currentWord.toString());
- currentWord = new StringBuilder(64);
- currentWord.append(lastChar);
- }
- }
- lastIsLower = true;
- }
-
- if (curChar != separator) {
- currentWord.append(curChar);
- }
- }
-
- result.add(currentWord.toString());
- }
- return result;
- }
-
- /**
- * Return an EPackage name for the given namespace.
- *
- * @param namespace
- * @return an EPackage name for the given namespace
- */
- public static String getPackageNameFromNamespace(String namespace) {
- return org.apache.tuscany.sdo.helper.SDOXSDEcoreBuilder.getDefaultPackageName(namespace);
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/resources/META-INF/LICENSE.txt b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/resources/META-INF/LICENSE.txt
deleted file mode 100644
index 0084319535..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/main/resources/META-INF/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, serviceDefinition marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java
deleted file mode 100644
index 135b374357..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer;
-
-public class CustomerValue {
-
- public int getValue(String custId, String stockSymbol) {
- return 0;
- }
-
- public Customer getCustomerDetails(String custId) {
- return new Customer();
- }
-
- public String noArgsServiceMethod() {
- return new String();
- }
-
- private void privateServiceMethod() {
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java
deleted file mode 100644
index dfebd77215..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import org.apache.tuscany.tools.java2wsdl.generate.account.Account;
-import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer;
-
-public class CustomerWithAccount {
-
- private Customer customer = new Customer();
-
- private Account[] accounts;
-
- public int getValue(String custId, String stockSymbol) {
- return 123;
- }
-
- public Customer getCustomerDetails(String custId) {
- return customer;
- }
-
- public Account getCustomerAccount(String custId, String accountId) {
- return accounts[0];
- }
-
- public Account[] getAccounts() {
- return accounts;
- }
-
- public void setAccounts(Account[] accounts) {
- this.accounts = accounts;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/ExampleService.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/ExampleService.java
deleted file mode 100644
index ccc2d3f628..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/ExampleService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import org.oasisopen.sca.annotation.OneWay;
-
-public interface ExampleService {
-
- void sayHelloTwoWay(String name);
-
- @OneWay
- void sayHelloOneWay(String name);
-
- String getGreeting();
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java
deleted file mode 100644
index c587252d23..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-/**
- * A JUnit test case to test the Tuscany Java 2 WSDL Generation
- */
-public class TuscanyJava2WSDLTestCase extends TestCase {
-
- /**
- * setup the pre-requisites for the test case to run
- *
- * @exception Exception
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /**
- * @exception Exception
- */
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Simple WSDL generation test.
- */
- public void testSimpleWSDLGeneration() {
- String[] arguments =
- new String[] {"-cn", "org.apache.tuscany.tools.java2wsdl.generate.CustomerValue",
- "-o", "target/java2wsdl-source", "-xc",
- "org.apache.tuscany.tools.java2wsdl.generate.extra.GoldCustomer"};
-
- Java2WSDL.main(arguments);
-
- File file = new File("target/java2wsdl-source/CustomerValue.wsdl");
- assertTrue(file.exists() && file.isFile());
- }
-
- /**
- * Test WSDL generation where a parameter Object[] is involved.
- */
- public void testWsdlGeneration2() {
-
- String[] arguments =
- new String[] {"-cn", "org.apache.tuscany.tools.java2wsdl.generate.CustomerWithAccount",
- "-o", "target/java2wsdl-source",};
- Java2WSDL.main(arguments);
-
- File file = new File("target/java2wsdl-source/CustomerWithAccount.wsdl");
- assertTrue(file.exists() && file.isFile());
- }
-
- public void testWsdlGeneration_SDO_Static() {
- // tests for SDOs where XSD exist. Hence no XSDs must be generated
- String[] arguments =
- new String[] {"-cn", "org.soapinterop.CreditScoreDocLit",
- "-o", "target/java2wsdl-source",
- "-ixsd", "[http://www.example.org/creditscore/doclit/," + "http://www.example.org/creditscore/doclit/xsd]"};
- Java2WSDL.main(arguments);
-
- File file = new File("target/java2wsdl-source/CreditScoreDocLit.wsdl");
- assertTrue(file.exists() && file.isFile());
- }
-
- /**
- * Test WSDL generation for a service interface.
- */
- public void testServiceWSDLGeneration() {
- String[] arguments =
- new String[] {"-cn", "org.apache.tuscany.tools.java2wsdl.generate.ExampleService",
- "-o", "target/java2wsdl-source"};
-
- Java2WSDL.main(arguments);
-
- File file = new File("target/java2wsdl-source/ExampleService.wsdl");
- assertTrue(file.exists() && file.isFile());
- }
-
- /**
- * Test WSDL generation from a java interface and then generate the java
- * interface using the generated WSDL.
- */
- public void _testRoundTrip() {
- // TODO implement round trip
- // this should re-generate java interfaces from the generated wsdl
- // and compile (?) the generated java code.
- // fail();
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java
deleted file mode 100644
index bf49d98888..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate.account;
-
-import java.math.BigDecimal;
-
-public class Account {
- int accountType;
-
- String accountNo;
-
- BigDecimal balance;
-
- public String getAccountNo() {
- return accountNo;
- }
-
- public void setAccountNo(String accountNo) {
- this.accountNo = accountNo;
- }
-
- public int getAccountType() {
- return accountType;
- }
-
- public void setAccountType(int accountType) {
- this.accountType = accountType;
- }
-
- public BigDecimal getBalance() {
- return balance;
- }
-
- public void setBalance(BigDecimal balance) {
- this.balance = balance;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java
deleted file mode 100644
index cf83095852..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate.customer;
-
-public class Customer {
- private String name = "";
-
- public int custType = 0;
-
- public String getName() {
- return name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java
deleted file mode 100644
index 901da8e551..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.java2wsdl.generate.extra;
-
-import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer;
-
-public class GoldCustomer extends Customer {
- public String goldCustNumber = "";
-
- public String getGoldCustNumber() {
- return goldCustNumber;
- }
-
- public void setGoldCustNumber(String goldCustNumber) {
- this.goldCustNumber = goldCustNumber;
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java
deleted file mode 100644
index 78a64dcc64..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.soapinterop;
-
-public interface CreditScoreDocLit {
- public org.example.creditscore.doclit.CreditReport getCreditScore(org.example.creditscore.doclit.Customer param0)
- throws java.rmi.RemoteException;
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/AccountService.wsdl b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/AccountService.wsdl
deleted file mode 100644
index 6f2fed1e2a..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/AccountService.wsdl
+++ /dev/null
@@ -1,242 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:tns="http://www.bigbank.com/Account/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:account="http://www.bigbank.com/Account/"
- targetNamespace="http://www.bigbank.com/Account/"
- name="AccountService">
-
- <wsdl:types>
- <xsd:schema targetNamespace="http://www.bigbank.com/Account/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:account="http://www.bigbank.com/Account/"
- xmlns:sdojava="commonj.sdo/java"
- sdojava:package="org.apache.tuscany.samples.bigbank.account">
-
- <xsd:element name="getAccountReportWrapped0">
- <xsd:complexType>
- <xsd:sequence>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getAccountReportWrapped0Response">
- <xsd:complexType>
- <xsd:sequence>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="getAccountReportWrapped1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="customerID" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getAccountReportWrapped1Response">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="accountReport" type="account:AccountReport"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="getAccountReportWrappedN">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="customerID" type="xsd:string"/>
- <xsd:element name="customerID2" type="xsd:int"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getAccountReportWrappedNResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="accountReport" type="account:AccountReport"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="getAccountReportBare0" type="xsd:string"/>
- <xsd:element name="getAccountReportBare0Response" type="xsd:int"/>
-
- <xsd:element name="getAccountReportBare1Simple" type="xsd:string"/>
- <xsd:element name="getAccountReportBare1SimpleResponse" type="xsd:int"/>
-
- <xsd:element name="getAccountReportBare1Complex" type="account:AccountRequest"/>
- <xsd:element name="getAccountReportBare1ComplexResponse" type="account:AccountReport"/>
-
- <xsd:complexType name="AccountRequest">
- <xsd:sequence>
- <xsd:element name="customerID" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="AccountReport">
- <xsd:sequence>
- <xsd:element name="accountSummaries" type="account:AccountSummary" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="AccountSummary">
- <xsd:attribute name="accountNumber" type="xsd:string"/>
- <xsd:attribute name="accountType" type="xsd:string"/>
- <xsd:attribute name="balance" type="xsd:float"/>
- </xsd:complexType>
-
- </xsd:schema>
- </wsdl:types>
-
- <wsdl:message name="getAccountReportWrapped0Request">
- <wsdl:part element="account:getAccountReportWrapped0" name="getAccountReportWrapped0Request"/>
- </wsdl:message>
- <wsdl:message name="getAccountReportWrapped0Response">
- <wsdl:part element="account:getAccountReportWrapped0Response" name="getAccountReportWrapped0Response"/>
- </wsdl:message>
-
- <wsdl:message name="getAccountReportWrapped1Request">
- <wsdl:part element="account:getAccountReportWrapped1" name="getAccountReportWrapped1Request"/>
- </wsdl:message>
- <wsdl:message name="getAccountReportWrapped1Response">
- <wsdl:part element="account:getAccountReportWrapped1Response" name="getAccountReportWrapped1Response"/>
- </wsdl:message>
-
- <wsdl:message name="getAccountReportWrappedNRequest">
- <wsdl:part element="account:getAccountReportWrappedN" name="getAccountReportWrappedNRequest"/>
- </wsdl:message>
- <wsdl:message name="getAccountReportWrappedNResponse">
- <wsdl:part element="account:getAccountReportWrappedNResponse" name="getAccountReportWrappedNResponse"/>
- </wsdl:message>
-
- <wsdl:message name="getAccountReportBare0Request">
- </wsdl:message>
- <wsdl:message name="getAccountReportBare0Response">
- </wsdl:message>
-
- <wsdl:message name="getAccountReportBare1SimpleRequest">
- <wsdl:part element="account:getAccountReportBare1Simple" name="getAccountReportBare1SimpleRequest"/>
- </wsdl:message>
- <wsdl:message name="getAccountReportBare1SimpleResponse">
- <wsdl:part element="account:getAccountReportBare1SimpleResponse" name="getAccountReportBare1SimpleResponse"/>
- </wsdl:message>
-
- <wsdl:message name="getAccountReportBare1ComplexRequest">
- <wsdl:part element="account:getAccountReportBare1Complex" name="getAccountReportBare1ComplexRequest"/>
- </wsdl:message>
- <wsdl:message name="getAccountReportBare1ComplexResponse">
- <wsdl:part element="account:getAccountReportBare1ComplexResponse" name="getAccountReportBare1ComplexResponse"/>
- </wsdl:message>
-
- <wsdl:portType name="Account_Service">
- <wsdl:operation name="getAccountReportWrapped0">
- <wsdl:input message="tns:getAccountReportWrapped0Request"/>
- <wsdl:output message="tns:getAccountReportWrapped0Response"/>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportWrapped1">
- <wsdl:input message="tns:getAccountReportWrapped1Request"/>
- <wsdl:output message="tns:getAccountReportWrapped1Response"/>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportWrappedN">
- <wsdl:input message="tns:getAccountReportWrappedNRequest"/>
- <wsdl:output message="tns:getAccountReportWrappedNResponse"/>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare0">
- <wsdl:input message="tns:getAccountReportBare0Request"/>
- <wsdl:output message="tns:getAccountReportBare0Response"/>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare1Simple">
- <wsdl:input message="tns:getAccountReportBare1SimpleRequest"/>
- <wsdl:output message="tns:getAccountReportBare1SimpleResponse"/>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare1Complex">
- <wsdl:input message="tns:getAccountReportBare1ComplexRequest"/>
- <wsdl:output message="tns:getAccountReportBare1ComplexResponse"/>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="AccountServiceSOAP" type="tns:Account_Service">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="getAccountReportWrapped0">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportWrapped0"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportWrapped1">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportWrapped1"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportWrappedN">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportWrappedN"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare0">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportBare0"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare1Simple">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportBare1Simple"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare1Complex">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportBare1Complex"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="AccountService">
- <wsdl:port binding="tns:AccountServiceSOAP"
- name="AccountServiceSOAP">
- <soap:address location="http://localhost:8085/sample-account/services/AccountService"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl
deleted file mode 100644
index 09d1a58589..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:tns="http://www.example.org/creditscore/doclit/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CreditScore"
- targetNamespace="http://www.example.org/creditscore/doclit/">
- <wsdl:types>
- <xsd:schema
- targetNamespace="http://www.example.org/creditscore/doclit/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="getCreditScoreRequest" type="tns:Customer" />
- <xsd:complexType name="Customer">
- <xsd:sequence>
- <xsd:element name="ssn" type="xsd:string" />
- <xsd:element name="firstName" type="xsd:string" />
- <xsd:element name="lastName" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:element name="getCreditScoreResponse" type="tns:CreditReport"/>
- <xsd:complexType name="CreditReport">
- <xsd:sequence>
- <xsd:element name="score" type="xsd:int"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="getCreditScoreResponse">
- <wsdl:part element="tns:getCreditScoreResponse"
- name="getCreditScoreResponse" />
- </wsdl:message>
- <wsdl:message name="getCreditScoreRequest">
- <wsdl:part element="tns:getCreditScoreRequest"
- name="getCreditScoreRequest" />
- </wsdl:message>
- <wsdl:portType name="CreditScoreDocLit">
- <wsdl:operation name="getCreditScore">
- <wsdl:input message="tns:getCreditScoreRequest" />
- <wsdl:output message="tns:getCreditScoreResponse" />
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="CreditScoreDocLitSOAP" type="tns:CreditScoreDocLit">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getCreditScore">
- <soap:operation
- soapAction="http://www.example.org/creditscore/doclit/getCreditScore" />
- <wsdl:input>
- <soap:body parts="getCreditScoreRequest" use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body parts="getCreditScoreResponse" use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="CreditScore">
- <wsdl:port binding="tns:CreditScoreDocLitSOAP"
- name="CreditScoreDocLitSOAP">
- <soap:address location="http://www.example.org/" />
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/helloworld.wsdl b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/helloworld.wsdl
deleted file mode 100644
index 051f604bb2..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/helloworld.wsdl
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://helloworldaxis.samples.tuscany.apache.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://helloworldaxis.samples.tuscany.apache.org" xmlns:intf="http://helloworldaxis.samples.tuscany.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="stockquote">
- <!--WSDL created by Apache Axis version: 1.2.1
-Built on Jun 14, 2005 (09:15:57 EDT)-->
- <wsdl:types>
- <schema elementFormDefault="qualified"
- xmlns:hello="http://helloworldaxis.samples.tuscany.apache.org"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://helloworldaxis.samples.tuscany.apache.org" xmlns="http://www.w3.org/2001/XMLSchema">
- <complexType name="ComplexGreetings">
- <sequence>
- <element name="greet1" type="xsd:string"/>
- <element name="greet2" type="xsd:double"/>
- </sequence>
- </complexType>
- <element name="getGreetings">
- <complexType>
- <sequence>
- <element name="in0" type="xsd:string"/>
- <element name="in1" type="xsd:double"/>
- <element name="in2" type="hello:ComplexGreetings"/>
- </sequence>
- <xsd:attribute name="language" type="xsd:string"/>
- </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="impl:getGreetings" name="parameters"/>
-
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
-
- <wsdl:part element="impl:getGreetingsResponse" name="parameters"/>
-
- </wsdl:message>
-
- <wsdl:portType name="HelloWorldServiceImpl">
-
- <wsdl:operation name="getGreetings">
-
- <wsdl:input message="impl:getGreetingsRequest" name="getGreetingsRequest"/>
-
- <wsdl:output message="impl:getGreetingsResponse" name="getGreetingsResponse"/>
-
- </wsdl:operation>
-
- </wsdl:portType>
-
- <wsdl:binding name="helloworldSoapBinding" type="impl:HelloWorldServiceImpl">
-
- <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="HelloWorldServiceImplService">
-
- <wsdl:port binding="impl:helloworldSoapBinding" name="helloworld">
-
- <!-- Tuscany SCA Service -->
-<!--
- <wsdlsoap:address location="http://localhost:8080/tuscany-samples-helloworldws-service/services/HelloWorldService"/>
--->
- <wsdlsoap:address location="http://localhost:9876/tuscany-samples-helloworldws-service/services/HelloWorldService"/>
-
- <!-- Axis Web Service -->
- <!--
- <wsdlsoap:address location="http://localhost:8081/helloworldaxissvc-incubating-M1/services/helloworld"/>
- -->
-
- </wsdl:port>
-
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/interopdoc.wsdl b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/interopdoc.wsdl
deleted file mode 100644
index 820c26ca34..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/interopdoc.wsdl
+++ /dev/null
@@ -1,180 +0,0 @@
-<?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="InteropTestDoc" targetNamespace="http://soapinterop.org/"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://soapinterop.org/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
-
- <xsd:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/" xmlns:interop="http://soapinterop.org/">
-
- <xsd:element name="SingleTag">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SingleTag" type="interop:SingleTag"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name="SingleTag"/>
- <xsd:element name="SingleTagResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SingleTag" type="interop:SingleTag"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="SimpleDocument">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SimpleDocument" type="interop:SimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="SimpleDocument">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
- <xsd:element name="SimpleDocumentResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SimpleDocument" type="interop:SimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="ComplexDocument">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="ComplexDocument" type="interop:ComplexDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="ComplexDocument">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="simpleDoc" type="interop:ArrayOfSimpleDocument"/>
- <xsd:element minOccurs="0" maxOccurs="1" name="child" type="interop:ChildDocument"/>
- </xsd:sequence>
- <xsd:attribute name="AnAttribute" type="xsd:string"/>
- </xsd:complexType>
- <xsd:complexType name="ArrayOfSimpleDocument">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="SimpleDocument" nillable="true" type="interop:SimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="ChildDocument">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="childSimpleDoc" type="interop:ArrayOfSimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:element name="ComplexDocumentResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="ComplexDocument" type="interop:ComplexDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:schema>
-
- </types>
-
- <message name="SingleTagSoapIn">
- <part name="parameters" element="tns:SingleTag"/>
- </message>
- <message name="SingleTagSoapOut">
- <part name="outputDoc" element="tns:SingleTagResponse"/>
- </message>
- <message name="SimpleDocumentSoapIn">
- <part name="parameters" element="tns:SimpleDocument"/>
- </message>
- <message name="SimpleDocumentSoapOut">
- <part name="outputDoc" element="tns:SimpleDocumentResponse"/>
- </message>
- <message name="ComplexDocumentSoapIn">
- <part name="parameters" element="tns:ComplexDocument"/>
- </message>
- <message name="ComplexDocumentSoapOut">
- <part name="outputDoc" element="tns:ComplexDocumentResponse"/>
- </message>
-
- <portType name="DocTestPortType">
-
- <operation name="SingleTag">
- <input message="tns:SingleTagSoapIn"/>
- <output message="tns:SingleTagSoapOut"/>
- </operation>
- <operation name="SimpleDocument">
- <input message="tns:SimpleDocumentSoapIn"/>
- <output message="tns:SimpleDocumentSoapOut"/>
- </operation>
- <operation name="ComplexDocument">
- <input message="tns:ComplexDocumentSoapIn"/>
- <output message="tns:ComplexDocumentSoapOut"/>
- </operation>
-
- </portType>
-
- <binding name="doc_test_binding" type="tns:DocTestPortType">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
-
- <operation name="SingleTag">
- <soap:operation soapAction="http://soapinterop.org/SingleTag"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
-
- <operation name="SimpleDocument">
- <soap:operation soapAction="http://soapinterop.org/SimpleDocument"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
-
- <operation name="ComplexDocument">
- <soap:operation soapAction="http://soapinterop.org/ComplexDocument"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
-
- <service name="interopDocSvc">
-
- <port name="interopDocPort" binding="tns:doc_test_binding">
- <soap:address location="http://www.whitemesa.net/interopdoc"/>
- </port>
-
- </service>
-
-</definitions>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/sequences.xsd b/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/sequences.xsd
deleted file mode 100644
index a565f3fa65..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/java2wsdl/src/test/resources/sequences.xsd
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:seq="http://www.example.com/sequences"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.example.com/sequences">
-
- <xsd:element name="mixedStockQuote" type="seq:MixedQuote" />
- <xsd:element name="rc" type="seq:RepeatingChoice" />
- <xsd:element name="mrc" type="seq:MixedRepeatingChoice" />
- <xsd:element name="rc2" type="seq:TwoRCs" />
- <xsd:element name="mrc2" type="seq:TwoRCsMixed" />
-
-
-
- <xsd:complexType mixed="true" name="MixedQuote">
- <xsd:sequence>
- <xsd:element name="symbol" type="xsd:string" />
- <xsd:element name="companyName" type="xsd:string" />
- <xsd:element name="price" type="xsd:decimal" />
- <xsd:element name="open1" type="xsd:decimal" />
- <xsd:element name="high" type="xsd:decimal" />
- <xsd:element name="low" type="xsd:decimal" />
- <xsd:element name="volume" type="xsd:double" />
- <xsd:element name="change1" type="xsd:double" />
- <xsd:element maxOccurs="unbounded" minOccurs="0"
- name="quotes" type="seq:MixedQuote" />
- </xsd:sequence>
- </xsd:complexType>
-
-
- <xsd:complexType name="RepeatingChoice">
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="a" type="xsd:string" />
- <xsd:element name="b" type="xsd:int" />
- </xsd:choice>
- </xsd:complexType>
-
-
- <xsd:complexType mixed="true" name="MixedRepeatingChoice">
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="a" type="xsd:string" />
- <xsd:element name="b" type="xsd:int" />
- </xsd:choice>
- </xsd:complexType>
-
-
- <xsd:complexType name="TwoRCs">
- <xsd:sequence>
-
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="a" type="xsd:string" />
- <xsd:element name="b" type="xsd:int" />
- </xsd:choice>
-
- <xsd:element name="split" type="xsd:string" />
-
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="y" type="xsd:string" />
- <xsd:element name="z" type="xsd:int" />
- </xsd:choice>
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType mixed="true" name="TwoRCsMixed">
- <xsd:sequence>
-
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="a" type="xsd:string" />
- <xsd:element name="b" type="xsd:int" />
- </xsd:choice>
-
- <xsd:element name="split" type="xsd:string" />
-
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="y" type="xsd:string" />
- <xsd:element name="z" type="xsd:int" />
- </xsd:choice>
-
- </xsd:sequence>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/pom.xml b/tags/java/sca/2.0-M1/tools/sdo/pom.xml
deleted file mode 100644
index 87f32985f7..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <packaging>pom</packaging>
- <artifactId>tuscany-sca-sdo-tools</artifactId>
- <name>Apache Tuscany SCA SDO Tools</name>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>java2wsdl</module>
- <module>wsdl2java</module>
- </modules>
- </profile>
- </profiles>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/LICENSE b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/LICENSE
deleted file mode 100644
index 8aa906c321..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/NOTICE b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/NOTICE
deleted file mode 100644
index 25bb89c9b2..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/pom.xml b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/pom.xml
deleted file mode 100644
index e7d0d0df95..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/pom.xml
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-sdo-tools</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-wsdl2java</artifactId>
- <name>Apache Tuscany SCA WSDL2Java Tool</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-M1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-impl</artifactId>
- <version>1.1.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-tools</artifactId>
- <version>1.1.1</version>
- </dependency>
-
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-xjc</artifactId>
- <version>2.1.7</version>
- </dependency>
-
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- </dependency>
-
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.1.7</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jsr173_api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0-2</version>
- </dependency>
-
- <dependency>
- <groupId>wsdl4j</groupId>
- <artifactId>wsdl4j</artifactId>
- <version>1.6.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.neethi</groupId>
- <artifactId>neethi</artifactId>
- <version>2.0.4</version>
- <exclusions>
- <exclusion>
- <groupId>wsdl4j</groupId>
- <artifactId>wsdl4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-java2wsdl</artifactId>
- <version>1.4.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-codegen</artifactId>
- <version>1.4.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.emf</groupId>
- <artifactId>codegen</artifactId>
- <version>2.2.3</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.emf</groupId>
- <artifactId>codegen-ecore</artifactId>
- <version>2.2.3</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>
- <version>1.0</version>
- <executions>
- <execution>
- <id>add-test-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/sdo-source</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-plugin</artifactId>
- <version>1.1.1</version>
- <executions>
- <execution>
- <id>generate-sdo</id>
- <phase>generate-test-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/test/resources/CreditScoreDocLit.wsdl
- </schemaFile>
- <javaPackage>org.example.creditscore.doclit</javaPackage>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>java.net</id>
- <name>java.net Maven 1.x Repository</name>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
- <repository>
- <!-- temporarily using indiana state univ as eclipse site diesnt have 2.2.2 at the moment -->
- <id>indiana</id>
- <url>http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/maven2/
- </url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-</project>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java
deleted file mode 100644
index 08c7131208..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.wsdl2java.generate;
-
-import static org.apache.tuscany.tools.wsdl2java.util.XMLNameUtil.getJavaNameFromXMLName;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axis2.description.AxisBindingOperation;
-import org.apache.axis2.description.AxisMessage;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.util.FileWriter;
-import org.apache.axis2.wsdl.WSDLConstants;
-import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
-import org.apache.axis2.wsdl.codegen.emitter.JavaEmitter;
-import org.apache.axis2.wsdl.codegen.writer.InterfaceWriter;
-import org.apache.axis2.wsdl.databinding.TypeMapper;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-/**
- * Overrides the Axis2 JavaEmitter to generate unwrapped methods.
- */
-public class JavaInterfaceEmitter extends JavaEmitter {
-
- private CodeGenConfiguration codegenConfiguration;
- private TypeMapper typeMapper;
-
- @Override
- public void setCodeGenConfiguration(CodeGenConfiguration configuration) {
- super.setCodeGenConfiguration(configuration);
- codegenConfiguration = configuration;
- }
-
- @Override
- public void setMapper(TypeMapper typeMapper) {
- super.setMapper(typeMapper);
- this.typeMapper = typeMapper;
- }
-
- private List getParameterElementList(Document doc, AxisMessage message, boolean wrapped) {
- List parameterElementList = new ArrayList();
-
- if (message != null && message.getElementQName() != null) {
-
- SDODataBindingTypeMappingEntry typeMappingEntry =
- (SDODataBindingTypeMappingEntry)this.typeMapper.getTypeMappingObject(message.getElementQName());
- List typeMappings;
- if (wrapped) {
- typeMappings = typeMappingEntry.getPropertyClassNames();
- if(typeMappings == null) {
- typeMappings = new ArrayList();
- typeMappings.add(typeMappingEntry.getClassName());
- }
- } else {
- typeMappings = new ArrayList();
- typeMappings.add(typeMappingEntry.getClassName());
- }
-
- for (int i = 0; i < typeMappings.size(); i++) {
- Element param = doc.createElement("param");
- parameterElementList.add(param);
-
- String typeMapping = (String)typeMappings.get(i);
-
- addAttribute(doc, "name", this.typeMapper.getParameterName(message.getElementQName()), param);
- addAttribute(doc, "type", (typeMapping == null) ? "" : typeMapping, param);
-
- // add an extra attribute to say whether the type mapping is the
- // default
- // if (TypeMapper.DEFAULT_CLASS_NAME.equals(typeMapping)) {
- if (typeMapper.getDefaultMappingName().equals(typeMapping)) {
-
- addAttribute(doc, "default", "yes", param);
- }
-
- addAttribute(doc, "value", null, param);
-
- // add this as a body parameter
- addAttribute(doc, "location", "body", param);
-
- }
- }
-
- return parameterElementList;
- }
-
- @Override
- public List getParameterElementList(Document doc, List parameters, String location) {
- List parameterElementList = new ArrayList();
-
- if ((parameters != null) && !parameters.isEmpty()) {
- int count = parameters.size();
-
- for (int i = 0; i < count; i++) {
- Element param = doc.createElement("param");
- QName name = (QName)parameters.get(i);
-
- addAttribute(doc, "name", this.typeMapper.getParameterName(name), param);
-
- String typeMapping = this.typeMapper.getTypeMappingName(name);
- String typeMappingStr = (typeMapping == null) ? "" : typeMapping;
-
- addAttribute(doc, "type", typeMappingStr, param);
- addAttribute(doc, "location", location, param);
- parameterElementList.add(param);
- }
- }
-
- return parameterElementList;
- }
-
- @Override
- protected Element getInputElement(Document doc, AxisBindingOperation operation, List headerParameterQNameList) {
- return getElement(doc,
- "input",
- operation.getAxisOperation().getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE),
- operation.getAxisOperation().getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE).isWrapped(),
- headerParameterQNameList);
- }
-
- @Override
- protected Element getOutputElement(Document doc, AxisBindingOperation operation, List headerParameterQNameList) {
- return getElement(doc,
- "output",
- operation.getAxisOperation().getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE),
- operation.getAxisOperation().getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE).isWrapped(),
- headerParameterQNameList);
- }
-
- protected Element getElement(Document doc,
- String elementName,
- AxisMessage message,
- boolean wrapped,
- List headerParameterQNameList) {
- Element element = doc.createElement(elementName);
-
- List parameterElementList = getParameterElementList(doc, message, wrapped);
- for (int i = 0; i < parameterElementList.size(); i++) {
- element.appendChild((Element)parameterElementList.get(i));
- }
-
- List outputElementList = getParameterElementList(doc, headerParameterQNameList, "header");
-
- for (int i = 0; i < outputElementList.size(); i++) {
- element.appendChild((Element)outputElementList.get(i));
- }
-
- return element;
- }
-
- @Override
- protected void writeInterface(boolean writeDatabinders) throws Exception {
- Document interfaceModel = createDOMDocumentForInterface(writeDatabinders);
- if (!codegenConfiguration.getOutputLocation().exists()) {
- codegenConfiguration.getOutputLocation().mkdirs();
- }
- InterfaceWriter interfaceWriter =
- new RemotableInterfaceWritter(this.codegenConfiguration.getOutputLocation(), this.codegenConfiguration
- .getOutputLanguage());
-
- String packageName = interfaceModel.getDocumentElement().getAttribute("package");
- String className = interfaceModel.getDocumentElement().getAttribute("name");
-
- System.out.println(">> Generating Java class " + packageName + "." + className);
- File outputFile =
- FileWriter.createClassFile(this.codegenConfiguration.getOutputLocation(), packageName, className, ".java");
- if (outputFile.exists()) {
- outputFile.delete();
- }
-
-// JIRA TUSCANY-1561 Port to Axis2 1.3
-// writeClass(interfaceModel, interfaceWriter);
-
- writeFile(interfaceModel, interfaceWriter);
- }
-
- @Override
- protected String makeJavaClassName(String word) {
- // return XMLNameUtil.getJavaNameFromXMLName(word, true);
- return getJavaNameFromXMLName(word, true);
- }
-
- @Override
- protected Element[] getFaultParamElements(Document doc, AxisOperation operation) {
- ArrayList params = new ArrayList();
- ArrayList faultMessages = operation.getFaultMessages();
-
- if (faultMessages != null && !faultMessages.isEmpty()) {
- Element paramElement;
- AxisMessage msg;
- for (int i = 0; i < faultMessages.size(); i++) {
- paramElement = doc.createElement("param");
- msg = (AxisMessage)faultMessages.get(i);
- String msgClassName = WSDL2JavaGenerator.normalizeClassName(msg.getName());
- addAttribute(doc, "name", msgClassName, paramElement);
- params.add(paramElement);
- }
-
- return (Element[])params.toArray(new Element[params.size()]);
- } else {
- return new Element[] {};// return empty array
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java
deleted file mode 100644
index 8e0c3683a3..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.wsdl2java.generate;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Definition;
-import javax.wsdl.Fault;
-import javax.wsdl.Message;
-import javax.wsdl.Operation;
-import javax.wsdl.Part;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
-import org.apache.axis2.util.FileWriter;
-import org.apache.axis2.util.XMLUtils;
-import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
-import org.apache.axis2.wsdl.codegen.CodeGenerationException;
-import org.apache.axis2.wsdl.codegen.extension.CodeGenExtension;
-import org.apache.axis2.wsdl.codegen.extension.DefaultDatabindingExtension;
-import org.apache.axis2.wsdl.codegen.extension.PackageFinder;
-import org.apache.axis2.wsdl.codegen.extension.WSDLValidatorExtension;
-import org.apache.axis2.wsdl.databinding.JavaTypeMapper;
-import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
-
-import com.sun.tools.xjc.api.XJC;
-
-public class JavaInterfaceGenerator {
-
- private List codegenExtensions = new ArrayList();
- private List<CodeGenConfiguration> codegenConfigurations= new LinkedList<CodeGenConfiguration>();
- private String outputLocation;
-
-
-
- public JavaInterfaceGenerator(String uri, String ports[], String outputLocation, String packageName,
- Map<QName, SDODataBindingTypeMappingEntry> typeMapping) throws CodeGenerationException {
- this.outputLocation = outputLocation;
-
- Definition definition;
- try {
- definition = readWSDL(uri);
- } catch (WSDLException e) {
- throw new CodeGenerationException(e);
- }
-
- HashSet<String> interestedPorts = ports == null ? null : new HashSet<String>(Arrays.asList(ports));
-
- // Service service=(Service)definition.getServices().values().().next();
-
- HashSet<QName> donePortTypes= new HashSet<QName>();
-
- for (Iterator sIter = definition.getServices().values().iterator(); sIter.hasNext(); ) {
- Service service = (Service) sIter.next();
-
- QName serviceQname = service.getQName();
- for (Iterator pIter= service.getPorts().values().iterator(); pIter.hasNext(); ) {
- Port port= (Port) pIter.next();
- if(interestedPorts != null && ! interestedPorts.contains(port.getName())) continue;//not iterested.
- PortType portType= getPortType(port);
- if(null == portType) continue; // not connected.
- QName pQName= portType.getQName();
- if(donePortTypes.contains(pQName)) continue; //allready did it.
- donePortTypes.add(pQName);
-
- if (packageName == null) {
- //use JAXWS/JAXB NS->package default algorithm, not the SDO/EMF one
- packageName = XJC.getDefaultPackageName(definition.getTargetNamespace());
- }
- //
- // Use WSDL4J object to generate exception classes
- //
- generateFaults(packageName, portType, typeMapping);
- JavaTypeMapper typeMapper = new JavaTypeMapper();
- for (Map.Entry<QName, SDODataBindingTypeMappingEntry> e : typeMapping.entrySet()) {
- typeMapper.addTypeMappingObject(e.getKey(), e.getValue());
- // Added for generation of exceptions from faults
- typeMapper.addTypeMappingName(e.getKey(), e.getValue().getClassName());
- }
-
-
- AxisService axisService;
- WSDL11ToAxisServiceBuilder builder;
- try {
- //
- // Added since at a newer level of Axis2, this doesn't work
- // without the setCodegen(true)
- //
- builder = new WSDL11ToAxisServiceBuilder(definition, serviceQname, port.getName());
- builder.setCodegen(true);
- axisService = builder.populateService();
- } catch (AxisFault e) {
- throw new CodeGenerationException(e);
- }
-
- axisService.setName(port.getBinding().getPortType().getQName().getLocalPart());
- CodeGenConfiguration codegenConfiguration = new CodeGenConfiguration(Collections.EMPTY_MAP);
- codegenConfigurations.add(codegenConfiguration);
- codegenConfiguration.setAxisService(axisService);
- codegenConfiguration.setAdvancedCodeGenEnabled(false);
- codegenConfiguration.setAsyncOn(false);
- codegenConfiguration.setDatabindingType("sdo");
- codegenConfiguration.setGenerateAll(true);
- codegenConfiguration.setGenerateDeployementDescriptor(false);
- codegenConfiguration.setOutputLanguage("java");
- codegenConfiguration.setOutputLocation(new File(outputLocation));
- codegenConfiguration.setPackageName(packageName);
- codegenConfiguration.setPackClasses(false);
- codegenConfiguration.setPolicyMap(Collections.EMPTY_MAP);
- codegenConfiguration.setPortName(port.getName());
- codegenConfiguration.setServerSide(false);
- codegenConfiguration.setServiceName(service.getQName().getLocalPart());
- // This lines up with the sync/async variable from the XSL template
- codegenConfiguration.setSyncOn(true);
- codegenConfiguration.setTypeMapper(typeMapper);
-
-// JIRA TUSCANY-1561 Port to Axis2 1.3
-// codegenConfiguration.setWriteMessageReceiver(false);
- codegenConfiguration.setSkipMessageReceiver(true);
-
- codegenConfiguration.setWriteTestCase(false);
- addExtension(new WSDLValidatorExtension(), codegenConfiguration);
- addExtension(new PackageFinder(), codegenConfiguration);
- addExtension(new SDODataBindingCodegenExtension(typeMapper), codegenConfiguration);
- addExtension(new DefaultDatabindingExtension(), codegenConfiguration);
- }
- }
- }
-
-
- private PortType getPortType(Port port) {
- Binding binding = port.getBinding();
- if(null != binding){
- return binding.getPortType();
- }
- return null;
-
- }
-
-
- @SuppressWarnings("unchecked")
- private void addExtension(CodeGenExtension ext, CodeGenConfiguration codegenConfiguration) {
- //ext.init(codegenConfiguration);
- codegenExtensions.add(new Object[]{ext, codegenConfiguration});
- }
-
- public void generate() throws CodeGenerationException {
- try {
- for (int i = 0; i < codegenExtensions.size(); i++) {
- // CodeGenExtension
- Object[] pair = (Object[])codegenExtensions.get(i);
-
- CodeGenExtension cge = (CodeGenExtension)pair[0];
- CodeGenConfiguration cgf = (CodeGenConfiguration)pair[1];
-
- cge.engage(cgf);
- }
-
- for (CodeGenConfiguration codegenConfiguration : codegenConfigurations) {
- JavaInterfaceEmitter emitter = new JavaInterfaceEmitter();
- emitter.setCodeGenConfiguration(codegenConfiguration);
- emitter.setMapper(codegenConfiguration.getTypeMapper());
-
- emitter.writeInterface(false);
- }
-
- } catch (Exception e) {
- throw new CodeGenerationException(e);
- }
- }
-
- /**
- * Read the WSDL file
- *
- * @param uri
- * @return
- * @throws WSDLException
- */
- private Definition readWSDL(String uri) throws WSDLException {
-
- WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
- reader.setFeature("javax.wsdl.importDocuments", true);
-
- File file = new File(uri);
- String baseURI;
-
- if (uri.startsWith("http://")) {
- baseURI = uri;
- } else {
- if (file.getParentFile() == null) {
- try {
- baseURI = new File(".").getCanonicalFile().toURI().toString();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- } else {
- baseURI = file.getParentFile().toURI().toString();
- }
- }
-
- Document doc;
- try {
- doc = XMLUtils.newDocument(uri);
- } catch (ParserConfigurationException e) {
- throw new WSDLException(WSDLException.PARSER_ERROR, "Parser Configuration Error", e);
- } catch (SAXException e) {
- throw new WSDLException(WSDLException.PARSER_ERROR, "Parser SAX Error", e);
-
- } catch (IOException e) {
- throw new WSDLException(WSDLException.INVALID_WSDL, "IO Error", e);
- }
-
- return reader.readWSDL(baseURI, doc);
- }
-
- private void generateFaults(String packageName, PortType portType, Map<QName, SDODataBindingTypeMappingEntry> typeMapping)
- throws CodeGenerationException{
-
- for (Object o: portType.getOperations()) {
- Operation op = (Operation)o;
- Map messageMap = op.getFaults();
- Iterator iter = messageMap.values().iterator();
- while (iter.hasNext()) {
- Fault fault = (Fault)iter.next();
- Message faultMsg = fault.getMessage();
- Iterator iter2 = faultMsg.getParts().values().iterator();
- Part faultMsgPart = (Part)iter2.next();
- // TODO - if other parts throw exc
- QName faultMsgQName = faultMsg.getQName();
- QName faultMsgPartElementQName = faultMsgPart.getElementName();
- String faultClassName = typeMapping.get(faultMsgPartElementQName).getClassName();
- writeException(packageName, faultMsgQName, faultClassName, faultMsgPartElementQName);
- }
- }
- }
-
- private void writeException(String packageName, QName faultMsgQName, String faultClassName, QName faultMsgPartElementQName)
- throws CodeGenerationException{
-
- try {
- String faultWrapperClassName =
- WSDL2JavaGenerator.normalizeClassName(faultMsgQName.getLocalPart());
-
- File outputDir = new File(this.outputLocation);
-
- if (!outputDir.exists()) {
- outputDir.mkdirs();
- }
- File outputFile = FileWriter.createClassFile(outputDir,
- packageName, faultWrapperClassName, ".java");
-
- FileOutputStream fileStream = new FileOutputStream(outputFile);
- PrintStream stream = new PrintStream(fileStream);
-
- System.out.println(">> Generating Java exception class " + packageName + "." + faultWrapperClassName);
-
- stream.println();
- stream.println("package " + packageName + ";");
- stream.println();
- stream.println("import javax.xml.ws.WebFault;");
- stream.println();
- stream.println("@WebFault(name=\"" + faultMsgPartElementQName.getLocalPart()
- + "\", targetNamespace=\""
- + faultMsgPartElementQName.getNamespaceURI()
- + "\")");
- stream.println("public class " + faultWrapperClassName + " extends Exception {");
- stream.println();
- stream.println(" private " + faultClassName + " fault;");
- stream.println();
- stream.println(" public " + faultWrapperClassName + "(String message, " + faultClassName + " fault) {");
- stream.println(" super(message);");
- stream.println(" this.fault = fault;");
- stream.println(" }");
- stream.println();
- stream.println(" public " + faultWrapperClassName + "(String message, " + faultClassName + " fault, Throwable cause) {");
- stream.println(" super(message, cause);");
- stream.println(" this.fault = fault;");
- stream.println(" }");
- stream.println();
- stream.println(" public " + faultClassName + " getFaultInfo() {");
- stream.println(" return this.fault;");
- stream.println(" }");
- stream.println("}");
- stream.println();
- } catch (Exception e) {
- throw new CodeGenerationException(e);
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java
deleted file mode 100644
index 0c4f42633a..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.wsdl2java.generate;
-
-import java.io.File;
-
-import org.apache.axis2.wsdl.codegen.CodeGenerationException;
-import org.apache.axis2.wsdl.codegen.writer.InterfaceWriter;
-
-/**
- *
- */
-public class RemotableInterfaceWritter extends InterfaceWriter {
- private static final String REMOTABLE_INTERFACE_TEMPLATE="/RemotableInterfaceTemplate.xsl";
-
- public RemotableInterfaceWritter(String outputFileLocation) {
- super(outputFileLocation);
- }
-
- public RemotableInterfaceWritter(File outputFileLocation, String language) {
- super(outputFileLocation, language);
- }
-
- /**
- * Loads the template.
- */
- @Override
- public void loadTemplate() throws CodeGenerationException {
- // the default behavior for the class writers is to use the property map from the language specific types
- // The properties are arranged in the following order
- // <lang-name>.* .template=<write-class>,<template-name>
-
- //override original behaviour to always load the template we specified
- this.xsltStream = this.getClass().getResourceAsStream(REMOTABLE_INTERFACE_TEMPLATE);
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java
deleted file mode 100644
index 4ab152fb90..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.wsdl2java.generate;
-
-import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
-import org.apache.axis2.wsdl.codegen.CodeGenerationException;
-import org.apache.axis2.wsdl.codegen.extension.AbstractDBProcessingExtension;
-import org.apache.axis2.wsdl.databinding.TypeMapper;
-
-/**
- * SDO data binding codegen extension.
- */
-public class SDODataBindingCodegenExtension extends AbstractDBProcessingExtension {
-
- private TypeMapper typeMapper;
-
- public SDODataBindingCodegenExtension(TypeMapper typeMapper) {
- this.typeMapper=typeMapper;
- }
-
- @Override
- protected boolean testFallThrough(String dbFrameworkName) {
- return !dbFrameworkName.equals("sdo");
- }
-
-// public void engage() {
-// if (testFallThrough(configuration.getDatabindingType())) {
-// return;
-// }
-//
-// // Set the type mapper into the config
-// configuration.setTypeMapper(typeMapper);
-//
-// }
-
- public void engage(CodeGenConfiguration configuration) throws CodeGenerationException {
- if (testFallThrough(configuration.getDatabindingType())) {
- return;
- }
-
- // Set the type mapper into the config
- configuration.setTypeMapper(typeMapper);
-
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java
deleted file mode 100644
index 2d81ef12bf..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.wsdl2java.generate;
-
-import java.util.List;
-
-/**
- * This represents a type mapping entry, used by the JavaInterfaceEmitter to generate
- * method signatures.
- */
-public class SDODataBindingTypeMappingEntry {
-
- private final boolean anonymous;
- private final List<String> propertyClassNames;
- private final String className;
-
- public SDODataBindingTypeMappingEntry(String className, boolean anonymous, List<String> propertyClassNames) {
- this.className = className;
- this.anonymous = anonymous;
- this.propertyClassNames = propertyClassNames;
- }
-
- public boolean isAnonymous() {
- return anonymous;
- }
-
- public String getClassName() {
- return className;
- }
-
- public List<String> getPropertyClassNames() {
- return propertyClassNames;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java
deleted file mode 100644
index f6d1f3a64a..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java
+++ /dev/null
@@ -1,529 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.wsdl2java.generate;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sdo.generate.XSD2JavaGenerator;
-import org.apache.tuscany.sdo.helper.HelperContextImpl;
-import org.apache.tuscany.sdo.util.DataObjectUtil;
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
-import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenModelFactory;
-import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
-import org.eclipse.emf.codegen.util.CodeGenUtil;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
-import org.eclipse.emf.ecore.util.ExtendedMetaData;
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XSDHelper;
-
-public class WSDL2JavaGenerator {
- //Note: Dynamic SDO is defined as 0x4000 to avoid conflict with XSD2Java genOptions
- static protected final int DYNAMIC_SDO = 0x1;
- static protected final int GENERATE_SDO = 0x2;
- static protected final int VERBOSE_MODE = 0x4;
- static protected final String NO_GEN_PARM = "-noGenerate";
- static protected final String TARGET_DIR_PARM = "-targetDirectory";
- static protected final String JAVA_PACKAGE_PARM = "-javaPackage";
- static protected final String ALL_NAMESPACES_PARM = "-schemaNamespace all";
-
- /**
- * Generate Java interfaces from WSDL Usage arguments: [ -targetDirectory
- * <target-root-directory> ] [ -javaPackage <java-package-name> ]
- * <wsdl-file> For example: generate somedir/somefile.wsdl Basic options:
- * -targetDirectory Generates the Java source code in the specified
- * directory. By default, the code is generated in the same directory as the
- * input WSDL file. -javaPackage Overrides the Java package for the
- * generated classes. By default the package name is derived from the
- * targetNamespace of the WSDL definition being generated. For example, if
- * the targetNamespace is "http://www.example.com/simple", the default
- * package will be "com.example.simple".
- */
- public static void main(String args[]) {
- if (args.length == 0) {
- printUsage();
- return;
- }
-
- String portName = null;
- String targetDirectory = null;
- String wsdlJavaPackage = null;
- String xsdJavaPackage = null;
- String sdoGenArgs = null;
- String sdoGenArgsString = null;
- int genOptions = 0;
-
- int index = 0;
- for (; index < args.length && args[index].startsWith("-"); ++index) {
- if (args[index].equalsIgnoreCase("-port")) {
- portName = args[++index];
- } else if (args[index].equalsIgnoreCase("-targetDirectory")) {
- targetDirectory = args[++index];
- } else if (args[index].equalsIgnoreCase("-javaPackage")) {
- wsdlJavaPackage = args[++index];
- } else if (args[index].equalsIgnoreCase("-dynamicSDO")) {
- genOptions |= DYNAMIC_SDO;
- } else if (args[index].equalsIgnoreCase("-generateSDO")){
- genOptions |= GENERATE_SDO;
- } else if (args[index].equalsIgnoreCase("-sdoGenArgs")){
- sdoGenArgs = args[++index];
- } else if (args[index].equalsIgnoreCase("-verbose")){
- genOptions |= VERBOSE_MODE;
- }
- // else if (...)
- else {
- printUsage();
- return;
- }
- }
- if (sdoGenArgs!=null && (GENERATE_SDO & genOptions)== 0){
- genOptions |= GENERATE_SDO;
- }
-
- if (targetDirectory == null) {
- targetDirectory = ".";
- }
- String wsdlFileName = args[index];
- if (wsdlFileName == null || ((DYNAMIC_SDO & genOptions)!=0 && (GENERATE_SDO & genOptions)!= 0)) {
- printUsage();
- return;
- }
- if (sdoGenArgs !=null){
- try {
- File inFile = new File(sdoGenArgs).getAbsoluteFile();
- FileReader inputFile = new FileReader(inFile);
- BufferedReader bufRead = new BufferedReader(inputFile);
- StringBuffer fileContents= new StringBuffer();
- String line;
- while ((line = bufRead.readLine())!=null){
- fileContents.append(line + " ");
- }
- sdoGenArgsString = fileContents.toString();
- } catch (IOException e) {
- e.printStackTrace();
- throw new IllegalArgumentException(e);
- }
- } else {
- sdoGenArgsString = null;
- }
-
- if ((DYNAMIC_SDO & genOptions) != 0){
- generateDynamicFromWSDL(wsdlFileName, portName!=null? new String[]{portName}:null, targetDirectory, wsdlJavaPackage, xsdJavaPackage, genOptions);
- } else {
- generateFromWSDL(wsdlFileName, portName!=null? new String[]{portName}:null, targetDirectory, wsdlJavaPackage, genOptions, sdoGenArgsString);
- }
-
- }
-
- @SuppressWarnings("unchecked")
- public static void generateFromWSDL(String wsdlFileName, String[] ports, String targetDirectory, String wsdlJavaPackage, int genOptions, String sdoGenArgsString)
- {
- try {
- if (targetDirectory == null) {
- targetDirectory = new File(wsdlFileName).getCanonicalFile().getParent();
- } else {
- targetDirectory = new File(targetDirectory).getCanonicalPath();
- }
-
- // Populate the typeMapping table that will be given to the Axis2 WSDL2Java
- Map<QName, SDODataBindingTypeMappingEntry> typeMapping =
- new HashMap<QName, SDODataBindingTypeMappingEntry>();
- StringBuffer buildCommand = new StringBuffer();
- //build XSD command lines
- //build generic command for simple case & dynamic SDO
- buildCommand.append(ALL_NAMESPACES_PARM);
- if (sdoGenArgsString == null){
- buildCommand.append(" " + TARGET_DIR_PARM + " " + targetDirectory);
- if (wsdlJavaPackage != null && (genOptions & GENERATE_SDO)!=0){
- buildCommand.append(" " + JAVA_PACKAGE_PARM + " " + wsdlJavaPackage);
- }
- if ((genOptions & GENERATE_SDO)==0){
- buildCommand.append(" ");
- buildCommand.append(NO_GEN_PARM);
- }
- } else {
- buildCommand.append(" ");
- buildCommand.append(sdoGenArgsString);
- }
-
- //TUSCANY-1642 - We shouldn't split the wsdlFileName as it my contain a filename with spaces
- Vector sdoCommand = new Vector(java.util.Arrays.asList(buildCommand.toString().split("\\s+")));
- sdoCommand.add(wsdlFileName);
-
- String[] sdoGenCommand = new String[sdoCommand.size()];
- sdoCommand.toArray(sdoGenCommand);
-
- if ((genOptions & VERBOSE_MODE)!=0){
- System.out.println("Options passed to XSD2Java: ");
- for (int i=0; i<sdoGenCommand.length; i++){ System.out.println("\"" + sdoGenCommand[i] + "\"");}
- }
-
- XSD2JavaGenerator codeGen = new XSD2JavaGenerator();
- try {
- codeGen.generateFromXMLSchema( sdoGenCommand );
- } catch (IllegalArgumentException e) {
- System.out.println("Specified Invalid XSD2Java Arguments.\nFollow the XSD2Java usage, omitting the wsdl/xsd file argument.");
- throw new IllegalArgumentException(e);
- }
-
- List packages = codeGen.getGeneratedPackageInfo();
-
- for (Iterator iter = packages.iterator(); iter.hasNext();)
- {
- XSD2JavaGenerator.GeneratedPackage packageInfo = (XSD2JavaGenerator.GeneratedPackage)iter.next();
- for (Iterator iterClass = packageInfo.getClasses().iterator(); iterClass.hasNext();)
- {
- XSD2JavaGenerator.GeneratedPackage.PackageClassInfo classInfo = (XSD2JavaGenerator.GeneratedPackage.PackageClassInfo)iterClass.next();
- SDODataBindingTypeMappingEntry typeMappingEntry;
- if ((genOptions & DYNAMIC_SDO)==0){
-
- typeMappingEntry = new SDODataBindingTypeMappingEntry(classInfo.getClassName(), classInfo.getAnonymous(), classInfo.getProperties());
- } else {
- // TO DO implement dynamic sdo case
- typeMappingEntry = null;
- System.out.println();
- }
- QName qname = new QName(packageInfo.getNamespace(),classInfo.getName());
-
- //FIXME Workaround for JIRA TUSCANY-1673
- // Do not overwrite a typemapping entry describing a element typed by an anonymous
- // complex type with a typemapping entry describing a complex type named like the
- // element
- SDODataBindingTypeMappingEntry existingTypeMapping = typeMapping.get(qname);
- if (existingTypeMapping == null || !existingTypeMapping.isAnonymous()) {
- typeMapping.put(qname, typeMappingEntry);
- }
- }
- }
-
- JavaInterfaceGenerator codeGenerator = new JavaInterfaceGenerator(wsdlFileName,
- ports,
- targetDirectory,
- wsdlJavaPackage,
- typeMapping);
- codeGenerator.generate();
- } catch (Exception e) {
- e.printStackTrace();
- throw new IllegalArgumentException(e);
- }
- }
-
- @SuppressWarnings("unchecked")
- public static void generateFromWSDL(String wsdlFileName, String targetDirectory,
- String wsdlJavaPackage,
- String xsdJavaPackage, int genOptions){
- String sdoGenArgsString = null;
- if (xsdJavaPackage != null){
- sdoGenArgsString = JAVA_PACKAGE_PARM + " " + xsdJavaPackage;
- }
- generateFromWSDL( wsdlFileName, null, targetDirectory, wsdlJavaPackage, genOptions, sdoGenArgsString);
-
- }
-
- public static void generateFromWSDL(String wsdlFileName, String[] ports,
- String targetDirectory, String wsdlJavaPackage,
- String xsdJavaPackage, int genOptions) {
- String sdoGenArgsString = null;
- if (xsdJavaPackage != null){
- sdoGenArgsString = JAVA_PACKAGE_PARM + " " + xsdJavaPackage;
- }
- generateFromWSDL( wsdlFileName, null, targetDirectory, wsdlJavaPackage, genOptions, sdoGenArgsString);
- }
-
- @SuppressWarnings("unchecked")
- public static void generateDynamicFromWSDL(String wsdlFileName, String[] ports,
- String targetDirectory, String wsdlJavaPackage,
- String xsdJavaPackage, int genOptions)
- {
-
- // Initialize the SDO runtime
- DataObjectUtil.initRuntime();
- EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
- ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
- HelperContext context = new HelperContextImpl(extendedMetaData, false);
- XSDHelper xsdHelper = context.getXSDHelper();
-
- try {
-
- // Load the WSDL file
- File inputFile = new File(wsdlFileName).getAbsoluteFile();
- InputStream inputStream = new FileInputStream(inputFile);
-
- // Define SDO metadata
- xsdHelper.define(inputStream, inputFile.toURI().toString());
-
- if (targetDirectory == null) {
- targetDirectory = new File(wsdlFileName).getCanonicalFile().getParent();
- } else {
- targetDirectory = new File(targetDirectory).getCanonicalPath();
- }
-
- // Populate the typeMapping table that will be given to the Axis2 WSDL2Java
- Map<QName, SDODataBindingTypeMappingEntry> typeMapping =
- new HashMap<QName, SDODataBindingTypeMappingEntry>();
- if (!packageRegistry.values().isEmpty()) {
- ResourceSet resourceSet = DataObjectUtil.createResourceSet();
-
- // Populate list of GenPackages and a map of GenClasses keyed by EClass
- List<GenPackage> genPackages = new ArrayList<GenPackage>();
- Map<EClass, GenClass> genClasses = new HashMap<EClass, GenClass>();
- for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();) {
- EPackage currentEPackage = (EPackage)iter.next();
- String currentBasePackage = extractBasePackageName(currentEPackage, xsdJavaPackage);
- String currentPrefix = CodeGenUtil.capName(currentEPackage.getName());
-
- GenPackage currentGenPackage = createGenPackage(currentEPackage, currentBasePackage,
- currentPrefix, genOptions, resourceSet);
- genPackages.add(currentGenPackage);
- for (GenClass genClass : (List<GenClass>)currentGenPackage.getGenClasses()) {
- genClasses.put(genClass.getEcoreClass(), genClass);
- }
-
- }
-
- // Process all the SDO packages
- // Populate the QName -> interfaceName typeMapping table
- for (GenPackage currentGenPackage : genPackages) {
- EPackage currentEPackage = currentGenPackage.getEcorePackage();
-
- // Populate the type mappings for all the complex types
- for (GenClass genClass : (List<GenClass>)currentGenPackage.getGenClasses()) {
- QName qname = new QName(extendedMetaData.getNamespace(currentEPackage),
- extendedMetaData.getName(genClass.getEcoreClass()));
- String interfaceName = (DYNAMIC_SDO & genOptions) == DYNAMIC_SDO ? "commonj.sdo.DataObject" : currentGenPackage
- .getInterfacePackageName()
- + '.' + genClass.getInterfaceName();
- SDODataBindingTypeMappingEntry typeMappingEntry =
- new SDODataBindingTypeMappingEntry(interfaceName, false, null);
- typeMapping.put(qname, typeMappingEntry);
- }
-
- // Process all the global XSD elements
- EClass documentRoot = extendedMetaData.getDocumentRoot(currentEPackage);
- if (documentRoot != null) {
- for (EStructuralFeature element : (List<EStructuralFeature>)extendedMetaData
- .getElements(documentRoot)) {
- EClassifier elementType = element.getEType();
-
- // Handle a complex type
- if (elementType instanceof EClass) {
- EClass eClass = (EClass)elementType;
-
- GenClass genClass = genClasses.get(elementType);
- QName qname = new QName(extendedMetaData.getNamespace(currentEPackage),
- extendedMetaData.getName(element));
- String interfaceName = (DYNAMIC_SDO & genOptions) == DYNAMIC_SDO ? "commonj.sdo.DataObject" : genClass
- .getGenPackage().getInterfacePackageName()
- + '.' + genClass.getInterfaceName();
- boolean anonymous = extendedMetaData.isAnonymous(eClass);
-
- // Build list of property class names
- List<String> propertyClassNames=new ArrayList<String>();
- for (EStructuralFeature feature : (List<EStructuralFeature>)eClass.getEStructuralFeatures()) {
- EClassifier propertyType = feature.getEType();
- if (propertyType instanceof EClass) {
- GenClass propertyGenClass = genClasses.get(propertyType);
- String propertyClassName = (DYNAMIC_SDO & genOptions) == DYNAMIC_SDO ? "commonj.sdo.DataObject"
- : propertyGenClass.getGenPackage().getInterfacePackageName() + '.'
- + '.' + propertyGenClass.getInterfaceName();
- propertyClassNames.add(propertyClassName);
- } else if (propertyType instanceof EClassifier) {
- String propertyClassName = propertyType.getInstanceClass().getName();
- propertyClassNames.add(propertyClassName);
- }
- }
-
- SDODataBindingTypeMappingEntry typeMappingEntry =
- new SDODataBindingTypeMappingEntry(interfaceName, anonymous, propertyClassNames);
- typeMapping.put(qname, typeMappingEntry);
-
- } else {
-
- // Handle a simple type
- QName qname = new QName(extendedMetaData.getNamespace(currentEPackage),
- extendedMetaData.getName(element));
- String className = elementType.getInstanceClass().getName();
- SDODataBindingTypeMappingEntry typeMappingEntry =
- new SDODataBindingTypeMappingEntry(className, false, null);
- typeMapping.put(qname, typeMappingEntry);
- }
- }
- }
- }
- }
-
- try {
- JavaInterfaceGenerator codeGenerator = new JavaInterfaceGenerator(wsdlFileName,
- ports,
- targetDirectory,
- wsdlJavaPackage,
- typeMapping);
- codeGenerator.generate();
- } catch (Exception e) {
- e.printStackTrace();
- throw new IllegalArgumentException(e);
- }
-
- } catch (IOException e) {
- e.printStackTrace();
- throw new IllegalArgumentException(e);
- }
- }
-
- @SuppressWarnings("unchecked")
- public static GenPackage createGenPackage(EPackage ePackage, String basePackage, String prefix,
- int genOptions, ResourceSet resourceSet) {
- GenModel genModel = ecore2GenModel(ePackage, basePackage, prefix, genOptions);
-
- URI ecoreURI = URI.createURI("file:///" + ePackage.getName() + ".ecore");
- URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel");
-
- Resource ecoreResource = resourceSet.createResource(ecoreURI);
- ecoreResource.getContents().add(ePackage);
-
- Resource genModelResource = resourceSet.createResource(genModelURI);
- genModelResource.getContents().add(genModel);
-
- return (GenPackage)genModel.getGenPackages().get(0);
- }
-
- public static GenModel ecore2GenModel(EPackage ePackage, String basePackage,
- String prefix, int genOptions) {
- GenModel genModel = GenModelFactory.eINSTANCE.createGenModel();
- genModel.initialize(Collections.singleton(ePackage));
-
- genModel.setRootExtendsInterface("");
- genModel.setRootImplementsInterface("commonj.sdo.DataObject");
- genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectImpl");
- genModel.setFeatureMapWrapperInterface("commonj.sdo.Sequence");
- genModel.setFeatureMapWrapperInternalInterface("org.apache.tuscany.sdo.util.BasicSequence");
- genModel.setFeatureMapWrapperClass("org.apache.tuscany.sdo.util.BasicSequence");
- genModel.setSuppressEMFTypes(true);
- genModel.setSuppressEMFMetaData(true);
- genModel.setSuppressEMFModelTags(true);
- genModel.setCanGenerate(true);
- // FIXME workaround java.lang.NoClassDefFoundError:
- // org/eclipse/jdt/core/jdom/IDOMNode with 02162006 build
- genModel.setFacadeHelperClass("Hack");
- genModel.setForceOverwrite(true);
-
- GenPackage genPackage = (GenPackage)genModel.getGenPackages().get(0);
-
- if (basePackage != null) {
- genPackage.setBasePackage(basePackage);
- }
- if (prefix != null) {
- genPackage.setPrefix(prefix);
- }
-
- return genModel;
- }
-
- public static String extractBasePackageName(EPackage ePackage, String javaPackage) {
- String qualifiedName = javaPackage != null ? javaPackage : ePackage.getName();
- String name = /* CodeGenUtil. */shortName(qualifiedName);
- String baseName = qualifiedName.substring(0, qualifiedName.length() - name.length());
- if (javaPackage != null || !name.equals(qualifiedName)) {
- ePackage.setName(name);
- }
- return baseName != null ? /* CodeGenUtil. */safeQualifiedName(baseName) : null;
- }
-
- public static String shortName(String qualifiedName) {
- int index = qualifiedName.lastIndexOf(".");
- return index != -1 ? qualifiedName.substring(index + 1) : qualifiedName;
- }
-
- public static String safeQualifiedName(String qualifiedName) {
- StringBuffer safeQualifiedName = new StringBuffer();
- for (StringTokenizer stringTokenizer = new StringTokenizer(qualifiedName, ".");
- stringTokenizer.hasMoreTokens();) {
- String name = stringTokenizer.nextToken();
- safeQualifiedName.append(CodeGenUtil.safeName(name));
- if (stringTokenizer.hasMoreTokens()) {
- safeQualifiedName.append('.');
- }
- }
- return safeQualifiedName.toString();
- }
- /*
- * Converts myClassName to MyClassName
- */
- public static String normalizeClassName(String className) {
-
- StringBuffer normalizedClassName = new StringBuffer();
-
- String beginPart = className.substring(0,1);
- String endPart = className.substring(1);
-
- normalizedClassName.append(beginPart.toUpperCase());
- normalizedClassName.append(endPart);
-
- return normalizedClassName.toString();
- }
-
- protected static void printDiagnostic(Diagnostic diagnostic, String indent) {
- System.out.print(indent);
- System.out.println(diagnostic.getMessage());
- for (Iterator i = diagnostic.getChildren().iterator(); i.hasNext();) {
- printDiagnostic((Diagnostic)i.next(), indent + " ");
- }
- }
-
- protected static void printUsage() {
- System.out.println("Usage arguments:");
- System.out.println(" [ -targetDirectory <target-root-directory> ]");
- System.out.println(" [ -javaPackage <java-package-name> ]");
- System.out.println(" [ -dynamicSDO | -generateSDO [ -sdoGenArgs <command-file-name> ]]");
- System.out.println(" [ -verbose ]");
- System.out.println(" <wsdl-file>");
- System.out.println("");
- System.out.println("Where <command-file-name> is a text file containing valid XSD2Java command\narguments (w/o the wsdl/xsd file name)");
- System.out.println("For example:");
- System.out.println("");
- System.out.println(" WSDL2JavaGenerator -targetDirectory myDir somedir/somefile.wsdl");
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/util/XMLNameUtil.java b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/util/XMLNameUtil.java
deleted file mode 100644
index d0b325982c..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/util/XMLNameUtil.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.wsdl2java.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class XMLNameUtil {
-
- /**
- * Returns a valid Java name from an XML Name.
- *
- * @param name
- * @param isUpperCase
- * @return a valid Java name from an XML Name
- */
- public static String getJavaNameFromXMLName(String name, boolean isUpperCase) {
- List<String> parsedName = parseName(name, '_');
- StringBuilder result = new StringBuilder(64 * parsedName.size());
- for (String nameComponent: parsedName) {
- if (nameComponent.length() > 0) {
- if (result.length() > 0 || isUpperCase) {
- result.append(Character.toUpperCase(nameComponent.charAt(0)));
- result.append(nameComponent.substring(1));
- } else {
- result.append(nameComponent);
- }
- }
- }
-
- if (result.length() == 0) {
- return "_";
- }
- if (Character.isJavaIdentifierStart(result.charAt(0))) {
- return isUpperCase ? result.toString() : decapitalizeName(result.toString());
- }
- return "_" + result;
- }
-
- /**
- * Decapitalize a name.
- * @param name
- * @return a decapitalized name
- */
- public static String decapitalizeName(String name) {
- if (name.length() == 0) {
- return name;
- } else {
- String lowerName = name.toLowerCase();
- int i;
- for (i = 0; i < name.length(); i++) {
- if (name.charAt(i) == lowerName.charAt(i)) {
- break;
- }
- }
- if (i > 1 && i < name.length()) {
- --i;
- }
- return name.substring(0, i).toLowerCase() + name.substring(i);
- }
- }
-
- /**
- * Parse the given name.
- *
- * @param sourceName
- * @param separator
- * @return some stuff parsed from the name
- */
- private static List<String> parseName(String sourceName, char separator) {
- List<String> result = new ArrayList<String>();
- if (sourceName != null) {
- StringBuilder currentWord = new StringBuilder(64);
- boolean lastIsLower = false;
- int index;
- int length;
- for (index = 0, length = sourceName.length(); index < length; ++index) {
- char curChar = sourceName.charAt(index);
- if (!Character.isJavaIdentifierPart(curChar)) {
- curChar = separator;
- }
- if (Character.isUpperCase(curChar)
- || (!lastIsLower && Character.isDigit(curChar))
- || curChar == separator) {
-
- if (lastIsLower && currentWord.length() > 1
- || curChar == separator && currentWord.length() > 0) {
- result.add(currentWord.toString());
- currentWord = new StringBuilder(64);
- }
- lastIsLower = false;
- } else {
- if (!lastIsLower) {
- int currentWordLength = currentWord.length();
- if (currentWordLength > 1) {
- char lastChar = currentWord.charAt(--currentWordLength);
- currentWord.setLength(currentWordLength);
- result.add(currentWord.toString());
- currentWord = new StringBuilder(64);
- currentWord.append(lastChar);
- }
- }
- lastIsLower = true;
- }
-
- if (curChar != separator) {
- currentWord.append(curChar);
- }
- }
-
- result.add(currentWord.toString());
- }
- return result;
- }
-
- /**
- * Return an EPackage name for the given namespace.
- *
- * @param namespace
- * @return an EPackage name for the given namespace
- */
- public static String getPackageNameFromNamespace(String namespace) {
- return org.apache.tuscany.sdo.helper.SDOXSDEcoreBuilder.getDefaultPackageName(namespace);
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/resources/META-INF/LICENSE.txt b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/resources/META-INF/LICENSE.txt
deleted file mode 100644
index 0084319535..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/resources/META-INF/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, serviceDefinition marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl
deleted file mode 100644
index 3782fa8932..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl
+++ /dev/null
@@ -1,130 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="text"/>
-
- <!-- import the databinding template-->
- <xsl:include href="databindsupporter"/>
- <!-- import the other templates for databinding
- Note - these names would be handled by a special
- URI resolver during the xslt transformations
- -->
- <xsl:include href="externalTemplate"/>
-
-
- <xsl:template match="/interface">
-
- <xsl:variable name="isSync"><xsl:value-of select="@isSync"/></xsl:variable>
- <xsl:variable name="isAsync"><xsl:value-of select="@isAsync"/></xsl:variable>
- <xsl:variable name="callbackname"><xsl:value-of select="@callbackname"/></xsl:variable>
- <xsl:variable name="package"><xsl:value-of select="@package"/></xsl:variable>
-
- /**
- * <xsl:value-of select="@name"/>.java
- *
- * This file was auto-generated from WSDL
- * by the Apache Axis2 version: #axisVersion# #today#
- */
- package <xsl:value-of select="$package"/>;
-
- import org.oasisopen.sca.annotation.Remotable;
- import org.oasisopen.sca.annotation.Service;
-
- /*
- * <xsl:value-of select="@name"/> java interface
- */
-
- @Remotable
- @Service
- public interface <xsl:value-of select="@name"></xsl:value-of> {
- <xsl:for-each select="method">
-
- <!-- Code for in-out mep -->
- <xsl:if test="@mep='12'">
- <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
-
- <!-- start of the sync block -->
- <xsl:if test="$isSync='1'">
- /**
- * Auto generated method signatures
- <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10; </xsl:text></xsl:for-each>
- <xsl:for-each select="fault/param[@name!='']">* @throws <xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10; *</xsl:text></xsl:for-each>
-
- */
- public <xsl:choose><xsl:when test="$outputtype=''">void</xsl:when><xsl:otherwise><xsl:value-of select="$outputtype"/></xsl:otherwise></xsl:choose>
- <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
- <xsl:for-each select="input/param[@type!='']">
- <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- </xsl:for-each>) throws <xsl:for-each select="fault/param[@name!='']">
- <xsl:if test="position()>1">,</xsl:if><xsl:text> </xsl:text><xsl:value-of select="@name"/><xsl:if test="position()=last()">,</xsl:if>
-
- </xsl:for-each> java.rmi.RemoteException;
- <!-- end of the sync block -->
- </xsl:if>
-
- <!-- start of the async block -->
- <xsl:if test="$isAsync='1'">
- /**
- * Auto generated method signature
- <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10; </xsl:text></xsl:for-each>
- <xsl:for-each select="fault/param[@name!='']">* @throws <xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10; *</xsl:text></xsl:for-each>
-
- */
-
- public void start<xsl:value-of select="@name"/>(
- <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@type!=''])"></xsl:value-of></xsl:variable>
- <xsl:for-each select="input/param">
- <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"></xsl:value-of></xsl:if></xsl:for-each>
- <xsl:if test="$paramCount>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws <xsl:for-each select="fault/param[@name!='']">
- <xsl:if test="position()>1">,</xsl:if><xsl:text> </xsl:text><xsl:value-of select="@name"/><xsl:if test="position()=last()">,</xsl:if>
- </xsl:for-each> java.rmi.RemoteException;
- </xsl:if>
- <!-- end of async block-->
-
- </xsl:if>
- <!-- Code for in-only mep -->
- <xsl:if test="@mep='10'">
-
- <!-- For in-only meps there would not be any asynchronous methods since there is no output -->
- /**
- * Auto generated method signature
- <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10; </xsl:text></xsl:for-each>
- <xsl:for-each select="fault/param[@name!='']">* @throws <xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10; *</xsl:text></xsl:for-each>
- */
- public void
- <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
- <xsl:for-each select="input/param">
-
- <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- </xsl:if>
- </xsl:for-each>) throws <xsl:for-each select="fault/param[@name!='']">
- <xsl:if test="position()>1">,</xsl:if><xsl:text> </xsl:text><xsl:value-of select="@name"/><xsl:if test="position()=last()">,</xsl:if>
- </xsl:for-each> java.rmi.RemoteException;
-
- </xsl:if>
-
- </xsl:for-each>
-
- <!-- Apply other templates -->
- //<xsl:apply-templates/>
- }
-
-
- </xsl:template>
- </xsl:stylesheet> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java
deleted file mode 100644
index 92581d6ac2..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.tools.wsdl2java.generate;
-
-import junit.framework.TestCase;
-
-/**
- * Test case for WSDL2Java
- */
-public class WSDL2JavaGeneratorTestCase extends TestCase {
-
-
- public void testAccountService() {
-
- String basedir = System.getProperty("basedir");
- if (basedir == null)
- basedir = ".";
-
- String[] args =
- new String[] {"-targetDirectory", basedir + "/target/wsdl2java-source",
- "-javaPackage", "org.apache.tuscany.tools.wsdl2java.generate.account",
- basedir + "/src/test/resources/AccountService.wsdl"};
-
- WSDL2JavaGenerator.main(args);
-
- }
-
- /**
- * Test WSDL with faults
- * Sample WSDL originated from BigBank and Tuscany 978
- */
- public void testAccountServiceWithFaults() {
-
- String basedir = System.getProperty("basedir");
- if (basedir == null)
- basedir = ".";
-
- String[] args =
- new String[] {"-targetDirectory", basedir + "/target/wsdl2java-source",
- "-javaPackage", "org.apache.tuscany.tools.wsdl2java.generate.account",
- basedir + "/src/test/resources/AccountServiceWithFault.wsdl"};
-
- WSDL2JavaGenerator.main(args);
-
- }
-
- /**
- * Test Interopdoc WSDL
- */
- public void testInteropdocWsdl() {
-
- String basedir = System.getProperty("basedir");
- if (basedir == null)
- basedir = ".";
-
- String[] args =
- new String[] {"-targetDirectory", basedir + "/target/wsdl2java-source",
- "-javaPackage", "org.apache.tuscany.tools.wsdl2java.generate.account",
- basedir + "/src/test/resources/interopdoc.wsdl"};
-
- WSDL2JavaGenerator.main(args);
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/java/org/soapinterop/CreditScoreDocLit.java b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/java/org/soapinterop/CreditScoreDocLit.java
deleted file mode 100644
index e9e8aa882a..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/java/org/soapinterop/CreditScoreDocLit.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.soapinterop;
-
-public interface CreditScoreDocLit {
- public org.example.creditscore.doclit.CreditReport getCreditScore(
- org.example.creditscore.doclit.Customer param0) throws java.rmi.RemoteException;
- }
-
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/AccountService.wsdl b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/AccountService.wsdl
deleted file mode 100644
index 6f2fed1e2a..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/AccountService.wsdl
+++ /dev/null
@@ -1,242 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:tns="http://www.bigbank.com/Account/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:account="http://www.bigbank.com/Account/"
- targetNamespace="http://www.bigbank.com/Account/"
- name="AccountService">
-
- <wsdl:types>
- <xsd:schema targetNamespace="http://www.bigbank.com/Account/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:account="http://www.bigbank.com/Account/"
- xmlns:sdojava="commonj.sdo/java"
- sdojava:package="org.apache.tuscany.samples.bigbank.account">
-
- <xsd:element name="getAccountReportWrapped0">
- <xsd:complexType>
- <xsd:sequence>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getAccountReportWrapped0Response">
- <xsd:complexType>
- <xsd:sequence>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="getAccountReportWrapped1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="customerID" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getAccountReportWrapped1Response">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="accountReport" type="account:AccountReport"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="getAccountReportWrappedN">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="customerID" type="xsd:string"/>
- <xsd:element name="customerID2" type="xsd:int"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getAccountReportWrappedNResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="accountReport" type="account:AccountReport"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="getAccountReportBare0" type="xsd:string"/>
- <xsd:element name="getAccountReportBare0Response" type="xsd:int"/>
-
- <xsd:element name="getAccountReportBare1Simple" type="xsd:string"/>
- <xsd:element name="getAccountReportBare1SimpleResponse" type="xsd:int"/>
-
- <xsd:element name="getAccountReportBare1Complex" type="account:AccountRequest"/>
- <xsd:element name="getAccountReportBare1ComplexResponse" type="account:AccountReport"/>
-
- <xsd:complexType name="AccountRequest">
- <xsd:sequence>
- <xsd:element name="customerID" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="AccountReport">
- <xsd:sequence>
- <xsd:element name="accountSummaries" type="account:AccountSummary" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="AccountSummary">
- <xsd:attribute name="accountNumber" type="xsd:string"/>
- <xsd:attribute name="accountType" type="xsd:string"/>
- <xsd:attribute name="balance" type="xsd:float"/>
- </xsd:complexType>
-
- </xsd:schema>
- </wsdl:types>
-
- <wsdl:message name="getAccountReportWrapped0Request">
- <wsdl:part element="account:getAccountReportWrapped0" name="getAccountReportWrapped0Request"/>
- </wsdl:message>
- <wsdl:message name="getAccountReportWrapped0Response">
- <wsdl:part element="account:getAccountReportWrapped0Response" name="getAccountReportWrapped0Response"/>
- </wsdl:message>
-
- <wsdl:message name="getAccountReportWrapped1Request">
- <wsdl:part element="account:getAccountReportWrapped1" name="getAccountReportWrapped1Request"/>
- </wsdl:message>
- <wsdl:message name="getAccountReportWrapped1Response">
- <wsdl:part element="account:getAccountReportWrapped1Response" name="getAccountReportWrapped1Response"/>
- </wsdl:message>
-
- <wsdl:message name="getAccountReportWrappedNRequest">
- <wsdl:part element="account:getAccountReportWrappedN" name="getAccountReportWrappedNRequest"/>
- </wsdl:message>
- <wsdl:message name="getAccountReportWrappedNResponse">
- <wsdl:part element="account:getAccountReportWrappedNResponse" name="getAccountReportWrappedNResponse"/>
- </wsdl:message>
-
- <wsdl:message name="getAccountReportBare0Request">
- </wsdl:message>
- <wsdl:message name="getAccountReportBare0Response">
- </wsdl:message>
-
- <wsdl:message name="getAccountReportBare1SimpleRequest">
- <wsdl:part element="account:getAccountReportBare1Simple" name="getAccountReportBare1SimpleRequest"/>
- </wsdl:message>
- <wsdl:message name="getAccountReportBare1SimpleResponse">
- <wsdl:part element="account:getAccountReportBare1SimpleResponse" name="getAccountReportBare1SimpleResponse"/>
- </wsdl:message>
-
- <wsdl:message name="getAccountReportBare1ComplexRequest">
- <wsdl:part element="account:getAccountReportBare1Complex" name="getAccountReportBare1ComplexRequest"/>
- </wsdl:message>
- <wsdl:message name="getAccountReportBare1ComplexResponse">
- <wsdl:part element="account:getAccountReportBare1ComplexResponse" name="getAccountReportBare1ComplexResponse"/>
- </wsdl:message>
-
- <wsdl:portType name="Account_Service">
- <wsdl:operation name="getAccountReportWrapped0">
- <wsdl:input message="tns:getAccountReportWrapped0Request"/>
- <wsdl:output message="tns:getAccountReportWrapped0Response"/>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportWrapped1">
- <wsdl:input message="tns:getAccountReportWrapped1Request"/>
- <wsdl:output message="tns:getAccountReportWrapped1Response"/>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportWrappedN">
- <wsdl:input message="tns:getAccountReportWrappedNRequest"/>
- <wsdl:output message="tns:getAccountReportWrappedNResponse"/>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare0">
- <wsdl:input message="tns:getAccountReportBare0Request"/>
- <wsdl:output message="tns:getAccountReportBare0Response"/>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare1Simple">
- <wsdl:input message="tns:getAccountReportBare1SimpleRequest"/>
- <wsdl:output message="tns:getAccountReportBare1SimpleResponse"/>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare1Complex">
- <wsdl:input message="tns:getAccountReportBare1ComplexRequest"/>
- <wsdl:output message="tns:getAccountReportBare1ComplexResponse"/>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="AccountServiceSOAP" type="tns:Account_Service">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="getAccountReportWrapped0">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportWrapped0"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportWrapped1">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportWrapped1"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportWrappedN">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportWrappedN"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare0">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportBare0"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare1Simple">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportBare1Simple"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getAccountReportBare1Complex">
- <soap:operation
- soapAction="http://www.bigbank.com/Account/getAccountReportBare1Complex"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="AccountService">
- <wsdl:port binding="tns:AccountServiceSOAP"
- name="AccountServiceSOAP">
- <soap:address location="http://localhost:8085/sample-account/services/AccountService"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/AccountServiceWithFault.wsdl b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/AccountServiceWithFault.wsdl
deleted file mode 100644
index dda5a36085..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/AccountServiceWithFault.wsdl
+++ /dev/null
@@ -1,475 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:account="http://www.bigbank.com/account"
- targetNamespace="http://www.bigbank.com/account"
- name="AccountServiceWithFault">
-
- <wsdl:types>
- <xsd:schema targetNamespace="http://www.bigbank.com/account"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:account="http://www.bigbank.com/account">
-
- <xsd:element name="getAccountReport">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="customerID"
- type="xsd:int" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getAccountReportResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="accountReport"
- type="account:AccountReport" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name="AccountReport">
- <xsd:sequence>
- <xsd:element name="accountSummaries"
- type="account:AccountSummary" maxOccurs="unbounded" />
- <xsd:element name="stockSummaries"
- type="account:StockSummary" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="AccountSummary">
- <xsd:attribute name="accountNumber" type="xsd:string" />
- <xsd:attribute name="accountType" type="xsd:string" />
- <xsd:attribute name="balance" type="xsd:float" />
- </xsd:complexType>
-
- <xsd:complexType name="StockSummary">
- <!-- xsd:attribute name="id" type="xsd:int" / -->
- <xsd:attribute name="purchaseLotNumber" type="xsd:int" />
- <!-- unique id for this purchase -->
- <xsd:attribute name="symbol" type="xsd:string" />
- <xsd:attribute name="quantity" type="xsd:int" />
- <xsd:attribute name="purchaseDate" type="xsd:dateTime" />
- <xsd:attribute name="purchasePrice" type="xsd:float" />
- <xsd:attribute name="currentPrice" type="xsd:float" />
- <xsd:attribute name="company" type="xsd:string" />
- <xsd:attribute name="highPrice" type="xsd:float" />
- <xsd:attribute name="lowPrice" type="xsd:float" />
-
- </xsd:complexType>
-
- <!-- Profile in data base -->
- <xsd:element name="getCustomerProfile">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="loginID" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <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:element name="getCustomerProfileResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="customerProfile"
- type="account:CustomerProfileData" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="withdraw">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="accountNumber"
- type="xsd:string" />
- <xsd:element name="amount" type="xsd:float" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="withdrawResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="balance" type="xsd:float" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <!-- @start added fault -->
- <xsd:element name="insufficientFundsFault">
- <xsd:complexType name="insufficientFundsFault">
- <xsd:sequence>
- <xsd:element name="message" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <!-- @end added fault -->
-
- <xsd:element name="deposit">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="accountNumber"
- type="xsd:string" />
- <xsd:element name="amount" type="xsd:float" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="depositResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="balance" type="xsd:float" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="purchaseStock">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="id" type="xsd:int" />
- <xsd:element name="stock" type="account:StockSummary" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="purchaseStockResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="purchaseSummary"
- type="account:StockSummary" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
-
-
- <xsd:element name="sellStock">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="purchaseLotNumber"
- type="xsd:int" /><!-- unique id for this purchase -->
- <xsd:element name="quantity" type="xsd:int" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="createAccount">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="customerProfile"
- type="account:CustomerProfileData" />
- <xsd:element name="createSavings"
- type="xsd:boolean" />
- <xsd:element name="createCheckings"
- type="xsd:boolean" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="createAccountResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="customerProfile"
- type="account:CustomerProfileData" />
- </xsd:sequence>
- </xsd:complexType>
-
- </xsd:element>
-
- <xsd:element name="getAccountLog">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="customerID"
- type="xsd:int" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getAccountLogResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="accountLog"
- type="account:AccountLog" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name="AccountLog">
- <xsd:sequence>
- <xsd:element name="accountLogEntries"
- type="account:AccountLogEntry" maxOccurs="unbounded" />
- <xsd:element name="stockLogEntries"
- type="account:StockLogEntry" maxOccurs="unbounded" />
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="AccountLogEntry">
- <xsd:attribute name="logSeqNo" type="xsd:int" />
- <xsd:attribute name="id" type="xsd:int" />
- <xsd:attribute name="accountNumber" type="xsd:string" />
- <xsd:attribute name="actionType" type="xsd:string" />
- <xsd:attribute name="amount" type="xsd:float" />
- </xsd:complexType>
-
- <xsd:complexType name="StockLogEntry">
- <xsd:attribute name="logSeqNo" type="xsd:int" />
- <xsd:attribute name="id" type="xsd:int" />
- <xsd:attribute name="symbol" type="xsd:string" />
- <xsd:attribute name="quantity" type="xsd:int" />
- <xsd:attribute name="actionType" type="xsd:string" />
- <xsd:attribute name="purchaseLotNumber" type="xsd:int" />
- </xsd:complexType>
-
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="getAccountReportRequest">
- <wsdl:part element="account:getAccountReport"
- name="getAccountReportRequest" />
- </wsdl:message>
- <wsdl:message name="getAccountReportResponse">
- <wsdl:part element="account:getAccountReportResponse"
- name="getAccountReportResponse" />
- </wsdl:message>
-
- <wsdl:message name="getCustomerProfileRequest">
- <wsdl:part element="account:getCustomerProfile"
- name="getCustomerProfile" />
- </wsdl:message>
- <wsdl:message name="getCustomerProfileResponse">
- <wsdl:part element="account:getCustomerProfileResponse"
- name="getCustomerProfileResponse" />
- </wsdl:message>
-
- <wsdl:message name="withdrawRequest">
- <wsdl:part element="account:withdraw" name="withdrawRequest" />
- </wsdl:message>
-
- <wsdl:message name="withdrawResponse">
- <wsdl:part element="account:withdrawResponse"
- name="withdrawResponse" />
- </wsdl:message>
-
- <!-- @start added fault -->
- <wsdl:message name="insufficientFundsFault">
- <wsdl:part element="account:insufficientFundsFault" name="insufficientFundsFault" />
- </wsdl:message>
- <!-- @end added fault -->
-
- <wsdl:message name="depositRequest">
- <wsdl:part element="account:deposit" name="depositRequest" />
- </wsdl:message>
-
- <wsdl:message name="depositResponse">
- <wsdl:part element="account:depositResponse"
- name="depositResponse" />
- </wsdl:message>
-
- <wsdl:message name="purchaseStockRequest">
- <wsdl:part element="account:purchaseStock"
- name="purchaseStockRequest" />
- </wsdl:message>
-
- <wsdl:message name="purchaseStockResponse">
- <wsdl:part element="account:purchaseStockResponse"
- name="purchaseStockResponse" />
- </wsdl:message>
-
- <wsdl:message name="sellStockRequest">
- <wsdl:part element="account:sellStock" name="sellStockRequest" />
- </wsdl:message>
-
- <wsdl:message name="createAccountRequest">
- <wsdl:part element="account:createAccount" name="createAccountRequest" />
- </wsdl:message>
-
- <wsdl:message name="createAccountResponse">
- <wsdl:part element="account:createAccountResponse" name="createAccountResponse" />
- </wsdl:message>
-
- <wsdl:message name="getAccountLogRequest">
- <wsdl:part element="account:getAccountLog"
- name="getAccountLogRequest" />
- </wsdl:message>
-
- <wsdl:message name="getAccountLogResponse">
- <wsdl:part element="account:getAccountLogResponse"
- name="getAccountLogResponse" />
- </wsdl:message>
-
- <wsdl:portType name="AccountServiceWithFault">
- <wsdl:operation name="getAccountReport">
- <wsdl:input message="account:getAccountReportRequest" />
- <wsdl:output message="account:getAccountReportResponse" />
- </wsdl:operation>
-
- <wsdl:operation name="getCustomerProfile">
- <wsdl:input message="account:getCustomerProfileRequest" />
- <wsdl:output message="account:getCustomerProfileResponse" />
- </wsdl:operation>
-
- <wsdl:operation name="withdraw">
- <wsdl:input message="account:withdrawRequest" />
- <wsdl:output message="account:withdrawResponse" />
- <!-- @start added fault -->
- <wsdl:fault message="account:insufficientFundsFault" name="insufficientFundsFault"/>
- <!-- @end added fault -->
- </wsdl:operation>
-
- <wsdl:operation name="deposit">
- <wsdl:input message="account:depositRequest" />
- <wsdl:output message="account:depositResponse" />
- </wsdl:operation>
-
- <wsdl:operation name="purchaseStock">
- <wsdl:input message="account:purchaseStockRequest" />
- <wsdl:output message="account:purchaseStockResponse" />
- </wsdl:operation>
-
- <wsdl:operation name="sellStock">
- <wsdl:input message="account:sellStockRequest" />
- <wsdl:output message="account:purchaseStockResponse" />
- </wsdl:operation>
-
-
- <wsdl:operation name="createAccount">
- <wsdl:input message="account:createAccountRequest" />
- <wsdl:output message="account:createAccountResponse" />
- </wsdl:operation>
-
- <wsdl:operation name="getAccountLog">
- <wsdl:input message="account:getAccountLogRequest" />
- <wsdl:output message="account:getAccountLogResponse" />
- </wsdl:operation>
-
- </wsdl:portType>
-
-
-
- <wsdl:binding name="AccountServiceWithFaultSOAP" type="account:AccountServiceWithFault">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getAccountReport">
- <soap:operation
- soapAction="http://www.bigbank.com/account/getAccountReport" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getCustomerProfile">
- <soap:operation
- soapAction="http://www.bigbank.com/account/getCustomerProfile" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
-
- <wsdl:operation name="withdraw">
- <soap:operation
- soapAction="http://www.bigbank.com/account/withdraw" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- <!-- @start added fault -->
- <wsdl:fault name="insufficientFundsFault">
- <soap:fault name="insufficientFundsFault" use="literal"/>
- </wsdl:fault>
- <!-- @end added fault -->
- </wsdl:operation>
-
- <wsdl:operation name="deposit">
- <soap:operation
- soapAction="http://www.bigbank.com/account/deposit" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
-
- <wsdl:operation name="purchaseStock">
- <soap:operation
- soapAction="http://www.bigbank.com/account/purchaseStock" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
-
- <wsdl:operation name="sellStock">
- <soap:operation
- soapAction="http://www.bigbank.com/account/sellStock" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
-
- <wsdl:operation name="createAccount">
- <soap:operation
- soapAction="http://www.bigbank.com/account/createAccount" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
-
- <wsdl:operation name="getAccountLog">
- <soap:operation
- soapAction="http://www.bigbank.com/account/getAccountLog" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
-
- </wsdl:binding>
- <wsdl:service name="AccountServiceWithFault">
- <wsdl:port binding="account:AccountServiceWithFaultSOAP"
- name="AccountServiceSOAP">
- <soap:address
- location="http://localhost:8080/sample-bigbank-account/services/AccountServiceWithFault" />
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/CreditScoreDocLit.wsdl b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/CreditScoreDocLit.wsdl
deleted file mode 100644
index 09d1a58589..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/CreditScoreDocLit.wsdl
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:tns="http://www.example.org/creditscore/doclit/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CreditScore"
- targetNamespace="http://www.example.org/creditscore/doclit/">
- <wsdl:types>
- <xsd:schema
- targetNamespace="http://www.example.org/creditscore/doclit/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="getCreditScoreRequest" type="tns:Customer" />
- <xsd:complexType name="Customer">
- <xsd:sequence>
- <xsd:element name="ssn" type="xsd:string" />
- <xsd:element name="firstName" type="xsd:string" />
- <xsd:element name="lastName" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:element name="getCreditScoreResponse" type="tns:CreditReport"/>
- <xsd:complexType name="CreditReport">
- <xsd:sequence>
- <xsd:element name="score" type="xsd:int"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="getCreditScoreResponse">
- <wsdl:part element="tns:getCreditScoreResponse"
- name="getCreditScoreResponse" />
- </wsdl:message>
- <wsdl:message name="getCreditScoreRequest">
- <wsdl:part element="tns:getCreditScoreRequest"
- name="getCreditScoreRequest" />
- </wsdl:message>
- <wsdl:portType name="CreditScoreDocLit">
- <wsdl:operation name="getCreditScore">
- <wsdl:input message="tns:getCreditScoreRequest" />
- <wsdl:output message="tns:getCreditScoreResponse" />
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="CreditScoreDocLitSOAP" type="tns:CreditScoreDocLit">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getCreditScore">
- <soap:operation
- soapAction="http://www.example.org/creditscore/doclit/getCreditScore" />
- <wsdl:input>
- <soap:body parts="getCreditScoreRequest" use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body parts="getCreditScoreResponse" use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="CreditScore">
- <wsdl:port binding="tns:CreditScoreDocLitSOAP"
- name="CreditScoreDocLitSOAP">
- <soap:address location="http://www.example.org/" />
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/helloworld.wsdl b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/helloworld.wsdl
deleted file mode 100644
index 051f604bb2..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/helloworld.wsdl
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://helloworldaxis.samples.tuscany.apache.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://helloworldaxis.samples.tuscany.apache.org" xmlns:intf="http://helloworldaxis.samples.tuscany.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="stockquote">
- <!--WSDL created by Apache Axis version: 1.2.1
-Built on Jun 14, 2005 (09:15:57 EDT)-->
- <wsdl:types>
- <schema elementFormDefault="qualified"
- xmlns:hello="http://helloworldaxis.samples.tuscany.apache.org"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://helloworldaxis.samples.tuscany.apache.org" xmlns="http://www.w3.org/2001/XMLSchema">
- <complexType name="ComplexGreetings">
- <sequence>
- <element name="greet1" type="xsd:string"/>
- <element name="greet2" type="xsd:double"/>
- </sequence>
- </complexType>
- <element name="getGreetings">
- <complexType>
- <sequence>
- <element name="in0" type="xsd:string"/>
- <element name="in1" type="xsd:double"/>
- <element name="in2" type="hello:ComplexGreetings"/>
- </sequence>
- <xsd:attribute name="language" type="xsd:string"/>
- </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="impl:getGreetings" name="parameters"/>
-
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
-
- <wsdl:part element="impl:getGreetingsResponse" name="parameters"/>
-
- </wsdl:message>
-
- <wsdl:portType name="HelloWorldServiceImpl">
-
- <wsdl:operation name="getGreetings">
-
- <wsdl:input message="impl:getGreetingsRequest" name="getGreetingsRequest"/>
-
- <wsdl:output message="impl:getGreetingsResponse" name="getGreetingsResponse"/>
-
- </wsdl:operation>
-
- </wsdl:portType>
-
- <wsdl:binding name="helloworldSoapBinding" type="impl:HelloWorldServiceImpl">
-
- <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="HelloWorldServiceImplService">
-
- <wsdl:port binding="impl:helloworldSoapBinding" name="helloworld">
-
- <!-- Tuscany SCA Service -->
-<!--
- <wsdlsoap:address location="http://localhost:8080/tuscany-samples-helloworldws-service/services/HelloWorldService"/>
--->
- <wsdlsoap:address location="http://localhost:9876/tuscany-samples-helloworldws-service/services/HelloWorldService"/>
-
- <!-- Axis Web Service -->
- <!--
- <wsdlsoap:address location="http://localhost:8081/helloworldaxissvc-incubating-M1/services/helloworld"/>
- -->
-
- </wsdl:port>
-
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/interopdoc.wsdl b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/interopdoc.wsdl
deleted file mode 100644
index 820c26ca34..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/interopdoc.wsdl
+++ /dev/null
@@ -1,180 +0,0 @@
-<?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="InteropTestDoc" targetNamespace="http://soapinterop.org/"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://soapinterop.org/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
-
- <xsd:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/" xmlns:interop="http://soapinterop.org/">
-
- <xsd:element name="SingleTag">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SingleTag" type="interop:SingleTag"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name="SingleTag"/>
- <xsd:element name="SingleTagResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SingleTag" type="interop:SingleTag"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="SimpleDocument">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SimpleDocument" type="interop:SimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="SimpleDocument">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string"/>
- </xsd:simpleContent>
- </xsd:complexType>
- <xsd:element name="SimpleDocumentResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="SimpleDocument" type="interop:SimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="ComplexDocument">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="ComplexDocument" type="interop:ComplexDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="ComplexDocument">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="simpleDoc" type="interop:ArrayOfSimpleDocument"/>
- <xsd:element minOccurs="0" maxOccurs="1" name="child" type="interop:ChildDocument"/>
- </xsd:sequence>
- <xsd:attribute name="AnAttribute" type="xsd:string"/>
- </xsd:complexType>
- <xsd:complexType name="ArrayOfSimpleDocument">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="SimpleDocument" nillable="true" type="interop:SimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="ChildDocument">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="childSimpleDoc" type="interop:ArrayOfSimpleDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:element name="ComplexDocumentResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="ComplexDocument" type="interop:ComplexDocument"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:schema>
-
- </types>
-
- <message name="SingleTagSoapIn">
- <part name="parameters" element="tns:SingleTag"/>
- </message>
- <message name="SingleTagSoapOut">
- <part name="outputDoc" element="tns:SingleTagResponse"/>
- </message>
- <message name="SimpleDocumentSoapIn">
- <part name="parameters" element="tns:SimpleDocument"/>
- </message>
- <message name="SimpleDocumentSoapOut">
- <part name="outputDoc" element="tns:SimpleDocumentResponse"/>
- </message>
- <message name="ComplexDocumentSoapIn">
- <part name="parameters" element="tns:ComplexDocument"/>
- </message>
- <message name="ComplexDocumentSoapOut">
- <part name="outputDoc" element="tns:ComplexDocumentResponse"/>
- </message>
-
- <portType name="DocTestPortType">
-
- <operation name="SingleTag">
- <input message="tns:SingleTagSoapIn"/>
- <output message="tns:SingleTagSoapOut"/>
- </operation>
- <operation name="SimpleDocument">
- <input message="tns:SimpleDocumentSoapIn"/>
- <output message="tns:SimpleDocumentSoapOut"/>
- </operation>
- <operation name="ComplexDocument">
- <input message="tns:ComplexDocumentSoapIn"/>
- <output message="tns:ComplexDocumentSoapOut"/>
- </operation>
-
- </portType>
-
- <binding name="doc_test_binding" type="tns:DocTestPortType">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
-
- <operation name="SingleTag">
- <soap:operation soapAction="http://soapinterop.org/SingleTag"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
-
- <operation name="SimpleDocument">
- <soap:operation soapAction="http://soapinterop.org/SimpleDocument"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
-
- <operation name="ComplexDocument">
- <soap:operation soapAction="http://soapinterop.org/ComplexDocument"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
-
- <service name="interopDocSvc">
-
- <port name="interopDocPort" binding="tns:doc_test_binding">
- <soap:address location="http://www.whitemesa.net/interopdoc"/>
- </port>
-
- </service>
-
-</definitions>
diff --git a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/sequences.xsd b/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/sequences.xsd
deleted file mode 100644
index a565f3fa65..0000000000
--- a/tags/java/sca/2.0-M1/tools/sdo/wsdl2java/src/test/resources/sequences.xsd
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:seq="http://www.example.com/sequences"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.example.com/sequences">
-
- <xsd:element name="mixedStockQuote" type="seq:MixedQuote" />
- <xsd:element name="rc" type="seq:RepeatingChoice" />
- <xsd:element name="mrc" type="seq:MixedRepeatingChoice" />
- <xsd:element name="rc2" type="seq:TwoRCs" />
- <xsd:element name="mrc2" type="seq:TwoRCsMixed" />
-
-
-
- <xsd:complexType mixed="true" name="MixedQuote">
- <xsd:sequence>
- <xsd:element name="symbol" type="xsd:string" />
- <xsd:element name="companyName" type="xsd:string" />
- <xsd:element name="price" type="xsd:decimal" />
- <xsd:element name="open1" type="xsd:decimal" />
- <xsd:element name="high" type="xsd:decimal" />
- <xsd:element name="low" type="xsd:decimal" />
- <xsd:element name="volume" type="xsd:double" />
- <xsd:element name="change1" type="xsd:double" />
- <xsd:element maxOccurs="unbounded" minOccurs="0"
- name="quotes" type="seq:MixedQuote" />
- </xsd:sequence>
- </xsd:complexType>
-
-
- <xsd:complexType name="RepeatingChoice">
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="a" type="xsd:string" />
- <xsd:element name="b" type="xsd:int" />
- </xsd:choice>
- </xsd:complexType>
-
-
- <xsd:complexType mixed="true" name="MixedRepeatingChoice">
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="a" type="xsd:string" />
- <xsd:element name="b" type="xsd:int" />
- </xsd:choice>
- </xsd:complexType>
-
-
- <xsd:complexType name="TwoRCs">
- <xsd:sequence>
-
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="a" type="xsd:string" />
- <xsd:element name="b" type="xsd:int" />
- </xsd:choice>
-
- <xsd:element name="split" type="xsd:string" />
-
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="y" type="xsd:string" />
- <xsd:element name="z" type="xsd:int" />
- </xsd:choice>
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType mixed="true" name="TwoRCsMixed">
- <xsd:sequence>
-
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="a" type="xsd:string" />
- <xsd:element name="b" type="xsd:int" />
- </xsd:choice>
-
- <xsd:element name="split" type="xsd:string" />
-
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="y" type="xsd:string" />
- <xsd:element name="z" type="xsd:int" />
- </xsd:choice>
-
- </xsd:sequence>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/pom.xml b/tags/java/sca/2.0-M1/vtest/assembly/component/pom.xml
deleted file mode 100644
index a1a1332c29..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-assembly</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-assembly-component</artifactId>
-
- <name>Apache Tuscany SCA Assembly Verification Tests - Component</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
-
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/AService.java b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/AService.java
deleted file mode 100644
index 592020c180..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/AService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.assembly.component;
-
-/**
- * Simple Remotable Service
- */
-public interface AService {
-
- public String getState();
- public String getBProperty();
- public String getB2Property();
-
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/BService.java b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/BService.java
deleted file mode 100644
index 0d95c8e4b8..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/BService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.assembly.component;
-
-/**
- * Simple Service
- */
-public interface BService {
-
- public String getState();
- public String getSomeProperty();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/CService.java b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/CService.java
deleted file mode 100644
index c979c57f31..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/CService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.assembly.component;
-
-/**
- *
- */
-public interface CService {
-
- public String getState();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/AServiceImpl.java
deleted file mode 100644
index ff17a71a3d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/AServiceImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.component.impl;
-
-import org.apache.tuscany.sca.vtest.assembly.component.AService;
-import org.apache.tuscany.sca.vtest.assembly.component.BService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- protected BService b;
-
- @Reference
- protected BService b2;
-
- public String getState() {
- return b.getState();
- }
-
- public String getBProperty() {
- return b.getSomeProperty();
- }
-
- public String getB2Property() {
- return b2.getSomeProperty();
- }
-
-}
-
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/BServiceImpl.java
deleted file mode 100644
index e57ed2f951..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/BServiceImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.component.impl;
-
-import org.apache.tuscany.sca.vtest.assembly.component.BService;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- @Property
- protected String someProperty;
-
- public String getState() {
- return "SomeStateFromB";
- }
-
- public String getSomeProperty() {
- return someProperty;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/CServiceImpl.java
deleted file mode 100644
index b2b420ed6a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/CServiceImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.component.impl;
-
-public class CServiceImpl {
-
- private String state = "Some State";
-
- public String getState() {
- return state;
- }
-
-}
-
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/component.composite b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/component.composite
deleted file mode 100644
index bb452feac9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/component.composite
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://assembly-tests"
- name="Assemby-component--Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.AServiceImpl"/>
- <reference name="b" target="BComponent"/>
- <reference name="b2" target="B2Component"/>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.BServiceImpl"/>
- <property name="someProperty">some b component value</property>
- </component>
-
- <component name="B2Component">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.BServiceImpl"/>
- <property name="someProperty">some b2 component value</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/nonuniquename.composite b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/nonuniquename.composite
deleted file mode 100644
index 3019542091..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/nonuniquename.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://assembly-tests"
- name="Assemby-non-unique-name--Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.AServiceImpl"/>
- </component>
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.BServiceImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/serviceelement.composite b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/serviceelement.composite
deleted file mode 100644
index 9460f5a2e1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/serviceelement.composite
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://assembly-tests"
- name="Assemby-component--Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.AServiceImpl"/>
- <reference name="b" target="BComponent"/>
- <reference name="b2" target="B2Component"/>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.BServiceImpl"/>
- <property name="someProperty">some b component value</property>
- <service name="BService"/>
- </component>
-
- <component name="B2Component">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.BServiceImpl"/>
- <property name="someProperty">some b2 component value</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/servicewithbinding.composite b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/servicewithbinding.composite
deleted file mode 100644
index 085d84f40e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/servicewithbinding.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://assembly-tests"
- name="Assemby-component-servicewithbinding-Composite">
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.CServiceImpl"/>
- <service name="CServiceImpl">
- <interface.java interface="org.apache.tuscany.sca.vtest.assembly.component.CService"/>
- <binding.sca/>
- </service>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/servicewithinterface.composite b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/servicewithinterface.composite
deleted file mode 100644
index cc915fbde5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/servicewithinterface.composite
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://assembly-tests"
- name="Assemby-component-servicewithinterface-Composite">
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.CServiceImpl"/>
- <service name="CServiceImpl">
- <interface.java interface="org.apache.tuscany.sca.vtest.assembly.component.CService"/>
- </service>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/zerocomponents.composite b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/zerocomponents.composite
deleted file mode 100644
index 6f02d7e941..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/zerocomponents.composite
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://assembly-tests"
- name="Assemby-zero-components-Composite">
-
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/zeroimplelements.composite b/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/zeroimplelements.composite
deleted file mode 100644
index 8629f3817a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/main/resources/zeroimplelements.composite
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://assembly-tests"
- name="Assemby-component-zeroimplelements-Composite">
-
- <component name="AComponent">
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.BServiceImpl"/>
- <property name="someProperty">some b component value</property>
- </component>
-
- <component name="B2Component">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.component.impl.BServiceImpl"/>
- <property name="someProperty">some b2 component value</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java b/tags/java/sca/2.0-M1/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
deleted file mode 100644
index 0938708b91..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.component;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- *
- */
-public class ComponentTestCase {
-
- private void initDomain(String compositePath) {
- System.out.println("Setting up");
- ServiceFinder.init(compositePath);
- }
-
- private void cleanupDomain() {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Lines 92-96:
- * <p>
- * Components are configured instances of implementations. Components
- * provide and consume services. More than one component can use and
- * configure the same implementation, where each component configures the
- * implementation differently.
- */
- @Test
- public void components1() throws Exception {
- initDomain("component.composite");
- AService service = ServiceFinder.getService(AService.class, "AComponent/AService");
- Assert.assertEquals("some b component value", service.getBProperty());
- Assert.assertEquals("some b2 component value", service.getB2Property());
- cleanupDomain();
- }
-
- /**
- * Lines 96-97:
- * <p>
- * There can be zero or more component elements within a composite.
- */
- @Test
- public void components2() throws Exception {
- initDomain("zerocomponents.composite");
- cleanupDomain();
- }
-
- /**
- * Lines 142-143:
- * <p>
- * name (required) – the name of the component. The name must be unique
- * across all the components in the composite.
- */
- @Test(expected = ServiceRuntimeException.class)
- //@Ignore("TUSCANY-2455")
- public void components3() throws Exception {
- initDomain("nonuniquename.composite");
- cleanupDomain();
- }
-
- /**
- * Lines 154-158:
- * <p>
- * A component element has zero or one implementation element as its child,
- * which points to the implementation used by the component. A component
- * with no implementation element is not runnable, but components of this
- * kind may be useful during a "top-down" development process as a means of
- * defining the characteristics required of the implementation before the
- * implementation is written.
- */
- @Test
- public void components4() throws Exception {
- initDomain("zeroimplelements.composite");
- cleanupDomain();
- }
-
- /**
- * Lines 159-160:
- * <p>
- * The component element can have zero or more service elements as children
- * which are used to configure the services of the component.
- */
- @Test
- public void components5() throws Exception {
- initDomain("serviceelement.composite");
- cleanupDomain();
- }
-
- /**
- * Lines 174-179:
- * <p>
- * A service has zero or one interface, which describes the operations
- * provided by the service. The interface is described by an interface
- * element which is a child element of the service element. If no interface
- * is specified, then the interface specified for the service by the
- * implementation is in effect. If an interface is specified it must provide
- * a compatible subset of the interface provided by the implementation, i.e.
- * provide a subset of the operations defined by the implementation for the
- * service.
- */
- @Test
- public void components6() throws Exception {
- initDomain("servicewithinterface.composite");
- CService service = ServiceFinder.getService(CService.class, "CComponent");
- Assert.assertEquals("Some State", service.getState());
- cleanupDomain();
- }
-
- /**
- * Lines 180-182:
- * <p>
- * A service element has one or more binding elements as children. If no
- * bindings are specified, then the bindings specified for the service by
- * the implementation are in effect. If bindings are specified, then those
- * bindings override the bindings specified by the implementation.
- */
- @Test
- public void components7() throws Exception {
- initDomain("servicewithbinding.composite");
- CService service = ServiceFinder.getService(CService.class, "CComponent");
- Assert.assertEquals("Some State", service.getState());
- cleanupDomain();
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/composite/pom.xml b/tags/java/sca/2.0-M1/vtest/assembly/composite/pom.xml
deleted file mode 100644
index d32b6fc0f7..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/composite/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-assembly</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-assembly-composite</artifactId>
-
- <name>Apache Tuscany SCA Assembly Verification Tests - Composite</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
-
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/AService.java b/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/AService.java
deleted file mode 100644
index a5cff3972b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/AService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.assembly.composite;
-
-/**
- * Simple Remotable Service
- */
-public interface AService {
-
- public String getState();
- public String getBProperty();
- public String getB2Property();
-
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/BService.java b/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/BService.java
deleted file mode 100644
index 39d879e745..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/BService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.assembly.composite;
-
-/**
- * Simple Service
- */
-public interface BService {
-
- public String getState();
- public String getSomeProperty();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/CService.java b/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/CService.java
deleted file mode 100644
index dd80c4dc6a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/CService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.assembly.composite;
-
-/**
- *
- */
-public interface CService {
-
- public String getState();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/AServiceImpl.java
deleted file mode 100644
index 4a4aa965ce..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/AServiceImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.composite.impl;
-
-import org.apache.tuscany.sca.vtest.assembly.composite.AService;
-import org.apache.tuscany.sca.vtest.assembly.composite.BService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- protected BService b;
-
- @Reference
- protected BService b2;
-
- public String getState() {
- return b.getState();
- }
-
- public String getBProperty() {
- return b.getSomeProperty();
- }
-
- public String getB2Property() {
- return b2.getSomeProperty();
- }
-
-}
-
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/BServiceImpl.java
deleted file mode 100644
index c71e2bcc16..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/BServiceImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.composite.impl;
-
-import org.apache.tuscany.sca.vtest.assembly.composite.BService;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- @Property
- protected String someProperty;
-
- public String getState() {
- return "SomeStateFromB";
- }
-
- public String getSomeProperty() {
- return someProperty;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/CServiceImpl.java
deleted file mode 100644
index 2f091a8ef2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/java/org/apache/tuscany/sca/vtest/assembly/composite/impl/CServiceImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.composite.impl;
-
-public class CServiceImpl {
-
- private String state = "Some State";
-
- public String getState() {
- return state;
- }
-
-}
-
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/resources/composite.composite b/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/resources/composite.composite
deleted file mode 100644
index d533cb8dcf..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/main/resources/composite.composite
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://assembly-tests"
- name="Assemby-component--Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.composite.impl.AServiceImpl"/>
- <reference name="b" target="BComponent"/>
- <reference name="b2" target="B2Component"/>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.composite.impl.BServiceImpl"/>
- <property name="someProperty">some b component value</property>
- </component>
-
- <component name="B2Component">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.composite.impl.BServiceImpl"/>
- <property name="someProperty">some b2 component value</property>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/test/java/org/apache/tuscany/sca/vtest/assembly/composite/CompositeTestCase.java b/tags/java/sca/2.0-M1/vtest/assembly/composite/src/test/java/org/apache/tuscany/sca/vtest/assembly/composite/CompositeTestCase.java
deleted file mode 100644
index 03f44e449c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/composite/src/test/java/org/apache/tuscany/sca/vtest/assembly/composite/CompositeTestCase.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.composite;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- *
- */
-public class CompositeTestCase {
-
- private void initDomain(String compositePath) {
- System.out.println("Setting up");
- ServiceFinder.init(compositePath);
- }
-
- private void cleanupDomain() {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
-
- /**
- * Lines nn-n:
- * <p>
- * spec
- */
- @Test
- public void composite1() throws Exception {
- initDomain("composite.composite");
-
- cleanupDomain();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/pom.xml b/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/pom.xml
deleted file mode 100644
index 21144763e9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-assembly</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-assembly-ctypefile</artifactId>
-
- <name>Apache Tuscany SCA Assembly Verification Tests - Component Type File</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
-
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/AService.java b/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/AService.java
deleted file mode 100644
index d1df390ace..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/AService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.assembly.ctypefile;
-
-/**
- * Simple Remotable Service
- */
-public interface AService {
-
- public String getState();
- public String getState2();
- public String getBProperty();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/BService.java b/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/BService.java
deleted file mode 100644
index 8ee18b242f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/BService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.assembly.ctypefile;
-
-/**
- * Simple Service
- */
-public interface BService {
-
- public String getState();
- public String getSomeProperty();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java
deleted file mode 100644
index 919e5c2953..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.ctypefile.impl;
-
-import org.apache.tuscany.sca.vtest.assembly.ctypefile.AService;
-import org.apache.tuscany.sca.vtest.assembly.ctypefile.BService;
-import org.oasisopen.sca.annotation.Reference;
-
-public class AServiceImpl implements AService {
-
- private BService bService;
- private BService b2Service;
-
- public void setBService(BService b) {
- this.bService = b;
- }
-
- @Reference
- public void setB2Service(BService b) {
- this.b2Service = b;
- }
-
- public String getState() {
- return bService.getState();
- }
-
- public String getState2() {
- return b2Service.getState();
- }
-
- public String getBProperty() {
- return bService.getSomeProperty();
- }
-
-}
-
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java
deleted file mode 100644
index fd32cb1f9b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.ctypefile.impl;
-
-import org.apache.tuscany.sca.vtest.assembly.ctypefile.BService;
-
-public class BServiceImpl implements BService {
-
- //@Property
- protected String someProperty;
-
- public String getState() {
- return "SomeStateFromB";
- }
-
- public String getSomeProperty() {
- return someProperty;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.componentType b/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.componentType
deleted file mode 100644
index 173203ae21..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.componentType
+++ /dev/null
@@ -1,30 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0">
-
- <service name="AService">
- <interface.java interface="org.apache.tuscany.sca.vtest.assembly.ctypefile.AService"/>
- </service>
-
- <reference name="bService">
- <interface.java interface="org.apache.tuscany.sca.vtest.assembly.ctypefile.BService"/>
- </reference>
-
-</componentType> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType b/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType
deleted file mode 100644
index c6a0f274c4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.assembly.ctypefile.BService"/>
- </service>
-
- <property name="someProperty" type="xsd:string">componentTypeValue</property>
-
-</componentType>
- \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/typefile.composite b/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/typefile.composite
deleted file mode 100644
index 889bb846ba..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/main/resources/typefile.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://assembly-tests"
- name="Assemby-component-typefile-Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.ctypefile.impl.AServiceImpl"/>
- <reference name="bService" target="BComponent/BService"/>
- <reference name="b2Service" target="BComponent/BService"/>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.ctypefile.impl.BServiceImpl"/>
- <property name="someProperty">compositeValue</property>
- </component>
-
- <!-- component name="BComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.assembly.ctypefile.impl.BServiceImpl"/>
- </component-->
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java b/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java
deleted file mode 100644
index f8f7e45f61..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.assembly.ctypefile;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- *
- */
-public class CompomnentTypeFileTestCase {
-
- protected static String compositeName = "typefile.composite";
- protected static AService aService = null;
- protected static BService bService2 = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent/AService");
- bService2 = ServiceFinder.getService(BService.class, "BComponent2/BService");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
-
- }
-
- /**
- * Lines 435-439:
- * <p>
- * Step two covers the cases where introspection of the implementation is
- * not possible or where it does not provide complete information and it
- * involves looking for an SCA component type file. Component type
- * information found in the component type file must be compatible with the
- * equivalent information found from inspection of the implementation.
- * <p>
- * Lines 441-444:
- * <p>
- * In the ideal case, the component type information is determined by
- * inspecting the implementation, for example as code annotations. The
- * component type file provides a mechanism for the provision of component
- * type information for implementation types where the information cannot be
- * determined by inspecting the implementation.
- */
- @Test
- public void typeFile1() throws Exception {
- Assert.assertSame("SomeStateFromB", aService.getState());
- }
-
- /**
- * Lines 439-449:
- * <p>
- * The component type file can specify partial information, with the
- * remainder being derived from the implementation.
- * <p>
- * The first test makes use of the reference to b which is provided by the
- * type file. The second test makes use of the reference to b2 which is
- * provided via annotation
- */
- @Test
- public void typeFile2() throws Exception {
- Assert.assertSame("SomeStateFromB", aService.getState());
- Assert.assertSame("SomeStateFromB", aService.getState2());
- }
-
- /**
- * Lines 450-451:
- * <p>
- * The componentType element can contain Service elements, Reference
- * elements and Property elements.
- */
- @Test
- public void typeFile3() throws Exception {
- Assert.assertEquals("compositeValue", aService.getBProperty());
- }
-
- public void typeFile31() throws Exception {
- Assert.assertEquals("componentTypeValue", bService2.getSomeProperty());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/assembly/pom.xml b/tags/java/sca/2.0-M1/vtest/assembly/pom.xml
deleted file mode 100644
index 2f575d4d0a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/assembly/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-vtest</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-assembly</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Assembly Verification Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>vtest-utilities</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>ctypefile</module>
- <module>component</module>
- <module>composite</module>
- </modules>
- </profile>
- </profiles>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/pom.xml
deleted file mode 100644
index 1a2ac09944..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-annotations-conversation</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations - @Conversation</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/AService.java
deleted file mode 100644
index bc7212f70c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/AService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversational;
-
-/**
- * Simple Remotable Service
- */
-public interface AService {
-
- public String setThenGetB1State(String someState);
-
- public String setThenGetB2State(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/B1Service.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/B1Service.java
deleted file mode 100644
index 76c857126a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/B1Service.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversational;
-
-/**
- * Simple Local Service
- */
-public interface B1Service {
-
- public void setState(String someState);
- public String getState();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/B2Service.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/B2Service.java
deleted file mode 100644
index 23791f2ca9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/B2Service.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversational;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Local Service
- */
-@Conversational
-public interface B2Service {
-
- public void setState(String someState);
- public String getState();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/AServiceImpl.java
deleted file mode 100644
index b8e346681c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/AServiceImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.B1Service;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.B2Service;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- protected B1Service b1;
-
- @Reference
- protected B2Service b2;
-
- public String setThenGetB1State(String someState) {
- b1.setState(someState);
- return b1.getState();
- }
-
- public String setThenGetB2State(String someState) {
- b2.setState(someState);
- return b2.getState();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/B1ServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/B1ServiceImpl.java
deleted file mode 100644
index 75bac4bf18..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/B1ServiceImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.B1Service;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(B1Service.class)
-public class B1ServiceImpl implements B1Service {
-
- String someState;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/B2ServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/B2ServiceImpl.java
deleted file mode 100644
index 860d60b0de..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/impl/B2ServiceImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.B2Service;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(B2Service.class)
-@Scope("COMPOSITE")
-public class B2ServiceImpl implements B2Service {
-
- String someState;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/resources/conversation.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/resources/conversation.composite
deleted file mode 100644
index 4c2de35d52..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/main/resources/conversation.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Converstion-Composite">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.impl.AServiceImpl" />
- <reference name="b1" target="B1Component" />
- <reference name="b2" target="B2Component" />
- </component>
-
- <component name="B1Component">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.impl.B1ServiceImpl" />
- </component>
-
- <component name="B2Component">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.conversational.impl.B2ServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/ConversationAnnotationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/ConversationAnnotationTestCase.java
deleted file mode 100644
index c00d5f1c10..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversational/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversational/ConversationAnnotationTestCase.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversational;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This test class tests the Service annotation described in section 1.2.1 and
- * 1.8.17
- */
-public class ConversationAnnotationTestCase {
-
- protected static String compositeName = "conversation.composite";
- protected static AService aService = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
-
- }
-
- /**
- * Line 328:<br>
- * <p>
- * When "@Conversational" is not specified on a service interface, the
- * service contract is stateless.<br>
- * <p>
- * Line 394, 395: <br>
- * A service may be declared as conversational by marking its Java interface
- * with "@Conversational". If a service interface is not marked with
- * "@Conversational", it is stateless. <br>
- * <p>
- * BService has no "@Conversation" annotation so communication from A-> is
- * stateless
- */
- @Test
- public void atConversation1() throws Exception {
- String thisState = "This State";
- Assert.assertNotSame(thisState, aService.setThenGetB1State(thisState));
- }
-
- /**
- * Line 325-327:<br>
- * <p>
- * Java service interfaces may be annotated to specify whether their
- * contract is conversational as described in the Assembly Specification
- * by using the "@Conversational" annotation. A conversational service
- * indicates that requests to the service are correlated in some way
- */
- @Test
- public void atConversation2() throws Exception {
- String thisState = "This State";
- Assert.assertSame(thisState, aService.setThenGetB2State(thisState));
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/pom.xml
deleted file mode 100644
index 2f4aef7cbc..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-annotations-conversationattributes</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations - @ConversationAttributes</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/AService.java
deleted file mode 100644
index a3f1f11826..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/AService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes;
-
-/**
- * Simple Service
- */
-public interface AService {
-
- public void testMaxAge() throws InterruptedException;
- public void testMaxIdle() throws InterruptedException;
- public void testSinglePrincipal();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/B2Service.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/B2Service.java
deleted file mode 100644
index 7290c31f1a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/B2Service.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service
- */
-@Conversational
-public interface B2Service {
-
- public void setState(String someState);
- public String getState();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/BService.java
deleted file mode 100644
index d38ca0276c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/BService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service
- */
-@Conversational
-public interface BService {
-
- public void setState(String someState);
- public String getState();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/CService.java
deleted file mode 100644
index 5db8768398..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/CService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes;
-
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * Simple Service
- */
-public interface CService {
-
- public void testSinglePricipal(ServiceReference<BService> bReference);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/AServiceImpl.java
deleted file mode 100644
index a0a654920d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/AServiceImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.B2Service;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.BService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.CService;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- protected BService b;
-
- @Reference
- protected B2Service b2;
-
- @Reference
- protected CService c;
-
- @Context
- protected ComponentContext context;
-
- private void delayForSeconds(int numSeconds) {
- try {
- Thread.sleep(numSeconds * 1000);// millisecs
- } catch (InterruptedException ex) {
- throw new Error(ex);
- }
- }
-
- public void testMaxAge() {
-
- String someState = "someState";
- b.setState(someState);
- delayForSeconds(2);
- b.setState(someState);
-
- }
-
- public void testMaxIdle() {
-
- String someState = "someState";
- b2.setState(someState);
- delayForSeconds(2);
- b2.setState(someState);
-
- }
-
- public void testSinglePrincipal() {
-
- b.setState("Some state");
- System.out.println("Calling c and passing reference to b");
- c.testSinglePricipal(context.getServiceReference(BService.class, "b"));
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/B2ServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/B2ServiceImpl.java
deleted file mode 100644
index 2f711be74d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/B2ServiceImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.BService;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-@ConversationAttributes(maxIdleTime="1 seconds")
-public class B2ServiceImpl implements BService {
-
- String someState;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/BServiceImpl.java
deleted file mode 100644
index f9aa1de8bd..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/BServiceImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.BService;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-@ConversationAttributes(maxAge="1 seconds", singlePrincipal=true)
-public class BServiceImpl implements BService {
-
- String someState;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/CServiceImpl.java
deleted file mode 100644
index cc1c0d18fd..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/impl/CServiceImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.BService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.CService;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl implements CService {
-
- public void testSinglePricipal(ServiceReference<BService> bReference) {
-
- System.out.println("In C calling set state on passed reference to B");
- bReference.getService().setState("someState");
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/ACallbackHandler.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/ACallbackHandler.java
deleted file mode 100644
index 3820240ee2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/ACallbackHandler.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.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 ACallbackHandler 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("AUser");
- } else if (callbacks[i] instanceof PasswordCallback) {
- PasswordCallback pc = (PasswordCallback)callbacks[i];
- pc.setPassword("AUserPasswd".toCharArray());
- } else {
- throw new UnsupportedCallbackException
- (callbacks[i], "Unsupported Callback!");
- }
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/JaasLoginModule.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/JaasLoginModule.java
deleted file mode 100644
index 75573b838d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/JaasLoginModule.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.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/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/UserPrincipal.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/UserPrincipal.java
deleted file mode 100644
index 8349e775c5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/security/UserPrincipal.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.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/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/AJass.config b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/AJass.config
deleted file mode 100644
index 9d5aec8ed5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/AJass.config
+++ /dev/null
@@ -1,3 +0,0 @@
-AService {
- org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.security.JaasLoginModule required debug=true;
-};
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/conversation.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/conversation.composite
deleted file mode 100644
index 49391b3353..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/conversation.composite
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Converstion-Composite">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- <reference name="b2" target="B2Component" />
- <reference name="c" target="CComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.impl.BServiceImpl" />
- </component>
-
- <component name="B2Component">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.impl.B2ServiceImpl" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.impl.CServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/definitions.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/definitions.xml
deleted file mode 100644
index d3573176a3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/definitions.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?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://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:convatt="http://convatt">
-
- <!-- PolicySets -->
- <policySet name="JaasPolicy" provides="tuscany:jaasAuthentication" appliesTo="sca:implementation.java"
- xmlns="http://www.osoa.org/xmlns/sca/1.0">
- <tuscany:jaasAuthentication>
- <tuscany:configurationName>AService</tuscany:configurationName>
- <tuscany:callbackHandler>org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.security.ACallbackHandler</tuscany:callbackHandler>
- </tuscany:jaasAuthentication>
- </policySet>
-
-</definitions> \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/singleprincipal.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/singleprincipal.composite
deleted file mode 100644
index c10369c9bd..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/main/resources/singleprincipal.composite
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests"
- xmlns:sample="http://java-api-tests"
- name="SinglePrincipal"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.impl.AServiceImpl"
- requires = "tuscany:jaasAuthentication" />
- <reference name="c" target="CComponent" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.impl.CServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/ConversationAttributesAnnotationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/ConversationAttributesAnnotationTestCase.java
deleted file mode 100644
index a843347031..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/ConversationAttributesAnnotationTestCase.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.ConversationEndedException;
-
-/**
- * This test class tests the Service annotation described in section 1.2.1 and
- * 1.8.17
- */
-public class ConversationAttributesAnnotationTestCase {
-
- protected static String compositeName = "conversation.composite";
- protected static AService aService = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
-
- }
-
- /**
- * Line 1665, 1666
- * <p>
- * maxIdleTime (optional) - The maximum time that can pass between
- * operations within a single conversation. If more time than this passes,
- * then the container may end the conversation.
- */
- @Test(expected = ConversationEndedException.class)
- public void maxIdle() throws Exception {
- aService.testMaxIdle();
- }
-
- /**
- * Line 1667, 1668
- * <p>
- * maxAge (optional) - The maximum time that the entire conversation can
- * remain active. If more time than this passes, then the container may end
- * the conversation.
- */
- @Test(expected = ConversationEndedException.class)
- public void maxAge() throws Exception {
- aService.testMaxAge();
- }
-
- /**
- * Line 1669, 1670
- * <p>
- * singlePrincipal (optional) – If true, only the principal (the user) that
- * started the conversation has authority to continue the conversation.
- * The default value is false.
- */
- @Ignore("TUSCANY-2608")
- @Test(expected = Exception.class)
- public void singlePrincipal() throws Exception {
- aService.testSinglePrincipal();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/SinglePricipalTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/SinglePricipalTestCase.java
deleted file mode 100644
index 4ebd667a00..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/conversationattributes/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/conversationattributes/SinglePricipalTestCase.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes;
-
-import javax.security.auth.login.Configuration;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- *
- */
-public class SinglePricipalTestCase {
-
- protected static String compositeName = "singleprincipal.composite";
- protected static AService aService = null;
-
- @Before
- public void init() throws Exception {
- try {
- Configuration.getConfiguration();
- } catch (java.lang.SecurityException e) {
- System.out.println("Caught SecurityException");
- System.setProperty("java.security.auth.login.config", this.getClass().getClassLoader()
- .getResource("AJass.config").toString());
- }
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
- }
-
- @After
- public void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
-
- }
-
- /**
- * Line 1669, 1670
- * <p>
- * singlePrincipal (optional) – If true, only the principal (the user) that
- * started the conversation has authority to continue the conversation. The
- * default value is false.
- */
- @Test(expected = Exception.class)
- public void singlePrincipal() throws Exception {
- aService.testSinglePrincipal();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/pom.xml
deleted file mode 100644
index f501e91e52..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-annotations-destroy</artifactId>
-
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations - @Destroy</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/AService.java
deleted file mode 100644
index 636e7fd8fc..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/AService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.destroy;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AService
- */
-@Remotable
-public interface AService {
- public String getGreetings(String name);
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr1Impl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr1Impl.java
deleted file mode 100644
index e790c9e6d2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr1Impl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.AService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService. The implementation has an error since it annotates a protected
- * method with "@Destroy".
- */
-@Service(AService.class)
-public class AServiceErr1Impl implements AService {
-
- @Destroy
- protected void destroy() {
- }
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr2Impl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr2Impl.java
deleted file mode 100644
index 1d874007b2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr2Impl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.AService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService. The implementation has an error since it annotates a private
- * method with "@Destroy".
- */
-@Service(AService.class)
-public class AServiceErr2Impl implements AService {
-
- @Destroy
- private void destroy() {
- }
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr3Impl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr3Impl.java
deleted file mode 100644
index bf4b0736ca..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr3Impl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.AService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService. The implementation has an error since it annotates a
- * method with non-void return type with "@Destroy".
- */
-@Service(AService.class)
-public class AServiceErr3Impl implements AService {
-
- @Destroy
- public String destroy() {
- return null;
- }
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr4Impl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr4Impl.java
deleted file mode 100644
index a320e6b3ff..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceErr4Impl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.AService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService. The implementation has an error since it annotates a
- * method with arguments with "@Destroy".
- */
-@Service(AService.class)
-public class AServiceErr4Impl implements AService {
-
- @Destroy
- public void destroy(int x) {
- }
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceImpl.java
deleted file mode 100644
index 4c77104866..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/impl/AServiceImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.AService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Destroy
- public void destroy() {
- }
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err1/AServiceErr1.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err1/AServiceErr1.composite
deleted file mode 100644
index b03a0defe5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err1/AServiceErr1.composite
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- xmlns:vtest="http://vtest"
- name="AServiceErr1">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.impl.AServiceErr1Impl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err2/AServiceErr2.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err2/AServiceErr2.composite
deleted file mode 100644
index 93aafdd971..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err2/AServiceErr2.composite
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- xmlns:vtest="http://vtest"
- name="AServiceErr2">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.impl.AServiceErr2Impl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err3/AServiceErr3.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err3/AServiceErr3.composite
deleted file mode 100644
index eb8f6e59ca..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err3/AServiceErr3.composite
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- xmlns:vtest="http://vtest"
- name="AServiceErr3">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.impl.AServiceErr3Impl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err4/AServiceErr4.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err4/AServiceErr4.composite
deleted file mode 100644
index 296a386876..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/err4/AServiceErr4.composite
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- xmlns:vtest="http://vtest"
- name="AServiceErr4">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.impl.AServiceErr4Impl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/proper/AService.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/proper/AService.composite
deleted file mode 100644
index 4373bc2558..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/main/resources/proper/AService.composite
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- xmlns:vtest="http://vtest"
- name="AService">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.destroy.impl.AServiceImpl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/DestroyAnnotationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/DestroyAnnotationTestCase.java
deleted file mode 100644
index 72834a6803..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/destroy/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/destroy/DestroyAnnotationTestCase.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.destroy;
-
-import java.io.File;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.node.SCAClient;
-import org.apache.tuscany.sca.node.SCAContribution;
-import org.apache.tuscany.sca.node.SCANode;
-import org.apache.tuscany.sca.node.SCANodeFactory;
-import org.junit.Test;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * This test class tests the "@Destroy" annotation described in section 1.8.8.
- */
-public class DestroyAnnotationTestCase {
-
- /**
- * Lines 1225, 1226, 1227<br>
- * The "@Destroy" annotation type is used to annotate a Java class method
- * that will be called when the scope defined for the local service
- * implemented by the class ends. The method must have a void return value
- * and no arguments. The annotated method must be public.
- * <p>
- * This method tests a proper destroy method. i.e., public, no arguments and
- * with void return type.
- */
- @Test
- public void atDestroyProper() throws Exception {
- SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- SCANode node = nodeFactory.createSCANode(new File("src/main/resources/proper/AService.composite").toURL().toString(),
- new SCAContribution("TestContribution",
- new File("src/main/resources/proper").toURL().toString()));
- node.start();
- AService aService = ((SCAClient)node).getService(AService.class, "AComponent");
- Assert.assertEquals("Hello Pandu", aService.getGreetings("Pandu"));
- node.stop();
- }
-
- /**
- * Lines 1225, 1226, 1227<br>
- * The "@Destroy" annotation type is used to annotate a Java class method
- * that will be called when the scope defined for the local service
- * implemented by the class ends. The method must have a void return value
- * and no arguments. The annotated method must be public.
- * <p>
- * This method tests that an exception is thrown when a protected method is
- * annotated with "@Destroy".
- */
- @Test
- public void atDestroyProtectedMethod() throws Exception {
- SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- try {
- SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err1/AServiceErr1.composite").toURL().toString(),
- new SCAContribution("TestContribution",
- new File("src/main/resources/err1").toURL().toString()));
- Assert.fail();
- node.stop();
- } catch(ServiceRuntimeException e) {
- //expected
- Assert.assertNotSame(-1, e.getMessage().indexOf("Destructor must be a public method."));
- }
- }
-
- /**
- * Lines 1225, 1226, 1227<br>
- * The "@Destroy" annotation type is used to annotate a Java class method
- * that will be called when the scope defined for the local service
- * implemented by the class ends. The method must have a void return value
- * and no arguments. The annotated method must be public.
- * <p>
- * This method tests that an exception is thrown when a private method is
- * annotated with "@Destroy".
- */
- @Test
- public void atDestroyPrivateMethod() throws Exception {
- SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- try {
- SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err2/AServiceErr2.composite").toURL().toString(),
- new SCAContribution("TestContribution",
- new File("src/main/resources/err2").toURL().toString()));
- Assert.fail();
- node.stop();
- } catch(ServiceRuntimeException e) {
- //expected
- Assert.assertNotSame(-1, e.getMessage().indexOf("Destructor must be a public method."));
- }
- }
-
- /**
- * Lines 1225, 1226, 1227<br>
- * The "@Destroy" annotation type is used to annotate a Java class method
- * that will be called when the scope defined for the local service
- * implemented by the class ends. The method must have a void return value
- * and no arguments. The annotated method must be public.
- * <p>
- * This method tests that an exception is thrown when a method with non-void
- * return type is annotated with "@Destroy".
- */
- @Test
- public void atDestroyNonVoidReturnType() throws Exception {
- SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- try {
- SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err3/AServiceErr3.composite").toURL().toString(),
- new SCAContribution("TestContribution",
- new File("src/main/resources/err3").toURL().toString()));
- Assert.fail();
- node.stop();
- } catch(ServiceRuntimeException e) {
- //expected
- Assert.assertNotSame(-1, e.getMessage().indexOf("Destructor must return void."));
- }
- }
-
- /**
- * Lines 1225, 1226, 1227<br>
- * The "@Destroy" annotation type is used to annotate a Java class method
- * that will be called when the scope defined for the local service
- * implemented by the class ends. The method must have a void return value
- * and no arguments. The annotated method must be public.
- * <p>
- * This method tests that an exception is thrown when a method with arguments is
- * annotated with "@Destroy".
- */
- @Test
- public void atDestroyMethodWithArgs() throws Exception {
- SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- try {
- SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err4/AServiceErr4.composite").toURL().toString(),
- new SCAContribution("TestContribution",
- new File("src/main/resources/err4").toURL().toString()));
- Assert.fail();
- node.stop();
- } catch(ServiceRuntimeException e) {
- //expected
- Assert.assertNotSame(-1, e.getMessage().indexOf("Destructor must not have argments"));
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/pom.xml
deleted file mode 100644
index 3675e3957f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-annotations-endsconversation</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations - @EndsConversation</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/AService.java
deleted file mode 100644
index 13bcb1fd51..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/AService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.endsconversation;
-
-/**
- * Simple Remotable Service
- */
-public interface AService {
-
- public void testAtEndsConversation();
-
- public void testSREndConversation();
-
- public void testTimedEnd();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/BService.java
deleted file mode 100644
index 01d3ef051e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/BService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.endsconversation;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-
-/**
- * Simple Local Service
- */
-@Conversational
-public interface BService {
-
- public void setState(String someState);
-
- public String getConversationId();
-
- @EndsConversation
- public void endConversation();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/impl/AServiceImpl.java
deleted file mode 100644
index 606020cf85..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/impl/AServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.endsconversation.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.endsconversation.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.endsconversation.BService;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-import org.junit.Assert;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- protected BService b;
-
- @Reference
- protected ServiceReference<BService> b2;
-
- private void delayForSeconds(int numSeconds) {
- try {
- Thread.sleep(numSeconds * 1000);// millisecs
- } catch (InterruptedException ex) {
- throw new Error(ex);
- }
- }
-
- public void testAtEndsConversation() {
- String firstId;
- b.setState("SomeState");
- firstId = b.getConversationId();
- b.endConversation();
- b.setState("SomeState");// This should start a new conversation
- Assert.assertNotSame(b.getConversationId(), firstId);
- }
-
- public void testSREndConversation() {
- String firstId;
- b2.getService().setState("SomeState");
- firstId = b2.getService().getConversationId();
- b2.getConversation().end();
- b2.getService().setState("SomeState");// This should start a new conversation
- Assert.assertNotSame(b2.getService().getConversationId(), firstId);
- }
-
- public void testTimedEnd() {
- b.setState("someState");
- delayForSeconds(2);
- b.setState("someState"); // should fail w/ timeout
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/impl/BServiceImpl.java
deleted file mode 100644
index 56644c6967..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/impl/BServiceImpl.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.endsconversation.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.endsconversation.BService;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-@ConversationAttributes(maxIdleTime="1 seconds")
-public class BServiceImpl implements BService {
-
- String someState;
-
- protected String conversationId;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- @ConversationID
- public void setConversationID (String id){
- this.conversationId = id;
- System.out.println("BService conversation ID =>" + conversationId);
- }
-
- public String getState() {
- return someState;
- }
-
- public String getConversationId() {
- return conversationId;
- }
-
- public void endConversation() {
- System.out.println("Conversation ended");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/resources/endsconversation.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/resources/endsconversation.composite
deleted file mode 100644
index cbc13e380c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/main/resources/endsconversation.composite
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Converstion-Composite">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.endsconversation.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- <reference name="b2" target="BComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.endsconversation.impl.BServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/EndsConversationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/EndsConversationTestCase.java
deleted file mode 100644
index 61d7e25187..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/endsconversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/endsconversation/EndsConversationTestCase.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.endsconversation;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.oasisopen.sca.ConversationEndedException;
-
-/**
- * This test class tests the Service annotation described in section 1.2.1 and
- * 1.8.17
- */
-public class EndsConversationTestCase {
-
- protected static String compositeName = "endsconversation.composite";
- protected static AService aService = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Lines 410,411,412,413:
- * <p>
- * A method of a conversational interface may be marked with an
- * "@EndsConversation" annotation. Once a method marked with
- * "@EndsConversation" has been called, the conversation between client and
- * service provider is at an end, which implies no further methods may be
- * called on that service within the *same* conversation.
- */
- @Test
- public void atEndsConversation1() throws Exception {
- aService.testAtEndsConversation();
- }
-
- /**
- * Lines 417,418,419,420:
- * <p>
- * From the errata: <br>
- * Solution: Replace lines 417-420 at the end of section 1.6.2.2 with the
- * following: "If a conversation is ended with an explicit outbound call to
- * an "@EndsConversation" method or a call to
- * ServiceReference.endConversation(), then any subsequent call to an
- * operation on the service reference will start a new conversation. If the
- * conversation ends for any other reason (e.g. a timeout occurred), then
- * until ServiceReference.getConversation().end() is called, the
- * ConversationEndedException will be thrown by any conversational
- * operation."
- * <p>
- * This tests the first section of the errata. Up to "start a new
- * conversation"
- */
- @Test
- public void atEndsConversation2() throws Exception {
- aService.testSREndConversation();
- }
-
- /**
- * Lines 417,418,419,420:
- * <p>
- * From the errata: <br>
- * Solution: Replace lines 417-420 at the end of section 1.6.2.2 with the
- * following: "If a conversation is ended with an explicit outbound call to
- * an "@EndsConversation" method or a call to
- * ServiceReference.endConversation(), then any subsequent call to an
- * operation on the service reference will start a new conversation. If the
- * conversation ends for any other reason (e.g. a timeout occurred), then
- * until ServiceReference.getConversation().end() is called, the
- * ConversationEndedException will be thrown by any conversational
- * operation."
- * <p>
- * This tests the second section of the errata. Starting with .. "If the
- * conversation ends for any other reason ..."
- */
- @Test(expected = ConversationEndedException.class)
- public void atEndsConversation3() throws Exception {
- aService.testTimedEnd();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/pom.xml
deleted file mode 100644
index f19a85e1b1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-annotations-init</artifactId>
-
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations - @Init</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-M1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/AService.java
deleted file mode 100644
index 9f6b9bcffd..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/AService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.init;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AService
- */
-@Remotable
-public interface AService {
- public String getGreetings(String name);
- public boolean isInitProper();
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr1Impl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr1Impl.java
deleted file mode 100644
index c48b2e2070..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr1Impl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.init.AService;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService. The implementation has an error since it annotates a protected
- * method with "@Init".
- */
-@Service(AService.class)
-public class AServiceErr1Impl implements AService {
-
- @Init
- protected void init() {
- }
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-
- public boolean isInitProper() {
- return false;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr2Impl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr2Impl.java
deleted file mode 100644
index 532b1d16eb..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr2Impl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.init.AService;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService. The implementation has an error since it annotates a private
- * method with "@Init".
- */
-@Service(AService.class)
-public class AServiceErr2Impl implements AService {
-
- @Init
- private void init() {
- }
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-
- public boolean isInitProper() {
- return false;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr3Impl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr3Impl.java
deleted file mode 100644
index b69a2541b0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr3Impl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.init.AService;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService. The implementation has an error since it annotates a
- * method with non-void return type with "@Init".
- */
-@Service(AService.class)
-public class AServiceErr3Impl implements AService {
-
- @Init
- public String init() {
- return null;
- }
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-
- public boolean isInitProper() {
- return false;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr4Impl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr4Impl.java
deleted file mode 100644
index 76f905cff0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceErr4Impl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.init.AService;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService. The implementation has an error since it annotates a
- * method with arguments with "@Init".
- */
-@Service(AService.class)
-public class AServiceErr4Impl implements AService {
-
- @Init
- public void init(int x) {
- }
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-
- public boolean isInitProper() {
- return false;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceImpl.java
deleted file mode 100644
index 14c0e9c2da..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/impl/AServiceImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.init.AService;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- private boolean initProper;
-
- @Property
- public String someProperty;
-
- @Reference
- public AService someReference;
-
- @Init
- public void init() {
- initProper = someProperty != null && someReference != null;
- }
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-
- public boolean isInitProper() {
- return initProper;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err1/AServiceErr1.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err1/AServiceErr1.composite
deleted file mode 100644
index 01b8e101e0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err1/AServiceErr1.composite
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- xmlns:vtest="http://vtest"
- name="AServiceErr1">
-
- <component name="AServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl.AServiceErr1Impl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err2/AServiceErr2.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err2/AServiceErr2.composite
deleted file mode 100644
index 4ae38d44b6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err2/AServiceErr2.composite
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- xmlns:vtest="http://vtest"
- name="AServiceErr2">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl.AServiceErr2Impl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err3/AServiceErr3.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err3/AServiceErr3.composite
deleted file mode 100644
index 6bc3d8e7fc..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err3/AServiceErr3.composite
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- xmlns:vtest="http://vtest"
- name="AServiceErr3">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl.AServiceErr3Impl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err4/AServiceErr4.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err4/AServiceErr4.composite
deleted file mode 100644
index 7ade16e6d3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/err4/AServiceErr4.composite
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- xmlns:vtest="http://vtest"
- name="AServiceErr4">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl.AServiceErr4Impl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/proper/AService.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/proper/AService.composite
deleted file mode 100644
index 35f13a2ae6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/main/resources/proper/AService.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- xmlns:vtest="http://vtest"
- name="AService">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl.AServiceImpl"/>
- <property name="someProperty">hello</property>
- <reference name="someReference" target="AnotherAComponent"/>
- </component>
- <component name="AnotherAComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.init.impl.AServiceImpl"/>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/InitAnnotationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/InitAnnotationTestCase.java
deleted file mode 100644
index 6ee7b8de89..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/init/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/init/InitAnnotationTestCase.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.init;
-
-import java.io.File;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.node.SCAClient;
-import org.apache.tuscany.sca.node.SCAContribution;
-import org.apache.tuscany.sca.node.SCANode;
-import org.apache.tuscany.sca.node.SCANodeFactory;
-import org.junit.Test;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * This test class tests the "@Init" annotation described in section 1.8.11.
- */
-public class InitAnnotationTestCase {
-
- /**
- * Lines 1290, 1291, 1292, 1293 <br>
- * The "@Init" annotation type is used to annotate a Java class method that
- * is called when the scope defined for the local service implemented by the
- * class starts. The method must have a void return value and no arguments.
- * The annotated method must be public. The annotated method is called after
- * all property and reference injection is complete.
- * <p>
- * This method tests a proper init method i.e., public, no arguments and with
- * void return type.<br>
- * Expected result: Method must be called. Method must be called after all property
- * and reference injection is complete.
- */
- @Test
- public void atInitProper() throws Exception {
- SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- SCANode node = nodeFactory.createSCANode(new File("src/main/resources/proper/AService.composite").toURL().toString(),
- new SCAContribution("TestContribution",
- new File("src/main/resources/proper").toURL().toString()));
- node.start();
- AService aService = ((SCAClient)node).getService(AService.class, "AComponent");
- Assert.assertTrue(aService.isInitProper());
- Assert.assertEquals("Hello Pandu", aService.getGreetings("Pandu"));
- node.stop();
- }
-
- /**
- * Lines 1290, 1291, 1292, 1293 <br>
- * The "@Init" annotation type is used to annotate a Java class method that
- * is called when the scope defined for the local service implemented by the
- * class starts. The method must have a void return value and no arguments.
- * The annotated method must be public. The annotated method is called after
- * all property and reference injection is complete.
- * <p>
- * This method tests that an exception is thrown when a protected method is
- * annotated with "@Init".
- */
- @Test
- public void atInitProtectedMethod() throws Exception {
- SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- try {
- SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err1/AServiceErr1.composite").toURL().toString(),
- new SCAContribution("TestContribution",
- new File("src/main/resources/err1").toURL().toString()));
- Assert.fail();
- node.stop();
- } catch(ServiceRuntimeException e) {
- //expected
- Assert.assertNotSame(-1, e.getMessage().indexOf("Initializer must be a public method."));
- }
- }
-
- /**
- * Lines 1290, 1291, 1292, 1293 <br>
- * The "@Init" annotation type is used to annotate a Java class method that
- * is called when the scope defined for the local service implemented by the
- * class starts. The method must have a void return value and no arguments.
- * The annotated method must be public. The annotated method is called after
- * all property and reference injection is complete.
- * <p>
- * This method tests that an exception is thrown when a private method is
- * annotated with "@Init".
- */
- @Test
- public void atInitPrivateMethod() throws Exception {
- SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- try {
- SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err2/AServiceErr2.composite").toURL().toString(),
- new SCAContribution("TestContribution",
- new File("src/main/resources/err2").toURL().toString()));
- Assert.fail();
- node.stop();
- } catch(ServiceRuntimeException e) {
- //expected
- Assert.assertNotSame(-1, e.getMessage().indexOf("Initializer must be a public method."));
- }
- }
-
- /**
- * Lines 1290, 1291, 1292, 1293 <br>
- * The "@Init" annotation type is used to annotate a Java class method that
- * is called when the scope defined for the local service implemented by the
- * class starts. The method must have a void return value and no arguments.
- * The annotated method must be public. The annotated method is called after
- * all property and reference injection is complete.
- * <p>
- * This method tests that an exception is thrown when a method with non-void
- * return type is annotated with "@Init".
- */
- @Test
- public void atInitNonVoidReturnType() throws Exception {
- SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- try {
- SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err3/HelloWorldErr3.composite").toURL().toString(),
- new SCAContribution("TestContribution",
- new File("src/main/resources/err3").toURL().toString()));
- Assert.fail();
- node.stop();
- } catch(ServiceRuntimeException e) {
- //expected
- Assert.assertNotSame(-1, e.getMessage().indexOf("Initializer must return void."));
- }
- }
-
- /**
- * Lines 1290, 1291, 1292, 1293 <br>
- * The "@Init" annotation type is used to annotate a Java class method that
- * is called when the scope defined for the local service implemented by the
- * class starts. The method must have a void return value and no arguments.
- * The annotated method must be public. The annotated method is called after
- * all property and reference injection is complete.
- * <p>
- * This method tests that an exception is thrown when a method with arguments is
- * annotated with "@Init".
- */
- @Test
- public void atInitMethodWithArgs() throws Exception {
- SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
- try {
- SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err4/HelloWorldErr4.composite").toURL().toString(),
- new SCAContribution("TestContribution",
- new File("src/main/resources/err4").toURL().toString()));
- Assert.fail();
- node.stop();
- } catch(ServiceRuntimeException e) {
- //expected
- Assert.assertNotSame(-1, e.getMessage().indexOf("Initializer must not have argments"));
- }
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/pom.xml
deleted file mode 100644
index 1740a018b2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-annotations-oneway</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations - @OneWay</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/AService.java
deleted file mode 100644
index b68cd53167..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/AService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.oneway;
-
-import org.oasisopen.sca.annotation.OneWay;
-
-/**
- * Simple Remotable Service
- */
-public interface AService {
-
- @OneWay
- public void setNameOneWay(String name);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/BService.java
deleted file mode 100644
index 1cb4f3adf5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/BService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.oneway;
-
-/**
- * Simple Local Service
- */
-public interface BService {
-
- public void setNameOneWay(String name);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/impl/AServiceImpl.java
deleted file mode 100644
index d95ea22456..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/impl/AServiceImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.oneway.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.oneway.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.oneway.BService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- protected BService b;
-
- public void setNameOneWay(String name) {
- b.setNameOneWay(name);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/impl/BServiceImpl.java
deleted file mode 100644
index 4f63a23429..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/impl/BServiceImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.oneway.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.oneway.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- String name;
-
- private void delay2Seconds() {
- try {
- Thread.sleep(2000);// millisecs
- } catch (InterruptedException ex) {
- throw new Error(ex);
- }
- }
-
- public void setNameOneWay(String name) {
- delay2Seconds();
- this.name = name;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/resources/oneway.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/resources/oneway.composite
deleted file mode 100644
index 47a7a98c7d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/main/resources/oneway.composite
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="OneWay-Composite">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.oneway.impl.AServiceImpl" />
- <reference name="b" target="BComponent"/>
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.oneway.impl.BServiceImpl" />
- </component>
-
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/OneWayAnnotationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/OneWayAnnotationTestCase.java
deleted file mode 100644
index f2fb8d0dc8..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/oneway/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/oneway/OneWayAnnotationTestCase.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.oneway;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This test class tests the Service annotation described in section 1.2.1 and
- * 1.8.17
- */
-public class OneWayAnnotationTestCase {
-
- protected static String compositeName = "oneway.composite";
- protected static AService aService = null;
- protected static BService bService = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Line 384,385,386:<br>
- * <p>
- * Any method that returns "void" and has no declared exceptions may be
- * marked with an "@OneWay" annotation. This means that the method is
- * non-blocking and communication with the service provider may use a
- * binding that buffers the requests and sends it at some later time.
- * <p>
- * Line 1319, 1320:<br>
- * <p>
- * The "@OneWay" annotation type is used to annotate a Java interface method
- * to indicate that invocations will be dispatched in a non-blocking fashion
- * as described in the section on Asynchronous Programming.<br>
- * <p>
- * The serviceMethod on A is annotated with "@OneWay". The A implementation
- * delegates to b's method which includes a 2 seconds delay. So, this will
- * fail if the call to A is blocking.
- */
- @Test(timeout = 500)
- public void atOneWay1() throws Exception {
- aService.setNameOneWay("Some Name");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/pom.xml
deleted file mode 100644
index eb227d3b7c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/pom.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-java-api</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>java-api-annotations</artifactId>
- <packaging>pom</packaging>
-
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>reference</module>
- <module>service</module>
- <module>property</module>
- <module>scope</module>
- <module>init</module>
- <module>destroy</module>
- <module>oneway</module>
- <module>conversational</module>
- <module>conversationattributes</module>
- <module>endsconversation</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/pom.xml
deleted file mode 100644
index e42f21b493..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-annotations-property</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations - @Property</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AService.java
deleted file mode 100644
index 5cfea1b099..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AService.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property;
-
-/**
- * Simple Service
- */
-public interface AService {
-
- public String getName();
-
- public String getP1();
-
- public String getP2();
-
- public String getP3();
-
- public String getP4();
-
- public String getP5();
-
- public String getP6();
-
- public String getP7AString();
-
- public int getP7BInt();
-
- public String getP8AString();
-
- public int getP8BInt();
-
- public String getP9AString();
-
- public int getP9BInt();
-
- public String getP10AString();
-
- public int getP10BInt();
-
- public String getP11AString();
-
- public int getP11BInt();
-
- public String getP12AString();
-
- public int getP12BInt();
-
- public String getP15();
-
- public String getP16();
-
- public String getP17();
-
- public String getP18();
-
- public int getP19Size();
-
- public String getP20(int i);
-
- public int getP20Size();
-
- public int getP21(int i);
-
- public int getP21Size();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AnotherAService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AnotherAService.java
deleted file mode 100644
index 5ddc59f8b6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AnotherAService.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property;
-
-/**
- * Simple Service
- */
-public interface AnotherAService {
-
- public String getName();
-
- public String getP13();
-
- public String getP14();
-
- public String getP22();
-
- public String getP23();
-
- public String getP24();
-
- public String getP25();
-
- public boolean getP14SetterIsCalled();
-
- public boolean getP23SetterIsCalled();
-
- public boolean getP24SetterIsCalled();
-
- public boolean getP25SetterIsCalled();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java
deleted file mode 100644
index c39d4e2504..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService {
-
- String getName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java
deleted file mode 100644
index 5de3b5fcff..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property;
-
-
-/**
- * Simple Service used by another service
- */
-public interface CService {
-
- String getName();
-
- public String getB1Name();
-
- public String getP2();
-
- public int getP3();
-
- public String getP4();
-
- public String getConstructor();
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AObject.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AObject.java
deleted file mode 100644
index f30c4c69fc..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AObject.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;
-
-/**
- * A simple object to hold a string
- */
-public class AObject {
-
- public String aString;
- public int bInt;
-
- public AObject() {
- this.aString = null;
- this.bInt = 0;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AServiceImpl.java
deleted file mode 100644
index 6dd91b598d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AServiceImpl.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.AService;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Property;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Property
- protected String p1; // simple Java type injected via field
-
- @Property
- public String p2; // simple Java type injected via field
-
- protected String p3; // simple Java type injected via setter
-
- public String p4; // simple Java type injected via setter
-
- protected String p5; // simple Java type injected via constructor parameter
-
- public String p6; // simple Java type injected via constructor parameter
-
- @Property(required=true)
- protected AObject p7; // complex Java type injected via field
-
- @Property
- public AObject p8; // complex Java type injected via field
-
- protected AObject p9; // complex Java type injected via setter
-
- public AObject p10; // complex Java type injected via setter
-
- protected AObject p11; // complex Java type injected via constructor parameter
-
- public AObject p12; // complex Java type injected via constructor parameter
-
- @Property(name="pFifteen")
- protected String p15; // injected via field with different name
-
- protected String p16; // injected via setter with different name
-
- @Property(name="p17", required=false)
- public String p17; // injected via field but not defined in composite
-
- public String p18; // injected via setter but not defined in composite
-
- @Property(name="p19", required=true)
- public List<String> p19; // a List and injected via field with no element
-
- public List<String> p20; // a List and injected via setter
-
- @Property(required=false)
- public Integer[] p21; // an array and injected via field
-
- public String getName() {
- return "AService";
- }
-
- public AServiceImpl(
- @Property(name = "p5") String p5,
- @Property(name = "p6") String p6,
- @Property(name = "p11") AObject p11,
- @Property(name = "p12") AObject p12
- ) {
- super();
- this.p5 = p5;
- this.p6 = p6;
- this.p11 = p11;
- this.p12 = p12;
- }
-
- @Property
- public void setP3(String p3) {
- this.p3 = p3;
- }
-
- @Property(required=true)
- public void setP4(String p4) {
- this.p4 = p4;
- }
-
- @Property
- public void setP9(AObject p9) {
- this.p9 = p9;
- }
-
- @Property
- public void setP10(AObject p10) {
- this.p10 = p10;
- }
-
- @Property(name="pSixteen")
- public void setP16(String p16) {
- this.p16 = p16;
- }
-
- @Property(name="p18", required=false)
- public void setP18(String p18) {
- this.p18 = p18;
- }
-
- @Property(name="p20", required=true)
- public void setP20(List<String> p20) {
- this.p20 = p20;
- }
-
- public String getP1() {
- return p1;
- }
-
- public String getP2() {
- return p2;
- }
-
- public String getP3() {
- return p3;
- }
-
- public String getP4() {
- return p4;
- }
-
- public String getP5() {
- return p5;
- }
-
- public String getP6() {
- return p6;
- }
-
- public String getP7AString() {
- return p7.aString;
- }
-
- public int getP7BInt() {
- return p7.bInt;
- }
-
- public String getP8AString() {
- return p8.aString;
- }
-
- public int getP8BInt() {
- return p8.bInt;
- }
-
- public String getP9AString() {
- return p9.aString;
- }
-
- public int getP9BInt() {
- return p9.bInt;
- }
-
- public String getP10AString() {
- return p10.aString;
- }
-
- public int getP10BInt() {
- return p10.bInt;
- }
-
- public String getP11AString() {
- return p11.aString;
- }
-
- public int getP11BInt() {
- return p11.bInt;
- }
-
- public String getP12AString() {
- return p12.aString;
- }
-
- public int getP12BInt() {
- return p12.bInt;
- }
-
- public String getP15() {
- return p15;
- }
-
- public String getP16() {
- return p16;
- }
-
- public String getP17() {
- return p17;
- }
-
- public String getP18() {
- return p18;
- }
-
- public int getP19Size() {
- return p19.size();
- }
-
- public String getP20(int i) {
- return p20.get(i);
- }
-
- public int getP20Size() {
- return p20.size();
- }
-
- public int getP21(int i) {
- return p21[i].intValue();
- }
-
- public int getP21Size() {
- return p21.length;
- }
-
-}
-
-
-
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AnotherAServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AnotherAServiceImpl.java
deleted file mode 100644
index b6d51ef253..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AnotherAServiceImpl.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.AnotherAService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AnotherAService.class)
-public class AnotherAServiceImpl implements AnotherAService {
-
- public String p13; // injected via field and un-annotated
-
- public String p14; // injected via setter and un-annotated
-
- protected String p22; // unannotated protected field should not be injected
-
- protected String p23; // un-annotated protected and has protected setter
-
- protected String p24; // un-annotated protected field and has public setter
-
- private String p25; // un-annotated private field and has public setter
-
- public boolean p14SetterIsCalled = false;
-
- public boolean p23SetterIsCalled = false;
-
- public boolean p24SetterIsCalled = false;
-
- public boolean p25SetterIsCalled = false;
-
-
- public String getName() {
- return "AService";
- }
-
- public void setP14(String p14) {
- p14SetterIsCalled = true;
- this.p14 = p14;
- }
-
- protected void setP23(String p23) {
- p23SetterIsCalled = true;
- this.p23 = p23;
- }
-
- public void setP24(String p24) {
- p24SetterIsCalled = true;
- this.p24 = p24;
- }
-
- public void setP25(String p25) {
- p25SetterIsCalled = true;
- this.p25 = p25;
- }
-
- public String getP13() {
- return p13;
- }
-
- public String getP14() {
- return p14;
- }
-
- public String getP22() {
- return p22;
- }
-
- public String getP23() {
- return p23;
- }
-
- public String getP24() {
- return p24;
- }
-
- public String getP25() {
- return p25;
- }
-
- public boolean getP14SetterIsCalled() {
- return p14SetterIsCalled;
- }
-
-
- public boolean getP23SetterIsCalled() {
- return p23SetterIsCalled;
- }
-
-
- public boolean getP24SetterIsCalled() {
- return p24SetterIsCalled;
- }
-
-
- public boolean getP25SetterIsCalled() {
- return p25SetterIsCalled;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java
deleted file mode 100644
index d6a36f54a9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- public String getName() {
- return "BService";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java
deleted file mode 100644
index ace9da2904..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
-import org.oasisopen.sca.annotation.Constructor;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl1 implements CService {
-
- public BService b1;
-
- public String p2;
-
- public int p3;
-
- public String p4;
-
- public String constructor;
-
- @Constructor
- public CServiceImpl1() {
- constructor = "NoArgument";
- }
-
- public CServiceImpl1(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4) {
- this.b1 = b1;
- this.p2 = p2;
- this.p3 = p3;
- this.p4 = p4;
- constructor = "AllArguments";
- }
-
- public CServiceImpl1(BService bOne, String pTwo, int pThree) {
- this.b1 = bOne;
- this.p2 = pTwo;
- this.p3 = pThree;
- constructor = "LessArguments";
- }
-
- public String getName() {
- return "BService";
- }
-
- public String getB1Name() {
- if (b1 == null)
- return null;
- return b1.getName();
- }
-
- public String getP2() {
- return p2;
- }
-
- public int getP3() {
- return p3;
- }
-
- public String getConstructor() {
- return constructor;
- }
-
- public String getP4() {
- return p4;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java
deleted file mode 100644
index 4396b6ce32..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
-import org.oasisopen.sca.annotation.Constructor;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl2 implements CService {
-
- public BService b1;
-
- public String p2;
-
- public int p3;
-
- public String p4;
-
- public String constructor;
-
- public CServiceImpl2() {
- constructor = "NoArgument";
- }
-
- @Constructor()
- public CServiceImpl2(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4) {
- this.b1 = b1;
- this.p2 = p2;
- this.p3 = p3;
- this.p4 = p4;
- constructor = "AllArguments";
- }
-
- public CServiceImpl2(BService bOne, String pTwo, int pThree) {
- this.b1 = bOne;
- this.p2 = pTwo;
- this.p3 = pThree;
- constructor = "LessArguments";
- }
-
- public String getName() {
- return "BService";
- }
-
- public String getB1Name() {
- if (b1 == null)
- return null;
- return b1.getName();
- }
-
- public String getP2() {
- return p2;
- }
-
- public int getP3() {
- return p3;
- }
-
- public String getConstructor() {
- return constructor;
- }
-
- public String getP4() {
- return p4;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java
deleted file mode 100644
index cd459f2dd1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
-import org.oasisopen.sca.annotation.Constructor;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl3 implements CService {
-
- public BService b1;
-
- public String p2;
-
- public int p3;
-
- public String p4;
-
- public String constructor;
-
- public CServiceImpl3() {
- constructor = "NoArgument";
- }
-
- @Constructor({"bOne", "pTwo", "pThree", "pFour"})
- public CServiceImpl3(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4) {
- this.b1 = b1;
- this.p2 = p2;
- this.p3 = p3;
- this.p4 = p4;
- constructor = "AllArguments";
- }
-
- public CServiceImpl3(BService bOne, String pTwo, int pThree) {
- this.b1 = bOne;
- this.p2 = pTwo;
- this.p3 = pThree;
- constructor = "LessArguments";
- }
-
- public String getName() {
- return "BService";
- }
-
- public String getB1Name() {
- if (b1 == null)
- return null;
- return b1.getName();
- }
-
- public String getP2() {
- return p2;
- }
-
- public int getP3() {
- return p3;
- }
-
- public String getConstructor() {
- return constructor;
- }
-
- public String getP4() {
- return p4;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java
deleted file mode 100644
index c22ee08f95..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
-import org.oasisopen.sca.annotation.Constructor;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl4 implements CService {
-
- public BService b1;
-
- public String p2;
-
- public int p3;
-
- public String p4;
-
- public String constructor;
-
- public CServiceImpl4() {
- constructor = "NoArgument";
- }
-
- public CServiceImpl4(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4, int extra) {
- this.b1 = b1;
- this.p2 = p2;
- this.p3 = p3;
- this.p4 = p4;
- constructor = "ExtraArguments";
- }
-
- @Constructor({"bOne", "pTwo", "pThree", "pFour"})
- public CServiceImpl4(BService bOne, String pTwo, int pThree, String pFour) {
- this.b1 = bOne;
- this.p2 = pTwo;
- this.p3 = pThree;
- this.p4 = pFour;
- constructor = "AllArguments";
- }
-
- public String getName() {
- return "BService";
- }
-
- public String getB1Name() {
- if (b1 == null)
- return null;
- return b1.getName();
- }
-
- public String getP2() {
- return p2;
- }
-
- public int getP3() {
- return p3;
- }
-
- public String getConstructor() {
- return constructor;
- }
-
- public String getP4() {
- return p4;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java
deleted file mode 100644
index 02892ca7f3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
-import org.oasisopen.sca.annotation.Constructor;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl5 implements CService {
-
- public BService b1;
-
- public String p2;
-
- public int p3;
-
- public String p4;
-
- public String constructor;
-
- public CServiceImpl5() {
- constructor = "NoArgument";
- }
-
- public CServiceImpl5(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4, int extra) {
- this.b1 = b1;
- this.p2 = p2;
- this.p3 = p3;
- this.p4 = p4;
- constructor = "ExtraArguments";
- }
-
- @Constructor({"bOne", "pFour", "pThree", "pTwo"})
- public CServiceImpl5(BService bOne, String pTwo, int pThree, String pFour) {
- this.b1 = bOne;
- this.p2 = pTwo;
- this.p3 = pThree;
- this.p4 = pFour;
- constructor = "SwitchedValues";
- }
-
- public String getName() {
- return "BService";
- }
-
- public String getB1Name() {
- if (b1 == null)
- return null;
- return b1.getName();
- }
-
- public String getP2() {
- return p2;
- }
-
- public int getP3() {
- return p3;
- }
-
- public String getConstructor() {
- return constructor;
- }
-
- public String getP4() {
- return p4;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java
deleted file mode 100644
index ed2c3dc365..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
-import org.oasisopen.sca.annotation.Constructor;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl6 implements CService {
-
- public BService b1;
-
- public String p2;
-
- public int p3;
-
- public String p4;
-
- public String constructor;
-
- public CServiceImpl6() {
- constructor = "NoArgument";
- }
-
- public CServiceImpl6(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4, int extra) {
- this.b1 = b1;
- this.p2 = p2;
- this.p3 = p3;
- this.p4 = p4;
- constructor = "ExtraArguments";
- }
-
- @Constructor({"bOne", "pTwo", "pThree", "pWrong"})
- public CServiceImpl6(BService bOne, String pTwo, int pThree, String pFour) {
- this.b1 = bOne;
- this.p2 = pTwo;
- this.p3 = pThree;
- this.p4 = pFour;
- constructor = "WrongValues";
- }
-
- public String getName() {
- return "BService";
- }
-
- public String getB1Name() {
- if (b1 == null)
- return null;
- return b1.getName();
- }
-
- public String getP2() {
- return p2;
- }
-
- public int getP3() {
- return p3;
- }
-
- public String getConstructor() {
- return constructor;
- }
-
- public String getP4() {
- return p4;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/resources/property.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/resources/property.composite
deleted file mode 100644
index f7af170f33..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/main/resources/property.composite
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Property-Composite">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.AServiceImpl" />
- <property name="p1">p1</property>
- <property name="p2">p2</property>
- <property name="p3">p3</property>
- <property name="p4">p4</property>
- <property name="p5">p5</property>
- <property name="p6">p6</property>
- <property name="p7" type="AObject">
- <AObject xmlns="">
- <aString>p7.aString</aString>
- <bInt>7</bInt>
- </AObject>
- </property>
- <property name="p8" type="AObject">
- <AObject xmlns="">
- <aString>p8.aString</aString>
- <bInt>8</bInt>
- </AObject>
- </property>
- <property name="p9" type="AObject">
- <AObject xmlns="">
- <aString>p9.aString</aString>
- <bInt>9</bInt>
- </AObject>
- </property>
- <property name="p10" type="AObject">
- <AObject xmlns="">
- <aString>p10.aString</aString>
- <bInt>10</bInt>
- </AObject>
- </property>
- <property name="p11" type="AObject">
- <AObject xmlns="">
- <aString>p11.aString</aString>
- <bInt>11</bInt>
- </AObject>
- </property>
- <property name="p12" type="AObject">
- <AObject xmlns="">
- <aString>p12.aString</aString>
- <bInt>12</bInt>
- </AObject>
- </property>
- <property name="pFifteen">p15</property>
- <property name="pSixteen">p16</property>
- <property name="p19" many="true"></property>
- <property name="p20" many="true">"p20"</property>
- <property name="p21" many="true">2 1 21</property>
- </component>
-
- <component name="CComponent1">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl1" />
- <reference name="bOne" target="BComponent"/>
- <property name="pTwo">p2</property>
- <property name="pThree">3</property>
- <property name="pFour">p4</property>
- </component>
-
- <component name="CComponent2">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl2" />
- <reference name="bOne" target="BComponent"/>
- <property name="pTwo">p2</property>
- <property name="pThree">3</property>
- <property name="pFour">p4</property>
- </component>
-
- <component name="CComponent3">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl3" />
- <reference name="bOne" target="BComponent"/>
- <property name="pTwo">p2</property>
- <property name="pThree">3</property>
- <property name="pFour">p4</property>
- </component>
-
- <component name="CComponent4">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl4" />
- <reference name="bOne" target="BComponent"/>
- <property name="pTwo">p2</property>
- <property name="pThree">3</property>
- <property name="pFour">p4</property>
- </component>
-
- <component name="CComponent5">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl5" />
- <reference name="bOne" target="BComponent"/>
- <property name="pTwo">p2</property>
- <property name="pThree">3</property>
- <property name="pFour">p4</property>
- </component>
-
- <component name="CComponent6">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl6" />
- <reference name="bOne" target="BComponent"/>
- <property name="pTwo">p2</property>
- <property name="pThree">3</property>
- <property name="pFour">p4</property>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.BServiceImpl"/>
- </component>
-
- <component name="AnotherAComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.AnotherAServiceImpl" />
- <property name="p13">p13</property>
- <property name="p14">p14</property>
- <property name="p22">p22</property>
- <property name="p23">p23</property>
- <property name="p24">p24</property>
- <property name="p25">p25</property>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/PropertyAnnotationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/PropertyAnnotationTestCase.java
deleted file mode 100644
index d5fbc568f7..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/property/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/PropertyAnnotationTestCase.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.property;
-
-import static org.junit.Assert.fail;
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * This test class tests the Property annotation described in section 1.2.3
- * including 1.8.5 and 1.8.13
- */
-public class PropertyAnnotationTestCase {
-
- protected static String compositeName = "property.composite";
- protected static AService aService = null;
- protected static CService cService1 = null;
- protected static CService cService2 = null;
- protected static CService cService3 = null;
- protected static CService cService4 = null;
- protected static CService cService5 = null;
- protected static CService cService6 = null;
- protected static AnotherAService anotherAService = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
- cService1 = ServiceFinder.getService(CService.class, "CComponent1");
- cService2 = ServiceFinder.getService(CService.class, "CComponent2");
- cService3 = ServiceFinder.getService(CService.class, "CComponent3");
- cService4 = ServiceFinder.getService(CService.class, "CComponent4");
- cService5 = ServiceFinder.getService(CService.class, "CComponent5");
- cService6 = ServiceFinder.getService(CService.class, "CComponent6");
- anotherAService = ServiceFinder.getService(AnotherAService.class, "AnotherAComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
-
- }
-
- /**
- * Lines 1343 to 1348:<br>
- * The "@Property" annotation type is used to annotate a Java class field or
- * a setter method that is used to inject an SCA property value. The type of
- * the property injected, which can be a simple Java type or a complex Java
- * type, is defined by the type of the Java class field or the type of the
- * setter method input argument.<br>
- * The "@Property" annotation may be used on protected or public fields and
- * on setter methods or on a constructor method.<br>
- * <p>
- * p1 - simple Java type injected via field<br>
- * p2 - simple Java type injected via field<br>
- * p3 - simple Java type injected via setter<br>
- * p4 - simple Java type injected via setter and required=true<br>
- * p5 - simple Java type injected via constructor parameter<br>
- * p6 - simple Java type injected via constructor parameter<br>
- * p7 - complex Java type injected via field and required=true<br>
- * p8 - complex Java type injected via field<br>
- * p9 - complex Java type injected via setter<br>
- * p10 - complex Java type injected via setter<br>
- * p11 - complex Java type injected via constructor parameter<br>
- * p12 - complex Java type injected via constructor parameter<br>
- */
- @Test
- public void atProperty1() throws Exception {
- Assert.assertEquals("p1", aService.getP1());
- Assert.assertEquals("p2", aService.getP2());
- Assert.assertEquals("p3", aService.getP3());
- Assert.assertEquals("p4", aService.getP4());
- Assert.assertEquals("p5", aService.getP5());
- Assert.assertEquals("p6", aService.getP6());
- Assert.assertEquals("p7.aString", aService.getP7AString());
- Assert.assertEquals(7, aService.getP7BInt());
- Assert.assertEquals("p8.aString", aService.getP8AString());
- Assert.assertEquals(8, aService.getP8BInt());
- Assert.assertEquals("p9.aString", aService.getP9AString());
- Assert.assertEquals(9, aService.getP9BInt());
- Assert.assertEquals("p10.aString", aService.getP10AString());
- Assert.assertEquals(10, aService.getP10BInt());
- Assert.assertEquals("p11.aString", aService.getP11AString());
- Assert.assertEquals(11, aService.getP11BInt());
- Assert.assertEquals("p12.aString", aService.getP12AString());
- Assert.assertEquals(12, aService.getP12BInt());
- }
-
- /**
- * Lines 1349 to 1352:<br>
- * Properties may also be injected via public setter methods even when the
- * "@Property" annotation is not present. However, the
- *
- * @Property annotation must be used in order to inject a property onto a
- * non-public field. In the case where there is no "@Property"
- * annotation, the name of the property is the same as the name of
- * the field or setter.<br>
- * <p>
- * p13 is an un-annotated public field which should be injected
- * via field<br>
- */
- @Test
- public void atProperty2() throws Exception {
- Assert.assertEquals("p13", anotherAService.getP13());
- }
-
- /**
- * Line 1353:<br>
- * Where there is both a setter method and a field for a property, the
- * setter method is used.<br>
- * <p>
- * p14 is an un-annotated public field, it should be injected via public
- * setter<br>
- */
- @Test
- public void atProperty3() throws Exception {
- Assert.assertEquals("p14", anotherAService.getP14());
- Assert.assertTrue(anotherAService.getP14SetterIsCalled());
- }
-
- /**
- * Lines 1355 to 1357:<br>
- * The "@Property" annotation has the following attributes:<br>
- * <li>name (optional) – the name of the property, defaults to the name of
- * the field of the Java class</li>
- * <li>required (optional) – specifies whether injection is required,
- * defaults to false</li>
- * <p>
- * p15 - injected via field with different name "pFifteen"<br>
- * p16 - injected via setter with different name "pSixteen"<br>
- * p17 - injected via field but not defined in composite<br>
- * p18 - injected via setter but not defined in composite<br>
- *
- * @TODO - Need to test required=true but not defined in composite (The
- * specification does not describe the proper behaviour in this
- * situation.)
- */
- @Test
- public void atProperty4() throws Exception {
- Assert.assertEquals("p15", aService.getP15());
- Assert.assertEquals("p16", aService.getP16());
- Assert.assertNull(aService.getP17());
- Assert.assertNull(aService.getP18());
- }
-
- /**
- * Lines 1369 to 1370:<br>
- * If the property is defined as an array or as a java.util.Collection, then
- * the implied component type has a property with a many attribute set to
- * true.<br>
- * <p>
- * p19 - a List and injected via field with no element<br>
- * p20 - a List and injected via setter<br>
- * p21 - an array and injected via field<br>
- */
- @Test
- public void atProperty5() throws Exception {
- Assert.assertEquals(0, aService.getP19Size());
- Assert.assertEquals(1, aService.getP20Size());
- Assert.assertEquals("p20", aService.getP20(0));
- Assert.assertEquals(3, aService.getP21Size());
- Assert.assertEquals(2, aService.getP21(0));
- Assert.assertEquals(1, aService.getP21(1));
- Assert.assertEquals(21, aService.getP21(2));
- }
-
- /**
- * Lines 1141 to 1162:<br>
- * 1.8.5. "@Constructor"<br>
- * ...<br>
- * The "@Constructor" annotation is used to mark a particular constructor to
- * use when instantiating a Java component implementation.<br>
- * The "@Constructor" annotation has the following attribute:<br>
- * <li>value (optional) – identifies the property/reference names that
- * correspond to each of the constructor arguments. The position in the
- * array determines which of the arguments are being named.</li>
- * <p>
- * cService1 - "@Constructor" without value and constructor arguments<br>
- * cService2 - "@Constructor" without value but with constructor arguments<br>
- * cService3 - "@Constructor" with values and constructor arguments<br>
- * cService4 - "@Constructor" with values and constructor arguments where
- * value, property and parameter names are same<br>
- * cService5 - "@Constructor" with switched values and constructor arguments<br>
- * cService6 - "@Constructor" with wrong values<br>
- */
- @Test
- public void atProperty6() throws Exception {
- Assert.assertNull(cService1.getB1Name());
- Assert.assertNull(cService1.getP2());
- Assert.assertEquals(0, cService1.getP3());
- Assert.assertNull(cService1.getP4());
- Assert.assertEquals("NoArgument", cService1.getConstructor());
-
- Assert.assertEquals("BService", cService2.getB1Name());
- Assert.assertEquals("p2", cService2.getP2());
- Assert.assertEquals(3, cService2.getP3());
- Assert.assertEquals("p4", cService2.getP4());
- Assert.assertEquals("AllArguments", cService2.getConstructor());
-
- Assert.assertEquals("BService", cService3.getB1Name());
- Assert.assertEquals("p2", cService3.getP2());
- Assert.assertEquals(3, cService3.getP3());
- Assert.assertEquals("p4", cService3.getP4());
- Assert.assertEquals("AllArguments", cService3.getConstructor());
-
- Assert.assertEquals("BService", cService4.getB1Name());
- Assert.assertEquals("p2", cService4.getP2());
- Assert.assertEquals(3, cService4.getP3());
- Assert.assertEquals("p4", cService4.getP4());
- Assert.assertEquals("AllArguments", cService4.getConstructor());
-
- Assert.assertEquals("BService", cService5.getB1Name());
- Assert.assertEquals("p4", cService5.getP2());
- Assert.assertEquals(3, cService5.getP3());
- Assert.assertEquals("p2", cService5.getP4());
- Assert.assertEquals("SwitchedValues", cService5.getConstructor());
-
- try {
- System.out.println(cService6.getB1Name());
- fail("Should have failed to call this service");
- } catch (Throwable t) {
- }
-
- }
-
- /**
- * Lines 1349 to 1352:<br>
- * 1.8.13. "@Property"<br>
- * ...<br>
- * Properties may also be injected via public setter methods even when the
- * "@Property" annotation is not present. However, the "@Property"
- * annotation must be used in order to inject a property onto a non-public
- * field. In the case where there is no "@Property" annotation, the name of
- * the property is the same as the name of the field or setter.
- * <p>
- * p22 is unannotated protected field which should not be injected p23 is
- * un-annotated protected which should not be injected via protected setter<br>
- */
- @Test
- @Ignore("JIRA-2289 - p23 failed")
- public void atProperty7() throws Exception {
- Assert.assertNull(anotherAService.getP22());
- Assert.assertNull(anotherAService.getP23());
- Assert.assertFalse(anotherAService.getP23SetterIsCalled());
- }
-
- /**
- * Lines 1349 to 1352:<br>
- * 1.8.13. "@Property"<br>
- * ...<br>
- * Properties may also be injected via public setter methods even when the
- * "@Property" annotation is not present. However, the "@Property"
- * annotation must be used in order to inject a property onto a non-public
- * field. In the case where there is no "@Property" annotation, the name of
- * the property is the same as the name of the field or setter.
- * <p>
- * p24 is un-annotated protected field which should be injected via public
- * setter<br>
- * p25 is un-annotated private field which should be injected via public
- * setter<br>
- */
- @Test
- public void atProperty8() throws Exception {
- Assert.assertEquals("p24", anotherAService.getP24());
- Assert.assertTrue(anotherAService.getP24SetterIsCalled());
- Assert.assertEquals("p25", anotherAService.getP25());
- Assert.assertTrue(anotherAService.getP25SetterIsCalled());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/pom.xml
deleted file mode 100644
index 1a0f95b942..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-annotations-reference</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations - @Reference</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/AService.java
deleted file mode 100644
index b28704a3b4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/AService.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.reference;
-
-
-/**
- * Simple Service that uses another Service
- */
-public interface AService {
-
- public String getName();
- public String getB1Name();
- public String getB2Name();
- public String getB3Name();
- public String getB4Name();
- public String getB5Name();
- public String getB6Name();
- public String getB7Name();
- public String getB8Name();
- public String getB9Name();
- public String getB10Name();
- public String getB11Name();
- public String getB12Name();
- public String getB13Name(int i);
- public String getB14Name(int i);
- public String getB15Name(int i);
-
- public int getB13Size();
- public int getB14Size();
- public int getB15Size();
-
- public boolean isB7SetterCalled();
- public boolean isB16Null();
- public boolean isB17Null();
-
- public boolean isB4Null();
- public boolean isB5Null();
- public boolean isB6Null();
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/BService.java
deleted file mode 100644
index 04c0bc377e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/BService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.reference;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService {
-
- String getName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AServiceImpl.java
deleted file mode 100644
index 60e2b2408c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AServiceImpl.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.reference.impl;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.reference.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.reference.BService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- protected BService b1; // field injection
-
- protected BService b2; // injected via constructor parameter
-
- protected BService b3; // setter injection
-
- public BService b4; // field injection (public, un-annotated)
-
- protected BService b5; // field injection (non-public, un-annotated)
-
- public BService b6; // setter injection (public, un-annotated)
-
- @Reference
- protected BService b7; // setter injection (field and setter annotated)
-
- @Reference(name="b8", required=false)
- protected BService bEight; // field injection (different reference and field name)
-
- protected BService bNine; // setter injection (different reference and field name)
-
- @Reference(required=false)
- protected BService b10; // multiplicity="0..1" and required=false
-
- @Reference(required=false)
- protected BService b11; // multiplicity="1..1" and required=false
-
- protected BService b12; // multiplicity="1..1" and required=true at setter
-
- @Reference(required=false)
- protected List<BService> b13; // multiplicity="0..n" and required=false
-
- protected List<BService> b14; // multiplicity="1..n" and required=false at setter
-
- @Reference(name="b15", required=true)
- protected BService[] b15s; // multiplicity="1..n" and required=true
-
- @Reference(required=false)
- protected BService b16;
-
- @Reference(required=false)
- public BService b17;
-
- protected boolean b7SetterCalled;
-
- public AServiceImpl(@Reference(name = "b2")
- BService b2) {
- super();
- this.b2 = b2;
- b7SetterCalled = false;
- }
-
- @Reference
- public void setB3(BService b3) {
- this.b3 = b3;
- }
-
- public void setB6(BService b6) {
- this.b6 = b6;
- }
-
- @Reference
- public void setB7(BService b7) {
- b7SetterCalled = true;
- this.b7 = b7;
- }
-
- @Reference(name="b9", required=false)
- public void setB9(BService bNine) {
- this.bNine = bNine;
- }
-
- @Reference(required=true)
- public void setB12(BService b12) {
- this.b12 = b12;
- }
-
- @Reference(required=true)
- public void setB14(List<BService> b14) {
- this.b14 = b14;
- }
-
- public String getName() {
- return "AService";
- }
-
- public String getB1Name() {
- return b1.getName();
- }
-
- public String getB2Name() {
- return b2.getName();
- }
-
- public String getB3Name() {
- return b3.getName();
- }
-
- public String getB4Name() {
- return b4.getName();
- }
-
- public String getB5Name() {
- return b5.getName();
- }
-
- public String getB6Name() {
- return b6.getName();
- }
-
- public String getB7Name() {
- return b7.getName();
- }
-
- public String getB8Name() {
- return bEight.getName();
- }
-
- public String getB9Name() {
- return bNine.getName();
- }
-
- public String getB10Name() {
- return b10.getName();
- }
-
- public String getB11Name() {
- return b11.getName();
- }
-
- public String getB12Name() {
- return b12.getName();
- }
-
- public String getB13Name(int i) {
- BService b = (BService) b13.get(i);
- return b.getName();
- }
-
- public String getB14Name(int i) {
- BService b = (BService) b14.get(i);
- return b.getName();
- }
-
- public String getB15Name(int i) {
- return b15s[i].getName();
- }
-
- public int getB13Size() {
- return b13.size();
- }
-
- public int getB14Size() {
- return b14.size();
- }
-
- public int getB15Size() {
- return b15s.length;
- }
-
- public boolean isB7SetterCalled() {
- return b7SetterCalled;
- }
-
- public boolean isB16Null() {
- return b16 == null;
- }
-
- public boolean isB17Null() {
- return b17 == null;
- }
-
- public boolean isB4Null() {
- return b4 == null;
- }
-
- public boolean isB5Null() {
- return b5 == null;
- }
-
- public boolean isB6Null() {
- return b6 == null;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java
deleted file mode 100644
index 20fccf807f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.reference.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.reference.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.reference.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-public class AUnannotatedServiceImpl implements AService {
-
- public BService b4; // field injection (public, un-annotated)
-
- protected BService b5; // field injection (non-public, un-annotated)
-
- public BService b6; // setter injection (public, un-annotated)
-
- public AUnannotatedServiceImpl() {
- }
-
- public String getName() {
- return "AService";
- }
-
- public String getB4Name() {
- return b4.getName();
- }
-
- public String getB5Name() {
- return b5.getName();
- }
-
- public void setB6(BService b6) {
- this.b6 = b6;
- }
-
- public String getB6Name() {
- return b6.getName();
- }
-
- public String getB1Name() {
- return null;
- }
-
- public String getB2Name() {
- return null;
- }
-
- public String getB3Name() {
- return null;
- }
-
- public String getB7Name() {
- return null;
- }
-
- public String getB8Name() {
- return null;
- }
-
- public String getB9Name() {
- return null;
- }
-
- public boolean isB7SetterCalled() {
- return false;
- }
-
- public String getB10Name() {
- return null;
- }
-
- public String getB11Name() {
- return null;
- }
-
- public String getB12Name() {
- return null;
- }
-
- public String getB13Name(int i) {
- return null;
- }
-
- public int getB13Size() {
- return 0;
- }
-
- public String getB14Name(int i) {
- return null;
- }
-
- public int getB14Size() {
- return 0;
- }
-
- public String getB15Name(int i) {
- return null;
- }
-
- public int getB15Size() {
- return 0;
- }
-
- public boolean isB16Null() {
- return true;
- }
-
- public boolean isB17Null() {
- return true;
- }
-
- public boolean isB4Null() {
- return b4 == null;
- }
-
- public boolean isB5Null() {
- return b5 == null;
- }
-
- public boolean isB6Null() {
- return b6 == null;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/BServiceImpl.java
deleted file mode 100644
index c7fc91e65f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/BServiceImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.reference.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.reference.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- public String getName() {
- return "BService";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/resources/ab.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/resources/ab.composite
deleted file mode 100644
index b4ad1e77d5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/main/resources/ab.composite
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests"
- name="AB-Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.reference.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent"/>
- <reference name="b2" target="BComponent"/>
- <reference name="b3" target="BComponent"/>
- <reference name="b7" target="BComponent"/>
- <reference name="b8" target="BComponent"/>
- <reference name="b9" target="BComponent"/>
- <reference name="b10" multiplicity="0..1" target="BComponent"/>
- <reference name="b11" multiplicity="1..1" target="BComponent"/>
- <reference name="b12" multiplicity="1..1" target="BComponent"/>
- <reference name="b13" multiplicity="0..n" target=""/>
- <reference name="b14" multiplicity="1..n" target="BComponent"/>
- <reference name="b15" multiplicity="1..n" target="BComponent BComponent"/>
- </component>
-
- <component name="AUnannotatedComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.reference.impl.AUnannotatedServiceImpl"/>
- <reference name="b4" target="BComponent"/>
- <reference name="b5" target="BComponent"/>
- <reference name="b6" target="BComponent"/>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.reference.impl.BServiceImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/ReferenceAnnotationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/ReferenceAnnotationTestCase.java
deleted file mode 100644
index 1fe50b4ea7..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/reference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/ReferenceAnnotationTestCase.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.reference;
-
-import static org.junit.Assert.fail;
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * This test class tests the "@Reference" annotation described in section 1.8.14
- */
-public class ReferenceAnnotationTestCase {
-
- protected static String compositeName = "ab.composite";
- protected static AService a;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a = ServiceFinder.getService(AService.class, "AComponent");
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Temporary test unrelated to spec test effort. Remove after resolution of
- */
- @Test
- @Ignore
- // JIRA T-2145
- public void bogusComponentName() throws Exception {
- ServiceFinder.init(compositeName);
- try {
- AService a = ServiceFinder.getService(AService.class, "AReallyBogusComponentName");
- if (a == null)
- fail("Should have thrown an exception rather than return null");
- else
- fail("Should have thrown an exception rather than return a proxy");
- } finally {
- ServiceFinder.cleanup();
- }
-
- }
-
- /**
- * Lines 1404, 1405, 1406 <br>
- * The "@Reference" annotation type is used to annotate a Java class field
- * or a setter method that is used to inject a service that resolves the
- * reference. The interface of the service injected is defined by the type
- * of the Java class field or the type of the setter method input argument.
- * <p>
- * This tests the use of the three usages of the "@Reference" annotation<br>
- * B1 is injected via field injection <br>
- * B2 is injected via constructor parameter <br>
- * B3 is injected via setter method
- */
- @Test
- public void atReference1() throws Exception {
-
- Assert.assertEquals("BService", a.getB1Name());
- Assert.assertEquals("BService", a.getB2Name());
- Assert.assertEquals("BService", a.getB3Name());
-
- }
-
- /**
- * Lines 1407, 1408, 1409, 1410 <br>
- * References may also be injected via public setter methods even when the
- * "@Reference" annotation is not present. However, the "@Reference"
- * annotation must be used in order to inject a reference onto a non public
- * field. In the case where there is no "@Reference" annotation, the name of
- * the reference is the same as the name of the field or setter.
- * <p>
- * B4 is injected via field injection. Public, Non-annotated <br>
- * B5 is expected to fail field injection. Non-Public, Non-Annotated <br>
- * B6 is injected via setter injection. Public, Non-Annotated
- */
- @Test
- public void atReference2() throws Exception {
- AService anotherA = ServiceFinder.getService(AService.class, "AUnannotatedComponent");
-
- Assert.assertFalse(anotherA.isB4Null());
- Assert.assertTrue(anotherA.isB5Null());
- Assert.assertFalse(anotherA.isB6Null());
-
- Assert.assertEquals("BService", anotherA.getB4Name());
- try {
- anotherA.getB5Name();
- fail("getB5Name expected to fail with NPE");
- } catch (NullPointerException e) {
- }
- Assert.assertEquals("BService", anotherA.getB6Name());
-
- }
-
- /**
- * Lines 1411 <br>
- * Where there is both a setter method and a field for a reference, the
- * setter method is used.
- * <p>
- * B7 has both field and setter annotated. The setter must be called
- */
- @Test
- public void atReference3() throws Exception {
- Assert.assertTrue(a.isB7SetterCalled());
- }
-
- /**
- * Lines 1413, 1414, 1415 <br>
- * The "@Reference" annotation has the following attributes: <br> • name
- * (optional) – the name of the reference, defaults to the name of the field
- * of the Java class <br>
- * required (optional) – whether injection of service or services is
- * required. Defaults to true.
- * <p>
- * Reference and field have different names<br>
- * B8 is field injected<br>
- * B9 is setter injected
- */
- @Test
- public void atReference4() throws Exception {
- Assert.assertEquals("BService", a.getB8Name());
- Assert.assertEquals("BService", a.getB9Name());
- }
-
- /**
- * Lines 1457 to 1459<br>
- * If the reference is not an array or collection, then the implied
- * component type has a reference with a multiplicity of either 0..1 or 1..1
- * depending on the value of the
- *
- * @Reference required attribute – 1..1 applies if required=true.<br>
- * <p>
- * B10 is field injected, required=false, and multiplicity="0..1"<br>
- * B11 is field injected, required=false, and multiplicity="1..1"<br>
- * B12 is setter injected, required=true, and multiplicity="1..1"
- */
- @Test
- public void atReference5() throws Exception {
- Assert.assertEquals("BService", a.getB10Name());
- Assert.assertEquals("BService", a.getB11Name());
- Assert.assertEquals("BService", a.getB12Name());
- }
-
- /**
- * Lines 1461 to 1463<br>
- * If the reference is defined as an array or as a java.util.Collection,
- * then the implied component type has a reference with a multiplicity of
- * either 1..n or 0..n, depending on whether the required attribute of the
- * "@Reference" annotation is set to true or false – 1..n applies if
- * required=true.<br>
- * <p>
- * B13 is a java.util.List, field injected, required=false,
- * multiplicity="0..n", and no target<br>
- * B14 is a java.util.List, setter injected, required=true,
- * multiplicity="1..n", and one target<br>
- * B15 is an array, field injected, required=true, multiplicity="1..n", and
- * two targets
- */
- @Test
- public void atReference6() throws Exception {
- Assert.assertEquals(0, a.getB13Size());
- Assert.assertEquals("BService", a.getB14Name(0));
- Assert.assertEquals(1, a.getB14Size());
- Assert.assertEquals("BService", a.getB15Name(0));
- Assert.assertEquals("BService", a.getB15Name(1));
- Assert.assertEquals(2, a.getB15Size());
- }
-
- /**
- * Lines 1415 <br>
- * required (optional) - whether injection of service or services is
- * required. Defaults to true.
- * <p>
- * b16 and b17 is defined as "@Reference(required=false)" and AComponent
- * does not define reference for them
- */
- @Test
- public void atReference7() throws Exception {
- Assert.assertTrue(a.isB16Null());
- Assert.assertTrue(a.isB17Null());
- }
-
- /**
- * Java Component Implementation Spec
- * Section 1.2.7
- * Line 361 when @Property and @Reference annotations are present
- * then unannotated fields are ignored
- */
- @Test
- public void atReference8() throws Exception {
- Assert.assertTrue(a.isB4Null());
- Assert.assertTrue(a.isB5Null());
- Assert.assertTrue(a.isB6Null());
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/pom.xml
deleted file mode 100644
index 29048e88a4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-annotations-scope</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations - @Scope</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java
deleted file mode 100644
index b7cf3fba71..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-
-/**
- * Simple Service
- */
-public interface AService {
-
- public String getName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java
deleted file mode 100644
index 7da9d29424..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-/**
- * Simple Service
- */
-public interface BService {
-
- public String getName();
-
- public boolean isInitReady();
-
- public String getCurrentState();
-
- public String setCurrentState(String currentState);
-
- public int getDestroyCalledCounter();
-
- public int getInitCalledCounter();
-
- public int getInstanceCounter();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java
deleted file mode 100644
index 208c6a78b0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-/**
- * Simple Service
- */
-public interface CService {
-
- public String getName();
-
- public boolean isInitReady();
-
- public String getCurrentState();
-
- public String setCurrentState(String currentState);
-
- public int getDestroyCalledCounter();
-
- public int getInitCalledCounter();
-
- public int getInstanceCounter();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java
deleted file mode 100644
index f9b87ad251..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-public interface DService {
-
- public String getName();
-
- public boolean isInitReady();
-
- public String getCurrentState();
-
- public String setCurrentState(String currentState);
-
- public int getDestroyCalledCounter();
-
- public int getInitCalledCounter();
-
- public int getInstanceCounter();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java
deleted file mode 100644
index 0e4ed9c18d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-public interface FService {
-
- public String getName();
-
- public boolean isInitReady();
-
- public String getCurrentState();
-
- public String setCurrentState(String currentState);
-
- public int getDestroyCalledCounter();
-
- public int getInitCalledCounter();
-
- public int getInstanceCounter();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java
deleted file mode 100644
index 566dc93e6d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-public interface GService {
-
- public String getName();
-
- public int getInitCalledCounter();
-
- public int getDestroyCalledCounter();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java
deleted file mode 100644
index 714b3ce8f4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-
-/**
- * Simple Service
- */
-@Remotable
-public interface HService {
-
- public String getName();
-
- public String test();
-
- public String testCounters(int n);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java
deleted file mode 100644
index 88cf95b593..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-
-/**
- * Simple Service
- */
-@Conversational
-public interface IService {
-
- public String getName();
-
- public boolean isInitReady();
-
- public String getCurrentState();
-
- public String getConversationId();
-
- public String setCurrentState(String currentState);
-
- public int getDestroyCalledCounter();
-
- public int getInitCalledCounter();
-
- public int getInstanceCounter();
-
- @EndsConversation
- public void endConversation();
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/JService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/JService.java
deleted file mode 100644
index ea974100ab..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/JService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-public interface JService {
-
- public String getName();
-
- public String getFailedReason();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/KService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/KService.java
deleted file mode 100644
index 454009da12..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/KService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-public interface KService {
-
- public String getName();
-
- public String callL1();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/LService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/LService.java
deleted file mode 100644
index 2910b1c81c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/LService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-public interface LService {
-
- public String getName();
-
- public String getCurrentState();
-
- public String setCurrentState(String currentState);
-
- public int getDestroyCalledCounter();
-
- public int getInitCalledCounter();
-
- public int getInstanceCounter();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/MService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/MService.java
deleted file mode 100644
index 81d0692d7a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/MService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-public interface MService {
-
- public String getName();
-
- public String getFailedReason();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/NService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/NService.java
deleted file mode 100644
index 3493a88206..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/NService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-public interface NService {
-
- public String getName();
-
- public String callO1(int nthTime);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/OService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/OService.java
deleted file mode 100644
index 982568b236..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/OService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-public interface OService {
-
- public String getName();
-
- public String getCurrentState();
-
- public String setCurrentState(String currentState);
-
- public int getDestroyCalledCounter();
-
- public int getInitCalledCounter();
-
- public int getInstanceCounter();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java
deleted file mode 100644
index f7a57941dc..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- public String getName() {
- return "AService";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java
deleted file mode 100644
index 29d6284c43..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.BService;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Destroy;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- private static int instanceCounter = 0;
-
- private static int initCalledCounter = 0;
-
- private static int destroyCalledCounter = 0;
-
- public AService a1;
-
- public String p1;
-
- private int currentInstanceId = 0;
-
- public String currentState = null;
-
- private boolean isInitReady = false;
-
- public BServiceImpl() {
- currentInstanceId = ++instanceCounter;
- isInitReady = false;
- }
-
- @Reference
- public void setA1(AService a1) {
- this.a1 = a1;
- }
-
- @Property
- public void setP1(String p1) {
- this.p1 = p1;
- }
-
- @Init
- public void initBService() throws Exception {
- initCalledCounter++;
- if (p1.equals("p1") && a1.getName().equals("AService"))
- isInitReady = true;
- }
-
- @Destroy
- public void destroyBService() {
- destroyCalledCounter++;
- }
-
- public String getName() {
- return "BService" + currentInstanceId;
- }
-
- public AService getA1() {
- return a1;
- }
-
- public String getP1() {
- return p1;
- }
-
- public String getCurrentState() {
- return currentState;
- }
-
- public String setCurrentState(String currentState) {
- this.currentState = currentState;
- return this.currentState;
- }
-
- public boolean isInitReady() {
- return isInitReady;
- }
-
- public int getDestroyCalledCounter() {
- return destroyCalledCounter;
- }
-
- public int getInitCalledCounter() {
- return initCalledCounter;
- }
-
- public int getInstanceCounter() {
- return instanceCounter;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java
deleted file mode 100644
index 037d900176..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.CService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Scope;
-
-@Service(CService.class)
-@Scope("STATELESS")
-public class CServiceImpl implements CService {
-
- public static int instanceCounter = 0;
-
- public static int initCalledCounter = 0;
-
- public static int destroyCalledCounter = 0;
-
- public AService a1;
-
- public String p1;
-
- public int currentInstanceId = 0;
-
- public String currentState = null;
-
- public boolean isInitReady = false;
-
- public CServiceImpl() {
- currentInstanceId = ++instanceCounter;
- isInitReady = false;
- }
-
- @Reference
- public void setA1(AService a1) {
- this.a1 = a1;
- }
-
- @Property
- public void setP1(String p1) {
- this.p1 = p1;
- }
-
- @Init
- public void initCService() throws Exception {
- initCalledCounter++;
- if (p1.equals("p1") && a1.getName().equals("AService"))
- isInitReady = true;
- }
-
- @Destroy
- public void destroyCService() {
- destroyCalledCounter++;
- }
-
- public String getName() {
- return "CService" + currentInstanceId;
- }
-
- public AService getA1() {
- return a1;
- }
-
- public String getP1() {
- return p1;
- }
-
- public String getCurrentState() {
- return currentState;
- }
-
- public String setCurrentState(String currentState) {
- this.currentState = currentState;
- return this.currentState;
- }
-
- public boolean isInitReady() {
- return isInitReady;
- }
-
- public int getDestroyCalledCounter() {
- return destroyCalledCounter;
- }
-
- public int getInitCalledCounter() {
- return initCalledCounter;
- }
-
- public int getInstanceCounter() {
- return instanceCounter;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java
deleted file mode 100644
index d5f1326086..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.DService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Scope;
-
-@Service(DService.class)
-@Scope("REQUEST")
-public class DServiceImpl implements DService {
-
- public static int instanceCounter = 0;
-
- public static int initCalledCounter = 0;
-
- public static int destroyCalledCounter = 0;
-
- public AService a1;
-
- public String p1;
-
- public int currentInstanceId = 0;
-
- public String currentState = null;
-
- public boolean isInitReady = false;
-
- public DServiceImpl() {
- currentInstanceId = ++instanceCounter;
- isInitReady = false;
- }
-
- @Reference
- public void setA1(AService a1) {
- this.a1 = a1;
- }
-
- @Property
- public void setP1(String p1) {
- this.p1 = p1;
- }
-
- @Init
- public void initDService() throws Exception {
- initCalledCounter++;
- if (p1.equals("p1") && a1.getName().equals("AService"))
- isInitReady = true;
- System.out.println("DService" + currentInstanceId + "->initDService");
- }
-
- @Destroy
- public void destroyDService() {
- destroyCalledCounter++;
- System.out.println("DService" + currentInstanceId + "->destroyDService");
- }
-
- public String getName() {
- return "DService" + currentInstanceId;
- }
-
- public AService getA1() {
- return a1;
- }
-
- public String getP1() {
- return p1;
- }
-
- public String getCurrentState() {
- return currentState;
- }
-
- public String setCurrentState(String currentState) {
- this.currentState = "DService" + currentInstanceId + "-" + currentState;
- return this.currentState;
- }
-
- public boolean isInitReady() {
- return isInitReady;
- }
-
- public int getDestroyCalledCounter() {
- return destroyCalledCounter;
- }
-
- public int getInitCalledCounter() {
- return initCalledCounter;
- }
-
- public int getInstanceCounter() {
- return instanceCounter;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java
deleted file mode 100644
index e2bfa3c45a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.FService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Scope;
-
-@Service(FService.class)
-@Scope("COMPOSITE")
-public class FServiceImpl implements FService {
-
- public static int instanceCounter = 0;
-
- public static int initCalledCounter = 0;
-
- public static int destroyCalledCounter = 0;
-
- public AService a1;
-
- public String p1;
-
- public int currentInstanceId = 0;
-
- public String currentState = null;
-
- public boolean isInitReady = false;
-
- public FServiceImpl() {
- currentInstanceId = ++instanceCounter;
- isInitReady = false;
- }
-
- @Reference
- public void setA1(AService a1) {
- this.a1 = a1;
- }
-
- @Property
- public void setP1(String p1) {
- this.p1 = p1;
- }
-
- @Init
- public void initFService() throws Exception {
- initCalledCounter++;
- if (p1.equals("p1") && a1.getName().equals("AService"))
- isInitReady = true;
- System.out.println("FService" + currentInstanceId + "->initFService");
- }
-
- @Destroy
- public void destroyFService() {
- destroyCalledCounter++;
- System.out.println("FService" + currentInstanceId + "->destroyFService");
- }
-
- public String getName() {
- return "FService" + currentInstanceId;
- }
-
- public AService getA1() {
- return a1;
- }
-
- public String getP1() {
- return p1;
- }
-
- public String getCurrentState() {
- return currentState;
- }
-
- public String setCurrentState(String currentState) {
- this.currentState = "FService" + currentInstanceId + "-" + currentState;
- return this.currentState;
- }
-
- public boolean isInitReady() {
- return isInitReady;
- }
-
- public int getDestroyCalledCounter() {
- return destroyCalledCounter;
- }
-
- public int getInitCalledCounter() {
- return initCalledCounter;
- }
-
- public int getInstanceCounter() {
- return instanceCounter;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java
deleted file mode 100644
index 28b8bd84b9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.GService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.EagerInit;
-
-@Scope("COMPOSITE")
-@EagerInit
-public class GServiceImpl implements GService {
-
- public static int initCalledCounter = 0;
-
- public static int destroyCalledCounter = 0;
-
- public AService a1;
-
- public String p1;
-
- @Init
- public void initGService() throws Exception {
- initCalledCounter++;
- System.out.println("GService->initGService");
- }
-
- @Destroy
- public void destroyGService() {
- destroyCalledCounter++;
- System.out.println("GService->destroyGService");
- }
-
- @Reference
- public void setA1(AService a1) {
- this.a1 = a1;
- }
-
- @Property
- public void setP1(String p1) {
- this.p1 = p1;
- }
-
- public String getName() {
- return "GService";
- }
-
- public int getInitCalledCounter() {
- return initCalledCounter;
- }
-
- public int getDestroyCalledCounter() {
- return destroyCalledCounter;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java
deleted file mode 100644
index 404f329201..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.IService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.HService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(HService.class)
-public class HServiceImpl implements HService {
-
- @Reference
- public IService i1;
-
- public String getName() {
- return "HService";
- }
-
- public String test() {
-
- String serviceName = i1.getName();
- String conversationIdBefore = i1.getConversationId();
-
- for (int i = 0; i < 10; i++) {
- String newState = "state-" + i;
- i1.setCurrentState(newState);
- String currentState = i1.getCurrentState();
- if (currentState == null || !currentState.equals(serviceName + "-" + newState)) {
- i1.endConversation();
- return "CurrentStateLost - " + currentState;
- }
- }
-
- boolean isInitReady = i1.isInitReady();
-
- String conversationIdAfter = i1.getConversationId();
-
- i1.endConversation();
-
- if (!isInitReady)
- return "InitNotReady";
-
- if (!conversationIdBefore.equals(conversationIdAfter))
- return "DifferentConversationId";
-
- return "None";
- }
-
- public String testCounters(int n) {
- int instanceCounter = i1.getInstanceCounter();
- int initCalledCounter = i1.getInitCalledCounter();
- int destroyCalledCounter = i1.getDestroyCalledCounter();
-
- System.out.println("instanceCounter=" + instanceCounter);
- System.out.println("initCalledCounter=" + initCalledCounter);
- System.out.println("destroyCalledCounter=" + destroyCalledCounter);
-
- if (instanceCounter != n + 1)
- return "IncorrectInstanceCounter";
- if (initCalledCounter != n + 1)
- return "IncorrectInitCalledCounter";
- if (destroyCalledCounter != n)
- return "IncorrectDestroyCalledCounter";
-
- return "None";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java
deleted file mode 100644
index 66d14c2e96..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.IService;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Scope;
-
-@Service(IService.class)
-@Scope("CONVERSATION")
-public class IServiceImpl implements IService {
-
- public static int instanceCounter = 0;
-
- public static int initCalledCounter = 0;
-
- public static int destroyCalledCounter = 0;
-
- @ConversationID
- protected String conversationId;
-
- public int currentInstanceId = 0;
-
- public AService a1;
-
- public String p1;
-
- public String currentState = null;
-
- public boolean isInitReady = false;
-
- public IServiceImpl() {
- synchronized (IServiceImpl.class) {
- currentInstanceId = ++instanceCounter;
- }
- isInitReady = false;
- }
-
- @Reference
- public void setA1(AService a1) {
- this.a1 = a1;
- }
-
- @Property
- public void setP1(String p1) {
- this.p1 = p1;
- }
-
- @Init
- public void initIService() throws Exception {
- initCalledCounter++;
- if (p1.equals("p1") && a1.getName().equals("AService"))
- isInitReady = true;
- System.out.println("IService" + currentInstanceId + "->initIService");
- }
-
- @Destroy
- public void destroyIService() {
- destroyCalledCounter++;
- System.out.println("IService" + currentInstanceId + "->destroyIService");
- }
-
- public void endConversation() {
- System.out.println("IService" + currentInstanceId + "->endConversation");
- }
-
- public String getName() {
- return "IService" + currentInstanceId;
- }
-
- public AService getA1() {
- return a1;
- }
-
- public String getP1() {
- return p1;
- }
-
- public String getCurrentState() {
- return currentState;
- }
-
- public String getConversationId() {
- return conversationId;
- }
-
- public String setCurrentState(String currentState) {
- this.currentState = "IService" + currentInstanceId + "-" + currentState;
- return this.currentState;
- }
-
- public boolean isInitReady() {
- return isInitReady;
- }
-
- public int getDestroyCalledCounter() {
- return destroyCalledCounter;
- }
-
- public int getInitCalledCounter() {
- return initCalledCounter;
- }
-
- public int getInstanceCounter() {
- return instanceCounter;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/JServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/JServiceImpl.java
deleted file mode 100644
index 80546f677c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/JServiceImpl.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.KService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.JService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Scope;
-
-@Service(JService.class)
-@Scope("COMPOSITE")
-public class JServiceImpl implements JService {
-
- @Reference
- public KService k1;
-
- public static String failedReason = "";
-
- public static Timer aTimer = null;
-
- @Init
- public void initJService() throws Exception {
- aTimer = new Timer();
- aTimer.schedule(new JTimerTask(), 1000);
- System.out.println("JService->initJService");
- }
-
- @Destroy
- public void destroyJService() {
- aTimer.cancel();
- System.out.println("JService->destroyJService");
- }
-
- public String getName() {
- return "JService";
- }
-
- public String getFailedReason() {
- return failedReason;
- }
-
- private class JTimerTask extends TimerTask {
-
- public boolean cancel() {
- return true;
- }
-
- public void run() {
- String result = k1.callL1();
- if (!result.equals("None"))
- failedReason = failedReason + ";" + result;
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/KServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/KServiceImpl.java
deleted file mode 100644
index 022a9d11f6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/KServiceImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.KService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.LService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Scope;
-
-@Service(KService.class)
-@Scope("STATELESS")
-public class KServiceImpl implements KService {
-
- public static int instanceCounter = 0;
-
- public String previousL1Name = null;
-
- public int currentInstanceId = 0;
-
- @Reference
- public LService l1;
-
- public KServiceImpl() {
- currentInstanceId = ++instanceCounter;
- }
-
-
- public String getName() {
- return "KService"+currentInstanceId;
- }
-
- public String callL1() {
-
- for (int i = 1; i < 11; i++) {
- System.out.println(getName() + " calls LService " + i + (i == 1 ? "st time:" : (i == 2 ? "nd time:" : (i == 3 ? "rd time:" : "th time"))));
-
- String serviceName = l1.getName();
- for (int j = 0; j < 10; j++) {
- String newState = "state-" + j;
- l1.setCurrentState(newState);
- String currentState = l1.getCurrentState();
- if (!currentState.equals(serviceName + "-" + newState)) {
- return "CurrentStateLost - " + currentState;
- }
- }
-
- System.out.print(" Name=" + serviceName);
- System.out.print(", #Instance=" + l1.getInstanceCounter());
- System.out.print(", #InitCalled=" + l1.getInitCalledCounter());
- System.out.println(", #DestroyCalled=" + l1.getDestroyCalledCounter());
-
- if (previousL1Name == null) {
- previousL1Name = serviceName;
- } else {
- if (!previousL1Name.equals(serviceName))
- return "DifferentLServiceInstance";
- }
- }
- return "None";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/LServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/LServiceImpl.java
deleted file mode 100644
index 196cd6f39a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/LServiceImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.LService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Scope;
-
-@Service(LService.class)
-@Scope("REQUEST")
-public class LServiceImpl implements LService {
-
- public static int instanceCounter = 0;
-
- public static int initCalledCounter = 0;
-
- public static int destroyCalledCounter = 0;
-
- public int currentInstanceId = 0;
-
- public String currentState = null;
-
- public LServiceImpl() {
- currentInstanceId = ++instanceCounter;
- }
-
- @Init
- public void initLService() throws Exception {
- initCalledCounter++;
- System.out.println("LService" + currentInstanceId + "->initLService");
- }
-
- @Destroy
- public void destroyLService() {
- destroyCalledCounter++;
- System.out.println("LService" + currentInstanceId + "->destroyLService");
- }
-
- public String getName() {
- return "LService" + currentInstanceId;
- }
-
- public String getCurrentState() {
- return currentState;
- }
-
- public String setCurrentState(String currentState) {
- this.currentState = "LService" + currentInstanceId + "-" + currentState;
- return this.currentState;
- }
-
- public int getDestroyCalledCounter() {
- return destroyCalledCounter;
- }
-
- public int getInitCalledCounter() {
- return initCalledCounter;
- }
-
- public int getInstanceCounter() {
- return instanceCounter;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/MServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/MServiceImpl.java
deleted file mode 100644
index acc7d8ca9e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/MServiceImpl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.MService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.NService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Scope;
-
-@Service(MService.class)
-@Scope("COMPOSITE")
-public class MServiceImpl implements MService {
-
- @Reference
- public NService n1;
-
- public static String failedReason = "";
-
- public static Timer aTimer = null;
-
- public static int counter = 0;
-
- @Init
- public void initMService() throws Exception {
- aTimer = new Timer();
- aTimer.schedule(new MTimerTask(), 1000, 1000);
- System.out.println("MService->initMService");
- }
-
- @Destroy
- public void destroyMService() {
- aTimer.cancel();
- System.out.println("MService->destroyMService");
- }
-
- public String getName() {
- return "MService";
- }
-
- public String getFailedReason() {
- return failedReason;
- }
-
- private class MTimerTask extends TimerTask {
-
- public boolean cancel() {
- return true;
- }
-
- public void run() {
- counter++;
- String result = n1.callO1(counter);
- if (!result.equals("None"))
- failedReason = failedReason + ";" + result;
- }
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/NServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/NServiceImpl.java
deleted file mode 100644
index b9d799331f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/NServiceImpl.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.NService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.OService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Scope;
-
-@Service(NService.class)
-@Scope("STATELESS")
-public class NServiceImpl implements NService {
-
- public static int instanceCounter = 0;
-
- public String previousL1Name = null;
-
- public int currentInstanceId = 0;
-
- @Reference
- public OService o1;
-
- public NServiceImpl() {
- currentInstanceId = ++instanceCounter;
- }
-
-
- public String getName() {
- return "NService"+currentInstanceId;
- }
-
- public String callO1(int nthTime) {
-
- for (int i = 1; i < 11; i++) {
- System.out.println(getName() + " calls OService " + i + (i == 1 ? "st time:" : (i == 2 ? "nd time:" : (i == 3 ? "rd time:" : "th time"))));
-
- String serviceName = o1.getName();
- for (int j = 0; j < 10; j++) {
- String newState = "state-" + j;
- o1.setCurrentState(newState);
- String currentState = o1.getCurrentState();
- if (!currentState.equals(serviceName + "-" + newState)) {
- return "CurrentStateLost - " + currentState;
- }
- }
-
- System.out.print(" Name=" + serviceName);
- System.out.print(", #Instance=" + o1.getInstanceCounter());
- System.out.print(", #InitCalled=" + o1.getInitCalledCounter());
- System.out.println(", #DestroyCalled=" + o1.getDestroyCalledCounter());
-
- if (previousL1Name == null) {
- previousL1Name = serviceName;
- } else {
- if (!previousL1Name.equals(serviceName))
- return "DifferentOServiceInstance";
- }
-
- }
-
- if (o1.getInstanceCounter() < nthTime) {
- return "SharedSameInstance";
- }
-
- return "None";
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/OServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/OServiceImpl.java
deleted file mode 100644
index 60178ba2a3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/OServiceImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.OService;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Scope;
-
-@Service(OService.class)
-@Scope("REQUEST")
-public class OServiceImpl implements OService {
-
- public static int instanceCounter = 0;
-
- public static int initCalledCounter = 0;
-
- public static int destroyCalledCounter = 0;
-
- public int currentInstanceId = 0;
-
- public String currentState = null;
-
- public OServiceImpl() {
- currentInstanceId = ++instanceCounter;
- }
-
- @Init
- public void initOService() throws Exception {
- initCalledCounter++;
- System.out.println("OService" + currentInstanceId + "->initOService");
- }
-
- @Destroy
- public void destroyOService() {
- destroyCalledCounter++;
- System.out.println("OService" + currentInstanceId + "->destroyOService");
- }
-
- public String getName() {
- return "OService" + currentInstanceId;
- }
-
- public String getCurrentState() {
- return currentState;
- }
-
- public String setCurrentState(String currentState) {
- this.currentState = "OService" + currentInstanceId + "-" + currentState;
- return this.currentState;
- }
-
- public int getDestroyCalledCounter() {
- return destroyCalledCounter;
- }
-
- public int getInitCalledCounter() {
- return initCalledCounter;
- }
-
- public int getInstanceCounter() {
- return instanceCounter;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/resources/scope.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/resources/scope.composite
deleted file mode 100644
index 7c195b2b5d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/main/resources/scope.composite
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Scope-Composite">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.AServiceImpl" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.BServiceImpl" />
- <reference name="a1" target="AComponent"/>
- <property name="p1">p1</property>
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.CServiceImpl" />
- <reference name="a1" target="AComponent"/>
- <property name="p1">p1</property>
- </component>
-
- <component name="DComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.DServiceImpl" />
- <reference name="a1" target="AComponent"/>
- <property name="p1">p1</property>
- </component>
-
- <component name="FComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.FServiceImpl" />
- <reference name="a1" target="AComponent"/>
- <property name="p1">p1</property>
- </component>
-
- <component name="GComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.GServiceImpl" />
- <reference name="a1" target="AComponent"/>
- <property name="p1">p1</property>
- </component>
-
- <component name="HComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.HServiceImpl" />
- <reference name="i1" target="IComponent"/>
- </component>
-
- <component name="IComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.IServiceImpl" />
- <reference name="a1" target="AComponent"/>
- <property name="p1">p1</property>
- </component>
-
- <component name="JComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.JServiceImpl" />
- <reference name="k1" target="KComponent"/>
- </component>
-
- <component name="KComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.KServiceImpl" />
- <reference name="l1" target="LComponent"/>
- </component>
-
- <component name="LComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.LServiceImpl" />
- </component>
-
- <component name="MComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.MServiceImpl" />
- <reference name="n1" target="NComponent"/>
- </component>
-
- <component name="NComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.NServiceImpl" />
- <reference name="o1" target="OComponent"/>
- </component>
-
- <component name="OComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.OServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java
deleted file mode 100644
index 6d65416ce8..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.scope;
-
-import java.util.ArrayList;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * This test class tests the Scope annotation described in section 1.2.4
- * including 1.8.7, 1.8.8, 1.8.9, 1.8.10, 1.8.11, and 1.8.16<br>
- * <p>
- * Check following:<br>
- * <li>Number of service instances be created</li>
- * <li>Init method be called and where all property and reference injection is
- * complete.</li>
- * <li>Destroy method be called</li>
- * <li>State be preserved in request and conversation scopes but not others</li>
- */
-public class ScopeAnnotationTestCase {
-
- protected static String compositeName = "scope.composite";
-
- protected static int numDThread = 5;
- protected static int numFThread = 5;
- protected static int numHThread = 5;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Line 259:<br>
- * <li>STATELESS</li>
- * <p>
- * Line 284:<br>
- * For stateless components, there is no implied correlation between
- * service requests.<br>
- * <p>
- * Line 1589 to 1591:<br>
- * The default value is 'STATELESS'. For 'STATELESS' implementations,
- * a different implementation instance may be used to service each request.
- * Implementation instances may be newly created or be drawn from a pool
- * of instances.<br>
- * <p>
- * BComponent is not defined '@Scope'<br>
- * CComponent is defined '@Scope("STATELESS")'<br>
- * <p>
- */
- @Test
- public void atScope1() throws Exception {
- System.out.println("atScope1");
- BThread b1 = new BThread("ThreadB1");
- BThread b2 = new BThread("ThreadB2");
- CThread c1 = new CThread("ThreadC1");
- CThread c2 = new CThread("ThreadC2");
-
- b1.start();
- b2.start();
- c1.start();
- c2.start();
- b1.join();
- b2.join();
- c1.join();
- c2.join();
-
- System.out.println("");
-
- Assert.assertEquals("None", b1.failedReason);
- Assert.assertEquals("None", b2.failedReason);
- Assert.assertEquals("None", c1.failedReason);
- Assert.assertEquals("None", c2.failedReason);
- }
-
- /**
- * Line 260:<br>
- * <li>REQUEST</li>
- * <p>
- * Lines 286 to 289:<br>
- * The lifecycle of request scope extends from the point a request on a
- * remotable interface enters the SCA runtime and a thread processes that
- * request until the thread completes synchronously processing the request.
- * During that time, all service requests will be delegated to the same
- * implementation instance of a request-scoped component.<br>
- * <p>
- */
- @Test
- public void atScope2() throws Exception {
- System.out.println("atScope2");
- ArrayList<DThread> d = new ArrayList<DThread>();
- for (int i = 0; i < numDThread; i++)
- d.add(new DThread("ThreadD"+i));
- for (int i = 0; i < numDThread; i++)
- d.get(i).start();
- for (int i = 0; i < numDThread; i++)
- d.get(i).join();
- System.out.println("");
- for (int i = 0; i < numDThread; i++)
- Assert.assertEquals("None", d.get(i).failedReason);
- }
-
- /**
- * Line 262:<br>
- * <li>COMPOSITE</li>
- * <p>
- * Lines 296 to 298:<br>
- * All service requests are dispatched to the same implementation instance
- * for the lifetime of the containing composite. The lifetime of the
- * containing composite is defined as the time it becomes active in the
- * runtime to the time it is deactivated, either normally or abnormally.<br>
- * <p>
- * Following lines should be found at System out<br>
- * atScope3 - Cleaning up<br>
- * FService1->destroyFService
- */
- @Test
- public void atScope3() throws Exception {
- System.out.println("atScope3");
- FService fService = ServiceFinder.getService(FService.class, "FComponent");
- String serviceName = fService.getName();
- boolean isInitReady = fService.isInitReady();
-
- ArrayList<FThread> f = new ArrayList<FThread>();
- for (int i = 0; i < numFThread; i++)
- f.add(new FThread("ThreadF"+i));
- for (int i = 0; i < numFThread; i++)
- f.get(i).start();
- for (int i = 0; i < numFThread; i++)
- f.get(i).join();
- for (int i = 0; i < numFThread; i++) {
- Assert.assertEquals(serviceName, f.get(i).serviceName);
- }
-
- int instanceCounter = fService.getInstanceCounter();
- int initCalledCounter = fService.getInitCalledCounter();
- int destroyCalledCounter = fService.getDestroyCalledCounter();
- System.out.println("");
-
- Assert.assertTrue(isInitReady);
- Assert.assertEquals(1, instanceCounter);
- Assert.assertEquals(1, initCalledCounter);
- Assert.assertEquals(0, destroyCalledCounter);
- }
-
- /**
- * Lines 299 to 302:<br>
- * A composite scoped implementation may also specify eager initialization
- * using the "@EagerInit" annotation. When marked for eager initialization,
- * the composite scoped instance will be created when its containing
- * component is started. If a method is marked with the "@Init" annotation,
- * it will be called when the instance is created.<p>
- * Section 1.8.9 "@EagerInit"<br>
- * <p>
- * GService is defined as eager initialization. It will be initialized
- * when calls SCADomain.newInstance(compositeName), so the
- * initCalledCounter is 1.
- */
- @Test
- public void atScope4() throws Exception {
- System.out.println("atScope4");
-
- GService gService = ServiceFinder.getService(GService.class, "GComponent");
- int initCalledCounter = gService.getInitCalledCounter();
- int destroyCalledCounter = gService.getDestroyCalledCounter();
-
- System.out.println("initCalledCounter="+ initCalledCounter);
- System.out.println("destroyCalledCounter="+ destroyCalledCounter);
- System.out.println("");
-
- Assert.assertEquals(1, initCalledCounter);
- Assert.assertEquals(0, destroyCalledCounter);
- }
-
- /**
- * Line 261:<br>
- * <li>CONVERSATION</li>
- * <p>
- * Lines 305 to 310:<br>
- * A conversation is defined as a series of correlated interactions between
- * a client and a target service. A conversational scope starts when the
- * first service request is dispatched to an implementation instance
- * offering a conversational service. A conversational scope completes
- * after an end operation defined by the service contract is called and
- * completes processing or the conversation expires. A conversation may be
- * long-running and the SCA runtime may choose to passivate implementation
- * instances. If this occurs, the runtime must guarantee implementation
- * instance state is preserved.
- */
- @Test
- public void atScope5() throws Exception {
- System.out.println("atScope5");
-
- ArrayList<HThread> g = new ArrayList<HThread>();
- for (int i = 0; i < numHThread; i++)
- g.add(new HThread("ThreadH"+i));
- for (int i = 0; i < numHThread; i++)
- g.get(i).start();
- for (int i = 0; i < numHThread; i++)
- g.get(i).join();
-
- HService hService = ServiceFinder.getService(HService.class, "HComponent");
- String failedReason = hService.testCounters(numHThread);
- System.out.println("");
-
- for (int i = 0; i < numHThread; i++)
- Assert.assertEquals("None", g.get(i).failedReason);
- Assert.assertEquals("None", failedReason);
- }
-
- /** Lines 290 to 293:<br>
- * There are times when a local request scoped service is called without
- * there being a remotable service earlier in the call stack, such as when
- * a local service is called from a non-SCA entity. In these cases, a
- * remote request is always considered to be present, but the lifetime of
- * the request is implementation dependent. For example, a timer event
- * could be treated as a remote request..<br>
- * <p>
- * When the composite runs, composite scope service JService kicks off a
- * timer by the @Init method. When the timer expires, JService invokes a
- * method that calls an operation on the reference to a stateless scope
- * sevice KService. KService calls a request scope service LService
- * multiple times. The results of the calls to LService should be set up to
- * differ depending on whether the same instance is called each time -
- * without the interface being declared Conversational.<br>
- * <p>
- */
- @Test
- public void atScope6() throws Exception {
- System.out.println("atScope6");
-
- JService jService = ServiceFinder.getService(JService.class, "JComponent");
- jService.getName();
- Thread.sleep(2000);
- String failedReason = jService.getFailedReason();
- System.out.println("");
-
- Assert.assertEquals("", failedReason);
- }
-
- /**
- * Same as atScope6 but the timer triggers KService multiple times.<br>
- */
- @Test
- @Ignore("TUSCANY-2256")
- public void atScope7() throws Exception {
- System.out.println("atScope7");
-
- MService mService = ServiceFinder.getService(MService.class, "MComponent");
- mService.getName();
- Thread.sleep(6000);
- String failedReason = mService.getFailedReason();
- System.out.println("");
-
- Assert.assertEquals("", failedReason);
- }
-
- private class BThread extends Thread {
- private String name = null;
- public String failedReason = "Unknown";
-
- public BThread(String name) {
- super();
- this.name = name;
- failedReason = "Unknown";
- }
-
- @Override
- public void run() {
- BService bService = ServiceFinder.getService(BService.class, "BComponent");
- bService.setCurrentState(name + "-state-1");
- System.out.println(name + "->" + bService.getName());
- if (!bService.isInitReady()) {
- failedReason = "InitNotReady";
- return;
- }
- if (bService.getCurrentState() != null) {
- failedReason = "CurrentStateNotNull";
- return;
- }
- int counter = bService.getInstanceCounter();
- if (counter < 2) {
- failedReason = "OnlyOneInstance - " + counter;
- return;
- }
- counter = bService.getInitCalledCounter();
- if (counter < 2) {
- failedReason = "InitBeCalledOnce - " + counter;
- return;
- }
- counter = bService.getDestroyCalledCounter();
- if (counter < 2) {
- failedReason = "DestroyBeCalledOnce - " + counter;
- return;
- }
- failedReason = "None";
- }
- }
-
- private class CThread extends Thread {
- private String name = null;
- public String failedReason = "Unknown";
-
- public CThread(String name) {
- super();
- this.name = name;
- failedReason = "Unknown";
- }
-
- @Override
- public void run() {
- CService cService = ServiceFinder.getService(CService.class, "CComponent");
- cService.setCurrentState(name + "-state-1");
- System.out.println(name + "->" + cService.getName());
- if (!cService.isInitReady()) {
- failedReason = "InitNotReady";
- return;
- }
- if (cService.getCurrentState() != null) {
- failedReason = "CurrentStateNotNull";
- return;
- }
- int counter = cService.getInstanceCounter();
- if (counter < 2) {
- failedReason = "OnlyOneInstance - " + counter;
- return;
- }
- counter = cService.getInitCalledCounter();
- if (counter < 2) {
- failedReason = "InitBeCalledOnce - " + counter;
- return;
- }
- counter = cService.getDestroyCalledCounter();
- if (counter < 2) {
- failedReason = "DestroyBeCalledOnce - " + counter;
- return;
- }
- failedReason = "None";
- }
- }
-
- private class DThread extends Thread {
-
- private String name = null;
- public String failedReason = "Unknown";
-
- public DThread(String name) {
- super();
- this.name = name;
- failedReason = "Unknown";
- }
-
- @Override
- public void run() {
- DService dService = ServiceFinder.getService(DService.class, "DComponent");
- String serviceName = dService.getName();
- System.out.println(name + "->" + serviceName);
-
- for (int i = 0; i < 10; i++) {
- String newState = name + "-state-" + i;
- dService.setCurrentState(newState);
- String currentState = dService.getCurrentState();
- if (!currentState.equals(serviceName + "-" + newState)) {
- failedReason = "CurrentStateLost - " + currentState;
- return;
- }
- }
-
- if (!dService.isInitReady()) {
- failedReason = "InitNotReady";
- return;
- }
-
- int counter = dService.getInstanceCounter();
- if (counter > numDThread) {
- failedReason = "TooMuchInstance - " + counter;
- return;
- }
-
- counter = dService.getInitCalledCounter();
- if (counter > numDThread) {
- failedReason = "InitBeCalledTooMuch - " + counter;
- return;
- }
-
- // JIRA T-2215
- /* Don't know when destroy method be called
- counter = dService.getDestroyCalledCounter();
- if (counter > numDThreads) {
- failedReason = "DestroyBeCalledTooMuch - " + counter;
- return;
- }
- */
- failedReason = "None";
- }
- }
-
- private class FThread extends Thread {
-
- private String name = null;
-
- public String serviceName = null;
-
- public FThread(String name) {
- super();
- this.name = name;
- }
-
- @Override
- public void run() {
- FService fService = ServiceFinder.getService(FService.class, "FComponent");
- serviceName = fService.getName();
- System.out.println(name + "->" + serviceName);
-
- for (int i = 0; i < 10; i++) {
- String newState = name + "-state-" + i;
- fService.setCurrentState(newState);
- fService.getCurrentState();
- }
- }
- }
-
- private class HThread extends Thread {
-
- public String failedReason = "Unknown";
-
- public HThread(String name) {
- super();
- failedReason = "Unknown";
- }
-
- @Override
- public void run() {
- HService hService = ServiceFinder.getService(HService.class, "HComponent");
- failedReason = hService.test();
- }
- }
-
-}
-
-
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/pom.xml
deleted file mode 100644
index 23112669c2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-annotations-service</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Annotations - @Service</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/AService.java
deleted file mode 100644
index 7b89b31d7f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/AService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-public interface AService {
-
- public String getName();
-
- public String setAObject(AObject a);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/BService.java
deleted file mode 100644
index 26bcf3b9db..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/BService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
-
-/**
- * Simple Local Service
- */
-public interface BService {
-
- public String getName();
-
- public String setAObject(AObject a);
-
- public String testServices();
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/CService.java
deleted file mode 100644
index 4f4f1e80c7..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/CService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
-
-/**
- * Simple Local Service without defining "@Service" at the implementation class
- */
-public interface CService {
-
- public String getName();
-
- public String setAObject(AObject a);
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService1.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService1.java
deleted file mode 100644
index ffabb3619c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService1.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-/**
- * Simple Local Service
- */
-public interface DService1 {
-
- public String getName1();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService2.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService2.java
deleted file mode 100644
index 83d7980dbc..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService2.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-/**
- * Simple Local Service
- */
-public interface DService2 {
-
- public String getName2();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService3.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService3.java
deleted file mode 100644
index a416e33de7..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/DService3.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-/**
- * Simple Local Service
- */
-public interface DService3 {
-
- public String getName3();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/EService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/EService.java
deleted file mode 100644
index ad44d2b93a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/EService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-/**
- * Simple Local Service which implementation class defines
- *
- * @Service() with no attributes
- */
-public interface EService {
-
- public String getName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/FService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/FService.java
deleted file mode 100644
index 52886131a1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/FService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-/**
- * Simple Local Service which implementation class defines
- *
- * @Service with full package name
- */
-public interface FService {
-
- public String getName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/GService1.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/GService1.java
deleted file mode 100644
index bd1a3a5fe6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/GService1.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-/**
- * Simple Local Service
- */
-public interface GService1 {
-
- public String getName();
-
- public String getServiceName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/GService2.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/GService2.java
deleted file mode 100644
index 0f8c7dabcb..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/GService2.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-/**
- * Simple Local Service
- */
-public interface GService2 extends GService1 {
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java
deleted file mode 100644
index 6a80e3023e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-public interface HService {
-
- public String getName();
-
- public String setAObject1(AObject a);
-
- public String setAObject2(AObject a);
-
- public String getComponentName();
-
- public String getAObject1String();
-
- public String getAObject2String();
-
- public String getAObject3String();
-
- public AObject getAObject3();
-
- public String getServiceName1();
-
- public String getServiceName2();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java
deleted file mode 100644
index cdeb43c4f4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-public interface IService {
-
- public String getName();
-
- public String setAObject1(AObject a);
-
- public String setAObject2(AObject a);
-
- public void setComponentName1(String componentName1);
-
- public String getComponentName1();
-
- public String getComponentName2();
-
- public String getAObject1String();
-
- public String getAObject2String();
-
- public String getAObject3String();
-
- public AObject getAObject3();
-
- public String getServiceName1();
-
- public String getServiceName2();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/AObject.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/AObject.java
deleted file mode 100644
index 0ab2e29194..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/AObject.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-/**
- * A simple object to hold a string
- */
-public class AObject {
-
- public String aString;
-
- public AObject() {
- this.aString = null;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/AServiceImpl.java
deleted file mode 100644
index b9617e5780..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/AServiceImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.AService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- public String getName() {
- return "AService";
- }
-
- public String setAObject(AObject a) {
- a.aString = "AService";
- return "AService";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/BServiceImpl.java
deleted file mode 100644
index 474ca084d6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/BServiceImpl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.AService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.BService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.CService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.HService;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.IService;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Reference;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- @Reference(required=false)
- public AService aService = null;
-
- @Reference(required=false)
- public CService cService = null;
-
- @Reference(required=false)
- public HService hService = null;
-
- @Reference(required=false)
- public IService iService = null;
-
- public String getName() {
- return "BService";
- }
-
- public String setAObject(AObject a) {
- a.aString = "BService";
- return "BService";
- }
-
- public String testServices() {
-
- AObject a = new AObject();
- aService.setAObject(a);
- if (a.aString != null)
- return "AServiceNotPassByValue";
-
- AObject c = new AObject();
- cService.setAObject(c);
- if (c.aString == null || !c.aString.equals("CService"))
- return "CServiceNotPassByReference";
-
-
- AObject h1 = new AObject();
- hService.setAObject1(h1);
- if (h1.aString == null || !h1.aString.equals("HService"))
- return "HServiceSetAObject1NotPassByReference";
- h1.aString = "testServices";
- if (!hService.getAObject1String().equals("testServices"))
- return "HServiceGetAObject1NotPassByReference";
-
- AObject h2 = new AObject();
- hService.setAObject2(h2);
- if (h2.aString != null)
- return "HServiceSetAObject2NotPassByValue";
- h2.aString = "testServices";
- if (!hService.getAObject2String().equals("HService"))
- return "HServiceGetAObject1NotPassByValue";
-
- AObject h3 = hService.getAObject3();
- h3.aString = "testServices";
- if (!hService.getAObject3String().equals("HService"))
- return "HServiceGetAObject3NotPassByValue";
-
- AObject i1 = new AObject();
- iService.setAObject1(i1);
- if (i1.aString == null || !i1.aString.equals("IService"))
- return "IServiceSetAObject1NotPassByReference";
- i1.aString = "testServices";
- if (!iService.getAObject1String().equals("testServices"))
- return "IServiceGetAObject1NotPassByReference";
-
- AObject i2 = new AObject();
- iService.setAObject2(i2);
- if (i2.aString == null || !i2.aString.equals("IService"))
- return "IServiceSetAObject2NotPassByReference";
- i2.aString = "testServices";
- if (!iService.getAObject2String().equals("testServices"))
- return "IServiceGetAObject2NotPassByReference";
-
- AObject i3 = iService.getAObject3();
- i3.aString = "testServices";
- if (!iService.getAObject3String().equals("testServices"))
- return "IServiceGetAObject3NotPassByReference";
-
- return "None";
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/CServiceImpl.java
deleted file mode 100644
index 3fc23d2f68..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/CServiceImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.CService;
-
-public class CServiceImpl implements CService {
-
- public String getName() {
- return "CService";
- }
-
- public String setAObject(AObject a) {
- a.aString = "CService";
- return "CService";
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/DServiceImpl.java
deleted file mode 100644
index 5b3c73ddd8..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/DServiceImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.DService1;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.DService2;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.DService3;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(interfaces = {DService1.class, DService2.class})
-public class DServiceImpl implements DService1, DService2, DService3 {
-
- public String getName1() {
- return "DService1";
- }
-
- public String getName2() {
- return "DService2";
- }
-
- public String getName3() {
- return "DService3";
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/EServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/EServiceImpl.java
deleted file mode 100644
index 321d019932..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/EServiceImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.EService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service()
-public class EServiceImpl implements EService {
-
- public String getName() {
- return "EService";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl.java
deleted file mode 100644
index f28fa0c3a7..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.FService;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(org.apache.tuscany.sca.vtest.javaapi.annotations.service.FService.class)
-public class FServiceImpl implements FService {
-
- @Context
- public RequestContext requestContext;
-
- public String getName() {
- return requestContext.getServiceName();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java
deleted file mode 100644
index 79051eea8f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/FServiceImpl2.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-import org.oasisopen.sca.annotation.Service;
-
-@Service(FServiceImpl2.class)
-public class FServiceImpl2 extends FServiceImpl {
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/GServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/GServiceImpl.java
deleted file mode 100644
index 161cbaa620..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/GServiceImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.GService1;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.GService2;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.RequestContext;
-
-@Service(interfaces = {GService1.class, GService2.class})
-public class GServiceImpl implements GService1 {
-
- @Context
- public RequestContext requestContext;
-
- public String getName() {
- return "GService";
- }
-
- public String getServiceName() {
- return requestContext.getServiceName();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java
deleted file mode 100644
index 02e67b645b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.HService;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.annotation.ComponentName;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.AllowsPassByReference;
-
-@Service(HService.class)
-@Scope("REQUEST")
-public class HServiceImpl implements HService {
-
- @ComponentName
- protected String componentName;
-
- private AObject aObject1 = null;
-
- private AObject aObject2 = null;
-
- private AObject aObject3 = null;
-
- public RequestContext requestContext;
-
- public ComponentContext componentContext;
-
- public String getName() {
- return "HService";
- }
-
- @AllowsPassByReference
- public String setAObject1(AObject a) {
- a.aString = "HService";
- aObject1 = a;
- return "HService";
- }
-
- public String setAObject2(AObject a) {
- a.aString = "HService";
- aObject2 = a;
- return "HService";
- }
-
- @Context
- public void setComponentContext(ComponentContext componentContext) {
- this.componentContext = componentContext;
- }
-
- @Context
- public void setRequestContext(RequestContext requestContext) {
- this.requestContext = requestContext;
- }
-
- public String getComponentName() {
- return componentName;
- }
-
- public String getAObject1String() {
- return aObject1.aString;
- }
-
- public String getAObject2String() {
- return aObject2.aString;
- }
-
- public String getAObject3String() {
- return aObject3.aString;
- }
-
- public AObject getAObject3() {
- aObject3 = new AObject();
- aObject3.aString = "HService";
- return aObject3;
- }
-
- public String getServiceName1() {
- return requestContext.getServiceName();
- }
-
- public String getServiceName2() {
- return componentContext.getRequestContext().getServiceName();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java
deleted file mode 100644
index ea08149eaf..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.IService;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.annotation.AllowsPassByReference;
-import org.oasisopen.sca.annotation.ComponentName;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(IService.class)
-@Scope("REQUEST")
-@AllowsPassByReference
-public class IServiceImpl implements IService {
-
- @ComponentName
- public String componentName1;
-
- public String componentName2;
-
- private AObject aObject1 = null;
-
- private AObject aObject2 = null;
-
- private AObject aObject3 = null;
-
- @Context
- public RequestContext requestContext;
-
- @Context
- public ComponentContext componentContext;
-
- public String getName() {
- return "IService";
- }
-
- public String setAObject1(AObject a) {
- a.aString = "IService";
- aObject1 = a;
- return "IService";
- }
-
- public String setAObject2(AObject a) {
- a.aString = "IService";
- aObject2 = a;
- return "IService";
- }
-
- @ComponentName
- public void setComponentName1(String componentName1) {
- this.componentName2 = componentName1;
- }
-
- public String getAObject1String() {
- return aObject1.aString;
- }
-
- public String getAObject2String() {
- return aObject2.aString;
- }
-
- public String getAObject3String() {
- return aObject3.aString;
- }
-
- public AObject getAObject3() {
- aObject3 = new AObject();
- aObject3.aString = "IService";
- return aObject3;
- }
-
- public String getComponentName1() {
- return componentName1;
- }
-
- public String getComponentName2() {
- return componentName2;
- }
-
- public String getServiceName1() {
- return requestContext.getServiceName();
- }
-
- public String getServiceName2() {
- return componentContext.getRequestContext().getServiceName();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/resources/service.composite b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/resources/service.composite
deleted file mode 100644
index 0731986df2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/main/resources/service.composite
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Service-Composite">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AServiceImpl" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.BServiceImpl" />
- </component>
-
- <component name="BComponent1">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.BServiceImpl" />
- <reference name="aService" target="AComponent"/>
- <reference name="cService" target="CComponent"/>
- <reference name="hService" target="HComponent"/>
- <reference name="iService" target="IComponent"/>
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.CServiceImpl" />
- </component>
-
- <component name="DComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.DServiceImpl" />
- </component>
-
- <component name="EComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.EServiceImpl" />
- </component>
-
- <component name="FComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.FServiceImpl" />
- </component>
-
- <component name="FComponent2">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.FServiceImpl2" />
- </component>
-
- <component name="GComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.GServiceImpl" />
- </component>
-
- <component name="HComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.HServiceImpl" />
- </component>
-
- <component name="IComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.IServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java
deleted file mode 100644
index 52f7821ebb..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
-
-import static org.junit.Assert.fail;
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.FServiceImpl2;
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This test class tests the Service annotation described in section 1.2.1
- * including 1.3.1, 1.8.1, 1.8.3, 1.8.6, 1.8.15 and 1.8.17<br>
- * but not..<br>
- * <li>Lines 1531 to 1534</li>
- */
-public class ServiceAnnotationTestCase {
-
- protected static String compositeName = "service.composite";
- protected static AService aService = null;
- protected static BService bService = null;
- protected static BService bService1 = null;
- protected static HService hService = null;
- protected static IService iService = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
- bService = ServiceFinder.getService(BService.class, "BComponent");
- bService1 = ServiceFinder.getService(BService.class, "BComponent1");
- hService = ServiceFinder.getService(HService.class, "HComponent");
- iService = ServiceFinder.getService(IService.class, "IComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
-
- }
-
- /**
- * Line 215:<br>
- * <li>As a Java interface</li>
- * <p>
- * Line 1622 to 1623:<br>
- * The
- *
- * @Service annotation type is used on a component implementation class to
- * specify the SCA services offered by the implementation.<br>
- */
- @Test
- public void atService1() throws Exception {
- Assert.assertEquals("AService", aService.getName());
- }
-
- /**
- * Line 216:<br>
- * <li>As a Java class</li>
- * <p>
- * Line 1631:<br>
- * <li>value – A shortcut for the case when the class provides only a
- * single service interface.</li>
- */
- @Test
- public void atService2() throws Exception {
- Assert.assertEquals("BService", bService.getName());
- }
-
- /**
- * Lines 222 to 224:<br>
- * A remotable service is defined using the "@Remotable" annotation on the
- * Java interface that defines the service. Remotable services are intended
- * to be used for coarse grained services, and the parameters are passed
- * by-value.<br>
- * <p>
- * Lines 321 to 323:<br>
- * The "@Remotable" annotation on a Java interface indicates that the
- * interface is designed to be used for remote communication. Remotable
- * interfaces are intended to be used for coarse grained services.
- * Operations parameters and return values are passed by-value.<br>
- */
- @Test
- public void atService3() throws Exception {
- AObject o = new AObject();
- Assert.assertEquals("AService", aService.setAObject(o));
- Assert.assertNull(o.aString);
- }
-
- /**
- * Lines 227 to 242:<br>
- * A local service can only be called by clients that are deployed within
- * the same address space as the component implementing the local service.<br>
- * ...<br>
- * The data exchange semantic for calls to local services is by-reference.<br>
- * ...<br>
- * Lines 996 to 1028:<br>
- * 1.8.1 "@AllowsPassByReference"<br>
- * ...<br>
- * Lines 1535 to 1540:<br>
- * Independent of whether the remotable service is called from outside of
- * the composite that contains it or from another component in the same
- * composite, the data exchange semantics are by-value.<br>
- * Implementations of remotable services may modify input data during or
- * after an invocation and may modify return data after the invocation. If a
- * remotable service is called locally or remotely, the SCA container is
- * responsible for making sure that no modification of input data or
- * post-invocation modifications to return data are seen by the caller.<br>
- * <p>
- * Test under Non-SCA <-> SCA
- * <li>BService is local service to test by reference</li>
- * <li>HService is remotable service to test "@AllowsPassByReference" at
- * method level</li>
- * <li>IService is remotable service to test "@AllowsPassByReference" at
- * class level</li>
- */
- @Test
- public void atService4() throws Exception {
- AObject b = new AObject();
- Assert.assertEquals("BService", bService.setAObject(b));
- Assert.assertEquals("BService", b.aString);
-
- AObject h1 = new AObject();
- Assert.assertEquals("HService", hService.setAObject1(h1));
- Assert.assertEquals("HService", h1.aString);
- h1.aString = "atService4";
- Assert.assertEquals("atService4", hService.getAObject1String());
-
- AObject h2 = new AObject();
- Assert.assertEquals("HService", hService.setAObject2(h2));
- Assert.assertNull(h2.aString);
- h2.aString = "atService4";
- Assert.assertEquals("HService", hService.getAObject2String());
-
- AObject h3 = hService.getAObject3();
- h3.aString = "atService4";
- Assert.assertEquals("HService", hService.getAObject3String());
-
- AObject i1 = new AObject();
- Assert.assertEquals("IService", iService.setAObject1(i1));
- Assert.assertEquals("IService", i1.aString);
- i1.aString = "atService4";
- Assert.assertEquals("atService4", iService.getAObject1String());
-
- AObject i2 = new AObject();
- Assert.assertEquals("IService", iService.setAObject2(i2));
- Assert.assertEquals("IService", i2.aString);
- i2.aString = "atService4";
- Assert.assertEquals("atService4", iService.getAObject2String());
-
- AObject i3 = iService.getAObject3();
- i3.aString = "atService4";
- Assert.assertEquals("atService4", iService.getAObject3String());
- }
-
- /**
- * Line 1624 to 1627:<br>
- * A class used as the implementation of a service is not required to have
- * an "@Service" annotation. If a class has no "@Service" annotation, then
- * the rules determining which services are offered and what interfaces
- * those services have are determined by the specific implementation type.
- * <br>
- */
- @Test
- public void atService5() throws Exception {
- CService cService = ServiceFinder.getService(CService.class, "CComponent");
- Assert.assertEquals("CService", cService.getName());
- }
-
- /**
- * Line 1623 to 1624:<br>
- * The class need not be declared as implementing all of the interfaces
- * implied by the services, but all methods of the service interfaces must
- * be present.<br>
- * <p>
- * Line 1629 to 1630:<br>
- * <li>interfaces – The value is an array of interface or class objects
- * that should be exposed as services by this component.</li>
- */
- @Test
- public void atService6() throws Exception {
- DService1 dService1 = ServiceFinder.getService(DService1.class, "DComponent/DService1");
- Assert.assertEquals("DService1", dService1.getName1());
- DService2 dService2 = ServiceFinder.getService(DService2.class, "DComponent/DService2");
- Assert.assertEquals("DService2", dService2.getName2());
- try {
- ServiceFinder.getService(DService3.class, "DComponent/DService3");
- fail("Should have failed to get this service");
- } catch (Exception e) {
- // Expect an exception
- }
- }
-
- /**
- * Line 1635 to 1636:<br>
- * A "@Service" annotation with no attributes is meaningless, it is the same
- * as not having the annotation there at all.<br>
- */
- @Test
- public void atService7() throws Exception {
- EService eService = ServiceFinder.getService(EService.class, "EComponent");
- Assert.assertEquals("EService", eService.getName());
- }
-
- /**
- * Line 1637 to 1638:<br>
- * The service names of the defined services default to the names of the
- * interfaces or class, without the package name.<br>
- */
- @Test
- public void atService8() throws Exception {
- FService fService = ServiceFinder.getService(FService.class, "FComponent");
- Assert.assertEquals("FService", fService.getName());
- FServiceImpl2 fServiceImpl2 = ServiceFinder.getService(FServiceImpl2.class, "FComponent2");
- Assert.assertEquals("FServiceImpl2", fServiceImpl2.getName());
- fService = ServiceFinder.getService(FService.class, "FComponent2");
- Assert.assertEquals("FServiceImpl2", fService.getName());
- }
-
- /**
- * Line 1639 to 1641:<br>
- * If a Java implementation needs to realize two services with the same
- * interface, then this is achieved through subclassing of the interface.
- * The subinterface must not add any methods. Both interfaces are listed in
- * the "@Service" annotation of the Java implementation class. <br>
- */
- @Test
- public void atService9() throws Exception {
- GService1 gService1 = ServiceFinder.getService(GService1.class, "GComponent/GService1");
- GService2 gService2 = ServiceFinder.getService(GService2.class, "GComponent/GService2");
- Assert.assertEquals("GService", gService1.getName());
- Assert.assertEquals("GService1", gService1.getServiceName());
- Assert.assertEquals("GService", gService2.getName());
- Assert.assertEquals("GService2", gService2.getServiceName());
- }
-
- /**
- * Lines 227 to 242:<br>
- * A local service can only be called by clients that are deployed within
- * the same address space as the component implementing the local service.<br>
- * ...<br>
- * The data exchange semantic for calls to local services is by-reference.<br>
- * ...<br>
- * Lines 996 to 1028:<br>
- * 1.8.1 "@AllowsPassByReference"<br>
- * ...<br>
- * Lines 1535 to 1540:<br>
- * Independent of whether the remotable service is called from outside of
- * the composite that contains it or from another component in the same
- * composite, the data exchange semantics are by-value.<br>
- * Implementations of remotable services may modify input data during or
- * after an invocation and may modify return data after the invocation. If a
- * remotable service is called locally or remotely, the SCA container is
- * responsible for making sure that no modification of input data or
- * post-invocation modifications to return data are seen by the caller.<br>
- * <p>
- * Test under SCA <-> SCA<br>
- * <li>AService is remotable service to test by value</li>
- * <li>CService is local service to test by-reference</li>
- * <li>HService is remotable service to test "@AllowsPassByReference" at
- * method level</li>
- * <li>IService is remotable service to test "@AllowsPassByReference" at
- * class level</li>
- */
- @Test
- public void atService10() throws Exception {
- Assert.assertEquals("None", bService1.testServices());
- }
-
- /**
- * Lines 1095 to 1124:<br>
- * 1.8.3. "@ComponentName"<br>
- * ...<br>
- * The "@ComponentName" annotation type is used to annotate a Java class
- * field or setter method that is used to inject the component name.<br>
- * ...<br>
- */
- @Test
- public void atService11() throws Exception {
- Assert.assertEquals("HComponent", hService.getComponentName());
- Assert.assertNull(iService.getComponentName1());
- Assert.assertEquals("IComponent", iService.getComponentName2());
- }
-
- /**
- * Lines 1164 to 1187:<br>
- * 1.8.6. "@Context"<br>
- * ...<br>
- * The "@Context" annotation type is used to annotate a Java class field or
- * a setter method that is used to inject a composite context for the
- * component. The type of context to be injected is defined by the type of
- * the Java class field or type of the setter method input argument, the
- * type is either ComponentContext or RequestContext.<br>
- * ...<br>
- * <p>
- * HService - "@Context" is used to annotate setter methods<br>
- * IService - "@Context" is used to annotate class fields<br>
- * <br>
- */
- @Test
- public void atService12() throws Exception {
- Assert.assertEquals("HService", hService.getServiceName1());
- Assert.assertEquals("HService", hService.getServiceName2());
- Assert.assertEquals("IService", iService.getServiceName1());
- Assert.assertEquals("IService", iService.getServiceName2());
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/pom.xml
deleted file mode 100644
index df49fc64ac..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-apis</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-apis-callablereference</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - CallableReference</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/AComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/AComponent.java
deleted file mode 100644
index a7040f944e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/AComponent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.callablereference;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service A.
- */
-@Conversational
-public interface AComponent {
-
- public String getName();
-
- public String getServiceName();
- public String getBusinessInterfaceName();
- public boolean isConversational();
- public void testConversationID();
- public String getCallbackResult();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BCallback.java
deleted file mode 100644
index 707568e507..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BCallback.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.callablereference;
-
-public interface BCallback {
-
- public void processResults(String result);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BComponent.java
deleted file mode 100644
index 18fcaee6ee..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/BComponent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.callablereference;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service B.
- */
-@Conversational
-@Callback(BCallback.class)
-public interface BComponent {
-
- public String getName();
-
- public void testCallback();
- public void testConversationID();
- public void testNonNullConversation();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/AComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/AComponentImpl.java
deleted file mode 100644
index 70a257d19f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/AComponentImpl.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.AComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.BCallback;
-import org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.BComponent;
-import org.junit.Assert;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AComponent.class)
-@Scope("CONVERSATION")
-public class AComponentImpl implements AComponent, BCallback {
-
- private static Object monitor = new Object();
- private static String returnMessage = null;
-
- protected ComponentContext componentContext;
-
- @Reference
- protected CallableReference<BComponent> bReference;
-
- @ConversationID
- protected String cid;
-
- public String getName() {
- return "ComponentA";
- }
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public String getServiceName() {
- return bReference.getService().getName();
- }
-
- public String getBusinessInterfaceName() {
- return bReference.getBusinessInterface().getSimpleName();
- }
-
- public boolean isConversational() {
- return bReference.isConversational();
- }
-
- public void testConversationID() {
- ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
- bSR.setConversationID("AConversationID");
- bSR.getService().testConversationID();
-
- Assert.assertEquals("AConversationID", bSR.getConversation().getConversationID());
- }
-
- public String getCallbackResult() {
- ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
- String cbID = "ComponentACallBack";
- bSR.setCallbackID(cbID);
- bSR.getService().testCallback();
-
- // Wait for 30s max.
- int count = 0;
- synchronized(monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- return returnMessage;
- }
-
- public void processResults(String result) {
- returnMessage = result;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/BComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/BComponentImpl.java
deleted file mode 100644
index ea4c71d27a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/impl/BComponentImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.BCallback;
-import org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.BComponent;
-import org.junit.Assert;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BComponent.class)
-@Scope("CONVERSATION")
-public class BComponentImpl implements BComponent {
-
- protected ComponentContext componentContext;
-
- @Callback
- protected BCallback callback;
-
- @ConversationID
- protected String cid;
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public String getName() {
- return "ComponentB";
- }
-
- public void testCallback() {
- callback = componentContext.getRequestContext().getCallback();
- callback.processResults("CallBackFromB");
-
- CallableReference<BCallback> bCR = componentContext.getRequestContext().getCallbackReference();
- Assert.assertEquals("ComponentACallBack", bCR.getCallbackID());
- }
-
- public void testConversationID() {
- Assert.assertEquals("AConversationID", cid);
- }
-
- public void testNonNullConversation() {
- Assert.assertNotNull(componentContext.getRequestContext().getServiceReference().getConversation());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/resources/callablereference.composite b/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/resources/callablereference.composite
deleted file mode 100644
index f997d78bb5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/main/resources/callablereference.composite
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java-api-tests"
- name="CallableReference-Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.impl.AComponentImpl"/>
- <reference name="bReference" target="BComponent"/>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.callablereference.impl.BComponentImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java
deleted file mode 100644
index 4d0d8338ba..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/callablereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/callablereference/CallableReferenceTestCase.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.callablereference;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This test class tests the CallableReference interface described in 1.7.3 of
- * the SCA Java Annotations & APIs Specification 1.0.
- */
-public class CallableReferenceTestCase {
-
- protected static String compositeName = "callablereference.composite";
- protected static AComponent a;
- protected static BComponent b;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a = ServiceFinder.getService(AComponent.class, "AComponent");
- b = ServiceFinder.getService(BComponent.class, "BComponent");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Lines 884 <br>
- * getService() - Returns a type-safe reference to the target of this
- * reference. The instance returned is guaranteed to implement the business
- * interface for this reference. The value returned is a proxy to the target
- * that implements the business interface associated with this reference.
- *
- * @throws Exception
- */
- @Test
- public void testGetService() throws Exception {
- Assert.assertEquals("ComponentB", a.getServiceName());
- }
-
- /**
- * Lines 885 <br>
- * getBusinessInterface() – Returns the Java class for the business
- * interface associated with this reference.
- *
- * @throws Exception
- */
- @Test
- public void testGetBusinessInterface() throws Exception {
- Assert.assertEquals("BComponent", a.getBusinessInterfaceName());
- }
-
- /**
- * Lines 886 <br>
- * isConversational() – Returns true if this reference is conversational.
- *
- * @throws Exception
- */
- @Test
- public void testIsConversational() throws Exception {
- Assert.assertEquals(true, a.isConversational());
- }
-
- /**
- * Lines 887 <br>
- * getConversation() – Returns the conversation associated with this
- * reference. Returns null if no conversation is currently active.
- *
- * @throws Exception
- */
- @Test
- public void testGetConversation() throws Exception {
- a.testConversationID();
- b.testNonNullConversation();
- }
-
- /**
- * Lines 888 <br>
- * getCallbackID() – Returns the callback ID.
- *
- * @throws Exception
- */
- @Test
- public void testGetCallbackID() throws Exception {
- // Actual test is in BComponentImpl. Below is an extra test.
- Assert.assertEquals("CallBackFromB", a.getCallbackResult());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/pom.xml
deleted file mode 100644
index f44c896479..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-apis</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-apis-componentcontext</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - ComponentContext</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java
deleted file mode 100644
index b2c8c07866..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext;
-
-/**
- * Simple Service A.
- */
-public interface AComponent {
-
- public String getName();
-
- public String getContextURI();
- public String getServiceBName();
- public String getServiceReferenceBName();
- public String getSelfReferenceName();
- public String getProperty();
- public String getRequestContextServiceName();
- public String getCastCallableReferenceServiceName();
- public String getCastServiceReferenceServiceName();
- public void illegalCast();
-
- public String testServiceLookup();
- public String getRequestContextContent();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java
deleted file mode 100644
index 7e425c740f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext;
-
-/**
- * Simple Service B.
- */
-public interface BComponent {
-
- String getName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java
deleted file mode 100644
index d7799bb3aa..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service B.
- */
-@Remotable
-public interface BService {
-
- String getBName();
-
- String getSelfReferenceWithServiceName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java
deleted file mode 100644
index d0da012f6f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext;
-
-/**
- * Simple Service C.
- */
-public interface CService {
-
- String getCName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java
deleted file mode 100644
index 079d859f74..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface DComponent {
-
- public String getName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java
deleted file mode 100644
index 06a71c29ac..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.AComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BService;
-import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.DComponent;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AComponent.class)
-@Scope("COMPOSITE")
-@EagerInit
-public class AComponentImpl implements AComponent {
-
- public static String rcContent = null;
-
- protected ComponentContext componentContext;
-
- @Reference
- protected BService bReference;
-
- @Reference
- protected DComponent dReference;
-
- @Property(name="aProperty", required=true)
- protected String aProperty;
-
- public String getName() {
- return "ComponentA";
- }
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- @Init
- public void init() {
- RequestContext rc = componentContext.getRequestContext();
- if (rc != null) {
- rcContent = "NotNull";
- } else {
- rcContent = "Null";
- }
- }
-
- public String getContextURI() {
- return componentContext.getURI();
- }
-
- public String getServiceBName() {
- return componentContext.getService(BService.class, "bReference").getBName();
- }
-
- public String getServiceReferenceBName() {
- ServiceReference<BService> bSR = componentContext.getServiceReference(BService.class, "bReference");
- return bSR.getService().getBName();
- }
-
- public String getSelfReferenceName() {
- ServiceReference<AComponent> aSR = componentContext.createSelfReference(AComponent.class);
- return aSR.getService().getName();
- }
-
- public String getProperty() {
- return componentContext.getProperty(String.class, "aProperty");
- }
-
- public String getRequestContextServiceName() {
- return componentContext.getRequestContext().getServiceName();
- }
-
- public String getCastCallableReferenceServiceName() {
- BService b = componentContext.getService(BService.class, "bReference");
- CallableReference<BService> bCR = componentContext.cast(b);
- return bCR.getService().getBName();
- }
-
- public String getCastServiceReferenceServiceName() {
- BService b = componentContext.getService(BService.class, "bReference");
- ServiceReference<BService> bSR = componentContext.cast(b);
- return bSR.getService().getBName();
- }
-
- public void illegalCast() {
- componentContext.cast("");
- }
-
- public String testServiceLookup() {
- return componentContext.getService(DComponent.class, "dReference").getName();
- }
-
- public String getRequestContextContent() {
- return rcContent;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java
deleted file mode 100644
index e508687965..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.AComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BService;
-import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.DComponent;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AComponent.class)
-@Scope("COMPOSITE")
-@EagerInit
-public class AUnannotatedComponentImpl implements AComponent {
-
- public static String rcContent = null;
-
- protected ComponentContext componentContext;
-
- protected BService bReference;
-
- protected DComponent dReference;
-
- protected String aProperty;
-
- public String getName() {
- return "ComponentA";
- }
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- @Init
- public void init() {
- RequestContext rc = componentContext.getRequestContext();
- if (rc != null) {
- rcContent = "NotNull";
- } else {
- rcContent = "Null";
- }
- }
-
- public String getContextURI() {
- return componentContext.getURI();
- }
-
- public String getServiceBName() {
- return componentContext.getService(BService.class, "bReference").getBName();
- }
-
- public String getServiceReferenceBName() {
- ServiceReference<BService> bSR = componentContext.getServiceReference(BService.class, "bReference");
- return bSR.getService().getBName();
- }
-
- public String getSelfReferenceName() {
- ServiceReference<AComponent> aSR = componentContext.createSelfReference(AComponent.class);
- return aSR.getService().getName();
- }
-
- public String getProperty() {
- return componentContext.getProperty(String.class, "aProperty");
- }
-
- public String getRequestContextServiceName() {
- return componentContext.getRequestContext().getServiceName();
- }
-
- public String getCastCallableReferenceServiceName() {
- BService b = componentContext.getService(BService.class, "bReference");
- CallableReference<BService> bCR = componentContext.cast(b);
- return bCR.getService().getBName();
- }
-
- public String getCastServiceReferenceServiceName() {
- BService b = componentContext.getService(BService.class, "bReference");
- ServiceReference<BService> bSR = componentContext.cast(b);
- return bSR.getService().getBName();
- }
-
- public void illegalCast() {
- componentContext.cast("");
- }
-
- public String testServiceLookup() {
- return componentContext.getService(DComponent.class, "dReference").getName();
- }
-
- public String getRequestContextContent() {
- return rcContent;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java
deleted file mode 100644
index 157864fd27..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BService;
-import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.CService;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(interfaces={BService.class, CService.class})
-public class BComponentImpl implements BService, CService {
-
- protected ComponentContext componentContext;
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public String getBName() {
- return "ServiceB";
- }
-
- public String getCName() {
- return "ServiceC";
- }
-
- public String getSelfReferenceWithServiceName() {
- ServiceReference<CService> cSR = componentContext.createSelfReference(CService.class, "CService");
- return cSR.getService().getCName();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.java
deleted file mode 100644
index 9432c70ff3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.DComponent;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(DComponent.class)
-public class DComponentImpl implements DComponent {
-
- public String getName() {
- return "ComponentD";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite
deleted file mode 100644
index 19f110d5dc..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java-api-tests"
- name="AB-Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl.AComponentImpl"/>
- <reference name="bReference" target="BComponent/BService"/>
- <reference name="dReference" target="DComponent"/>
- <property name="aProperty" type="xsd:string">PropertyA</property>
- </component>
-
- <component name="AUnannotatedComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl.AUnannotatedComponentImpl"/>
- <reference name="bReference" target="BComponent/BService"/>
- <reference name="dReference" target="DComponent"/>
- <property name="aProperty" type="xsd:string">PropertyA</property>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl.BComponentImpl"/>
- </component>
-
- <component name="DComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl.DComponentImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
deleted file mode 100644
index e9352a5c06..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * This test class tests the ComponentContext interface described in 1.7.1 of
- * the SCA Java Annotations & APIs Specification 1.0. Relevant sections of 1.4
- * will also be covered here.
- */
-public class ComponentContextTestCase {
-
- protected static String compositeName = "ab.composite";
- protected static AComponent a;
- protected static AComponent aUnannotated;
- protected static BService b;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a = ServiceFinder.getService(AComponent.class, "AComponent");
- aUnannotated = ServiceFinder.getService(AComponent.class, "AUnannotatedComponent");
- b = ServiceFinder.getService(BService.class, "BComponent/BService");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Lines 776 <br>
- * getURI() - Returns the absolute URI of the component within the SCA
- * domain.
- *
- * @throws Exception
- */
- @Test
- public void testGetURI() throws Exception {
- Assert.assertEquals("AComponent", a.getContextURI());
- Assert.assertEquals("AUnannotatedComponent", aUnannotated.getContextURI());
- }
-
- /**
- * Lines 778 <br>
- * getService(Class&lt;B&gt; businessInterface, String referenceName) ?
- * Returns a proxy for the reference defined by the current component.
- *
- * @throws Exception
- */
- @Test
- public void testGetService() throws Exception {
- Assert.assertEquals(a.getServiceBName(), "ServiceB");
- }
-
- /**
- * Lines 780 <br>
- * getServiceReference(Class&lt;B&gt; businessInterface, String
- * referenceName) ? Returns a ServiceReference defined by the current
- * component.
- *
- * @throws Exception
- */
- @Test
- public void testGetServiceReference() throws Exception {
- Assert.assertEquals(a.getServiceReferenceBName(), "ServiceB");
- }
-
- /**
- * Lines 783 <br>
- * createSelfReference(Class&lt;B&gt; businessInterface) ? Returns a
- * ServiceReference that can be used to invoke this component over the
- * designated service.
- *
- * @throws Exception
- */
- @Test
- public void testCreateSelfReference() throws Exception {
- Assert.assertEquals(a.getSelfReferenceName(), "ComponentA");
- }
-
- /**
- * Lines 785 <br>
- * getSelfReference(Class&lt;B&gt; businessInterface, String serviceName) -
- * Returns a ServiceReference that can be used to invoke this component over
- * the designated service. Service name explicitly declares the service name
- * to invoke.
- *
- * @throws Exception
- */
- @Test
- public void testCreateSelfReferenceWithServiceName() throws Exception {
- Assert.assertEquals("ServiceC", b.getSelfReferenceWithServiceName());
- }
-
- /**
- * Lines 788 <br>
- * getProperty (Class&lt;B&gt; type, String propertyName) - Returns the
- * value of an SCA property defined by this component.
- *
- * @throws Exception
- */
- @Test
- public void testGetProperty() throws Exception {
- Assert.assertEquals("PropertyA", a.getProperty());
- }
-
- /**
- * Lines 793 <br>
- * getRequestContext() - Returns the context for the current SCA service
- * request, or null if there is no current request or if the context is
- * unavailable.
- *
- * @throws Exception
- */
- @Test
- public void testGetRequestContext() throws Exception {
- Assert.assertEquals("AComponent", a.getRequestContextServiceName());
- Assert.assertEquals("NotNull", a.getRequestContextContent());
- }
-
- /**
- * Lines 790,794 <br>
- * cast(B target) - Casts a type-safe reference to a CallableReference.
- *
- * @throws Exception
- */
- @Test
- public void testCast() throws Exception {
- Assert.assertEquals("ServiceB", a.getCastCallableReferenceServiceName());
- Assert.assertEquals("ServiceB", a.getCastServiceReferenceServiceName());
-
- String check = "";
- try {
- a.illegalCast();
- } catch (IllegalArgumentException iae) {
- check = "IllegalCast";
- } catch (ServiceRuntimeException sre) {
- if (sre.getCause() instanceof IllegalArgumentException) {
- check = "IllegalCast";
- }
- }
- Assert.assertEquals("IllegalCast", check);
- }
-
- /**
- * Lines 342-344 <br>
- * When a component implementation needs access to a service where the
- * reference to the service is not known at compile time, the reference can
- * be located using the component?s ComponentContext.
- *
- * @throws Exception
- */
- @Test
- @Ignore("TUSCANY-2609")
- public void testServiceLookup() throws Exception {
- Assert.assertEquals("ComponentD", a.testServiceLookup());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/pom.xml
deleted file mode 100644
index 3e0f1c609f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-apis</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-apis-conversation</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - Conversation</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/AComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/AComponent.java
deleted file mode 100644
index 845c10303e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/AComponent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.conversation;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service A.
- */
-@Conversational
-public interface AComponent {
-
- public String getName();
-
- public void testConversation();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/BComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/BComponent.java
deleted file mode 100644
index a3148aa0d7..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/BComponent.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.conversation;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-
-/**
- * Simple Service B.
- */
-@Conversational
-public interface BComponent {
-
- public String getName();
-
- public void testCustomConversationID();
- public void testGeneratedConversationID(Object id);
-
- @EndsConversation
- public void endsConversation();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/AComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/AComponentImpl.java
deleted file mode 100644
index 7160121388..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/AComponentImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.conversation.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.conversation.AComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.conversation.BComponent;
-import org.junit.Assert;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.Conversation;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AComponent.class)
-@Scope("CONVERSATION")
-public class AComponentImpl implements AComponent {
-
- protected ComponentContext componentContext;
-
- @Reference
- protected CallableReference<BComponent> bReference;
-
- @ConversationID
- protected String cid;
-
- public String getName() {
- return "ComponentA";
- }
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public void testConversation() {
- ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
- bSR.setConversationID("AConversationID");
- bSR.getService().testCustomConversationID();
-
- Conversation bc = bSR.getConversation();
- Assert.assertEquals("AConversationID", bc.getConversationID());
- bc.end();
-
- Assert.assertEquals("ComponentB", bReference.getService().getName());
- bReference.getService().testGeneratedConversationID(bReference.getConversation().getConversationID());
- bReference.getConversation().end();
-
- Assert.assertEquals(1, BComponentImpl.customInitCount);
- Assert.assertEquals(1, BComponentImpl.customDestroyCount);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/BComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/BComponentImpl.java
deleted file mode 100644
index c487559ca1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/impl/BComponentImpl.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.conversation.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.conversation.BComponent;
-import org.junit.Assert;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.ConversationID;
-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(BComponent.class)
-@Scope("CONVERSATION")
-public class BComponentImpl implements BComponent {
-
- public static int customInitCount = 0;
- public static int customDestroyCount = 0;
-
- protected ComponentContext componentContext;
-
- @ConversationID
- protected String cid;
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public String getName() {
- return "ComponentB";
- }
-
- public void testCustomConversationID() {
- Assert.assertEquals("AConversationID", cid);
- }
-
- public void testGeneratedConversationID(Object id) {
- Assert.assertEquals(id.toString(), cid);
- }
-
- public void endsConversation() {
- }
-
- @Init
- public void initB() {
- if (cid.equals("AConversationID")) {
- customInitCount++;
- }
- }
-
- @Destroy
- public void destroyB() {
- if (cid.equals("AConversationID")) {
- customDestroyCount++;
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/resources/conversation.composite b/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/resources/conversation.composite
deleted file mode 100644
index 87cab2f479..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/main/resources/conversation.composite
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java-api-tests"
- name="Conversation-Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.conversation.impl.AComponentImpl"/>
- <reference name="bReference" target="BComponent"/>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.conversation.impl.BComponentImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java
deleted file mode 100644
index 9b46ac5e08..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/conversation/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/conversation/ConversationTestCase.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.conversation;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This test class tests the Conversation interface described in 1.7.5 of the
- * SCA Java Annotations & APIs Specification 1.0.
- */
-public class ConversationTestCase {
-
- protected static String compositeName = "conversation.composite";
- protected static AComponent a;
- protected static BComponent b;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a = ServiceFinder.getService(AComponent.class, "AComponent");
- b = ServiceFinder.getService(BComponent.class, "BComponent");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Lines 941, 942 <br>
- * getConversationID() – Returns the identifier for this conversation. If a
- * user-defined identity had been supplied for this reference then its value
- * will be returned; otherwise the identity generated by the system when the
- * conversation was initiated will be returned. <br>
- * end() – Ends this conversation.
- *
- * @throws Exception
- */
- @Test
- public void testConversation() throws Exception {
- a.testConversation();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/pom.xml
deleted file mode 100644
index 48588acb19..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-apis</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-apis-exception</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - Exception</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java
deleted file mode 100644
index 90582e88a2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/AComponent.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service A.
- */
-@Conversational
-public interface AComponent {
-
- public String getName();
-
- public void testConversation();
- public void testCallBack();
-
- public boolean testServiceRuntimeException();
- public boolean testServiceUnavailableException();
-
- public boolean testCheckedException();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java
deleted file mode 100644
index c1c1c6544c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BCallback.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception;
-
-public interface BCallback {
-
- public void processResults(String result);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.java
deleted file mode 100644
index 11886277ad..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/BComponent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception;
-
-import org.oasisopen.sca.annotation.Callback;
-
-/**
- * Simple Service B.
- */
-@Callback(BCallback.class)
-public interface BComponent {
-
- public String getName();
-
- public void testCallback();
- public void testRedirectedCallback();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java
deleted file mode 100644
index 466a32731a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/CComponent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service C.
- */
-@Conversational
-public interface CComponent {
-
- public String getName();
-
- public void testConversation();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java
deleted file mode 100644
index c0aed7a707..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DComponent.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remote Service D.
- */
-@Remotable
-public interface DComponent {
-
- public String getName();
- public void testException() throws DException;
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java
deleted file mode 100644
index 82873ed96d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/DException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception;
-
-public class DException extends Exception {
-
- private static final long serialVersionUID = -3819913841563109423L;
-
- public DException(String message) {
- super(message);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java
deleted file mode 100644
index 1190e6900f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/AComponentImpl.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.exception.AComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.exception.BComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.exception.CComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DException;
-import org.junit.Assert;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ConversationEndedException;
-import org.oasisopen.sca.NoRegisteredCallbackException;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.ServiceRuntimeException;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AComponent.class)
-@Scope("CONVERSATION")
-public class AComponentImpl implements AComponent {
-
- protected ComponentContext componentContext;
-
- @Reference
- protected CallableReference<BComponent> bReference;
-
- @Reference
- protected ServiceReference<CComponent> cReference;
-
- @Reference
- protected ServiceReference<DComponent> dReference;
-
- @ConversationID
- protected String cid;
-
- public String getName() {
- return "ComponentA";
- }
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public void testConversation() {
- ServiceReference<CComponent> cSR = componentContext.getServiceReference(CComponent.class, "cReference");
- cSR.setConversationID("AConversationID");
- Assert.assertEquals("ComponentC", cSR.getService().getName());
-
- try {
- Thread.sleep(1100);
- cSR.getService().testConversation();
-
- Assert.fail();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- } catch (ConversationEndedException cee) {
- // Expected
- }
- }
-
- public void testCallBack() {
- ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
- bSR.setCallbackID("ComponentACallBack");
-
- try {
- bSR.getService().testCallback();
- Assert.fail();
- } catch (NoRegisteredCallbackException e) {
- // Expected
- }
- }
-
- public boolean testServiceRuntimeException() {
- try {
- componentContext.getServiceReference(BComponent.class, "dummyBReference").getService().getName();
- } catch (ServiceRuntimeException sre) {
- return true;
- }
-
- return false;
- }
-
- public boolean testServiceUnavailableException() {
- return false;
- }
-
- public boolean testCheckedException() {
- try {
- dReference.getService().testException();
- } catch (DException e) {
- if (e.getMessage().equals("ADException")) {
- return true;
- }
- }
-
- return false;
- }
-
- @Destroy
- public void destroy() {
- System.out.println("This is a Destroy of AComponent ..");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.java
deleted file mode 100644
index eca4b54109..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/BComponentImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.exception.BCallback;
-import org.apache.tuscany.sca.vtest.javaapi.apis.exception.BComponent;
-import org.junit.Assert;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BComponent.class)
-public class BComponentImpl implements BComponent {
-
- protected ComponentContext componentContext;
-
- @Callback
- protected BCallback callback;
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public String getName() {
- return "ComponentB";
- }
-
- public void testCallback() {
- callback = componentContext.getRequestContext().getCallback();
- callback.processResults("CallBackFromB");
-
- CallableReference<BCallback> bCR = componentContext.getRequestContext().getCallbackReference();
- Assert.assertEquals("ComponentACallBack", bCR.getCallbackID());
- }
-
- public void testRedirectedCallback() {
- callback = componentContext.getRequestContext().getCallback();
- callback.processResults("RedirectedCallBackFromB");
-
- CallableReference<BCallback> bCR = componentContext.getRequestContext().getCallbackReference();
- Assert.assertEquals("RedirectedCallBack", bCR.getCallbackID());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java
deleted file mode 100644
index 57a34716e6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/CComponentImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.exception.CComponent;
-import org.junit.Assert;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CComponent.class)
-@Scope("CONVERSATION")
-@ConversationAttributes(maxIdleTime="1 seconds")
-public class CComponentImpl implements CComponent {
-
- @Context
- protected RequestContext requestContext;
-
- @ConversationID
- protected String cid;
-
- public String getName() {
- return "ComponentC";
- }
-
- public void testConversation() {
- Assert.assertEquals("AConversationID", cid);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java
deleted file mode 100644
index c1f5a56a9a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/impl/DComponentImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.exception.DException;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(DComponent.class)
-public class DComponentImpl implements DComponent {
-
- public String getName() {
- return "ComponentD";
- }
-
- public void testException() throws DException {
- throw new DException("ADException");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/resources/exception.composite b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/resources/exception.composite
deleted file mode 100644
index 5bd933ce96..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/main/resources/exception.composite
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java-api-tests"
- name="Exception-Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.exception.impl.AComponentImpl"/>
- <reference name="bReference" target="BComponent"/>
- <reference name="cReference" target="CComponent"/>
- <reference name="dReference" target="DComponent"/>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.exception.impl.BComponentImpl"/>
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.exception.impl.CComponentImpl"/>
- </component>
-
- <component name="DComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.exception.impl.DComponentImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java
deleted file mode 100644
index da7b1da0fa..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/exception/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/exception/ExceptionTestCase.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.exception;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * This test class tests the Exceptions described in 1.7.6, 1.7.7, 1.7.8, and 1.7.9 of the SCA Java Annotations & APIs Specification 1.0.
- * This also covers 1.5 of the specification.
- */
-public class ExceptionTestCase {
-
- protected static SCADomain domain;
- protected static String compositeName = "exception.composite";
- protected static AComponent a;
- protected static BComponent b;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- domain = SCADomain.newInstance(compositeName);
- a = domain.getService(AComponent.class, "AComponent");
- b = domain.getService(BComponent.class, "BComponent");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- if (domain != null) {
- domain.close();
- }
- }
-
- /**
- * Lines 951 <br>
- * NoRegisteredCallbackException.
- *
- * @throws Exception
- */
- @Test
- public void testNoRegisteredCallbackException() throws Exception {
- a.testCallBack();
- }
-
- /**
- * Lines 960 <br>
- * ServiceRuntimeException - This exception signals problems in the management of SCA component execution.
- *
- * @throws Exception
- */
- @Test
- public void testServiceRuntimeException() throws Exception {
- Assert.assertTrue(a.testServiceRuntimeException());
- }
-
- /**
- * Lines 970 <br>
- * ServiceUnavailableException – This exception signals problems in the interaction with remote services.
- *
- * @throws Exception
- */
- @Test
- //@Ignore
- public void testServiceUnavailableException() throws Exception {
- domain.getComponentManager().stopComponent("AComponent");
-
- try {
- a.getName();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- try {
- AComponent ac = domain.getService(AComponent.class, "AComponent");
- ac.getName();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- domain.getComponentManager().startComponent("AComponent");
- }
-
- /**
- * Lines 983 <br>
- * ConversationEndedException.
- *
- * @throws Exception
- */
- @Test
- public void testConversationEndedException() throws Exception {
- a.testConversation();
- }
-
- /**
- * Lines 360-361 <br>
- * Business exceptions are thrown by the implementation of the called service method,
- * and are defined as checked exceptions on the interface that types the service.
- *
- * @throws Exception
- */
- @Test
- public void testCheckedException() throws Exception {
- Assert.assertTrue(a.testCheckedException());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/apis/pom.xml
deleted file mode 100644
index 1f74f0e39a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-java-api</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>java-api-apis</artifactId>
- <packaging>pom</packaging>
-
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>componentcontext</module>
- <module>requestcontext</module>
- <module>callablereference</module>
- <module>servicereference</module>
- <module>conversation</module>
- <module>exception</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/pom.xml
deleted file mode 100644
index efb0474579..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-apis</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-apis-requestcontext</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - RequestContext</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/AComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/AComponent.java
deleted file mode 100644
index 6fec5cada3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/AComponent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext;
-
-/**
- * Simple Service A.
- */
-public interface AComponent {
-
- public String getName();
-
- public boolean isJAASSubject();
- public String getServiceName();
- public String getCallbackResult();
- public String getServiceReferenceName();
- public String getCallbackServiceReferenceName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BCallback.java
deleted file mode 100644
index 4dd2088f90..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BCallback.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext;
-
-public interface BCallback {
-
- public String getCallbackName();
- public void processResults(String result);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BComponent.java
deleted file mode 100644
index d913e95a53..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/BComponent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext;
-
-import org.oasisopen.sca.annotation.Callback;
-
-/**
- * Simple Service B.
- */
-@Callback(BCallback.class)
-public interface BComponent {
-
- public String getName();
-
- public void testCallback();
- public String getServiceReferenceName();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/AComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/AComponentImpl.java
deleted file mode 100644
index 5d3cbf6e3d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/AComponentImpl.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.impl;
-
-import javax.security.auth.Subject;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.AComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.BCallback;
-import org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.BComponent;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AComponent.class)
-public class AComponentImpl implements AComponent, BCallback {
-
- private static Object monitor = new Object();
- private static String returnMessage = null;
- private static CallableReference<BCallback> cbCR;
-
- protected ComponentContext componentContext;
-
- @Reference
- protected BComponent bReference;
-
- public String getName() {
- return "ComponentA";
- }
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public boolean isJAASSubject() {
- return componentContext.getRequestContext().getSecuritySubject() instanceof Subject;
- }
-
- public String getServiceName() {
- return componentContext.getRequestContext().getServiceName();
- }
-
- public String getCallbackResult() {
- ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
- String cbID = "ComponentACallBack";
- bSR.setCallbackID(cbID);
- bSR.getService().testCallback();
-
- // Wait for 30s max.
- int count = 0;
- synchronized(monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- return returnMessage;
- }
-
- public void processResults(String result) {
- returnMessage = result;
- cbCR = componentContext.getRequestContext().getServiceReference();
- }
-
- public String getServiceReferenceName() {
- CallableReference<AComponent> aCR = componentContext.getRequestContext().getServiceReference();
- return aCR.getService().getName();
- }
-
- public String getCallbackServiceReferenceName() {
- return cbCR.getService().getCallbackName();
- }
-
- public String getCallbackName() {
- return "CallBackB";
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/BComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/BComponentImpl.java
deleted file mode 100644
index d358736daa..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/impl/BComponentImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.BCallback;
-import org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.BComponent;
-import org.junit.Assert;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BComponent.class)
-public class BComponentImpl implements BComponent {
-
- protected ComponentContext componentContext;
-
- @Callback
- protected BCallback callback;
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public String getName() {
- return "ComponentB";
- }
-
- public void testCallback() {
- callback = componentContext.getRequestContext().getCallback();
- callback.processResults("CallBackFromB");
-
- CallableReference<BCallback> bCR = componentContext.getRequestContext().getCallbackReference();
- Assert.assertEquals("ComponentACallBack", bCR.getCallbackID());
- }
-
- public String getServiceReferenceName() {
- CallableReference<BComponent> bCR = componentContext.getRequestContext().getServiceReference();
- return bCR.getService().getName();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/resources/requestcontext.composite b/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/resources/requestcontext.composite
deleted file mode 100644
index 4aa5eeb25a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/main/resources/requestcontext.composite
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java-api-tests"
- name="RequestContext-Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.impl.AComponentImpl"/>
- <reference name="bReference" target="BComponent"/>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext.impl.BComponentImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java
deleted file mode 100644
index e3b761bd37..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/requestcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/requestcontext/RequestContextTestCase.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.requestcontext;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * This test class tests the RequestContext interface described in 1.7.2 of the
- * SCA Java Annotations & APIs Specification 1.0.
- */
-public class RequestContextTestCase {
-
- protected static String compositeName = "requestcontext.composite";
- protected static AComponent a;
- protected static BComponent b;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a = ServiceFinder.getService(AComponent.class, "AComponent");
- b = ServiceFinder.getService(BComponent.class, "BComponent");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Lines 858 <br>
- * getSecuritySubject() – Returns the JAAS Subject of the current request.
- *
- * @throws Exception
- */
- @Ignore("TUSCANY-2608")
- public void testGetSecuritySubject() throws Exception {
- Assert.assertTrue(a.isJAASSubject());
- }
-
- /**
- * Lines 860 <br>
- * getServiceName() – Returns the name of the service on the Java
- * implementation the request came in on.
- *
- * @throws Exception
- */
- @Test
- public void testGetServiceName() throws Exception {
- Assert.assertEquals("AComponent", a.getServiceName());
- }
-
- /**
- * Lines 861, 862 <br>
- * getCallbackReference() – Returns a callable reference to the callback as
- * specified by the caller. getCallback() – Returns a proxy for the callback
- * as specified by the caller.
- *
- * @throws Exception
- */
- @Test
- public void testGetCallback() throws Exception {
- Assert.assertEquals("CallBackFromB", a.getCallbackResult());
- }
-
- /**
- * Lines 863 <br>
- * getServiceReference() – When invoked during the execution of a service
- * operation, this API MUST return a CallableReference that represents the
- * service. When invoked during the execution of a callback operation, this
- * API MUST return a CallableReference that represents the callback service.
- *
- * @throws Exception
- */
- @Test
- public void testGetServiceReference() throws Exception {
- Assert.assertEquals("ComponentA", a.getServiceReferenceName());
- Assert.assertEquals("ComponentB", b.getServiceReferenceName());
- Assert.assertEquals("CallBackB", a.getCallbackServiceReferenceName());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/pom.xml
deleted file mode 100644
index 57822d856d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-apis</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-apis-servicereference</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - ServiceReference</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/AComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/AComponent.java
deleted file mode 100644
index 6de5d6810e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/AComponent.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.servicereference;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service A.
- */
-@Conversational
-public interface AComponent {
-
- public String getName();
-
- public void testConversationID();
- public String getCallbackResult();
- public void redirectCallback();
- public void testGetCallback();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BCallback.java
deleted file mode 100644
index f8c5c1272f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BCallback.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.servicereference;
-
-public interface BCallback {
-
- public void processResults(String result);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BComponent.java
deleted file mode 100644
index 65a444d100..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/BComponent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.servicereference;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service B.
- */
-@Conversational
-@Callback(BCallback.class)
-public interface BComponent {
-
- public String getName();
-
- public void testCallback();
- public void testConversationID();
- public void testRedirectedCallback();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/CComponent.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/CComponent.java
deleted file mode 100644
index 28c90e2071..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/CComponent.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.servicereference;
-
-/**
- * Simple Service C.
- */
-public interface CComponent extends BCallback {
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/AComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/AComponentImpl.java
deleted file mode 100644
index 86dc80a4e1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/AComponentImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.AComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.BCallback;
-import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.BComponent;
-import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.CComponent;
-import org.junit.Assert;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AComponent.class)
-@Scope("CONVERSATION")
-public class AComponentImpl implements AComponent, BCallback {
-
- private static Object monitor = new Object();
- private static String returnMessage = null;
-
- protected ComponentContext componentContext;
-
- @Reference
- protected CallableReference<BComponent> bReference;
-
- @Reference
- protected ServiceReference<CComponent> cReference;
-
- @ConversationID
- protected String cid;
-
- public String getName() {
- return "ComponentA";
- }
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public void testConversationID() {
- ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
- bSR.setConversationID("AConversationID");
- bSR.getService().testConversationID();
-
- Assert.assertEquals("AConversationID", bSR.getConversation().getConversationID());
- }
-
- public String getCallbackResult() {
- ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
- String cbID = "ComponentACallBack";
- bSR.setCallbackID(cbID);
- bSR.getService().testCallback();
-
- // Wait for 30s max.
- int count = 0;
- synchronized(monitor) {
- while (returnMessage == null && count++ < 30) {
- try {
- monitor.wait(1000L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- return returnMessage;
- }
-
- public void processResults(String result) {
- returnMessage = result;
- }
-
- public void redirectCallback() {
- ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
- bSR.setCallbackID("RedirectedCallBack");
- bSR.setCallback(cReference);
- bSR.getService().testRedirectedCallback();
- }
-
- public void testGetCallback() {
- ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
- bSR.setCallback(cReference);
- Assert.assertEquals(cReference, bSR.getCallback());
-
- TestObject aCallback = new TestObject();
- bSR.setCallback(aCallback);
- Assert.assertEquals(aCallback, bSR.getCallback());
- Assert.assertEquals(1, ((TestObject) bSR.getCallback()).getId());
-
- TestObject bCallback = new TestObject();
- bSR.setCallback(bCallback);
- Assert.assertEquals(bCallback, bSR.getCallback());
- Assert.assertEquals(2, ((TestObject) bSR.getCallback()).getId());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/BComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/BComponentImpl.java
deleted file mode 100644
index c5af80291e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/BComponentImpl.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.BCallback;
-import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.BComponent;
-import org.junit.Assert;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BComponent.class)
-@Scope("CONVERSATION")
-public class BComponentImpl implements BComponent {
-
- protected ComponentContext componentContext;
-
- @Callback
- protected BCallback callback;
-
- @ConversationID
- protected String cid;
-
- @Context
- public void setComponentContext(ComponentContext context) {
- this.componentContext = context;
- }
-
- public String getName() {
- return "ComponentB";
- }
-
- public void testCallback() {
- callback = componentContext.getRequestContext().getCallback();
- callback.processResults("CallBackFromB");
-
- CallableReference<BCallback> bCR = componentContext.getRequestContext().getCallbackReference();
- Assert.assertEquals("ComponentACallBack", bCR.getCallbackID());
- }
-
- public void testConversationID() {
- Assert.assertEquals("AConversationID", cid);
- }
-
- public void testRedirectedCallback() {
- callback = componentContext.getRequestContext().getCallback();
- callback.processResults("RedirectedCallBackFromB");
-
- CallableReference<BCallback> bCR = componentContext.getRequestContext().getCallbackReference();
- Assert.assertEquals("RedirectedCallBack", bCR.getCallbackID());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/CComponentImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/CComponentImpl.java
deleted file mode 100644
index 563d3ceab6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/CComponentImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.CComponent;
-import org.junit.Assert;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CComponent.class)
-public class CComponentImpl implements CComponent {
-
- @Context
- protected RequestContext requestContext;
-
- public void processResults(String result) {
- Assert.assertEquals("RedirectedCallBackFromB", result);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/TestObject.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/TestObject.java
deleted file mode 100644
index ba3edf13ae..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/impl/TestObject.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.impl;
-
-public class TestObject {
-
- public static int count = 0;
-
- private int id;
-
- public TestObject() {
- count++;
- id = count;
- }
-
- public int getId() {
- return id;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/resources/servicereference.composite b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/resources/servicereference.composite
deleted file mode 100644
index 9bded61947..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/main/resources/servicereference.composite
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://java-api-tests"
- name="ServiceReference-Composite">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.impl.AComponentImpl"/>
- <reference name="bReference" target="BComponent"/>
- <reference name="cReference" target="CComponent"/>
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.impl.BComponentImpl"/>
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.servicereference.impl.CComponentImpl"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java
deleted file mode 100644
index fda917d60a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/apis/servicereference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/servicereference/ServiceReferenceTestCase.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.apis.servicereference;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This test class tests the ServiceReference interface described in 1.7.4 of
- * the SCA Java Annotations & APIs Specification 1.0.
- */
-public class ServiceReferenceTestCase {
-
- protected static String compositeName = "servicereference.composite";
- protected static AComponent a;
- protected static BComponent b;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a = ServiceFinder.getService(AComponent.class, "AComponent");
- b = ServiceFinder.getService(BComponent.class, "BComponent");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Lines 915-916 <br>
- * getConversationID() - Returns the id supplied by the user that will be
- * associated with conversations initiated through this reference. <br>
- * setConversationID(Object conversationId) – Set the id to associate with
- * any conversation started through this reference. If the value supplied is
- * null then the id will be generated by the implementation. Throws an
- * IllegalStateException if a conversation is currently associated with this
- * reference.
- *
- * @throws Exception
- */
- @Test
- public void testConversationID() throws Exception {
- a.testConversationID();
- }
-
- /**
- * Lines 917 <br>
- * setCallbackID(Object callbackID) – Sets the callback ID.
- *
- * @throws Exception
- */
- @Test
- public void testSetCallbackID() throws Exception {
- Assert.assertEquals("CallBackFromB", a.getCallbackResult());
- }
-
- /**
- * Lines 918 <br>
- * getCallback() – Returns the callback object.
- *
- * @throws Exception
- */
- @Test
- public void testGetCallback() throws Exception {
- a.testGetCallback();
- }
-
- /**
- * Lines 919 <br>
- * setCallback(Object callback) – Sets the callback object.
- *
- * @throws Exception
- */
- @Test
- public void testSetCallback() throws Exception {
- a.redirectCallback();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/pom.xml
deleted file mode 100644
index a22d213b93..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-conversation-callback</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Conversation - Callback</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
deleted file mode 100644
index e78736d4df..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback;
-
-/**
- * Simple Service
- */
-public interface AService {
-
- public void testCallback();
-
- public void testCallback2();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
deleted file mode 100644
index f4271d0d92..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-@Conversational
-public interface AServiceCallback {
-
- public void callBack(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
deleted file mode 100644
index d7ecbb7427..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-@Conversational
-@Callback(AServiceCallback.class)
-public interface BService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack(String string);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java
deleted file mode 100644
index be7ea97eac..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-@Conversational
-public interface BServiceCallback {
-
- public void callBack(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CService.java
deleted file mode 100644
index 19a8b86f28..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-@Conversational
-@Callback(BServiceCallback.class)
-public interface CService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack(String string);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java
deleted file mode 100644
index 15672f9ee0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback;
-
-public class Utilities {
-
- public static void delayQuarterSecond() {
- try {
- Thread.sleep(250);// millisecs
- } catch (InterruptedException ex) {
- throw new Error(ex);
- }
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/AServiceCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/AServiceCallback.java
deleted file mode 100644
index 31479f1848..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/AServiceCallback.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-@Conversational
-public interface AServiceCallback {
-
- public void callBack(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/BService.java
deleted file mode 100644
index b6359f348b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/BService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-@Conversational
-@Callback(AServiceCallback.class)
-public interface BService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack(String string);
-
- public void testCallBack2(String string);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/AServiceImpl.java
deleted file mode 100644
index 9e8b64e3b9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/AServiceImpl.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.BService;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-@Scope("CONVERSATION")
-public class AServiceImpl implements AService, AServiceCallback {
-
- @Reference
- protected ServiceReference<BService> b;
-
- private String someState;
-
- public void callBack(String someState) {
- System.out.println("A-callback called with this state => " + someState);
- this.someState = someState;
- }
-
- public void testCallback() {
- b.getService().testCallBack("Some string");
- int count = 4;
- while (someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (someState == null)
- Assert.fail("Callback not received by this instance");
- }
-
- public void testCallback2() {
- b.getService().testCallBack2("Some string");
- int count = 4;
- while (someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (someState == null)
- Assert.fail("Callback not received by this instance");
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/BServiceImpl.java
deleted file mode 100644
index acf262512e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/BServiceImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.BService;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl implements BService {
-
- String someState;
-
- @Callback
- protected CallableReference<AServiceCallback> callback;
-
- @Context
- protected ComponentContext componentContext;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void testCallBack(String someState) {
- callback.getService().callBack(someState);
- }
-
- public void testCallBack2(String someState) {
- AServiceCallback callback = componentContext.getRequestContext().getCallback();
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/AServiceCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/AServiceCallback.java
deleted file mode 100644
index b1439770da..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/AServiceCallback.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-@Conversational
-public interface AServiceCallback {
-
- public void callBack(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/BService.java
deleted file mode 100644
index dae4152333..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/BService.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-@Conversational
-@Callback(AServiceCallback.class)
-public interface BService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack(String string);
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/CustomCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/CustomCallback.java
deleted file mode 100644
index d1a30fd305..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/CustomCallback.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-@Conversational
-public interface CustomCallback {
-
- public void someMethod();
-
- public void callBack(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/AServiceImpl.java
deleted file mode 100644
index 7732b3865f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/AServiceImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.CustomCallback;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-@Scope("CONVERSATION")
-public class AServiceImpl implements AService {
-
- @Reference
- protected ServiceReference<BService> b;
-
- @Reference
- protected CustomCallback customCallback;
-
- protected static String someState;
-
- public void testCallback() {
- b.setCallback(customCallback);
- b.getService().testCallBack("Some string");
- int count = 4;
- while (someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (someState == null)
- Assert.fail("Callback not received by this instance");
- }
-
- public void testCallback2() {
- Assert.fail("Should never get here");
-
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/BServiceImpl.java
deleted file mode 100644
index 9bda00413b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/BServiceImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.BService;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl implements BService {
-
- String someState;
-
- @Callback
- protected AServiceCallback callback;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void testCallBack(String someState) {
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/CustomCallbackImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/CustomCallbackImpl.java
deleted file mode 100644
index 1bbc1fa4eb..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/CustomCallbackImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.CustomCallback;
-import org.oasisopen.sca.annotation.Scope;
-
-@Scope("CONVERSATION")
-public class CustomCallbackImpl implements CustomCallback, AServiceCallback {
-
- public void someMethod() {
- System.out.println("Custom-callback some method called");
- }
-
- public void callBack(String someState) {
- System.out.println("Custom-callback called with this state => " + someState);
- AServiceImpl.someState = someState;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/AServiceCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/AServiceCallback.java
deleted file mode 100644
index 6a66e73569..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/AServiceCallback.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-@Conversational
-public interface AServiceCallback {
-
- public void callBack(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/BService.java
deleted file mode 100644
index 24dbad3d4a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/BService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-@Conversational
-@Callback(AServiceCallback.class)
-public interface BService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack(String string);
-
- public void testCallBack2(String string);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/AServiceImpl.java
deleted file mode 100644
index b9785fa657..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/AServiceImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.BService;
-import org.junit.Assert;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-@Scope("CONVERSATION")
-public class AServiceImpl implements AService, AServiceCallback {
-
- @Reference
- protected ServiceReference<BService> b;
-
- @Context
- protected RequestContext requestContext;
-
- private String someState;
-
- public void callBack(String someState) {
- System.out.println("A-callback called with this state => " + someState);
- Assert.assertNotNull(requestContext.getServiceReference().getCallbackID());
- this.someState = someState;
- }
-
- public void testCallback() {
- b.getService().testCallBack("Some string");
- int count = 4;
- while (someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (someState == null)
- Assert.fail("Callback not received by this instance");
- }
-
- public void testCallback2() {
- b.getService().testCallBack2("Some string");
- int count = 4;
- while (someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (someState == null)
- Assert.fail("Callback not received by this instance");
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/BServiceImpl.java
deleted file mode 100644
index dc546a81a0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/BServiceImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.BService;
-import org.oasisopen.sca.CallableReference;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl implements BService {
-
- String someState;
-
- @Callback
- protected CallableReference<AServiceCallback> callback;
-
- @Context
- protected ComponentContext componentContext;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void testCallBack(String someState) {
- callback.getService().callBack(someState);
- }
-
- public void testCallBack2(String someState) {
- AServiceCallback callback = componentContext.getRequestContext().getCallback();
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
deleted file mode 100644
index 01260c67f1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-@Scope("CONVERSATION")
-public class AServiceImpl implements AService, AServiceCallback {
-
- @Reference
- protected ServiceReference<BService> b;
-
- private String someState;
-
- public void callBack(String someState) {
- System.out.println("A-callback called with this state => " + someState);
- this.someState = someState;
- }
-
- public void testCallback() {
- b.getService().testCallBack("Some string");
- int count = 4;
- while (someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (someState == null)
- Assert.fail("Callback not received by this instance");
- }
-
- public void testCallback2() {
- Assert.fail("Should not be called");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java
deleted file mode 100644
index 78dfe7221f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.CService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl implements BService, BServiceCallback {
-
- String someState;
-
- @Callback
- protected AServiceCallback callback;
-
- @Reference
- protected ServiceReference<CService> c;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void callBack(String someState) {
- System.out.println("B-callback called with this state => " + someState);
- this.someState = someState;
- }
-
- public void testCallBack(String someState) {
-
- c.getService().testCallBack(someState);
- int count = 4;
- while (this.someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (this.someState == null)
- Assert.fail("Callback not received by this instance");
-
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/CServiceImpl.java
deleted file mode 100644
index 6120b815d5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/CServiceImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.CService;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-@Scope("CONVERSATION")
-public class CServiceImpl implements CService {
-
- String someState;
-
- @Callback
- protected BServiceCallback callback;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void testCallBack(String someState) {
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java
deleted file mode 100644
index 50feee41d6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- *
- */
-@Conversational
-public interface AServiceCallback {
-
- public void callBack(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.java
deleted file mode 100644
index 67dd77ce7b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Local Service
- */
-@Conversational
-@Callback(AServiceCallback.class)
-public interface BService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack(String string);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BServiceCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BServiceCallback.java
deleted file mode 100644
index fd19c8d7b1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BServiceCallback.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local;
-
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service
- */
-@Conversational
-public interface BServiceCallback {
-
- public void callBack(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/CService.java
deleted file mode 100644
index c3b2e04ff2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/CService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service
- */
-@Conversational
-@Callback(BServiceCallback.class)
-public interface CService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack(String string);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/AServiceImpl.java
deleted file mode 100644
index 0298b39825..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/AServiceImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.BService;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-@Scope("CONVERSATION")
-public class AServiceImpl implements AService, AServiceCallback {
-
- @Reference
- protected ServiceReference<BService> b;
-
- private String someState;
-
- public void callBack(String someState) {
- System.out.println("A-callback called with this state => " + someState);
- this.someState = someState;
- }
-
- public void testCallback() {
- b.getService().testCallBack("Some local string");
- int count = 4;
- while (someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (someState == null)
- Assert.fail("Callback not received by this instance");
- }
-
- public void testCallback2() {
- Assert.fail("Not implemented");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/BServiceImpl.java
deleted file mode 100644
index 4374306609..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/BServiceImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.BServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.CService;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl implements BService, BServiceCallback {
-
- String someState;
-
- @Callback
- protected AServiceCallback callback;
-
- @Reference
- protected ServiceReference<CService> c;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void callBack(String someState) {
- System.out.println("B-callback called with this state => " + someState);
- this.someState = someState;
- }
-
- public void testCallBack(String someState) {
-
- c.getService().testCallBack(someState);
- int count = 4;
- while (this.someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (this.someState == null)
- Assert.fail("Callback not received by this instance");
-
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/CServiceImpl.java
deleted file mode 100644
index d487c94fd3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/CServiceImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.BServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.CService;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-@Scope("CONVERSATION")
-public class CServiceImpl implements CService {
-
- String someState;
-
- @Callback
- protected BServiceCallback callback;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void testCallBack(String someState) {
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java
deleted file mode 100644
index 164397bf6b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/CService.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BServiceCallback;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-
-/**
- * Simple Service
- */
-@Conversational
-@Callback(BServiceCallback.class)
-public interface CService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack(String string);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java
deleted file mode 100644
index d71c89d565..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.CService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl implements BService, BServiceCallback {
-
- String someState;
-
- @Callback
- protected AServiceCallback callback;
-
- @Reference
- protected ServiceReference<CService> c;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void callBack(String someState) {
- System.out.println("B-callback called with this state => " + someState);
- this.someState = someState;
- }
-
- public void testCallBack(String someState) {
-
- c.getService().testCallBack(someState);
- int count = 4;
- while (this.someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (this.someState == null)
- Assert.fail("Callback not received by this instance");
-
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java
deleted file mode 100644
index 5dcaf9c06f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/CServiceImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.CService;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-@Scope("CONVERSATION")
-public class CServiceImpl implements CService {
-
- String someState;
-
- @Callback
- protected BServiceCallback callback;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void testCallBack(String someState) {
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback.java
deleted file mode 100644
index 4b2ee3a838..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-@Conversational
-public interface AServiceCallback {
-
- public void callBack(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback2.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback2.java
deleted file mode 100644
index 88059ccb45..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback2.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-@Conversational
-public interface AServiceCallback2 {
-
- public void callBack2(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService.java
deleted file mode 100644
index 691dc80632..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-@Conversational
-@Callback(AServiceCallback.class)
-public interface BService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack(String string);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService2.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService2.java
deleted file mode 100644
index 7c691efa8d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService2.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-@Conversational
-@Callback(AServiceCallback2.class)
-public interface BService2 {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack2(String string);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/AServiceImpl.java
deleted file mode 100644
index 272484a6f0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/AServiceImpl.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.AServiceCallback2;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.BService2;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-@Scope("CONVERSATION")
-public class AServiceImpl implements AService, AServiceCallback , AServiceCallback2 {
-
- @Reference
- protected ServiceReference<BService> b;
-
- @Reference
- protected ServiceReference<BService2> b2;
-
-
- private String someState;
- private String someState2;
-
- public void callBack(String someState) {
- System.out.println("A-callback called with this state => " + someState);
- this.someState = someState;
- }
-
- public void callBack2(String someState) {
- System.out.println("A-callback2 called with this state => " + someState);
- this.someState2 = someState;
- }
-
- public void testCallback() {
- b.getService().testCallBack("Some string");
- int count = 4;
- while (someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (someState == null)
- Assert.fail("Callback not received by this instance");
- }
-
- public void testCallback2() {
- b2.getService().testCallBack2("Some string");
- int count = 4;
- while (someState2 == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (someState2 == null)
- Assert.fail("Callback not received by this instance");
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/BServiceImpl.java
deleted file mode 100644
index d9c4866466..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/BServiceImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.AServiceCallback2;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.BService2;
-import org.junit.Assert;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(interfaces= {BService.class,BService2.class})
-@Scope("CONVERSATION")
-public class BServiceImpl implements BService, BService2 {
-
- String someState;
-
- @Callback
- protected AServiceCallback callback;
-
- @Callback
- protected AServiceCallback2 callback2;
-
- @Callback
- protected AServiceCallback2 callback3;
-
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void testCallBack(String someState) {
- callback.callBack(someState);
- }
-
- public void testCallBack2(String someState) {
- Assert.assertNotNull(callback3); //Spec lines 670,671
- callback2.callBack2(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/BServiceCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/BServiceCallback.java
deleted file mode 100644
index 1c2d20ff94..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/BServiceCallback.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-public interface BServiceCallback {
-
- public void callBack(String someState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/CService.java
deleted file mode 100644
index 5dd429077d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/CService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service
- */
-@Remotable
-@Conversational
-@Callback(BServiceCallback.class)
-public interface CService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testCallBack(String string);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl.java
deleted file mode 100644
index b263eb869b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.BServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.CService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl implements BService, BServiceCallback {
-
- String someState;
-
- @Callback
- protected AServiceCallback callback;
-
- @Reference
- protected ServiceReference<CService> c;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void callBack(String someState) {
- System.out.println("B-callback called with this state => " + someState);
- this.someState = someState;
- }
-
- public void testCallBack(String someState) {
-
- c.getService().testCallBack(someState);
- int count = 4;
- while (this.someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (this.someState != null)
- Assert.fail("Callback should NOT have been received by this instance");
-
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl2.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl2.java
deleted file mode 100644
index 4f08ac7a1b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl2.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.BServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.CService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.junit.Assert;
-import org.oasisopen.sca.RequestContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl2 implements BService, BServiceCallback {
-
- String someState;
-
- @Context
- protected RequestContext rc;
-
- @Callback
- protected AServiceCallback callback;
-
- @Reference
- protected ServiceReference<CService> c;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void callBack(String someState) {
- System.out.println("B-callback called with this state => " + someState);
- this.someState = someState;
- Assert.assertSame("1234", rc.getServiceReference().getCallbackID());
- }
-
- public void testCallBack(String someState) {
-
- c.setCallbackID("1234");
-
- c.getService().testCallBack(someState);
- int count = 4;
- while (this.someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (this.someState != null)
- Assert.fail("Callback should NOT have been received by this instance");
-
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl3.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl3.java
deleted file mode 100644
index 11c896a06d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl3.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.BServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.CService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl3 implements BService, BServiceCallback {
-
- String someState;
-
- @Callback
- protected AServiceCallback callback;
-
- @Reference
- protected ServiceReference<CService> c;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void callBack(String someState) {
- System.out.println("B-callback called with this state => " + someState);
- this.someState = someState;
- Assert.assertSame(null, callback);
- }
-
- public void testCallBack(String someState) {
-
- c.getService().testCallBack(someState);
- int count = 4;
- while (this.someState == null && count > 0) {
- Utilities.delayQuarterSecond();
- count--;
- }
- if (this.someState != null)
- Assert.fail("Callback should NOT have been received by this instance");
-
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/CServiceImpl.java
deleted file mode 100644
index 00984ae565..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/CServiceImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.BServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.CService;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-@Scope("CONVERSATION")
-public class CServiceImpl implements CService {
-
- String someState;
-
- @Callback
- protected BServiceCallback callback;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void testCallBack(String someState) {
- callback.callBack(someState);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-accessing.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-accessing.composite
deleted file mode 100644
index 802c9c30db..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-accessing.composite
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Conversation-callback-multi">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.impl.BServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-custom.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-custom.composite
deleted file mode 100644
index e66ea5d537..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-custom.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Conversation-callback-custom">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- <reference name="customCallback" target="CComponent/CustomCallback" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.impl.BServiceImpl" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.impl.CustomCallbackImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-id.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-id.composite
deleted file mode 100644
index 4d93d2279d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-id.composite
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Conversation-callback-id">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.impl.BServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite
deleted file mode 100644
index cd8c589a59..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Conversation-Callback-local">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.impl.BServiceImpl" />
- <reference name="c" target="CComponent" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.impl.CServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
deleted file mode 100644
index d2d9956103..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Conversation-callback-mixed">
-<!-- TODO: TUSCANY-2291
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.impl.BServiceImpl" />
- <reference name="c" target="CComponent" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.impl.CServiceImpl" />
- </component>
--->
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-multi.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-multi.composite
deleted file mode 100644
index 6c69330ce5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-multi.composite
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Conversation-callback-multi">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.impl.AServiceImpl" />
- <reference name="b" target="BComponent/BService" />
- <reference name="b2" target="BComponent/BService2" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.impl.BServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackfieldnull.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackfieldnull.composite
deleted file mode 100644
index 72c08e8344..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackfieldnull.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Conversation-callback-stateless">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl.BServiceImpl3" />
- <reference name="c" target="CComponent" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl.CServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite
deleted file mode 100644
index 144f7f3d00..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Conversation-callback-stateless">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl.BServiceImpl2" />
- <reference name="c" target="CComponent" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl.CServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite
deleted file mode 100644
index ace06b245c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Conversation-callback-stateless">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl.BServiceImpl" />
- <reference name="c" target="CComponent" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl.CServiceImpl" />
- </component>
-
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback.composite
deleted file mode 100644
index 4623f17ca2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/main/resources/callback.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Conversation-callback">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.BServiceImpl" />
- <reference name="c" target="CComponent" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.CServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
deleted file mode 100644
index 2680370c5b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.callback;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- *
- */
-public class CallbackTestCase {
-
- protected static AService aService = null;
-
- @Before
- public void init() throws Exception {
- try {
- System.out.println("Setting up");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @After
- public void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-
- /**
- * Lines 529-610
- * <p>
- * A callback service is a service that is used for asynchronous
- * communication from a service provider back to its client in contrast to
- * the communication through return values from synchronous operations.
- * Callbacks are used by bidirectional services, which are services that
- * have two interfaces: • an interface for the provided service • a callback
- * interface that must be provided by the client
- * <p>
- * Callbacks may be used for both remotable and local services. Either both
- * interfaces of a bidirectional service must be remotable, or both must be
- * local. It is illegal to mix the two. There are two basic forms of
- * callbacks: stateless callbacks and stateful callbacks. A callback
- * interface is declared by using the "@Callback" annotation on a remotable
- * service interface, which takes the Java Class object of the interface as
- * a parameter. The annotation may also be applied to a method or to a field
- * of an implementation, which is used in order to have a callback injected,
- * as explained in the next section.
- * <p>
- * 1.6.7.1. Stateful Callbacks A stateful callback represents a specific
- * implementation instance of the component that is the client of the
- * service. The interface of a stateful callback should be marked as
- * conversational. The following example interfaces define an interaction
- * over stateful callback.
- * <p>
- * An implementation of the service in this example could use the
- * "@Callback" annotation to request that a stateful callback be injected.
- * The following is a fragment of an implementation of the example service.
- * In this example, the request is passed on to some other component, so
- * that the example service acts essentially as an intermediary. Because the
- * service is conversation scoped, the callback will still be available when
- * the backend service sends back its asynchronous response.
- * <p>
- * This fragment must come from an implementation that offers two services,
- * one that it offers to it clients (MyService) and one that is used for
- * receiving callbacks from the back end (MyServiceCallback). The client of
- * this service would also implement the methods defined in
- * MyServiceCallback.
- * <p>
- * Stateful callbacks support some of the same use cases as are supported by
- * the ability to pass service references as parameters. The primary
- * difference is that stateful callbacks do not require any additional
- * parameters be passed with service operations. This can be a great
- * convenience. If the service has many operations and any of those
- * operations could be the first operation of the conversation, it would be
- * unwieldy to have to take a callback parameter as part of every operation,
- * just in case it is the first operation of the conversation. It is also
- * more natural than requiring the application developers to invoke an
- * explicit operation whose only purpose is to pass the callback object that
- * should be used.
- * <p>
- * This tests the *remote* bidirectional interfaces option
- */
- @Test
- public void statefulCallback() throws Exception {
- System.out.println("Setting up for callback tests");
- ServiceFinder.init("callback.composite");
- aService = ServiceFinder.getService(AService.class, "AComponent");
- aService.testCallback();
- }
-
- /**
- * Lines 529-610
- * <p>
- * A callback service is a service that is used for asynchronous
- * communication from a service provider back to its client in contrast to
- * the communication through return values from synchronous operations.
- * Callbacks are used by bidirectional services, which are services that
- * have two interfaces: • an interface for the provided service • a callback
- * interface that must be provided by the client
- * <p>
- * Callbacks may be used for both remotable and local services. Either both
- * interfaces of a bidirectional service must be remotable, or both must be
- * local. It is illegal to mix the two. There are two basic forms of
- * callbacks: stateless callbacks and stateful callbacks. A callback
- * interface is declared by using the "@Callback" annotation on a remotable
- * service interface, which takes the Java Class object of the interface as
- * a parameter. The annotation may also be applied to a method or to a field
- * of an implementation, which is used in order to have a callback injected,
- * as explained in the next section.
- * <p>
- * 1.6.7.1. Stateful Callbacks A stateful callback represents a specific
- * implementation instance of the component that is the client of the
- * service. The interface of a stateful callback should be marked as
- * conversational. The following example interfaces define an interaction
- * over stateful callback.
- * <p>
- * An implementation of the service in this example could use the
- * "@Callback" annotation to request that a stateful callback be injected.
- * The following is a fragment of an implementation of the example service.
- * In this example, the request is passed on to some other component, so
- * that the example service acts essentially as an intermediary. Because the
- * service is conversation scoped, the callback will still be available when
- * the backend service sends back its asynchronous response.
- * <p>
- * This fragment must come from an implementation that offers two services,
- * one that it offers to it clients (MyService) and one that is used for
- * receiving callbacks from the back end (MyServiceCallback). The client of
- * this service would also implement the methods defined in
- * MyServiceCallback.
- * <p>
- * Stateful callbacks support some of the same use cases as are supported by
- * the ability to pass service references as parameters. The primary
- * difference is that stateful callbacks do not require any additional
- * parameters be passed with service operations. This can be a great
- * convenience. If the service has many operations and any of those
- * operations could be the first operation of the conversation, it would be
- * unwieldy to have to take a callback parameter as part of every operation,
- * just in case it is the first operation of the conversation. It is also
- * more natural than requiring the application developers to invoke an
- * explicit operation whose only purpose is to pass the callback object that
- * should be used.
- * <p>
- * This tests the *local* bidirectional interfaces option
- */
- @Test
- public void localstatefulCallback() throws Exception {
- System.out.println("Setting up for local callback tests");
- ServiceFinder.init("callback-local.composite");
- aService = ServiceFinder.getService(AService.class, "AComponent");
- aService.testCallback();
- }
-
- /**
- * Lines 534, 535
- * <p>
- * Callbacks may be used for both remotable and local services. Either both
- * interfaces of a bidirectional service must be remotable, or both must be
- * local. It is illegal to mix the two.
- * <p>
- * In this test configuration BServiceCallback is remotable and CService is
- * not
- */
- @Test(expected = ServiceRuntimeException.class)
- @Ignore("TUSCANY-2291")
- public void statefulMixedCallback() throws Exception {
- System.out.println("Setting up for mixed local/remote callback tests");
- ServiceFinder.init("callback-mixed.composite");
- aService = ServiceFinder.getService(AService.class, "AComponent");
- aService.testCallback();
- }
-
- /**
- * Lines 613-615
- * <p>
- * A stateless callback interface is a callback whose interface is not
- * marked as conversational. Unlike stateless services, the client of that
- * uses stateless callbacks will not have callback methods routed to an
- * instance of the client that contains any state that is relevant to the
- * conversation.
- * <p>
- * This test is identical in structure to the stateful test except that
- * BServiceCallback is not conversational and we test that the callback is
- * NOT routed to the same instance.
- */
- @Test
- public void statelessCallback() throws Exception {
- System.out.println("Setting up for stateless callback tests");
- ServiceFinder.init("callback-stateless.composite");
- aService = ServiceFinder.getService(AService.class, "AComponent");
- aService.testCallback();
- }
-
- /**
- * Lines 616-621
- * <p>
- * The only information that the client has to work with (other than the
- * parameters of the callback method) is a callback ID object that is passed
- * with requests to the service and is guaranteed to be returned with any
- * callback.
- * <p>
- * The following is a repeat of the client code fragment above, but with the
- * assumption that in this case the MyServiceCallback is stateless. The
- * client in this case needs to set the callback ID before invoking the
- * service and then needs to get the callback ID when the response is
- * received.
- * <p>
- * Lines 747-755
- * <p>
- * The identity that is used to identify a callback request is, by default,
- * generated by the system. However, it is possible to provide an
- * application specified identity that should be used to identify the
- * callback by calling the ServiceReference.setCallbackID() method. This can
- * be used even either stateful or stateless callbacks. The identity will be
- * sent to the service provider, and the binding must guarantee that the
- * service provider will send the ID back when any callback method is
- * invoked. The callback identity has the same restrictions as the
- * conversation ID. It should either be a string or an object that can be
- * serialized into XML. Bindings determine the particular mechanisms to use
- * for transmission of the identity and these may lead to further
- * restrictions when using a given binding.
- * <p>
- * TODO - Need to add explicit test back to stateful for 747-755
- */
- @Test
- public void statelessCallback2() throws Exception {
- System.out.println("Setting up for stateless callback id tests");
- ServiceFinder.init("callback-stateless-callbackid.composite");
- aService = ServiceFinder.getService(AService.class, "AComponent");
- aService.testCallback();
-
- }
-
- /**
- * Lines 650-654
- * <p>
- * The difference for stateless services is that the callback field would
- * not be available if the component is servicing a request for anything
- * other than the original client. So, the technique used in the previous
- * section, where there was a response from the backend Service which was
- * forwarded as a callback from MyService would not work because the
- * callback field would be null when the message from the backend system was
- * received.
- * <p>
- */
- @Test
- public void statelessCallback3() throws Exception {
- System.out.println("Setting up for stateless callback ref null tests");
- ServiceFinder.init("callback-stateless-callbackfieldnull.composite");
- aService = ServiceFinder.getService(AService.class, "AComponent");
- aService.testCallback();
-
- }
-
- /**
- * Lines 658-669
- * <p>
- * Since it is possible for a single implementation class to implement
- * multiple services, it is also possible for callbacks to be defined for
- * each of the services that it implements. The service implementation can
- * include an injected field for each of its callbacks. The runtime injects
- * the callback onto the appropriate field based on the type of the
- * callback. The following shows the declaration of two fields, each of
- * which corresponds to a particular service offered by the implementation.
- * <p>
- * Lines 670,671
- * <p>
- * If a single callback has a type that is compatible with multiple declared
- * callback fields, then all of them will be set.
- */
- @Test
- public void statefulMultiBidirectional() throws Exception {
- System.out.println("Setting up for multi-bidirectional interfaces tests");
- ServiceFinder.init("callback-multi.composite");
- aService = ServiceFinder.getService(AService.class, "AComponent");
- aService.testCallback();
- aService.testCallback2(); // Includes test for 670,671
-
- }
-
- /**
- * Lines 675-706
- * <p>
- * In addition to injecting a reference to a callback service, it is also
- * possible to obtain a reference to a Callback instance by annotating a
- * field or method with the "@Callback" annotation. A reference implementing
- * the callback service interface may be obtained using
- * CallableReference.getService(). The following fragments come from a
- * service implementation that uses the callback API:
- * <p>
- * Alternatively a callback may be retrieved programmatically using the
- * RequestContext API. The snippet below show how to retrieve a callback in
- * a method programmatically:
- * <p>
- * Lines 695, 696
- * <p>
- * Alternatively a callback may be retrieved programmatically using the
- * RequestContext API. The snippet below show how to retrieve a callback in
- * a method programmatically:
- */
- @Test
- public void accessingCallbacks() throws Exception {
- System.out.println("Setting up for callback accessing tests");
- ServiceFinder.init("callback-accessing.composite");
- aService = ServiceFinder.getService(AService.class, "AComponent");
- aService.testCallback();
- aService.testCallback2(); // Lines 695-696
-
- }
-
- /**
- * Lines 708-724
- * <p>
- * On the client side, the service that implements the callback can access
- * the callback ID (i.e. reference parameters) that was returned with the
- * callback operation also by accessing the request context, as follows:
- * <p>
- * On the client side, the object returned by the getServiceReference()
- * method represents the service reference that was used to send the
- * original request. The object returned by getCallbackID() represents the
- * identity associated with the callback, which may be a single String or
- * may be an object (as described below in “Customizing the Callback
- * Identity”).
- */
- @Test
- public void callbackId() throws Exception {
- System.out.println("Setting up for callback id tests");
- ServiceFinder.init("callback-id.composite");
- aService = ServiceFinder.getService(AService.class, "AComponent");
- aService.testCallback();
-
- }
-
- /**
- * Lines 728-732
- * <p>
- * By default, the client component of a service is assumed to be the
- * callback service for the bidirectional service. However, it is possible
- * to change the callback by using the ServiceReference.setCallback()
- * method. The object passed as the callback should implement the interface
- * defined for the callback, including any additional SCA semantics on that
- * interface such as its scope and whether or not it is remotable.
- * <p>
- * TODO - Need to complete testing of 1.6.7.5 after resolution of t-2312
- */
- @Test
- public void customCallback() throws Exception {
- System.out.println("Setting up for custom callback tests; create domain instance");
- ServiceFinder.init("callback-custom.composite");
- System.out.println("Setting up for custom callback tests; get AService handle");
- aService = ServiceFinder.getService(AService.class, "AComponent");
- aService.testCallback();
-
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/pom.xml
deleted file mode 100644
index a22380873f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-conversation-id</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Conversation - ID</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/AService.java
deleted file mode 100644
index 39719539ba..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/AService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.id;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-public interface AService {
-
- public void testAnnotation();
-
- public void testAnnotation2();
-
- public void testAnnotation3();
-
- public void testAnnotation4();
-
- public void testAnnotation5();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/BService.java
deleted file mode 100644
index b5911101b8..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/BService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.id;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Local Service
- */
-@Remotable
-@Conversational
-public interface BService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testAnnotation();
-
- public void testAnnotation2();
-
- public void testAnnotation3();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CService.java
deleted file mode 100644
index 1730f863b5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.id;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Local Service
- */
-@Remotable
-@Conversational
-public interface CService {
-
- public void setState(String someState);
-
- public String getState();
-
- public void testAnnotation();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CustomConversationId.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CustomConversationId.java
deleted file mode 100644
index ac40c56ee6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/CustomConversationId.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.id;
-
-
-public class CustomConversationId {
-
- int id;
- String name;
-
- public CustomConversationId(int id, String name) {
- super();
- this.id = id;
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public int getNumber() {
- return id;
- }
-
- public void setName(String someName) {
- name = someName;
- }
-
- public void setNumber(int someInt) {
- id = someInt;
- }
-
- public String toString() {
- return "id->" + id + " name->" + name;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/AServiceImpl.java
deleted file mode 100644
index bac842dfca..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/AServiceImpl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.id.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.id.AService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.id.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.id.CService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.id.CustomConversationId;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-@Scope("CONVERSATION")
-public class AServiceImpl implements AService {
-
- @Reference
- protected ServiceReference<BService> b;
-
- @Reference
- protected ServiceReference<CService> c;
-
- public void testAnnotation() {
- b.getService().testAnnotation();
- }
-
- public void testAnnotation2() {
- b.getService().testAnnotation2();
- }
-
- public void testAnnotation3() {
- b.getService().testAnnotation3();
- }
-
- public void testAnnotation4() {
- CustomConversationId id = new CustomConversationId (1, "One");
- c.setConversationID(id);
- c.getService().testAnnotation();
- }
-
- public void testAnnotation5() {
- b.getService().getState();
- Assert.assertNotNull(b.getConversation().getConversationID());
-// Assert.assertNotNull(b.getConversationID());
-
- CustomConversationId id = new CustomConversationId (1, "One");
- c.setConversationID(id);
- Assert.assertSame(id, c.getConversationID());
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/BServiceImpl.java
deleted file mode 100644
index 3c4eea4bc9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/BServiceImpl.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.id.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.id.BService;
-import org.junit.Assert;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-@ConversationAttributes(maxAge = "1 seconds")
-public class BServiceImpl implements BService {
-
- String someState;
-
- @ConversationID
- protected String conversationID;
-
- @ConversationID
- protected Object conversationID2;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void testAnnotation() {
- Assert.assertNotNull(conversationID);
- System.out.println(conversationID);
- }
-
- public void testAnnotation2() {
- Assert.assertNotNull(conversationID2);
- System.out.println(conversationID);
- }
-
- public void testAnnotation3() {
- Assert.assertTrue(conversationID2 instanceof String);
- System.out.println(conversationID);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/CServiceImpl.java
deleted file mode 100644
index 1e5a459954..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/impl/CServiceImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.id.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.id.CService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.id.CustomConversationId;
-import org.junit.Assert;
-import org.oasisopen.sca.annotation.ConversationID;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-@Scope("CONVERSATION")
-public class CServiceImpl implements CService {
-
- String someState;
-
- @ConversationID
- protected Object conversationID;
-
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void testAnnotation() {
- Assert.assertNotNull(conversationID);
- Assert.assertTrue(conversationID instanceof CustomConversationId);
-
- Assert.assertSame(1, ((CustomConversationId)conversationID).getNumber());
- Assert.assertSame("One", ((CustomConversationId)conversationID).getName());
- System.out.println(conversationID);
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/resources/conversation-id.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/resources/conversation-id.composite
deleted file mode 100644
index 25e7154fca..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/main/resources/conversation-id.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Converstion-ID">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.id.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- <reference name="c" target="CComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.id.impl.BServiceImpl" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.id.impl.CServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/ConversationIDTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/ConversationIDTestCase.java
deleted file mode 100644
index d3cb107a61..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/id/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/id/ConversationIDTestCase.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.id;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- *
- */
-public class ConversationIDTestCase {
-
- protected static String compositeName = "conversation-id.composite";
- protected static AService aService = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
-
- }
-
- /**
- * Lines 504, 505
- * <p>
- * If a protected or public field or setter method is annotated with
- * "@ConversationID", then the conversation ID for the conversation is
- * injected onto the field
- */
- @Test
- public void idAnnotation() throws Exception {
- aService.testAnnotation();
- }
-
- /**
- * Lines 505
- * <p>
- * The type of the field is not necessarily String
- */
- @Test
- public void idAnnotation2() throws Exception {
- aService.testAnnotation2();
- }
-
- /**
- * Lines 505, 506
- * <p>
- * System generated conversation IDs are always strings
- */
- @Test
- public void idAnnotation3() throws Exception {
- aService.testAnnotation3();
- }
-
- /**
- * Lines 506, 507
- * <p>
- * ... but application generated conversation IDs may be other complex
- * types.
- * <p>
- * Lines 513, 514
- * <p>
- * ... To do this, the client would not use reference injection, but would
- * use the of ServiceReference.setConversationID() API.
- */
- @Test
- public void idAnnotation4() throws Exception {
- aService.testAnnotation4();
- }
-
- /**
- * Lines 522, 523
- * <p>
- * Whether the conversation ID is chosen by the client or is generated by
- * the system, the client may access the conversation ID by calling
- * ServiceReference.getConversationID().
- * <p>
- * This test is following updates to this section of the specification per
- * the OASIS TC under issue JAVA-31. The updated text reads: "...by calling
- * getConversationID() on the current conversation object".
- */
- @Test
- public void idAnnotation5() throws Exception {
- aService.testAnnotation5();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/pom.xml
deleted file mode 100644
index e9f0d61822..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-conversation-lifetime</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Conversation - Lifetime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/AService.java
deleted file mode 100644
index f5249b3a5b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/AService.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-public interface AService {
-
- public void testConversationStarted();
-
- public void testConversationStarted2();
-
- public void testConversationContinue();
-
- public void testConversationContinue2();
-
- public void testConversationContinue3();
-
- public void testConversationEnd();
-
- public void testConversationEnd2();
-
- public void testConversationEnd3();
-
- public void testConversationEnd4();
-
- public void testConversationEnd5();
-
- public void testConversationEnd6();
-
- public void testConversationEnd7();
-
- public void testConversationEnd8();
-
- public void testConversationEnd9();
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/AServiceCallback.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/AServiceCallback.java
deleted file mode 100644
index 635e6e74d4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/AServiceCallback.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Remotable Service
- */
-@Remotable
-@Conversational
-public interface AServiceCallback {
-
- @EndsConversation
- public void endConversation();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/BService.java
deleted file mode 100644
index b28a31da38..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/BService.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime;
-
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.EndsConversation;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Local Service
- */
-@Remotable
-@Conversational
-@Callback(AServiceCallback.class)
-public interface BService {
-
- public void setState(String someState);
-
- public String getState();
-
- @EndsConversation
- public void endConversation();
-
- public void endConversationViaCallback();
-
- public void throwNonBusinessException();
-
- public void throwBusinessException() throws BServiceBusinessException;
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/BServiceBusinessException.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/BServiceBusinessException.java
deleted file mode 100644
index ab186ee7eb..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/BServiceBusinessException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime;
-
-
-/**
- * Denotes an error starting the runtime
- *
- * @version $Rev$ $Date$
- */
-public class BServiceBusinessException extends Exception {
-
- static final long serialVersionUID = 2096658015909178325L;
-
- private String message;
-
- public BServiceBusinessException() {
- }
-
- public BServiceBusinessException(String message) {
- super(message);
- setMessage(message);
- }
-
- public BServiceBusinessException(Throwable cause) {
- super(cause);
- setMessage(cause.getMessage());
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/CService.java
deleted file mode 100644
index 020d18b862..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/CService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Local Service
- */
-@Remotable
-@Conversational
-public interface CService {
-
- public void setState(String someState);
- public String getState();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/DService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/DService.java
deleted file mode 100644
index c339ebd6ea..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/DService.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime;
-
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Local Service
- */
-@Remotable
-@Conversational
-public interface DService {
-
- public void setState(String someState);
- public String getState();
-
- public void continueConversation(ServiceReference<BService> b, Object convId);
- public void continueConversation2(String filename, Object id, String serializedState);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/AServiceImpl.java
deleted file mode 100644
index 18d592f9d0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/AServiceImpl.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.impl;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.AService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.BServiceBusinessException;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.CService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.DService;
-import org.junit.Assert;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ConversationEndedException;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-@Scope("CONVERSATION")
-public class AServiceImpl implements AService, AServiceCallback {
-
- @Context
- public ComponentContext context;
-
- @Reference
- protected ServiceReference<BService> b;
-
- @Reference
- protected DService d;
-
- public void testConversationStarted() {
- b.getService().setState("Some state");
- Assert.assertNotNull(b.getConversation().getConversationID());
- }
-
- public void testConversationStarted2() {
- ServiceReference<BService> ref = context.getServiceReference(BService.class, "b");
- ref.getService().setState("Some state");
- Assert.assertNotNull(ref.getConversation().getConversationID());
- }
-
- public void testConversationContinue() {
-
- b.getService().setState("Some state");
- Object id = b.getConversation().getConversationID();
- b.getService().setState("Some more state");
- Assert.assertEquals(id, b.getConversation().getConversationID());
- }
-
- public void testConversationContinue2() {
-
- b.getService().setState("Some state");
- d.continueConversation(b, b.getConversation().getConversationID());
-
- }
-
- public void testConversationContinue3() {
-
- String serializedState = "Serialized State";
-
- String filename = "target/Serialized-Reference.txt";
- b.getService().setState(serializedState);
- Object id = b.getConversation().getConversationID();
- writeReference(b, filename);
- d.continueConversation2(filename, id, serializedState);
-
- }
-
- // Utilities
-
- private void delayForSeconds(int numSeconds) {
- try {
- Thread.sleep(numSeconds * 1000);// millisecs
- } catch (InterruptedException ex) {
- throw new Error(ex);
- }
- }
-
- private void writeReference(ServiceReference<BService> ref, String filename) {
-
- FileOutputStream fos = null;
- ObjectOutputStream out = null;
- try {
- fos = new FileOutputStream(filename);
- out = new ObjectOutputStream(fos);
- out.writeObject(ref);
- out.close();
- } catch (IOException ex) {
- ex.printStackTrace();
- }
- }
-
- public void testConversationEnd() {
- String someState = "Some state";
- b.getService().setState(someState);
- b.getService().endConversation();
- Assert.assertNotSame(someState, b.getService().getState());
- }
-
- public void testConversationEnd2() {
- String someState = "Some state";
- b.getService().setState(someState);
- b.getService().endConversationViaCallback();
- Assert.assertNotSame(someState, b.getService().getState());
- }
-
- public void endConversation() {
- System.out.println("A-callback to end conversation");
- }
-
- public void testConversationEnd3() {
- String someState = "Some state";
- b.getService().setState(someState);
- delayForSeconds(2);
- try {
- b.getService().getState();
- } catch (ConversationEndedException e) {
- b.getConversation().end();// need to clean up to avoid exception
- }
- Assert.assertNotSame(someState, b.getService().getState());
- }
-
- public void testConversationEnd4() {
- String someState = "Some state";
- b.getService().setState(someState);
- b.getConversation().end();
- Assert.assertNotSame(someState, b.getService().getState());
- }
-
- public void testConversationEnd5() {
- String someState = "Some state";
- b.getService().setState(someState);
- try {
- b.getService().throwNonBusinessException();
- } catch (Error e) {
- // Expected
- }
- Assert.assertNotSame(someState, b.getService().getState());
- }
-
- public void testConversationEnd6() {
- String someState = "Some state";
- b.getService().setState(someState);
- Object id = b.getConversation().getConversationID();
- b.getService().endConversation();
- Assert.assertNotSame(someState, b.getService().getState());
- Assert.assertNotSame(id, b.getConversation().getConversationID());
- }
-
- public void testConversationEnd7() {
- b.getService().setState("Some state");
- b.getService().endConversation();
- Assert.assertNull(b.getConversationID());
- }
-
- public void testConversationEnd8() {
- String someState = "Some state";
- b.getService().setState(someState);
- delayForSeconds(2);
- b.getService().getState();
- }
-
- public void testConversationEnd9() {
- String someState = "Some state";
- b.getService().setState(someState);
- try {
- b.getService().throwBusinessException();
- } catch (BServiceBusinessException e) {
- // Expected
- }
- Assert.assertSame(someState, b.getService().getState());
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/BServiceImpl.java
deleted file mode 100644
index 71e09c38b3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/BServiceImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.AServiceCallback;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.BServiceBusinessException;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.ConversationAttributes;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-@ConversationAttributes(maxAge="1 seconds")
-public class BServiceImpl implements BService {
-
- String someState;
-
- @Callback
- protected AServiceCallback callback;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void endConversation() {
- System.out.println("Someone called Bservice.endsConversation()");
- }
-
- public void endConversationViaCallback() {
- callback.endConversation();
- }
-
- public void throwNonBusinessException() {
- throw new Error();
- }
-
- public void throwBusinessException() throws BServiceBusinessException {
- throw new BServiceBusinessException("Business Exception");
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/CServiceImpl.java
deleted file mode 100644
index e182613932..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/CServiceImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.CService;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-@Scope("CONVERSATION")
-public class CServiceImpl implements CService {
-
- String someState;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/DServiceImpl.java
deleted file mode 100644
index 15a4ab3b76..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/impl/DServiceImpl.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.impl;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.DService;
-import org.junit.Assert;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(DService.class)
-@Scope("CONVERSATION")
-public class DServiceImpl implements DService {
-
- String someState;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public void continueConversation(ServiceReference<BService> b, Object convId) {
-
- b.getService().setState("Some more state");
- Assert.assertEquals(convId, b.getConversation().getConversationID());
- }
-
- public void continueConversation2(String filename, Object convId, String serializedState) {
- ServiceReference<BService> b = readReference(filename);
- Assert.assertEquals(serializedState, b.getService().getState());
- Assert.assertEquals(convId, b.getConversation().getConversationID());
- }
-
- // Utilities
- @SuppressWarnings("unchecked")
- private ServiceReference<BService> readReference(String filename) {
- ServiceReference<BService> b = null;
- FileInputStream fis = null;
- ObjectInputStream in = null;
- try {
- fis = new FileInputStream(filename);
- in = new ObjectInputStream(fis);
- ServiceReference<BService> readObject = (ServiceReference<BService>)in.readObject();
- b = readObject;
- in.close();
- } catch (IOException ex) {
- ex.printStackTrace();
- } catch (ClassNotFoundException ex) {
- ex.printStackTrace();
- }
- return b;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/resources/lifetime.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/resources/lifetime.composite
deleted file mode 100644
index 21ee8acac1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/main/resources/lifetime.composite
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Converstion-Lifetime">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- <reference name="d" target="DComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.impl.BServiceImpl" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.impl.CServiceImpl" />
- </component>
-
- <component name="DComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.impl.DServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/LifetimeTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/LifetimeTestCase.java
deleted file mode 100644
index 52c11b881c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/lifetime/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/lifetime/LifetimeTestCase.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.ConversationEndedException;
-
-/**
- *
- */
-public class LifetimeTestCase {
-
- protected static String compositeName = "lifetime.composite";
- protected static AService aService = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
-
- }
-
- /**
- * Lines 475, 476
- * <p>
- * Conversations start on the client side when one of the following occur: A
- * "@Reference" to a conversational service is injected, ... and then a
- * method of the service is called
- */
- @Test
- public void lifetime1() throws Exception {
- aService.testConversationStarted();
- }
-
- /**
- * Lines 477, 478, 479
- * <p>
- * Conversations start on the client side when one of the following occur
- * ... A call is made to CompositeContext.getServiceReference and then a
- * method of the service is called.
- */
- @Test
- //@Ignore("TUSCANY-2243")
- public void lifetime2() throws Exception {
- aService.testConversationStarted2();
- }
-
- /**
- * Line 481, 482
- * <p>
- * The client can continue an existing conversation, by: Holding the service
- * reference that was created when the conversation started
- */
- @Test
- public void lifetime3() throws Exception {
- aService.testConversationContinue();
- }
-
- /**
- * Line 481, 483
- * <p>
- * The client can continue an existing conversation, by: ... • Getting the
- * service reference object passed as a parameter from another service, even
- * remotely
- */
- @Test
- public void lifetime4() throws Exception {
- // aService.testConversationContinue2();
- }
-
- /**
- * Line 481, 484
- * <p>
- * The client can continue an existing conversation, by:<br> • Loading a
- * service reference that had been written to some form of persistent
- * storage
- */
- @Test
- public void lifetime6() throws Exception {
- aService.testConversationContinue3();
- }
-
- /**
- * Line 487, 488
- * <p>
- * A conversation ends, and any state associated with the conversation is
- * freed up, when: <br>
- * ...A server operation that has been annotated "@EndConveration" has been
- * called
- */
- @Test
- public void lifetime7() throws Exception {
- aService.testConversationEnd();
- }
-
- /**
- * Line 487, 489
- * <p>
- * A conversation ends, and any state associated with the conversation is
- * freed up, when: <br>
- * ...The server calls an "@EndsConversation" method on the "@Callback"
- * reference <br>
- */
- @Test
- public void lifetime8() throws Exception {
- aService.testConversationEnd2();
- }
-
- /**
- * Line 487, 490
- * <p>
- * 487 A conversation ends, and any state associated with the conversation
- * is freed up, when: <br>
- * ... The server's conversation lifetime timeout occurs
- */
- @Test
- public void lifetime9() throws Exception {
- aService.testConversationEnd3();
- }
-
- /**
- * Line 487, 491
- * <p>
- * A conversation ends, and any state associated with the conversation is
- * freed up, when: <br>
- * ...The client calls Conversation.end()
- */
- @Test
- public void lifetime10() throws Exception {
- aService.testConversationEnd4();
- }
-
- /**
- * Line 487, 492
- * <p>
- * A conversation ends, and any state associated with the conversation is
- * freed up, when: <br>
- * ...Any non-business exception is thrown by a conversational operation
- */
- @Test
- //@Ignore("TUSCANY-2283")
- public void lifetime11() throws Exception {
- aService.testConversationEnd5();
- aService.testConversationEnd9();
- }
-
- /**
- * Line 494, 495
- * <p>
- * If a method is invoked on a service reference after an
- * "@EndsConversation" method has been called then a new conversation will
- * automatically be started.
- */
- @Test
- public void lifetime12() throws Exception {
- aService.testConversationEnd6();
- }
-
- /**
- * Line 495, 496, 497
- * <p>
- * If ServiceReference.getConversationID() is called after the
- * "@EndsConversation" method: is called, but before the next conversation
- * has been started, it will return null.
- */
- @Test
- public void lifetime13() throws Exception {
- aService.testConversationEnd7();
- }
-
- /**
- * Line 498, 499
- * <p>
- * If a service reference is used after the service provider's conversation
- * timeout has caused the conversation to be ended, then
- * ConversationEndedException will be thrown.
- */
- @Test(expected = ConversationEndedException.class)
- public void lifetime14() throws Exception {
- aService.testConversationEnd8();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/pom.xml
deleted file mode 100644
index ba7f29396a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>java-api-annotations</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-conversation-parameters</artifactId>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Conversation - Parameters</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/AService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/AService.java
deleted file mode 100644
index bd19b504d9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/AService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.parameters;
-
-/**
- * Simple Remotable Service
- */
-public interface AService {
-
- public void setBStateThenGetCState();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/BService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/BService.java
deleted file mode 100644
index c404b91673..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/BService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.parameters;
-
-import org.oasisopen.sca.annotation.Conversational;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Local Service
- */
-@Remotable
-@Conversational
-public interface BService {
-
- public void setState(String someState);
- public String getState();
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/CService.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/CService.java
deleted file mode 100644
index d9f32dcfea..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/CService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.javaapi.conversation.parameters;
-
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * Simple Local Service
- */
-public interface CService {
-
- public void setState(String someState);
- public String getState();
- public Object continueConversation(ServiceReference<BService> bref);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/AServiceImpl.java
deleted file mode 100644
index 920d1294b3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/AServiceImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.impl;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.AService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.CService;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- protected ServiceReference<BService> b;
-
- @Reference
- protected CService c;
-
- public void setBStateThenGetCState() {
- String someState = "set by A";
- b.getService().setState(someState);
- Assert.assertEquals(someState, c.continueConversation(b));
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/BServiceImpl.java
deleted file mode 100644
index 98cf59c084..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/BServiceImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.BService;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-@Scope("CONVERSATION")
-public class BServiceImpl implements BService {
-
- String someState;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/CServiceImpl.java
deleted file mode 100644
index 5f223dfcf0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/impl/CServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.impl;
-
-import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.BService;
-import org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.CService;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl implements CService {
-
- String someState;
-
- public void setState(String someState) {
- this.someState = someState;
- }
-
- public String getState() {
- return someState;
- }
-
- public String continueConversation(ServiceReference<BService> bref) {
- return bref.getService().getState();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/resources/parameters.composite b/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/resources/parameters.composite
deleted file mode 100644
index a8500dfb09..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/main/resources/parameters.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://java-api-tests" name="Converstion-Composite">
-
- <component name="AComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.impl.AServiceImpl" />
- <reference name="b" target="BComponent" />
- <reference name="c" target="CComponent" />
- </component>
-
- <component name="BComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.impl.BServiceImpl" />
- </component>
-
- <component name="CComponent">
- <implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.parameters.impl.CServiceImpl" />
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/ConversationParametersTestCase.java b/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/ConversationParametersTestCase.java
deleted file mode 100644
index 929fe06115..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/parameters/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/parameters/ConversationParametersTestCase.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.javaapi.conversation.parameters;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This test class tests the Service annotation described in section 1.2.1 and
- * 1.8.17
- */
-public class ConversationParametersTestCase {
-
- protected static ServiceFinder serviceFinder;
- protected static String compositeName = "parameters.composite";
- protected static AService aService = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- aService = ServiceFinder.getService(AService.class, "AComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
-
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
-
- }
-
- /**
- * Line 423, 424, 425:<br>
- * <p>
- * The service reference which represents a single conversation can be
- * passed as a parameter to another service, even if that other service is
- * remote. This may be used in order to allow one component to continue a
- * conversation that had been started by another.
- */
- @Test
- public void passParameter1() throws Exception {
- aService.setBStateThenGetCState();
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/conversation/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/conversation/pom.xml
deleted file mode 100644
index 2e9af9eb3c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/conversation/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-java-api</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api-conversation</artifactId>
- <packaging>pom</packaging>
-
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - Conversation</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>parameters</module>
- <module>lifetime</module>
- <module>id</module>
- <module>callback</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/java-api/pom.xml b/tags/java/sca/2.0-M1/vtest/java-api/pom.xml
deleted file mode 100644
index b4ace8aa05..0000000000
--- a/tags/java/sca/2.0-M1/vtest/java-api/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-vtest</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-java-api</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>vtest-utilities</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>annotations</module>
- <module>apis</module>
- <module>conversation</module>
- </modules>
- </profile>
- </profiles>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/pom.xml b/tags/java/sca/2.0-M1/vtest/pom.xml
deleted file mode 100644
index edee81bd2e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-vtest</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Specification Verification Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>java-api</module>
- <module>wsbinding</module>
- <module>utilities</module>
- <module>assembly</module>
- </modules>
- </profile>
- </profiles>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/processcomments.rb b/tags/java/sca/2.0-M1/vtest/processcomments.rb
deleted file mode 100644
index b7a7fc1cc3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/processcomments.rb
+++ /dev/null
@@ -1,198 +0,0 @@
-=begin
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-Scans java test source files, recursively from the current directory,
-and produces a list of test metods sorted by specification line number.
-
-The implementation makes heavy use of my scant knowledge of regex. I'll
-comeback and clean this up as time allows.
-
-Assumes a test comment convention like this:
-
- /**
- * Lines 410,411,412,413:
- * <p>
- * A method of a conversational interface may be marked with an
- * "@EndsConversation" annotation. Once a method marked with
- * "@EndsConversation" has been called, the conversation between client and
- * service provider is at an end, which implies no further methods may be
- * called on that service within the *same* conversation.
- */
- @Test
- public void atEndsConversation1() throws Exception {
-
-Example command line usage
->ruby processcomments.rb > comment_scan.txt
-
-Current output is formatted for a cwiki page and can be directly pasted to a blank page
-
-Some TODO's:
- Add logic to process number ranges such as "Lines 523-556" or "Lines 523 to 556"
-=end
-class TestMethod
-
- attr_accessor :lines_tested, :first_line_tested
-
- def initialize(text, parent)
- @text = text
- @parent = parent
- @lines_tested = init_lines_tested
- @first_line_tested = @lines_tested.first
- end
-
- #Define sort criteria
- def <=>(test_method)
- @first_line_tested.<=>(test_method.first_line_tested)
- end
-
- def name
- regex = /void\s*\S*\(\) /
- str = @text[regex]
- str.sub(/void\s*/, '')
- end
-
- def init_lines_tested
- lines_regex = /Line.*?$/
- lines_array = @text.scan(lines_regex)
- nums_regex = /\d{1,4}/
- line_numbers = Array.new
- lines_array.each do |line_text|
- number_strings =line_text.scan(nums_regex)
- number_strings.each {|num_string| line_numbers<<num_string.to_i}
- end
- line_numbers
- end
-
- def lines_tested_string
- lts = String.new
- lines_tested.each {|n| lts = lts +"," + n.to_s }
- lts[1..lts.length]
- end
-
- def ignore_line
- @text[/^\s*@Ignore.*/]
- end
-
- def jira
- result = ignore_line
- result = result[/\d{4,5}/]
- result ? "T-" + result : "x"
- end
-
- def ignore_string
- ignore_line ? jira : ""
- end
-
- def package_name
- @parent.package_name
- end
-
- def testcase_name
- @parent.testcase_name
- end
-
- def long_name
- self.package_name + "." + testcase_name + "." + self.name
- end
-
- def to_s
- long_name + "\n" + "Lines tested: " + lines_tested_string + "\n\n"
- end
-
- def to_cwiki_s
- "|" + lines_tested_string + "|" + long_name + "|" + ignore_string + "|\n"
- end
-end
-
-class TestCase
- attr_accessor :text, :test_methods
-
- def initialize(text)
- @text = text
- @test_methods = Array.new
- create_test_methods
- end
-
- def create_test_methods
- regex = /\/\*\*\W*?$\W*?Line.*?\{/m
- test_method_text_array = text.scan(regex)
- test_method_text_array.each do |t|
- @test_methods<<TestMethod.new(t, self)
- $num_test_methods +=1
- end
- end
-
- def package_name
- line = @text[/pack.*$/]
- line.sub!(/package /, '')
- line.sub(/;/, '')
- end
-
- def testcase_name
- text[/\S*TestCase/]
- end
-end
-
-def process_file(fn)
- text = String.new
- File.open(fn) { |f| text = f.read }
- $testcases << TestCase.new(text)
-end
-
-def spec_tested (dir_pwd)
- subfolder_name = dir_pwd[/\/[^\/\\]*$/]
- subfolder_name = subfolder_name[1..subfolder_name.length-1]
- result = case subfolder_name
- when "java-api" : "SCA Java Common Annotations and APIs V1.00"
- when "wsbinding" : "SCA Web Services Binding V1.00"
- else "Unknown!"
- end
-end
-
-$num_files_processed = $num_test_methods = 0
-$testcases = Array.new
-svn_info = `svn info`
-svn_revision = svn_info[/Revision: \d*/]
-
-Dir["**/*TestCase.java"].each do |filename|
- process_file(filename)
- $num_files_processed += 1
-end
-
-all_test_methods = Array.new
-$testcases.each do |tc|
- tc.test_methods.each {|m| all_test_methods<<m}
-end
-
-#confluence wiki output
-puts "Content generated by /vtest/processcomments.rb"
-puts "h1. " + spec_tested(Dir.pwd) + " - Test map"
-puts "h3. Test case files scanned " + Date.today.to_s + " (svn:" + svn_revision + ")"
-puts "* Total files processed = #{$num_files_processed}"
-puts "* Number of test cases = #{$testcases.length}"
-puts "* Number of test methods = #{$num_test_methods}"
-
-puts "||Specification Line Numbers|| package/testcase/method ||ignored||"
-all_test_methods.sort.each {|tm| puts tm.to_cwiki_s}
-
-
-
-
diff --git a/tags/java/sca/2.0-M1/vtest/utilities/pom.xml b/tags/java/sca/2.0-M1/vtest/utilities/pom.xml
deleted file mode 100644
index 845ad212a7..0000000000
--- a/tags/java/sca/2.0-M1/vtest/utilities/pom.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-vtest</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-utilities</artifactId>
- <name>Apache Tuscany SCA Verification Tests - Utilities</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>wsdl4j</groupId>
- <artifactId>wsdl4j</artifactId>
- <version>1.6.2</version>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/utilities/src/main/java/org/apache/tuscany/sca/vtest/utilities/ServiceFinder.java b/tags/java/sca/2.0-M1/vtest/utilities/src/main/java/org/apache/tuscany/sca/vtest/utilities/ServiceFinder.java
deleted file mode 100644
index 9b6792e51b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/utilities/src/main/java/org/apache/tuscany/sca/vtest/utilities/ServiceFinder.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.utilities;
-
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- *
- *
- */
-public class ServiceFinder {
-
- private static SCADomain domain;
-
- protected ServiceFinder() {
- super();
- }
-
- public static void init(String compositeFileName) {
- if (domain != null)
- System.out.println("VTEST WARNING: domain already exists and is will be overwritten!");
- domain = SCADomain.newInstance(compositeFileName);
- }
-
-
- public static <B> B getService(Class<B> businessInterface, String serviceName) {
- return domain.getService(businessInterface, serviceName);
- }
-
- public static void cleanup() {
- domain.close();
- domain = null;
- }
-
- private static String getUri(String component, String service, String binding) {
-
- List<ComponentService> csList = domain.getComponentManager().getComponent(component).getServices();
-
- for (int i = 0; i < csList.size(); i++) {
- ComponentService cs = csList.get(i);
- if (service.equals(cs.getName())) {
- List<Binding> bList = cs.getBindings();
- for (int j = 0; j < bList.size(); j++) {
- String bName = bList.get(j).getName();
- if (bName.equals(binding)) {
- String bUri = bList.get(j).getURI();
- System.out.println(component + "/" + service + "-> binding name: " + bName + ", uri: " + bUri);
- return bUri;
- }
- }
- }
- }
- return null;
- }
-
- public static Definition getWSDLDefinition(String component, String service) {
- return getWSDLDefinition(component, service, service);
- }
-
- public static Definition getWSDLDefinition(String component, String service, String binding) {
-
- String uri = getUri(component, service, binding);
-
- if (uri == null)
- return null;
-
- try {
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose",false);
- wsdlReader.setFeature("javax.wsdl.importDocuments",true);
- return wsdlReader.readWSDL(uri + "?wsdl");
- } catch (WSDLException e) {
- e.printStackTrace(System.out);
- }
- return null;
- }
-
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/pom.xml
deleted file mode 100644
index 6626e8ee2b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-wsbinding-nowsdl</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding-nowsdl-defaultbinding</artifactId>
- <name>Apache Tuscany SCA Web Service Binding Verification Tests - No WSDL Default Binding</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/AService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/AService.java
deleted file mode 100644
index b99ced1e17..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/AService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AService.
- */
-@Remotable
-public interface AService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/BService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/BService.java
deleted file mode 100644
index 77c7bd4071..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/BService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/CService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/CService.java
deleted file mode 100644
index b1979b99d9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/CService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface CService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public Integer getInteger(Integer i);
-
- public float getFloat(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/DService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/DService.java
deleted file mode 100644
index 9a99700550..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/DService.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for DService.
- */
-@Remotable
-public interface DService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
- public String getC1String(String aString);
-
- public String getC1String2(String aString, String bString);
-
- public Integer getC1Integer(Integer i);
-
- public float getC1Float(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/AServiceImpl.java
deleted file mode 100644
index 862dd78735..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/AServiceImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- public BService b1;
-
- public String getName() {
- return "AService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/BServiceImpl.java
deleted file mode 100644
index 225476ada0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/BServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- public String getName() {
- return "BService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/CServiceImpl.java
deleted file mode 100644
index 9c5908f34e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/CServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.CService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl implements CService {
-
- public String getName() {
- return "CService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public Integer getInteger(Integer i) {
- return i;
- }
-
- public float getFloat(float f) {
- return f;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/DServiceImpl.java
deleted file mode 100644
index 9bda9468f5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/DServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.CService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.DService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(DService.class)
-public class DServiceImpl implements DService {
-
- @Reference
- public BService b1;
-
- @Reference
- public CService c1;
-
- public String getName() {
- return "DService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
- public String getC1String(String aString) {
- return c1.getString(aString);
- }
-
- public String getC1String2(String aString, String bString) {
- return c1.getString2(aString, bString);
- }
-
- public Integer getC1Integer(Integer i) {
- return c1.getInteger(i);
- }
-
- public float getC1Float(float f) {
- return c1.getFloat(f);
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/resources/nowsdl.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/resources/nowsdl.composite
deleted file mode 100644
index 39d66fa365..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/main/resources/nowsdl.composite
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest.wsbinding.nowsdl.defaultbinding"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="nowsdl.defaultbinding">
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService"/>
- <binding.ws uri="http://localhost:8085/BComponent"/>
- </service>
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl.CServiceImpl"/>
- <service name="CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.CService"/>
- <binding.ws uri="http://localhost:8085/CComponent"/>
- </service>
- </component>
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService"/>
- <binding.ws uri="http://localhost:8085/BComponent"/>
- </reference>
- </component>
-
- <component name="DComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl.DServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService"/>
- <binding.ws uri="http://localhost:8085/BComponent"/>
- </reference>
- <reference name="c1" target="CComponent/CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.CService"/>
- <binding.ws uri="http://localhost:8085/CComponent"/>
- </reference>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/NoWsdlDefaultBindingTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/NoWsdlDefaultBindingTestCase.java
deleted file mode 100644
index b50774cfa9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/defaultbinding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/NoWsdlDefaultBindingTestCase.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.DService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests the simplest form of the binding element without WSDL document
- * described in section section 2.2.2 of SCA Web Services Binding V1.00
- *
- * @TODO - will add following tests<br>
- * <li>promoted service</li>
- * <li>with complex type object</li>
- */
-public class NoWsdlDefaultBindingTestCase {
-
- protected static ServiceFinder serviceFinder;
- protected static String compositeName = "nowsdl.composite";
- protected static AService a;
- protected static DService d;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a = ServiceFinder.getService(AService.class, "AComponent");
- d = ServiceFinder.getService(DService.class, "DComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 169-181:<br>
- * 2.2.2 Examples Without a WSDL Document<br>
- * The next example shows the simplest form of the binding element without
- * WSDL document,<br>
- * ...<br>
- * which itself uses all the defaults.<br>
- */
- @Test
- public void testNoWsdl1() throws Exception {
- String aName = a.getName();
- String b1Str1 = a.getB1String("string1");
- String b1Str2 = a.getB1String2("string2", "string3");
- int b1Int = a.getB1Int(4000);
-
- System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
- }
-
- /**
- * Lines 169-181:<br>
- * Test two references using binding.ws but without WSDL documents.<br>
- */
- @Test
- public void testNoWsdl2() throws Exception {
- String dName = d.getName();
- String b1Str1 = d.getB1String("string1");
- String b1Str2 = d.getB1String2("string2", "string3");
- String c1Str1 = d.getC1String("string5");
- String c1Str2 = d.getC1String2("string6", "string7");
-
- int b1Int = d.getB1Int(4000);
- float c1Float = d.getC1Float((float) 8.8);
-
- Integer c1Integer = d.getC1Integer(new Integer(9000));
-
- System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer);
- Assert.assertEquals("DService", dName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
- Assert.assertEquals("string5", c1Str1);
- Assert.assertEquals("string6string7", c1Str2);
- Assert.assertEquals((float) 8.8, c1Float);
- Assert.assertEquals(new Integer(9000), c1Integer);
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/pom.xml
deleted file mode 100644
index bc65b57ebd..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-wsbinding-nowsdl</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding-nowsdl-multisoapbindings</artifactId>
- <name>Apache Tuscany SCA Web Service Binding Verification Tests - No WSDL Multi Soap Bindings</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/AService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/AService.java
deleted file mode 100644
index 1edeea95a3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/AService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AService.
- */
-@Remotable
-public interface AService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/BService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/BService.java
deleted file mode 100644
index 007ff62f17..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/BService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/CService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/CService.java
deleted file mode 100644
index 63049ac3df..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/CService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface CService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public Integer getInteger(Integer i);
-
- public float getFloat(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/DService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/DService.java
deleted file mode 100644
index 1a8d4671aa..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/DService.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for DService.
- */
-@Remotable
-public interface DService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
- public String getC1String(String aString);
-
- public String getC1String2(String aString, String bString);
-
- public Integer getC1Integer(Integer i);
-
- public float getC1Float(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/AServiceImpl.java
deleted file mode 100644
index abed24390e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/AServiceImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- public BService b1;
-
- public String getName() {
- return "AService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/BServiceImpl.java
deleted file mode 100644
index aba7748bb0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/BServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- public String getName() {
- return "BService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/CServiceImpl.java
deleted file mode 100644
index c7bf86e5eb..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/CServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl implements CService {
-
- public String getName() {
- return "CService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public Integer getInteger(Integer i) {
- return i;
- }
-
- public float getFloat(float f) {
- return f;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/DServiceImpl.java
deleted file mode 100644
index 9f6ff73355..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/DServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.DService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(DService.class)
-public class DServiceImpl implements DService {
-
- @Reference
- public BService b1;
-
- @Reference
- public CService c1;
-
- public String getName() {
- return "DService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
- public String getC1String(String aString) {
- return c1.getString(aString);
- }
-
- public String getC1String2(String aString, String bString) {
- return c1.getString2(aString, bString);
- }
-
- public Integer getC1Integer(Integer i) {
- return c1.getInteger(i);
- }
-
- public float getC1Float(float f) {
- return c1.getFloat(f);
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite
deleted file mode 100644
index 8cd599354a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest.wsbinding.nowsdl"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="nowsdl">
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
- <binding.ws name="BServiceSOAP11" requires="SOAP.1_1" uri="http://localhost:8085/BService/soap11"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BService/soap12"/>
- </service>
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.CServiceImpl"/>
- <service name="CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/>
- <binding.ws name="CServiceSOAP12" requires="SOAP.1_2" uri="http://localhost:8085/CService/soap12"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/CService/soap11"/>
- </service>
- </component>
-
- <component name="AComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
- <binding.ws/>
- </reference>
- </component>
-
- <component name="AComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
- <binding.ws requires="SOAP"/>
- </reference>
- </component>
-
- <component name="AComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
- <binding.ws requires="SOAP.1_1"/>
- </reference>
- </component>
-
- <component name="AComponent4">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
- <binding.ws requires="SOAP.1_2"/>
- </reference>
- </component>
-
- <component name="DComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.DServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
- <binding.ws requires="SOAP.1_1"/>
- </reference>
- <reference name="c1" target="CComponent/CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/>
- <binding.ws requires="SOAP.1_2"/>
- </reference>
- </component>
-
- <component name="DComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.DServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
- <binding.ws requires="SOAP.1_2"/>
- </reference>
- <reference name="c1" target="CComponent/CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/>
- <binding.ws requires="SOAP.1_1"/>
- </reference>
- </component>
-
- <service name="BServicePromoted" promote="BComponentPromoted">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
- <binding.ws name="BServicePromotedSOAP11" requires="SOAP.1_1" uri="http://localhost:8085/BServicePromoted/soap11"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServicePromoted/soap12"/>
- </service>
-
- <service name="CServicePromoted" promote="CComponentPromoted">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/>
- <binding.ws name="CServicePromotedSOAP12" requires="SOAP.1_2" uri="http://localhost:8085/CServicePromoted/soap12"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/CServicePromoted/soap11"/>
- </service>
-
- <component name="BComponentPromoted">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.BServiceImpl"/>
- </component>
-
- <component name="CComponentPromoted">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.CServiceImpl"/>
- </component>
-
- <reference name="DComponent3B1" promote="DComponent3/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServicePromoted/soap12"/>
- </reference>
-
- <reference name="DComponent3C1" promote="DComponent3/c1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/CServicePromoted/soap11"/>
- </reference>
-
- <component name="DComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.DServiceImpl"/>
- <reference name="b1"/>
- <reference name="c1"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/GeneratedWSDLTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/GeneratedWSDLTestCase.java
deleted file mode 100644
index ae058cf6c9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/GeneratedWSDLTestCase.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Binding;
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.http.HTTPAddress;
-import javax.wsdl.extensions.http.HTTPBinding;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap.SOAPBinding;
-import javax.wsdl.extensions.soap12.SOAP12Address;
-import javax.wsdl.extensions.soap12.SOAP12Binding;
-
-import junit.framework.Assert;
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Tests the simplest form of the binding element without WSDL document
- * described in section 2.3.2 of SCA Web Services Binding V1.00
- */
-public class GeneratedWSDLTestCase {
-
- protected static String compositeName = "nowsdlmultisoapbindings.composite";
- protected static Definition cWSDL = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- cWSDL = ServiceFinder.getWSDLDefinition("CComponent", "CService");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- private Map getPorts(Definition wsdl, String service) {
- String targetNamespace = wsdl.getTargetNamespace();
- HashMap sMap = (HashMap) wsdl.getServices();
- for (Iterator i = sMap.keySet().iterator(); i.hasNext();) {
- Object k1 = i.next();
- Service s = (Service) sMap.get(k1);
- String qName = "{" + targetNamespace + "}" + service;
- if (s.getQName().toString().equals(qName)) {
- return s.getPorts();
- }
- // Don't why implmentation changed to add Service at the end of qname
- if (s.getQName().toString().equals(qName + "Service")) {
- return s.getPorts();
- }
- }
- return null;
- }
-
- /**
- * Lines 262-264:<br>
- * The WSDL service has one or more ports for each web service binding on
- * the SCA service that has a SOAP requirement, or that refers to an
- * existing WSDL binding, depending on the requirements of the web service
- * binding. Each of those ports has a single binding.<p>
- * Each service has following bindings:<br>
- * <li>SoapBinding - PortType and SOAP11</li>
- * <li>SOAP12Binding - SOAP12</li>
- * <li>HTTPBinding - Http</li>
- * <br>and following ports:<br>
- * <li>SoapAddress</li>
- * <li>SOAP12Address</li>
- * <li>HTTPAddress</li>
- */
- @Test
- @Ignore
- // Only generate SOAP port and binding
- public void testMultiSoapBindings4() throws Exception {
-
- Map pMap = getPorts(cWSDL, "CService");
- int numSoapPort = 0;
- int numSoap12Port = 0;
- int numHttpPort = 0;
- for (Iterator iter = pMap.keySet().iterator(); iter.hasNext();) {
- Object k2 = iter.next();
- Port p = (Port) pMap.get(k2);
- List eeList = p.getExtensibilityElements();
- for (int i = 0; i < eeList.size(); i++) {
- Object address = eeList.get(i);
- if (address instanceof SOAPAddress) {
- numSoapPort++;
- } else if (address instanceof SOAP12Address) {
- numSoap12Port++;
- } else if (address instanceof HTTPAddress) {
- numHttpPort++;
- };
- }
- }
-
- Map cMap = cWSDL.getBindings();
- int numSoapBinding = 0;
- int numSoap12Binding = 0;
- int numHttpBinding = 0;
- for (Iterator iter = cMap.keySet().iterator(); iter.hasNext();) {
- Object k1 = iter.next();
- Binding b = (Binding) cMap.get(k1);
- List eeList = b.getExtensibilityElements();
- for (int i = 0; i < eeList.size(); i++) {
- Object binding = eeList.get(i);
- if (binding instanceof SOAPBinding) {
- numSoapBinding++;
- } else if (binding instanceof SOAP12Binding) {
- numSoap12Binding++;
- } else if (binding instanceof HTTPBinding) {
- numHttpBinding++;
- }
- }
- }
-
- System.out.println("testMultiSoapBindings4");
- System.out.println(" # of SOAPPort: " + numSoapPort);
- System.out.println(" # of SOAP12Port: " + numSoap12Port);
- System.out.println(" # of HTTPPort: " + numHttpPort);
- System.out.println(" # of SOAPBinding: " + numSoapBinding);
- System.out.println(" # of SOAP12Binding: " + numSoap12Binding);
- System.out.println(" # of HTTPBinding: " + numHttpBinding);
-
- Assert.assertEquals(numSoapPort, 1);
- Assert.assertTrue(numSoap12Port > 0);
- Assert.assertTrue(numSoapBinding > 0);
- Assert.assertEquals(numSoap12Binding, 1);
- // Skipped to test HTTP
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java
deleted file mode 100644
index 5dbb696bf5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings;
-
-import junit.framework.Assert;
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.DService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests the simplest form of the binding element without WSDL document
- * described in section section 2.2.2 and 2.3.2 of SCA Web Services
- * Binding V1.00
- */
-public class NoWsdlMultiSoapBindingsTestCase {
-
- protected static String compositeName = "nowsdlmultisoapbindings.composite";
- protected static AService a1;
- protected static AService a2;
- protected static AService a3;
- protected static AService a4;
- protected static DService d1;
- protected static DService d2;
- protected static DService d3;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a1 = ServiceFinder.getService(AService.class, "AComponent1");
- a2 = ServiceFinder.getService(AService.class, "AComponent2");
- a3 = ServiceFinder.getService(AService.class, "AComponent3");
- a4 = ServiceFinder.getService(AService.class, "AComponent4");
- d1 = ServiceFinder.getService(DService.class, "DComponent1");
- d2 = ServiceFinder.getService(DService.class, "DComponent2");
- d3 = ServiceFinder.getService(DService.class, "DComponent3");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 201-225:<br>
- * The next example shows the use of the binding element without a WSDL
- * document, with multiple SOAP bindings with non-default values. The SOAP
- * 1.2 binding name defaults to the service name, the SOAP 1.1 binding is
- * given an explicit name. The reference has a web service binding which
- * uses SOAP 1.2, but otherwise uses all the defaults for SOAP binding.
- * The reference binding name defaults to the reference name.<p>
- * Line 253:<br>
- * <li>soap</li>
- * ...<br>
- * version, including multiple versions.<br>
- * <p>
- * AComponent1 - no requires<br>
- * AComponent2 - requires = soap<br>
- * AComponent3 - requires = soap.1_1<br>
- * AComponent4 - requires = soap.1_2<br>
- */
- @Test
- public void testMultiSoapBindings1() throws Exception {
-
- String aName = a1.getName();
- String b1Str1 = a1.getB1String("string1");
- String b1Str2 = a1.getB1String2("string2", "string3");
- int b1Int = a1.getB1Int(1000);
-
- System.out.println("AComponent1: " + aName + ", " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(1000, b1Int);
-
- aName = a2.getName();
- b1Str1 = a2.getB1String("string1");
- b1Str2 = a2.getB1String2("string2", "string3");
- b1Int = a2.getB1Int(2000);
-
- System.out.println("AComponent2: " + aName + ", " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(2000, b1Int);
-
- aName = a3.getName();
- b1Str1 = a3.getB1String("string1");
- b1Str2 = a3.getB1String2("string2", "string3");
- b1Int = a3.getB1Int(3000);
-
- System.out.println("AComponent3: " + aName + ", " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(3000, b1Int);
-
- aName = a4.getName();
- b1Str1 = a4.getB1String("string1");
- b1Str2 = a4.getB1String2("string2", "string3");
- b1Int = a4.getB1Int(4000);
-
- System.out.println("AComponent4: " + aName + ", " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
-
- }
-
- /**
- * Lines 201-225, 262-264:<br>
- * The WSDL service has one or more ports for each web service binding on
- * the SCA service that has a SOAP requirement, or that refers to an
- * existing WSDL binding, depending on the requirements of the web service
- * binding. Each of those ports has a single binding.<br>
- * <p>
- * Test multiple SOAP bindings with two references which use different versions.<br>
- */
- @Test
- public void testMultiSoapBindings2() throws Exception {
-
- String dName = d1.getName();
- String b1Str1 = d1.getB1String("string1");
- String b1Str2 = d1.getB1String2("string2", "string3");
- String c1Str1 = d1.getC1String("string5");
- String c1Str2 = d1.getC1String2("string6", "string7");
- int b1Int = d1.getB1Int(4000);
- float c1Float = d1.getC1Float((float) 8.8);
- Integer c1Integer = d1.getC1Integer(new Integer(9001));
-
- System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer);
- Assert.assertEquals("DService", dName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
- Assert.assertEquals("string5", c1Str1);
- Assert.assertEquals("string6string7", c1Str2);
- Assert.assertEquals((float) 8.8, c1Float);
- Assert.assertEquals(new Integer(9001), c1Integer);
-
- dName = d2.getName();
- b1Str1 = d2.getB1String("string1");
- b1Str2 = d2.getB1String2("string2", "string3");
- c1Str1 = d2.getC1String("string5");
- c1Str2 = d2.getC1String2("string6", "string7");
- b1Int = d2.getB1Int(4000);
- c1Float = d2.getC1Float((float) 8.8);
- c1Integer = d2.getC1Integer(new Integer(9002));
-
- System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer);
- Assert.assertEquals("DService", dName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
- Assert.assertEquals("string5", c1Str1);
- Assert.assertEquals("string6string7", c1Str2);
- Assert.assertEquals((float) 8.8, c1Float);
- Assert.assertEquals(new Integer(9002), c1Integer);
- }
-
- /**
- * Lines 201-225, 262-264:<br>
- * Test multiple SOAP bindings with promoted services and references.<br>
- */
- @Test
- public void testMultiSoapBindings3() throws Exception {
-
- String dName = d3.getName();
- String b1Str1 = d3.getB1String("string1");
- String b1Str2 = d3.getB1String2("string2", "string3");
- String c1Str1 = d3.getC1String("string5");
- String c1Str2 = d3.getC1String2("string6", "string7");
- int b1Int = d3.getB1Int(4000);
- float c1Float = d3.getC1Float((float) 8.8);
- Integer c1Integer = d3.getC1Integer(new Integer(9003));
-
- System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer);
- Assert.assertEquals("DService", dName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
- Assert.assertEquals("string5", c1Str1);
- Assert.assertEquals("string6string7", c1Str2);
- Assert.assertEquals((float) 8.8, c1Float);
- Assert.assertEquals(new Integer(9003), c1Integer);
-
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/pom.xml
deleted file mode 100644
index 54216350ec..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/pom.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-wsbinding</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding-nowsdl</artifactId>
- <packaging>pom</packaging>
-
- <name>Apache Tuscany SCA Web Service Binding Verification Tests - No WSDL</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>vtest-utilities</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>defaultbinding</module>
- <module>soapversion</module>
- <module>multisoapbindings</module>
- <module>promoted</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/pom.xml
deleted file mode 100644
index e8fa0137fc..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-wsbinding-nowsdl</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding-nowsdl-promoted</artifactId>
- <name>Apache Tuscany SCA Web Service Binding Verification Tests - No WSDL Promoted Service and Reference</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java
deleted file mode 100644
index d786f36db1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AService.
- */
-@Remotable
-public interface AService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BService.java
deleted file mode 100644
index d4ebfcfe37..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP.java
deleted file mode 100644
index 7289714ed2..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BServiceSOAP {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP11.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP11.java
deleted file mode 100644
index e0c58088da..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP11.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BServiceSOAP11 {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP12.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP12.java
deleted file mode 100644
index e279b1d55d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP12.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BServiceSOAP12 {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/CService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/CService.java
deleted file mode 100644
index 9aaba29629..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/CService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface CService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public Integer getInteger(Integer i);
-
- public float getFloat(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/DService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/DService.java
deleted file mode 100644
index 35291dc402..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/DService.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for DService.
- */
-@Remotable
-public interface DService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
- public String getC1String(String aString);
-
- public String getC1String2(String aString, String bString);
-
- public Integer getC1Integer(Integer i);
-
- public float getC1Float(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/AServiceImpl.java
deleted file mode 100644
index 0bc776b06d..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/AServiceImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- public BService b1;
-
- public String getName() {
- return "AService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceImpl.java
deleted file mode 100644
index 8ebf27bdb1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- public String getName() {
- return "BService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP11Impl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP11Impl.java
deleted file mode 100644
index 22247f8372..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP11Impl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BServiceSOAP11.class)
-public class BServiceSOAP11Impl implements BServiceSOAP11 {
-
- public String getName() {
- return "BServiceSOAP11";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP12Impl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP12Impl.java
deleted file mode 100644
index 4fbc82227c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP12Impl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BServiceSOAP12.class)
-public class BServiceSOAP12Impl implements BServiceSOAP12 {
-
- public String getName() {
- return "BServiceSOAP12";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAPImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAPImpl.java
deleted file mode 100644
index 83f6746a5f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAPImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BServiceSOAP.class)
-public class BServiceSOAPImpl implements BServiceSOAP {
-
- public String getName() {
- return "BServiceSOAP";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/CServiceImpl.java
deleted file mode 100644
index ec6611fae4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/CServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.CService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl implements CService {
-
- public String getName() {
- return "CService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public Integer getInteger(Integer i) {
- return i;
- }
-
- public float getFloat(float f) {
- return f;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/DServiceImpl.java
deleted file mode 100644
index 4b488c376e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/DServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.CService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.DService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(DService.class)
-public class DServiceImpl implements DService {
-
- @Reference
- public BService b1;
-
- @Reference
- public CService c1;
-
- public String getName() {
- return "DService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
- public String getC1String(String aString) {
- return c1.getString(aString);
- }
-
- public String getC1String2(String aString, String bString) {
- return c1.getString2(aString, bString);
- }
-
- public Integer getC1Integer(Integer i) {
- return c1.getInteger(i);
- }
-
- public float getC1Float(float f) {
- return c1.getFloat(f);
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/resources/nowsdlpromoted.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/resources/nowsdlpromoted.composite
deleted file mode 100644
index f79df5bf8f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/main/resources/nowsdlpromoted.composite
+++ /dev/null
@@ -1,246 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest.wsbinding.nowsdl.promoted"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="nowsdl.promoted">
-
- <service name="BService" promote="BComponent">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService"/>
- <binding.ws uri="http://localhost:8085/BService"/>
- </service>
-
- <service name="BServiceSOAP" promote="BComponentSOAP">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP"/>
- <binding.ws requires="SOAP" uri="http://localhost:8085/BServiceSOAP"/>
- </service>
-
- <service name="BServiceSOAP11" promote="BComponentSOAP11">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BServiceSOAP11"/>
- </service>
-
- <service name="BServiceSOAP12" promote="BComponentSOAP12">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServiceSOAP12"/>
- </service>
-
- <service name="CService" promote="CComponent">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.CService"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/CService"/>
- </service>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.BServiceImpl"/>
- </component>
-
- <component name="BComponentSOAP">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.BServiceSOAPImpl"/>
- </component>
-
- <component name="BComponentSOAP11">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.BServiceSOAP11Impl"/>
- </component>
-
- <component name="BComponentSOAP12">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.BServiceSOAP12Impl"/>
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.CServiceImpl"/>
- </component>
-
- <reference name="AComponent1B1" promote="AComponent1/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService"/>
- <binding.ws uri="http://localhost:8085/BService"/>
- </reference>
-
- <reference name="AComponent2B1" promote="AComponent2/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService"/>
- <binding.ws requires="SOAP" uri="http://localhost:8085/BService"/>
- </reference>
-
- <reference name="AComponent3B1" promote="AComponent3/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BService"/>
- </reference>
-
- <reference name="AComponent4B1" promote="AComponent4/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BService"/>
- </reference>
-
- <reference name="AComponent5B1" promote="AComponent5/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP"/>
- <binding.ws uri="http://localhost:8085/BServiceSOAP"/>
- </reference>
-
- <reference name="AComponent6B1" promote="AComponent6/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP"/>
- <binding.ws requires="SOAP" uri="http://localhost:8085/BServiceSOAP"/>
- </reference>
-
- <reference name="AComponent7B1" promote="AComponent7/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BServiceSOAP"/>
- </reference>
-
- <reference name="AComponent8B1" promote="AComponent8/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServiceSOAP"/>
- </reference>
-
- <reference name="AComponent9B1" promote="AComponent9/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/>
- <binding.ws uri="http://localhost:8085/BServiceSOAP11"/>
- </reference>
-
- <reference name="AComponent10B1" promote="AComponent10/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/>
- <binding.ws requires="SOAP" uri="http://localhost:8085/BServiceSOAP11"/>
- </reference>
-
- <reference name="AComponent11B1" promote="AComponent11/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BServiceSOAP11"/>
- </reference>
-
- <reference name="AComponent12B1" promote="AComponent12/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServiceSOAP11"/>
- </reference>
-
- <reference name="AComponent13B1" promote="AComponent13/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12"/>
- <binding.ws uri="http://localhost:8085/BServiceSOAP12"/>
- </reference>
-
- <reference name="AComponent14B1" promote="AComponent14/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12"/>
- <binding.ws requires="SOAP" uri="http://localhost:8085/BServiceSOAP12"/>
- </reference>
-
- <reference name="AComponent15B1" promote="AComponent15/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BServiceSOAP12"/>
- </reference>
-
- <reference name="AComponent16B1" promote="AComponent16/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServiceSOAP12"/>
- </reference>
-
- <reference name="DComponentB1" promote="DComponent/b1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BServiceSOAP11"/>
- </reference>
-
- <reference name="DComponentC1" promote="DComponent/c1">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.CService"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/CService"/>
- </reference>
-
- <component name="AComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent4">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent5">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent6">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent7">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent8">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent9">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent10">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent11">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent12">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent13">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent14">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent15">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="AComponent16">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/>
- <reference name="b1"/>
- </component>
-
- <component name="DComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.DServiceImpl"/>
- <reference name="b1"/>
- <reference name="c1"/>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted1TestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted1TestCase.java
deleted file mode 100644
index ae7dafa46e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted1TestCase.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted;
-
-import junit.framework.Assert;
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.AService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests the simplest form of the binding element without WSDL document
- * described in section section 2.3.1 and 2.3.3.1 of SCA Web Services Binding
- * V1.00
- */
-public class NoWsdlPromoted1TestCase {
-
- protected static ServiceFinder serviceFinder;
- protected static String compositeName = "nowsdlpromoted.composite";
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 251-253, 287-291:<br>
- * <li>soap</li>
- * This indicates that a SOAP binding is required. The SOAP binding may be
- * of any SOAP version, including multiple versions.<br>
- * <br>
- * 2.3.3.1 SOAP versions<br>
- * Where a web service binding requires a specific SOAP version, then a
- * single WSDL port and SOAP binding of the appropriate version is
- * generated. Where no specific SOAP version is required, then one or more
- * WSDL ports with associated SOAP bindings may be generated, depending on
- * the level(s) supported in the target runtime.<br>
- * <p>
- * Tests promoted services and references<br>
- */
- @Test
- public void testSoapVersion1() throws Exception {
-
- for (int i = 0; i < 8; i++) {
- AService a = ServiceFinder.getService(AService.class, "AComponent" + (i+1));
- String aName = a.getName();
- String b1Str1 = a.getB1String("string1");
- String b1Str2 = a.getB1String2("string2", "string3");
- int b1Int = a.getB1Int(i * 1000 + 1000);
- System.out.println(i + " - " + aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(i * 1000 + 1000, b1Int);
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted2TestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted2TestCase.java
deleted file mode 100644
index a4744b9007..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted2TestCase.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted;
-
-import junit.framework.Assert;
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.DService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests the simplest form of the binding element without WSDL document
- * described in section section 2.3.1 and 2.3.3.1 of SCA Web Services Binding
- * V1.00
- */
-public class NoWsdlPromoted2TestCase {
-
- protected static ServiceFinder serviceFinder;
- protected static String compositeName = "nowsdlpromoted.composite";
- protected static DService d;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- d = ServiceFinder.getService(DService.class, "DComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 254-257, 287-291:<br>
- * <li>soap.1_1</li><br>
- * A SOAP 1.1 binding only is required.<br>
- * <li>soap.1_2</li><br>
- * A SOAP 1.2 binding only is required.<br>
- * <br>
- * 2.3.3.1 SOAP versions<br>
- * Where a web service binding requires a specific SOAP version, then a
- * single WSDL port and SOAP binding of the appropriate version is
- * generated. Where no specific SOAP version is required, then one or more
- * WSDL ports with associated SOAP bindings may be generated, depending on
- * the level(s) supported in the target runtime.<br>
- * <p>
- * Tests promoted services and references<br>
- */
- @Test
- public void testSoapVersion2() throws Exception {
-
- for (int i = 8; i < 16; i++) {
- AService a = ServiceFinder.getService(AService.class, "AComponent" + (i+1));
- String aName = a.getName();
- String b1Str1 = a.getB1String("string1");
- String b1Str2 = a.getB1String2("string2", "string3");
- int b1Int = a.getB1Int(i * 1000 + 1000);
- System.out.println(i + " - " + aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(i * 1000 + 1000, b1Int);
- }
- }
-
- /**
- * Lines 254-257, 287-291:<br>
- * Test two references using binding.ws with 2 different SOAP versions
- * and without WSDL document.<br>
- */
- @Test
- public void testSoapVersion3() throws Exception {
- String dName = d.getName();
- String b1Str1 = d.getB1String("string1");
- String b1Str2 = d.getB1String2("string2", "string3");
- String c1Str1 = d.getC1String("string5");
- String c1Str2 = d.getC1String2("string6", "string7");
-
- int b1Int = d.getB1Int(4000);
- float c1Float = d.getC1Float((float) 8.8);
-
- Integer c1Integer = d.getC1Integer(new Integer(9000));
-
- System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer);
- Assert.assertEquals("DService", dName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
- Assert.assertEquals("string5", c1Str1);
- Assert.assertEquals("string6string7", c1Str2);
- Assert.assertEquals((float) 8.8, c1Float);
- Assert.assertEquals(new Integer(9000), c1Integer);
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/pom.xml
deleted file mode 100644
index 8db04db4f7..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-wsbinding-nowsdl</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding-nowsdl-soapversion</artifactId>
- <name>Apache Tuscany SCA Web Service Binding Verification Tests - No WSDL SOAP Version</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/AService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/AService.java
deleted file mode 100644
index e78c977ef0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/AService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AService.
- */
-@Remotable
-public interface AService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BService.java
deleted file mode 100644
index 1d95f089c9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP.java
deleted file mode 100644
index 45d10bbd45..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BServiceSOAP {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP11.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP11.java
deleted file mode 100644
index f55e23012f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP11.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BServiceSOAP11 {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP12.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP12.java
deleted file mode 100644
index 91c9860b98..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP12.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BServiceSOAP12 {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/CService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/CService.java
deleted file mode 100644
index 99d4f7b09f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/CService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface CService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public Integer getInteger(Integer i);
-
- public float getFloat(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/DService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/DService.java
deleted file mode 100644
index e95fae6877..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/DService.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for DService.
- */
-@Remotable
-public interface DService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
- public String getC1String(String aString);
-
- public String getC1String2(String aString, String bString);
-
- public Integer getC1Integer(Integer i);
-
- public float getC1Float(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/AServiceImpl.java
deleted file mode 100644
index a313b769e5..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/AServiceImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference
- public BService b1;
-
- public String getName() {
- return "AService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceImpl.java
deleted file mode 100644
index 3baf691d88..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- public String getName() {
- return "BService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP11Impl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP11Impl.java
deleted file mode 100644
index 965e195ae3..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP11Impl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BServiceSOAP11.class)
-public class BServiceSOAP11Impl implements BServiceSOAP11 {
-
- public String getName() {
- return "BServiceSOAP11";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP12Impl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP12Impl.java
deleted file mode 100644
index 69e7edcc68..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP12Impl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BServiceSOAP12.class)
-public class BServiceSOAP12Impl implements BServiceSOAP12 {
-
- public String getName() {
- return "BServiceSOAP12";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAPImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAPImpl.java
deleted file mode 100644
index 7e8294f778..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAPImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BServiceSOAP.class)
-public class BServiceSOAPImpl implements BServiceSOAP {
-
- public String getName() {
- return "BServiceSOAP";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/CServiceImpl.java
deleted file mode 100644
index 7909edeb39..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/CServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.CService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl implements CService {
-
- public String getName() {
- return "CService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public Integer getInteger(Integer i) {
- return i;
- }
-
- public float getFloat(float f) {
- return f;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/DServiceImpl.java
deleted file mode 100644
index 2f34bf08f9..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/DServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.CService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.DService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(DService.class)
-public class DServiceImpl implements DService {
-
- @Reference
- public BService b1;
-
- @Reference
- public CService c1;
-
- public String getName() {
- return "DService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
- public String getC1String(String aString) {
- return c1.getString(aString);
- }
-
- public String getC1String2(String aString, String bString) {
- return c1.getString2(aString, bString);
- }
-
- public Integer getC1Integer(Integer i) {
- return c1.getInteger(i);
- }
-
- public float getC1Float(float f) {
- return c1.getFloat(f);
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/resources/nowsdlsoapversion.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/resources/nowsdlsoapversion.composite
deleted file mode 100644
index 61a658ab55..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/main/resources/nowsdlsoapversion.composite
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest.wsbinding.nowsdl.soapversion"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="nowsdl.soapversion">
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService"/>
- <binding.ws uri="http://localhost:8085/BComponent"/>
- </service>
- </component>
-
- <component name="BComponentSOAP">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.BServiceSOAPImpl"/>
- <service name="BServiceSOAP">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP"/>
- <binding.ws requires="SOAP" uri="http://localhost:8085/BComponentSOAP"/>
- </service>
- </component>
-
- <component name="BComponentSOAP11">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.BServiceSOAP11Impl"/>
- <service name="BServiceSOAP11">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponentSOAP11"/>
- </service>
- </component>
-
- <component name="BComponentSOAP12">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.BServiceSOAP12Impl"/>
- <service name="BServiceSOAP12">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BComponentSOAP12"/>
- </service>
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.CServiceImpl"/>
- <service name="CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.CService"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/CComponent"/>
- </service>
- </component>
-
- <component name="AComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService"/>
- <binding.ws uri="http://localhost:8085/BComponent"/>
- </reference>
- </component>
-
- <component name="AComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService"/>
- <binding.ws requires="SOAP" uri="http://localhost:8085/BComponent"/>
- </reference>
- </component>
-
- <component name="AComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponent"/>
- </reference>
- </component>
-
- <component name="AComponent4">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BComponent"/>
- </reference>
- </component>
-
- <component name="AComponent5">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP/BServiceSOAP">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP"/>
- <binding.ws uri="http://localhost:8085/BComponentSOAP"/>
- </reference>
- </component>
-
- <component name="AComponent6">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP/BServiceSOAP">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP"/>
- <binding.ws requires="SOAP" uri="http://localhost:8085/BComponentSOAP"/>
- </reference>
- </component>
-
- <component name="AComponent7">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP/BServiceSOAP">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponentSOAP"/>
- </reference>
- </component>
-
- <component name="AComponent8">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP/BServiceSOAP">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BComponentSOAP"/>
- </reference>
- </component>
-
- <component name="AComponent9">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP11/BServiceSOAP11">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/>
- <binding.ws uri="http://localhost:8085/BComponentSOAP11"/>
- </reference>
- </component>
-
- <component name="AComponent10">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP11/BServiceSOAP11">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/>
- <binding.ws requires="SOAP" uri="http://localhost:8085/BComponentSOAP11"/>
- </reference>
- </component>
-
- <component name="AComponent11">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP11/BServiceSOAP11">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponentSOAP11"/>
- </reference>
- </component>
-
- <component name="AComponent12">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP11/BServiceSOAP11">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BComponentSOAP11"/>
- </reference>
- </component>
-
- <component name="AComponent13">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP12/BServiceSOAP12">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12"/>
- <binding.ws uri="http://localhost:8085/BComponentSOAP12"/>
- </reference>
- </component>
-
- <component name="AComponent14">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP12/BServiceSOAP12">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12"/>
- <binding.ws requires="SOAP" uri="http://localhost:8085/BComponentSOAP12"/>
- </reference>
- </component>
-
- <component name="AComponent15">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP12/BServiceSOAP12">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponentSOAP12"/>
- </reference>
- </component>
-
- <component name="AComponent16">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/>
- <reference name="b1" target="BComponentSOAP12/BServiceSOAP12">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BComponentSOAP12"/>
- </reference>
- </component>
-
- <component name="DComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.DServiceImpl"/>
- <reference name="b1" target="BComponentSOAP11/BServiceSOAP11">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/>
- <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponentSOAP11"/>
- </reference>
- <reference name="c1" target="CComponent/CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.CService"/>
- <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/CComponent"/>
- </reference>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/GeneratedWSDLTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/GeneratedWSDLTestCase.java
deleted file mode 100644
index edd0d91072..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/GeneratedWSDLTestCase.java
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Binding;
-import javax.wsdl.BindingInput;
-import javax.wsdl.BindingOperation;
-import javax.wsdl.BindingOutput;
-import javax.wsdl.Definition;
-import javax.wsdl.Operation;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.http.HTTPAddress;
-import javax.wsdl.extensions.http.HTTPBinding;
-import javax.wsdl.extensions.http.HTTPOperation;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap.SOAPBinding;
-import javax.wsdl.extensions.soap.SOAPBody;
-import javax.wsdl.extensions.soap.SOAPHeader;
-import javax.wsdl.extensions.soap.SOAPHeaderFault;
-import javax.wsdl.extensions.soap.SOAPOperation;
-import javax.wsdl.extensions.soap12.SOAP12Address;
-import javax.wsdl.extensions.soap12.SOAP12Binding;
-import javax.wsdl.extensions.soap12.SOAP12Body;
-import javax.wsdl.extensions.soap12.SOAP12Header;
-import javax.wsdl.extensions.soap12.SOAP12HeaderFault;
-import javax.wsdl.extensions.soap12.SOAP12Operation;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.CService;
-
-
-/**
- * Tests the simplest form of the binding element without WSDL document
- * described in section section 2.3.2, 2.3.3, 2.3.3.1, and 2.3.4 of SCA
- * Web Services Binding V1.00
- */
-public class GeneratedWSDLTestCase {
-
- protected static ServiceFinder serviceFinder;
- protected static String compositeName = "nowsdlsoapversion.composite";
- protected static Definition bWSDL = null;
- protected static Definition cWSDL = null;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- bWSDL = ServiceFinder.getWSDLDefinition("BComponent", "BService");
- cWSDL = ServiceFinder.getWSDLDefinition("CComponent", "CService");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 260-262:<br>
- * A separate WSDL document is generated for each SCA service. Each has
- * its own unique target namespace. This is to ensure that bindings on
- * different services of the same component do not clash.<br>
- */
- @Test
- @Ignore("TUSCANY-2607")
- // Don't know why target namespaces are same
- public void testSoapVersion4() throws Exception {
- String cTargetNamespace = cWSDL.getTargetNamespace();
- String bTargetNamespace = bWSDL.getTargetNamespace();
- Assert.assertFalse(bTargetNamespace.equals(cTargetNamespace));
- }
-
- /**
- * Lines 271-273:<br>
- * The target namespace of the WSDL document, and of the service, ports and
- * generated binding elements is:<br>
- * Base System URI for HTTP / Component Name / Service Name<br>
- */
- @Test
- @Ignore("TUSCANY-2607")
- // The target namespace does not follow the convention
- public void testSoapVersion5() throws Exception {
- String bTargetNamespace = bWSDL.getTargetNamespace();
- String cTargetNamespace = cWSDL.getTargetNamespace();
- Assert.assertTrue(bTargetNamespace.endsWith("BComponent/BService"));
- Assert.assertTrue(cTargetNamespace.endsWith("CComponent/CService"));
- }
-
- private Map getPorts(Definition wsdl, String service) {
- String targetNamespace = wsdl.getTargetNamespace();
- HashMap sMap = (HashMap) wsdl.getServices();
- for (Iterator i = sMap.keySet().iterator(); i.hasNext();) {
- Object k1 = i.next();
- Service s = (Service) sMap.get(k1);
- String qName = "{" + targetNamespace + "}" + service;
- if (s.getQName().toString().equals(qName)) {
- return s.getPorts();
- }
- // Don't why implmentation changed to add Service at the end of qname
- if (s.getQName().toString().equals(qName + "Service")) {
- return s.getPorts();
- }
- }
- return null;
- }
-
- /**
- * Lines 262-264, 290-291:<br>
- * The WSDL service has one or more ports for each web service binding on
- * the SCA service that has a SOAP requirement, or that refers to an
- * existing WSDL binding, depending on the requirements of the web service
- * binding. Each of those ports has a single binding.<br>
- * <p>
- * 2.3.3.1 SOAP versions<br>
- * Where no specific SOAP version is required, then one or more WSDL ports
- * with associated SOAP bindings may be generated, depending on the level(s)
- * supported in the target runtime.<br>
- * <p>
- * BComponent/BService is not specified a SOAP version.
- * It should have following bindings:<br>
- * <li>SoapBinding - PortType and SOAP11</li>
- * <li>SOAP12Binding - SOAP12</li>
- * <li>HTTPBinding - Http</li>
- * <br>and following ports:<br>
- * <li>SoapAddress</li>
- * <li>SOAP12Address</li>
- * <li>HTTPAddress</li>
-
- */
- @Test
- public void testSoapVersion6() throws Exception {
-
- Map pMap = getPorts(bWSDL, "BService");
- int numSoapPort = 0;
- int numSoap12Port = 0;
- int numHttpPort = 0;
- for (Iterator iter = pMap.keySet().iterator(); iter.hasNext();) {
- Object k2 = iter.next();
- Port p = (Port) pMap.get(k2);
- List eeList = p.getExtensibilityElements();
- for (int i = 0; i < eeList.size(); i++) {
- Object address = eeList.get(i);
- if (address instanceof SOAPAddress) {
- numSoapPort++;
- } else if (address instanceof SOAP12Address) {
- numSoap12Port++;
- } else if (address instanceof HTTPAddress) {
- numHttpPort++;
- } else {
- System.out.println("address:" + address.getClass());
- }
- }
- }
-
- Map bMap = bWSDL.getBindings();
- int numSoapBinding = 0;
- int numSoap12Binding = 0;
- int numHttpBinding = 0;
- for (Iterator iter = bMap.keySet().iterator(); iter.hasNext();) {
- Object k1 = iter.next();
- Binding b = (Binding) bMap.get(k1);
- List eeList = b.getExtensibilityElements();
- for (int i = 0; i < eeList.size(); i++) {
- Object binding = eeList.get(i);
- if (binding instanceof SOAPBinding) {
- numSoapBinding++;
- } else if (binding instanceof SOAP12Binding) {
- numSoap12Binding++;
- } else if (binding instanceof HTTPBinding) {
- numHttpBinding++;
- }
- }
- }
-
- System.out.println("testSoapVersion6");
- System.out.println(" # of SOAPPort: " + numSoapPort);
- System.out.println(" # of SOAP12Port: " + numSoap12Port);
- System.out.println(" # of HTTPPort: " + numHttpPort);
- System.out.println(" # of SOAPBinding: " + numSoapBinding);
- System.out.println(" # of SOAP12Binding: " + numSoap12Binding);
- System.out.println(" # of HTTPBinding: " + numHttpBinding);
-
- Assert.assertEquals(numSoapPort, 1);
- Assert.assertEquals(numSoap12Port, 0);
- Assert.assertTrue(numSoapBinding > 0);
- Assert.assertEquals(numSoap12Binding, 0);
- // Skipped to test HTTP
-
- }
-
- /**
- * Lines 275-284:<br>
- * 2.3.3 WSDL Bindings<br>
- * The binding elements in the generated WSDL document are either defined
- * within the document, derived from the requirements of the binding, or
- * are imported from existing WSDL documents.<br>
- * Generated bindings have the following fixed assumptions:<br>
- * <li>use="literal" for input and output messages</li>
- * <li>style="document" for the binding</li>
- * <li>All faults map to soap:faults</li>
- * <li>No header or headerFault elements are generated</li>
- * <li>The transport is "http://schemas.xmlsoap.org/soap/http", unless the
- * system provides intents for alternative transports<br>
- * <p>
- */
- @Test
- public void testSoapVersion7() throws Exception {
- Map bMap = bWSDL.getBindings();
- for (Iterator iter = bMap.keySet().iterator(); iter.hasNext();) {
- Object k1 = iter.next();
- Binding b = (Binding) bMap.get(k1);
- List eeList = b.getExtensibilityElements();
- for (int i = 0; i < eeList.size(); i++) {
- Object binding = eeList.get(i);
- if (binding instanceof SOAPBinding) {
- SOAPBinding sb = (SOAPBinding) binding;
- Assert.assertEquals(sb.getStyle(), "document");
- Assert.assertEquals(sb.getTransportURI(), "http://schemas.xmlsoap.org/soap/http");
- } else if (binding instanceof SOAP12Binding) {
- SOAP12Binding sb = (SOAP12Binding) binding;
- Assert.assertEquals(sb.getStyle(), "document");
- Assert.assertEquals(sb.getTransportURI(), "http://schemas.xmlsoap.org/soap/http");
- } else if (binding instanceof HTTPBinding) {
- }
- }
- List operations = b.getBindingOperations();
- for (int i = 0; i < eeList.size(); i++) {
- BindingOperation bop = (BindingOperation) operations.get(i);
-
- List oeeList = bop.getExtensibilityElements();
- for (int j = 0; j < eeList.size(); j++) {
- Object op = oeeList.get(j);
- if (op instanceof SOAPOperation) {
- SOAPOperation sop = (SOAPOperation) op;
- if (sop.getStyle() != null)
- Assert.assertEquals(sop.getStyle(), "document");
- } else if (op instanceof SOAP12Operation) {
- SOAP12Operation sop = (SOAP12Operation) op;
- Assert.assertEquals(sop.getStyle(), "document");
- } else if (op instanceof HTTPOperation) {
- // HTTPOperation hop = (HTTPOperation) op;
- }
- }
-
- BindingInput bInput = (BindingInput) bop.getBindingInput();
- List bInputList = bInput.getExtensibilityElements();
- for (int j = 0; j < eeList.size(); j++) {
- Object body = bInputList.get(j);
- if (body instanceof SOAPBody) {
- SOAPBody sBody = (SOAPBody) body;
- Assert.assertEquals(sBody.getUse(), "literal");
- } else if (body instanceof SOAP12Body) {
- SOAP12Body sBody = (SOAP12Body) body;
- Assert.assertEquals(sBody.getUse(), "literal");
- } else {
- Assert.assertFalse(body instanceof SOAPHeader);
- Assert.assertFalse(body instanceof SOAP12Header);
- Assert.assertFalse(body instanceof SOAPHeaderFault);
- Assert.assertFalse(body instanceof SOAP12HeaderFault);
- }
- }
-
- BindingOutput bOutput = (BindingOutput) bop.getBindingOutput();
- List bOutputList = bOutput.getExtensibilityElements();
- for (int j = 0; j < eeList.size(); j++) {
- Object body = bOutputList.get(j);
- if (body instanceof SOAPBody) {
- SOAPBody sBody = (SOAPBody) body;
- Assert.assertEquals(sBody.getUse(), "literal");
- } else if (body instanceof SOAP12Body) {
- SOAP12Body sBody = (SOAP12Body) body;
- Assert.assertEquals(sBody.getUse(), "literal");
- } else {
- Assert.assertFalse(body instanceof SOAPHeader);
- Assert.assertFalse(body instanceof SOAP12Header);
- Assert.assertFalse(body instanceof SOAPHeaderFault);
- Assert.assertFalse(body instanceof SOAP12HeaderFault);
- }
- }
-
- Map bFaults = bop.getBindingFaults();
- if (bFaults.size() > 0)
- System.out.println("WARNING: Skipped to test binding faults");
-
- }
- }
- }
-
- /**
- * Lines 288-289:<br>
- * 2.3.3.1 SOAP versions<br>
- * Where a web service binding requires a specific SOAP version, then a
- * single WSDL port and SOAP binding of the appropriate version is
- * generated.
- */
- @Test
- public void testSoapVersion8() throws Exception {
-
- Map pMap = getPorts(cWSDL, "CService");
- int numSoapPort = 0;
- int numSoap12Port = 0;
- int numHttpPort = 0;
- for (Iterator iter = pMap.keySet().iterator(); iter.hasNext();) {
- Object k2 = iter.next();
- Port p = (Port) pMap.get(k2);
- List eeList = p.getExtensibilityElements();
- for (int i = 0; i < eeList.size(); i++) {
- Object address = eeList.get(i);
- if (address instanceof SOAPAddress) {
- numSoapPort++;
- } else if (address instanceof SOAP12Address) {
- numSoap12Port++;
- } else if (address instanceof HTTPAddress) {
- numHttpPort++;
- };
- }
- }
-
- Map cMap = cWSDL.getBindings();
- int numSoapBinding = 0;
- int numSoap12Binding = 0;
- int numHttpBinding = 0;
- for (Iterator iter = cMap.keySet().iterator(); iter.hasNext();) {
- Object k1 = iter.next();
- Binding b = (Binding) cMap.get(k1);
- List eeList = b.getExtensibilityElements();
- for (int i = 0; i < eeList.size(); i++) {
- Object binding = eeList.get(i);
- if (binding instanceof SOAPBinding) {
- numSoapBinding++;
- } else if (binding instanceof SOAP12Binding) {
- numSoap12Binding++;
- } else if (binding instanceof HTTPBinding) {
- numHttpBinding++;
- }
- }
- }
-
- System.out.println("testSoapVersion8");
- System.out.println(" # of SOAPPort: " + numSoapPort);
- System.out.println(" # of SOAP12Port: " + numSoap12Port);
- System.out.println(" # of HTTPPort: " + numHttpPort);
- System.out.println(" # of SOAPBinding: " + numSoapBinding);
- System.out.println(" # of SOAP12Binding: " + numSoap12Binding);
- System.out.println(" # of HTTPBinding: " + numHttpBinding);
-
- Assert.assertTrue(numSoap12Port > 0);
- Assert.assertTrue(numSoap12Binding > 0);
- Assert.assertEquals(numSoapPort, 0);
- Assert.assertEquals(numSoapBinding, 0);
- // Skipped to test HTTP
- }
-
- private boolean testOperation(Operation op, Method m[]) {
- for (int i = 0; i < m.length; i++) {
- if(m[i].getName().equals(op.getName())) {
- Assert.assertNotNull(op.getInput());
- Assert.assertNotNull(op.getOutput());
- return true;
- }
- }
- return false;
- }
-
- /**
- * Lines 293-296:<br>
- * 2.3.4 WSDL PortType<br>
- * An SCA service has a single interface. This interface is always imported
- * into the generated WSDL document. This may be done directly for
- * WSDL-defined interfaces, or indirectly via a WSDL generated from the
- * interface type for the service.<br>
- */
- @Test
- public void testSoapVersion9() throws Exception {
- Method bMethod[] = BService.class.getMethods();
- Map bPTMap = bWSDL.getPortTypes();
- Assert.assertEquals(bPTMap.size(), 1);
- for (Iterator iter = bPTMap.keySet().iterator(); iter.hasNext();) {
- PortType pt = (PortType) bPTMap.get(iter.next());
- List opList = pt.getOperations();
- Assert.assertEquals(bMethod.length, opList.size());
- for (int i = 0; i < opList.size(); i++) {
- Operation op = (Operation) opList.get(i);
- Assert.assertTrue(testOperation(op, bMethod));
- }
- }
-
- Method cMethod[] = CService.class.getMethods();
- Map cPTMap = cWSDL.getPortTypes();
- Assert.assertEquals(cPTMap.size(), 1);
- for (Iterator iter = cPTMap.keySet().iterator(); iter.hasNext();) {
- PortType pt = (PortType) cPTMap.get(iter.next());
- List opList = pt.getOperations();
- Assert.assertEquals(cMethod.length, opList.size());
- for (int i = 0; i < opList.size(); i++) {
- Operation op = (Operation) opList.get(i);
- Assert.assertTrue(testOperation(op, cMethod));
- }
- }
- }
-
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlNoSoapVersionTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlNoSoapVersionTestCase.java
deleted file mode 100644
index 896b5a3d89..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlNoSoapVersionTestCase.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion;
-
-import junit.framework.Assert;
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.AService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests the simplest form of the binding element without WSDL document
- * described in section section 2.3.1 and 2.3.3.1 of SCA Web Services Binding
- * V1.00
- */
-public class NoWsdlNoSoapVersionTestCase {
-
- protected static ServiceFinder serviceFinder;
- protected static String compositeName = "nowsdlsoapversion.composite";
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 251-253, 287-291:<br>
- * <li>soap</li>
- * This indicates that a SOAP binding is required. The SOAP binding may be
- * of any SOAP version, including multiple versions.<br>
- * <br>
- * 2.3.3.1 SOAP versions<br>
- * Where a web service binding requires a specific SOAP version, then a
- * single WSDL port and SOAP binding of the appropriate version is
- * generated. Where no specific SOAP version is required, then one or more
- * WSDL ports with associated SOAP bindings may be generated, depending on
- * the level(s) supported in the target runtime.<br>
- * <p>
- */
- @Test
- public void testSoapVersion1() throws Exception {
-
- for (int i = 0; i < 8; i++) {
- AService a = ServiceFinder.getService(AService.class, "AComponent" + (i+1));
- String aName = a.getName();
- String b1Str1 = a.getB1String("string1");
- String b1Str2 = a.getB1String2("string2", "string3");
- int b1Int = a.getB1Int(i * 1000 + 1000);
- System.out.println(i + " - " + aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(i * 1000 + 1000, b1Int);
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlSoapVersionTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlSoapVersionTestCase.java
deleted file mode 100644
index c65f7e8e52..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlSoapVersionTestCase.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion;
-
-import junit.framework.Assert;
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.DService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests the simplest form of the binding element without WSDL document
- * described in section section 2.3.1, 2.3.2 and 2.3.3.1 of SCA Web Services
- * Binding V1.00
- */
-public class NoWsdlSoapVersionTestCase {
-
- protected static ServiceFinder serviceFinder;
- protected static String compositeName = "nowsdlsoapversion.composite";
- protected static DService d;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- d = ServiceFinder.getService(DService.class, "DComponent");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 254-257:<br>
- * <li>soap.1_1</li><br>
- * A SOAP 1.1 binding only is required.<br>
- * <li>soap.1_2</li><br>
- * A SOAP 1.2 binding only is required.<br>
- * <br>
- * 2.3.3.1 SOAP versions<br>
- * Where a web service binding requires a specific SOAP version, then a
- * single WSDL port and SOAP binding of the appropriate version is
- * generated. Where no specific SOAP version is required, then one or more
- * WSDL ports with associated SOAP bindings may be generated, depending on
- * the level(s) supported in the target runtime.<br>
- * <p>
- */
- @Test
- public void testSoapVersion2() throws Exception {
-
- for (int i = 8; i < 16; i++) {
- AService a = ServiceFinder.getService(AService.class, "AComponent" + (i+1));
- String aName = a.getName();
- String b1Str1 = a.getB1String("string1");
- String b1Str2 = a.getB1String2("string2", "string3");
- int b1Int = a.getB1Int(i * 1000 + 1000);
- System.out.println(i + " - " + aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(i * 1000 + 1000, b1Int);
- }
- }
-
- /**
- * Lines 254-257, 287-291, 260-262:<br>
- * A separate WSDL document is generated for each SCA service. Each has
- * its own unique target namespace. This is to ensure that bindings on
- * different services of the same component do not clash.<br>
- * <p>
- * Test two references using binding.ws with 2 different SOAP versions
- * and without WSDL document.<br>
- */
- @Test
- public void testSoapVersion3() throws Exception {
- String dName = d.getName();
- String b1Str1 = d.getB1String("string1");
- String b1Str2 = d.getB1String2("string2", "string3");
- String c1Str1 = d.getC1String("string5");
- String c1Str2 = d.getC1String2("string6", "string7");
-
- int b1Int = d.getB1Int(4000);
- float c1Float = d.getC1Float((float) 8.8);
-
- Integer c1Integer = d.getC1Integer(new Integer(9000));
-
- System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer);
- Assert.assertEquals("DService", dName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
- Assert.assertEquals("string5", c1Str1);
- Assert.assertEquals("string6string7", c1Str2);
- Assert.assertEquals((float) 8.8, c1Float);
- Assert.assertEquals(new Integer(9000), c1Integer);
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/pom.xml
deleted file mode 100644
index 43f5c99b8b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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-vtest</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Web Service Binding Verification Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>vtest-utilities</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
-
- </dependencies>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>service</module>
- <module>nowsdl</module>
- <module>wsdlelement</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/service/pom.xml
deleted file mode 100644
index f433a3dce0..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-wsbinding</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding-service</artifactId>
- <name>Apache Tuscany SCA Web Service Binding Verification Tests - Service</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AClientService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AClientService.java
deleted file mode 100644
index bdb5aa3821..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AClientService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AClientService.
- */
-@Remotable
-public interface AClientService {
- public String getGreetingsForward(String name);
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AService.java
deleted file mode 100644
index 2dc7afce0c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AService.
- */
-@Remotable
-public interface AService {
- public String getGreetings(String name);
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AClientServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AClientServiceImpl.java
deleted file mode 100644
index 93cd716abe..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AClientServiceImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.AClientService;
-import org.apache.tuscany.sca.vtest.wsbinding.AService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AClientService.class)
-public class AClientServiceImpl implements AClientService {
-
- @Reference
- protected AService aService;
-
- public String getGreetingsForward(String name) {
- return aService.getGreetings(name);
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AServiceImpl.java
deleted file mode 100644
index 6ab7668c8b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AServiceImpl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.AService;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/aservice.wsdl b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/aservice.wsdl
deleted file mode 100644
index e7953eb2b4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/aservice.wsdl
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://wsbinding.vtest.sca.tuscany.apache.org"
- xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
- xmlns:ns0="http://wsbinding.vtest.sca.tuscany.apache.org"
- xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
- xmlns:ns1="http://org.apache.axis2/xsd"
- xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://wsbinding.vtest.sca.tuscany.apache.org" xmlns:ns="http://wsbinding.vtest.sca.tuscany.apache.org">
- <xs:element name="getGreetings">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="param0" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="getGreetingsResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:schema>
- </wsdl:types>
-
- <wsdl:message name="getGreetingsRequest">
- <wsdl:part name="parameters" element="ns0:getGreetings"/>
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
- <wsdl:part name="parameters" element="ns0:getGreetingsResponse"/>
- </wsdl:message>
-
- <wsdl:portType name="AServicePortType">
- <wsdl:operation name="getGreetings">
- <wsdl:input message="ns0:getGreetingsRequest" wsaw:Action="urn:getGreetings"/>
- <wsdl:output message="ns0:getGreetingsResponse" wsaw:Action="urn:getGreetingsResponse"/>
- </wsdl:operation>
- </wsdl:portType>
-
- <wsdl:binding name="AServiceSOAP12Binding" type="ns0:AServicePortType">
- <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="getGreetings">
- <soap12:operation soapAction="urn:getGreetings" style="document"/>
- <wsdl:input>
- <soap12:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap12:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:binding name="AServicePortTypeBinding" type="ns0:AServicePortType">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="getGreetings">
- <soap:operation soapAction=""/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:binding name="AServiceHttpBinding" type="ns0:AServicePortType">
- <http:binding verb="POST"/>
- <wsdl:operation name="getGreetings">
- <http:operation location="AService/getGreetings"/>
- <wsdl:input>
- <mime:content part="getGreetings" type="text/xml"/>
- </wsdl:input>
- <wsdl:output>
- <mime:content part="getGreetings" type="text/xml"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:binding name="AServiceSOAP11Binding" type="ns0:AServicePortType">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="getGreetings">
- <soap:operation soapAction="urn:getGreetings" style="document"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="AServicePortTypeService">
- <wsdl:port name="AServicePortTypePort" binding="ns0:AServicePortTypeBinding">
- <soap:address location="http://localhost:8085/AService"/>
- </wsdl:port>
- </wsdl:service>
-
- <wsdl:service name="AService">
- <wsdl:port name="AServiceHttpport" binding="ns0:AServiceHttpBinding">
- <http:address location="http://localhost:8085/AService/httpport"/>
- </wsdl:port>
- <wsdl:port name="AServiceSOAP12port_http" binding="ns0:AServiceSOAP12Binding">
- <soap12:address location="http://localhost:8085/AService/soap12port"/>
- </wsdl:port>
- <wsdl:port name="AServiceSOAP11port_http" binding="ns0:AServiceSOAP11Binding">
- <soap:address location="http://localhost:8085/AService/soap11port"/>
- </wsdl:port>
- <wsdl:port name="AServiceSOAP12port_http_null" binding="ns0:AServiceSOAP12Binding">
- <soap12:address location=""/>
- </wsdl:port>
- <wsdl:port name="AServiceSOAP12port_http_wsdl" binding="ns0:AServiceSOAP12Binding">
- <soap12:address location="inWsdl"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/endpoint-uri-resolution.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/endpoint-uri-resolution.composite
deleted file mode 100644
index 0d92174442..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/endpoint-uri-resolution.composite
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- name="endpoint-uri-resolution">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
- <service name="AService">
- <binding.ws name="bnd1" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP12port_http)"
- uri="http://localhost:8085/AService/soap12portxxx"/>
- <binding.ws name="bnd2" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP11Binding)"
- uri="http://localhost:8085/AService/endpointrefxxx">
- <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
- <wsa:Address>http://localhost:8085/AService/endpointref</wsa:Address>
- </wsa:EndpointReference>
- </binding.ws>
- <binding.ws name="bnd3" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP12port_http_null)"
- uri="http://localhost:8085/AService/uriInBinding"/>
- <!-- binding.ws name="bnd4" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP12port_http_null)"/-->
- <binding.ws name="bnd5" uri="http://localhost:8085/AService/noWsdlElement"/>
- <binding.ws name="bnd6" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP12port_http_wsdl)"
- uri="http://localhost:8085/AService/endpointref6"/>
- <binding.ws name="bnd7" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP11Binding)"
- uri="http://localhost:8085/AService/endpointref7">
- <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
- <wsa:Address>inAddress</wsa:Address>
- </wsa:EndpointReference>
- </binding.ws>
- <binding.ws name="bnd8" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP12Binding)"
- uri="http://localhost:8085/AService/endpointref8">
- <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
- <wsa:Address></wsa:Address>
- </wsa:EndpointReference>
- </binding.ws>
- </service>
- </component>
- <component name="AClientComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/soap12port"/>
- </reference>
- </component>
- <component name="AClientComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/endpointref"/>
- </reference>
- </component>
- <component name="AClientComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/uriInBinding"/>
- </reference>
- </component>
- <component name="AClientComponent4">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AComponent"/>
- </reference>
- </component>
- <component name="AClientComponent5">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/noWsdlElement"/>
- </reference>
- </component>
- <component name="AClientComponent6">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/endpointref6/inWsdl"/>
- </reference>
- </component>
- <component name="AClientComponent7">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/endpointref7/inAddress"/>
- </reference>
- </component>
- <component name="AClientComponent8">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/endpointref8"/>
- </reference>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/endpointreference.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/endpointreference.composite
deleted file mode 100644
index 3ba152b7b8..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/endpointreference.composite
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- name="endpointreference">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
- <service name="AService">
- <binding.ws wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP11Binding)">
- <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
- <wsa:Address>http://localhost:8085/AService/endpointref</wsa:Address>
- </wsa:EndpointReference>
- </binding.ws>
- </service>
- </component>
- <component name="AClientComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/endpointref"/>
- </reference>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlbinding.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlbinding.composite
deleted file mode 100644
index 85c604070a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlbinding.composite
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- name="wsdlbinding">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
- <service name="AService">
- <binding.ws name="bnd11" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP11Binding)"
- uri="http://localhost:8085/AService/bnd11"/>
- <binding.ws name="bnd12" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP12Binding)"
- uri="http://localhost:8085/AService/bnd12"/>
- </service>
- </component>
- <component name="AClientBnd11Component">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/bnd11"/>
- </reference>
- </component>
- <component name="AClientBnd12Component">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/bnd12"/>
- </reference>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlendpoint.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlendpoint.composite
deleted file mode 100644
index 0c11c79efe..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlendpoint.composite
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- name="wsdlendpoint">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
- <service name="AService">
- <binding.ws wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.endpoint(AService/AServiceEndPoint)"
- uri="http://localhost:8085/AService/endpoint"/>
- </service>
- </component>
- <component name="AClientComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/endpoint"/>
- </reference>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlport.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlport.composite
deleted file mode 100644
index 859b93bec4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlport.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- name="wsdlport">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
- <service name="AService">
- <binding.ws name="p11" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP11port_http)"/>
- <binding.ws name="p12" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP12port_http)"/>
- </service>
- </component>
- <component name="AClientP11Component">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/soap11port"/>
- </reference>
- </component>
- <component name="AClientP12Component">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/soap12port"/>
- </reference>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlservice.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlservice.composite
deleted file mode 100644
index fa96e650de..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/main/resources/wsdlservice.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest"
- name="wsdlservice">
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
- <service name="AService">
- <binding.ws wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.service(AService)"
- uri="http://localhost:8085/AComponent"/>
- </service>
- </component>
- <component name="AClientS11Component">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/soap11port"/>
- </reference>
- </component>
- <component name="AClientS12Component">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
- <reference name="aService">
- <binding.ws uri="http://localhost:8085/AService/soap12port"/>
- </reference>
- </component>
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointReferenceTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointReferenceTestCase.java
deleted file mode 100644
index d858daaf78..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointReferenceTestCase.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests EndpointReference element specified in service binding.ws as per Web
- * Services Binding Specification v1.00 - Sec 2.1 - Lines 61 to 65.
- */
-public class EndpointReferenceTestCase {
-
- protected static String compositeName = "endpointreference.composite";
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 61-65
- * <p>
- * /binding.ws/wsa:EndpointReference – optional WS-Addressing [6]
- * EndpointReference that specifies the endpoint for the service or
- * reference. When this element is present along with the wsdlElement
- * attribute on the parent element, the wsdlElement attribute value MUST be
- * of the ‘Binding’ form as specified above, i.e. <WSDL-namespace-
- * URI>#wsdl.binding(<binding-name>).
- */
- @Test
- public void testWsdlBinding() throws Exception {
- AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent");
- Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu"));
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointUriResolutionTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointUriResolutionTestCase.java
deleted file mode 100644
index 49f9db248f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointUriResolutionTestCase.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Tests "Endpoint URI resolution" for service binding.ws as per Web Services
- * Binding Specification v1.00 - Sec 2.1.1 - Lines 70 to 85.
- */
-public class EndpointUriResolutionTestCase {
-
- protected static String compositeName = "endpoint-uri-resolution.composite";
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 71-78
- * <p>
- * The rules for resolving the URI at which an SCA service is hosted, or SCA
- * reference targets, when used with binding.ws (in precedence order) are:
- * 1. The URIs in the endpoint(s) of the referenced WSDL or The URI
- * specified by the wsa:Address element of the wsa:EndpointReference, 2. The
- * explicitly stated URI in the "uri" attribute of the binding.ws element,
- * which may be relative, 3. The implicit URI as defined by the Assembly
- * specification
- * <p>
- * This method tests that URI in the endpoint takes precedence.
- */
- @Test
- public void testUriInEndpoint() throws Exception {
- AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent1");
- Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu"));
- }
-
- /**
- * Lines 71-78
- * <p>
- * The rules for resolving the URI at which an SCA service is hosted, or SCA
- * reference targets, when used with binding.ws (in precedence order) are:
- * 1. The URIs in the endpoint(s) of the referenced WSDL or The URI
- * specified by the wsa:Address element of the wsa:EndpointReference, 2. The
- * explicitly stated URI in the "uri" attribute of the binding.ws element,
- * which may be relative, 3. The implicit URI as defined by the Assembly
- * specification
- * <p>
- * This method tests that URI in the EndpointReference takes precedence.
- */
- @Test
- public void testUriInEndpointReference() throws Exception {
- AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent2");
- Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu"));
- }
-
- /**
- * Lines 71-78
- * <p>
- * The rules for resolving the URI at which an SCA service is hosted, or SCA
- * reference targets, when used with binding.ws (in precedence order) are:
- * 1. The URIs in the endpoint(s) of the referenced WSDL or The URI
- * specified by the wsa:Address element of the wsa:EndpointReference, 2. The
- * explicitly stated URI in the "uri" attribute of the binding.ws element,
- * which may be relative, 3. The implicit URI as defined by the Assembly
- * specification
- * <p>
- * This method tests that explicitly stated URI in the "uri" attribute of
- * binding.ws takes precedence.
- */
- @Test
- public void testUriInBindingWs() throws Exception {
- AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent3");
- Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu"));
- }
-
- /**
- * Lines 71-78
- * <p>
- * The rules for resolving the URI at which an SCA service is hosted, or SCA
- * reference targets, when used with binding.ws (in precedence order) are:
- * 1. The URIs in the endpoint(s) of the referenced WSDL or The URI
- * specified by the wsa:Address element of the wsa:EndpointReference, 2. The
- * explicitly stated URI in the "uri" attribute of the binding.ws element,
- * which may be relative, 3. The implicit URI as defined by the Assembly
- * specification
- * <p>
- * This method tests that implicit URI is used.
- */
- @Ignore("TUSCANY-2523 - Port 8080 conflicts with Continuum")
- @Test
- public void testImplicitUri() throws Exception {
- AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent4");
- Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu"));
- }
-
- /**
- * Lines 71-78
- * <p>
- * The rules for resolving the URI at which an SCA service is hosted, or SCA
- * reference targets, when used with binding.ws (in precedence order) are:
- * 1. The URIs in the endpoint(s) of the referenced WSDL or The URI
- * specified by the wsa:Address element of the wsa:EndpointReference, 2. The
- * explicitly stated URI in the "uri" attribute of the binding.ws element,
- * which may be relative, 3. The implicit URI as defined by the Assembly
- * specification
- * <p>
- * This method tests that explicitly stated URI in the "uri" attribute of
- * the binding.ws is used in the absence of a wsdlElement.
- */
- @Test
- public void testNoWsdlElement() throws Exception {
- AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent5");
- Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu"));
- }
-
- /**
- * Lines 79-83
- * <p>
- * The URI in the WSDL endpoint or in the wsa:Address of an EPR may be a
- * relative URI, in which case it is relative to the URI defined in (2) or
- * (3). The wsa:Address element can be the empty relative URI, in which case
- * it uses the URI defined in (2) or (3) directly. This allows the EPR
- * writer to specify reference parameters, metadata and other EPR contents
- * while allowing the URI to be chosen by the deployer.
- * <p>
- * This method tests that the relative URI specified in WSDL endpoint is
- * used along with the explicit URI specified in the "uri" attribute of
- * binding.ws element.
- */
- @Test
- public void testRelativeUriInWsdl() throws Exception {
- AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent6");
- Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu"));
- }
-
- /**
- * Lines 79-83
- * <p>
- * The URI in the WSDL endpoint or in the wsa:Address of an EPR may be a
- * relative URI, in which case it is relative to the URI defined in (2) or
- * (3). The wsa:Address element can be the empty relative URI, in which case
- * it uses the URI defined in (2) or (3) directly. This allows the EPR
- * writer to specify reference parameters, metadata and other EPR contents
- * while allowing the URI to be chosen by the deployer.
- * <p>
- * This method tests that the relative URI specified in wsa:Address is used
- * along with the explicit URI specified in the "uri" attribute of
- * binding.ws element.
- */
- @Test
- public void testRelativeUriInAddress() throws Exception {
- AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent7");
- Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu"));
- }
-
- /**
- * Lines 79-83
- * <p>
- * The URI in the WSDL endpoint or in the wsa:Address of an EPR may be a
- * relative URI, in which case it is relative to the URI defined in (2) or
- * (3). The wsa:Address element can be the empty relative URI, in which case
- * it uses the URI defined in (2) or (3) directly. This allows the EPR
- * writer to specify reference parameters, metadata and other EPR contents
- * while allowing the URI to be chosen by the deployer.
- * <p>
- * This method tests that when wsa:Address is empty, the explicit URI
- * specified in the "uri" attribute of binding.ws element is used.
- */
- @Test
- public void testEmptyAddressElement() throws Exception {
- AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent8");
- Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu"));
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlBindingTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlBindingTestCase.java
deleted file mode 100644
index 292de8b654..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlBindingTestCase.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests wsdlElement specified on service binding.ws as per Web Services Binding Specification v1.00 - Sec 2.1
- * - Lines 35 to 54.
- */
-public class WsdlBindingTestCase {
-
- protected static String compositeName = "wsdlbinding.composite";
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 50-54
- * <p>
- * Binding:
- * <WSDL-namespace-URI>#wsdl.binding(<binding-name>)
- * In this case, the identified WSDL binding must have an equivalent PortType with the SCA
- * service or reference. In this case the endpoint address URI for the SCA service or
- * reference must be provided via the URI attribute on the binding.
- */
- @Test
- public void testWsdlBinding() throws Exception {
- AClientService aClientBnd11 = ServiceFinder.getService(AClientService.class, "AClientBnd11Component");
- Assert.assertEquals("Hello Pandu", aClientBnd11.getGreetingsForward("Pandu"));
- AClientService aClientBnd12 = ServiceFinder.getService(AClientService.class, "AClientBnd12Component");
- Assert.assertEquals("Hello Pandu", aClientBnd12.getGreetingsForward("Pandu"));
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlEndpointTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlEndpointTestCase.java
deleted file mode 100644
index 842da87bd4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlEndpointTestCase.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Tests wsdlElement specified on service binding.ws as per Web Services Binding
- * Specification v1.00 - Sec 2.1 - Lines 35 to 54.
- */
-public class WsdlEndpointTestCase {
-
- protected static String compositeName = "wsdlendpoint.composite";
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 46-49
- * <p>
- * Endpoint (WSDL 2.0): <WSDL-namespace-URI>#wsdl.endpoint(<service-name>/<endpoint-name>)
- * In this case, the identified endpoint in the WSDL 2.0 Service must have
- * an equivalent PortType with the SCA service or reference.
- */
- @Test
- @Ignore("WSDL2.0 Support")
- public void testWsdlEndpoint() throws Exception {
- AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent");
- Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu"));
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlPortTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlPortTestCase.java
deleted file mode 100644
index 0545cef776..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlPortTestCase.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests wsdlElement specified on service binding.ws as per Web Services Binding
- * Specification v1.00 - Sec 2.1 - Lines 35 to 54.
- */
-public class WsdlPortTestCase {
-
- protected static String compositeName = "wsdlport.composite";
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 42-45
- * <p>
- * Port (WSDL 1.1): <WSDL-namespace-URI>#wsdl.port(<service-name>/<port-name>)
- * In this case, the identified port in the WSDL 1.1 Service must have an
- * equivalent PortType with the SCA service or reference.
- */
- @Test
- public void testWsdlPort() throws Exception {
- AClientService aClientP11 = ServiceFinder.getService(AClientService.class, "AClientP11Component");
- Assert.assertEquals("Hello Pandu", aClientP11.getGreetingsForward("Pandu"));
- AClientService aClientP12 = ServiceFinder.getService(AClientService.class, "AClientP12Component");
- Assert.assertEquals("Hello Pandu", aClientP12.getGreetingsForward("Pandu"));
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlServiceTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlServiceTestCase.java
deleted file mode 100644
index aa2b2fac7a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlServiceTestCase.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Tests wsdlElement specified on service binding.ws as per Web Services Binding
- * Specification v1.00 - Sec 2.1 - Lines 35 to 54.
- */
-public class WsdlServiceTestCase {
-
- protected static String compositeName = "wsdlservice.composite";
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 38-41
- * <p>
- * Service: <WSDL-namespace-URI>#wsdl.service(<service-name>) In this case,
- * all the endpoints in the WSDL Service that have equivalent PortTypes with
- * the SCA service or reference must be available to the SCA service or
- * reference.
- */
- @Test
- @Ignore("TUSCANY-2298")
- public void testWsdlService() throws Exception {
- AClientService aClientS11 = ServiceFinder.getService(AClientService.class, "AClientS11Component");
- Assert.assertEquals("Hello Pandu", aClientS11.getGreetingsForward("Pandu"));
- AClientService aClientS12 = ServiceFinder.getService(AClientService.class, "AClientS12Component");
- Assert.assertEquals("Hello Pandu", aClientS12.getGreetingsForward("Pandu"));
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/pom.xml
deleted file mode 100644
index f74fb28d95..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-wsbinding-wsdlelement</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding-wsdlelement-binding</artifactId>
- <name>Apache Tuscany SCA Web Service Binding Verification Tests - WSDL wsdlElement wsdl.binding</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/AService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/AService.java
deleted file mode 100644
index 2f6db92318..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/AService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AService.
- */
-@Remotable
-public interface AService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
- public String getB2String(String aString);
-
- public int getB2Int(int i);
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService.java
deleted file mode 100644
index a040adb113..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService2.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService2.java
deleted file mode 100644
index 3195263584..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService2.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService2 {
-
- public String getString(String aString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/CService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/CService.java
deleted file mode 100644
index aed5abebf4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/CService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface CService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public Integer getInteger(Integer i);
-
- public float getFloat(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/DService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/DService.java
deleted file mode 100644
index 3386ea709f..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/DService.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for DService.
- */
-@Remotable
-public interface DService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
- public String getC1String(String aString);
-
- public String getC1String2(String aString, String bString);
-
- public Integer getC1Integer(Integer i);
-
- public float getC1Float(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/AServiceImpl.java
deleted file mode 100644
index 853cc74d4e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/AServiceImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService2;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference(required=false)
- public BService b1;
-
- @Reference(required=false)
- public BService2 b2;
-
- public String getName() {
- return "AService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
- public String getB2String(String aString) {
- return b2.getString(aString);
- }
-
- public int getB2Int(int i) {
- return b2.getInt(i);
- }
-
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BService2Impl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BService2Impl.java
deleted file mode 100644
index 43051d6f10..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BService2Impl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService2;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService2.class)
-public class BService2Impl implements BService2 {
-
- public String getName() {
- return "BService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BServiceImpl.java
deleted file mode 100644
index 5496362e34..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- public String getName() {
- return "BService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/CServiceImpl.java
deleted file mode 100644
index 63753d4ba7..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/CServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.CService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl implements CService {
-
- public String getName() {
- return "CService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public Integer getInteger(Integer i) {
- return i;
- }
-
- public float getFloat(float f) {
- return f;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/DServiceImpl.java
deleted file mode 100644
index 0a268ff447..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/DServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.CService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.DService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements DService.
- */
-@Service(DService.class)
-public class DServiceImpl implements DService {
-
- @Reference
- public BService b1;
-
- @Reference
- public CService c1;
-
- public String getName() {
- return "DService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
- public String getC1String(String aString) {
- return c1.getString(aString);
- }
-
- public String getC1String2(String aString, String bString) {
- return c1.getString2(aString, bString);
- }
-
- public Integer getC1Integer(Integer i) {
- return c1.getInteger(i);
- }
-
- public float getC1Float(float f) {
- return c1.getFloat(f);
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/bservice.wsdl b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/bservice.wsdl
deleted file mode 100644
index 8ce0fbaeb8..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/bservice.wsdl
+++ /dev/null
@@ -1,228 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.binding.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="wsdlelement" targetNamespace="http://vtest.wsbinding.wsdlelement.binding.bservice" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
- <wsdl:types>
- <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.binding.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="getString">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getStringResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2">
- <xsd:complexType>
- <xsd:sequence> <xsd:element name="in1" type="xsd:string"></xsd:element>
- <xsd:element name="in2" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2Response">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getInt">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:int"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getIntResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:int"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="getStringRequest">
- <wsdl:part element="tns:getString" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getStringResponse">
- <wsdl:part element="tns:getStringResponse" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getString2Request">
- <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Response">
- <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntRequest">
- <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntResponse">
- <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringRequest">
- <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringResponse">
- <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntRequest">
- <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntResponse">
- <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:portType name="BService1PortType">
- <wsdl:operation name="getString">
- <wsdl:input message="tns:getStringRequest"/>
- <wsdl:output message="tns:getStringResponse"/>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <wsdl:input message="tns:getString2Request"></wsdl:input>
- <wsdl:output message="tns:getString2Response"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <wsdl:input message="tns:getIntRequest"></wsdl:input>
- <wsdl:output message="tns:getIntResponse"></wsdl:output>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:portType name="BService2PortType">
- <wsdl:operation name="getString">
- <wsdl:input message="tns:getStringRequest"></wsdl:input>
- <wsdl:output message="tns:getStringResponse"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <wsdl:input message="tns:getIntRequest"></wsdl:input>
- <wsdl:output message="tns:getIntResponse"></wsdl:output>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="BService1SOAPBinding"
- type="tns:BService1PortType"> <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getString"> <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getString" /> <wsdl:input> <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output> <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getString2" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getInt" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="BService2SOAPBinding"
- type="tns:BService2PortType">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getString">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getString" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getInt" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="BService3SOAP12Binding"
- type="tns:BService1PortType">
- <soap12:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getString">
- <soap12:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getString" />
- <wsdl:input>
- <soap12:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap12:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <soap12:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getString2" />
- <wsdl:input>
- <soap12:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap12:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <soap12:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getInt" />
- <wsdl:input>
- <soap12:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap12:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="BService">
- <wsdl:port binding="tns:BService1SOAPBinding" name="BService1SOAP">
- <soap:address location=""/>
- </wsdl:port>
- <wsdl:port name="BService2SOAP"
- binding="tns:BService2SOAPBinding">
- <soap:address location="" />
- </wsdl:port>
- <wsdl:port name="BService3SOAP12"
- binding="tns:BService3SOAP12Binding">
- <soap12:address location=""></soap12:address>
- </wsdl:port>
- </wsdl:service>
- <wsdl:service name="BService2">
- <wsdl:port name="BService2Port" binding="tns:BService2SOAPBinding">
- <soap:address location="" />
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/cservice.wsdl b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/cservice.wsdl
deleted file mode 100644
index ff151faa7a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/cservice.wsdl
+++ /dev/null
@@ -1,173 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.binding.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CService" targetNamespace="http://vtest.wsbinding.wsdlelement.binding.cservice">
- <wsdl:types>
- <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.binding.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="getFloat">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:float"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getFloatResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:float"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getInteger">
- <xsd:complexType>
- <xsd:sequence> <xsd:element name="in" type="xsd:integer"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getIntegerResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:integer"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in1" type="xsd:string"></xsd:element>
- <xsd:element name="in2" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2Response">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getStringResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="getFloatRequest">
- <wsdl:part element="tns:getFloat" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getFloatResponse">
- <wsdl:part element="tns:getFloatResponse" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getIntegerRequest">
- <wsdl:part name="parameters" element="tns:getInteger"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntegerResponse">
- <wsdl:part name="parameters" element="tns:getIntegerResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Request">
- <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Response">
- <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringRequest">
- <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringResponse">
- <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Request">
- <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Response">
- <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
- </wsdl:message>
- <wsdl:portType name="CServicePortType">
- <wsdl:operation name="getFloat">
- <wsdl:input message="tns:getFloatRequest"/>
- <wsdl:output message="tns:getFloatResponse"/>
- </wsdl:operation>
- <wsdl:operation name="getInteger">
- <wsdl:input message="tns:getIntegerRequest"></wsdl:input>
- <wsdl:output message="tns:getIntegerResponse"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString">
- <wsdl:input message="tns:getStringRequest"></wsdl:input>
- <wsdl:output message="tns:getStringResponse"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <wsdl:input message="tns:getString2Request"></wsdl:input>
- <wsdl:output message="tns:getString2Response"></wsdl:output>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="CServiceSOAPBinding"
- type="tns:CServicePortType"> <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getFloat"> <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.cservice/getFloat" /> <wsdl:input> <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output> <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInteger">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.cservice/getInteger" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.cservice/getString" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.binding.cservice/getString2" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="CService">
- <wsdl:port binding="tns:CServiceSOAPBinding" name="CServiceSOAP">
- <soap:address location=""/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/wsdlelement.binding.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/wsdlelement.binding.composite
deleted file mode 100644
index 6b97b5e602..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/main/resources/wsdlelement.binding.composite
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest.wsbinding.wsdlelement.binding"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="wsdlelement.binding">
-
- <component name="BComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService1SOAPBinding)"
- uri="http://localhost:8085/BComponent1"/>
- </service>
- </component>
-
- <component name="BComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService2SOAPBinding)"
- uri="http://localhost:8085/BComponent2"/>
- </service>
- </component>
-
- <component name="BComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.BService2Impl"/>
- <service name="BService2">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService2"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService2SOAPBinding)"
- uri="http://localhost:8085/BComponent3"/>
- </service>
- </component>
-
- <component name="BComponent4">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService3SOAP12Binding)"
- uri="http://localhost:8085/BComponent4"/>
- </service>
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.CServiceImpl"/>
- <service name="CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.CService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.cservice#wsdl.binding(CServiceSOAPBinding)"
- uri="http://localhost:8085/CComponent"/>
- </service>
- </component>
-
- <component name="AComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent1/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService1SOAPBinding)" uri="http://localhost:8085/BComponent1"/>
- </reference>
- </component>
-
- <component name="AComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent2/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService2SOAPBinding)" uri="http://localhost:8085/BComponent2"/>
- </reference>
- </component>
-
- <component name="AComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.AServiceImpl"/>
- <reference name="b2" target="BComponent3/BService2">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService2"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService2SOAPBinding)" uri="http://localhost:8085/BComponent3"/>
- </reference>
- </component>
-
- <component name="AComponent4">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent4/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService3SOAP12Binding)" uri="http://localhost:8085/BComponent4"/>
- </reference>
- </component>
-
- <component name="DComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.DServiceImpl"/>
- <reference name="b1" target="BComponent1/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService1SOAPBinding)" uri="http://localhost:8085/BComponent1"/>
- </reference>
- <reference name="c1" target="CComponent/CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.CService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.cservice#wsdl.binding(CServiceSOAPBinding)" uri="http://localhost:8085/CComponent"/>
- </reference>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/WsdlElementBindingTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/WsdlElementBindingTestCase.java
deleted file mode 100644
index f30cf38654..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/binding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/WsdlElementBindingTestCase.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding;
-
-import static org.junit.Assert.fail;
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.DService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests the simplest form of the binding element wsdl.binding with WSDL
- * document described in section section 2.1 of SCA Web Services Binding
- * V1.00<br>
- */
-public class WsdlElementBindingTestCase {
-
- protected static ServiceFinder serviceFinder;
- protected static String compositeName = "wsdlelement.binding.composite";
- protected static AService a1;
- protected static AService a2;
- protected static AService a3;
- protected static AService a4;
- protected static DService d;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a1 = ServiceFinder.getService(AService.class, "AComponent1");
- a2 = ServiceFinder.getService(AService.class, "AComponent2");
- a3 = ServiceFinder.getService(AService.class, "AComponent3");
- a4 = ServiceFinder.getService(AService.class, "AComponent4");
- d = ServiceFinder.getService(DService.class, "DComponent1");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 50-54:<br>
- * Binding:<br>
- * <WSDL-namespace-URI>#wsdl.binding(<binding-name>)<br>
- * In this case, the identified WSDL binding must have an equivalent
- * PortType with the SCA service or reference. In this case the endpoint
- * address URI for the SCA service or reference must be provided via the
- * URI attribute on the binding.<br>
- * <br>
- * Tests wsdl.binding(BService1SOAPBinding)<br>
- */
- @Test
- public void testWsdlElementBinding1() throws Exception {
- String aName = a1.getName();
- String b1Str1 = a1.getB1String("string1");
- String b1Str2 = a1.getB1String2("string2", "string3");
- int b1Int = a1.getB1Int(1000);
-
- System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(1000, b1Int);
- }
-
- /**
- * Lines 50-54:<br>
- * Binding:<br>
- * <br>
- * Tests wsdl.binding(BService2SOAPBinding) with BService where the binding
- * does not define getString2, so exceptions are expected.<br>
- */
- @Test
- public void testWsdlElementBinding2() throws Exception {
- String aName = a2.getName();
- System.out.println(aName + ": ");
- try {
- a2.getB1String("string1");
- fail("Should not be able to call getString");
- } catch (Exception e) {
- System.out.println(" Exception is expected: " + e.toString());
- }
- try {
- a2.getB1String2("string2", "string3");
- fail("Should not be able to call getString2");
- } catch (Exception e) {
- System.out.println(" Exception is expected: " + e.toString());
- }
- try {
- a2.getB1Int(2000);
- fail("Should not be able to call getInt");
- } catch (Exception e) {
- System.out.println(" Exception is expected: " + e.toString());
- }
- }
-
- /**
- * Lines 50-54:<br>
- * Binding:<br>
- * <br>
- * Tests wsdl.binding(BService2SOAPBinding) with BService2<br>
- */
- @Test
- public void testWsdlElementBinding3() throws Exception {
- String aName = a3.getName();
- String b2Str1 = a3.getB2String("string1");
- int b2Int = a3.getB2Int(3000);
-
- System.out.println(aName + ": " + b2Str1 + ", " + b2Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b2Str1);
- Assert.assertEquals(3000, b2Int);
- }
-
- /**
- * Lines 50-54:<br>
- * Binding:<br>
- * <br>
- * Tests two references using wsdl.binding.<br>
- */
- @Test
- public void testWsdlElementBinding4() throws Exception {
- String dName = d.getName();
- String b1Str1 = d.getB1String("string1");
- String b1Str2 = d.getB1String2("string2", "string3");
- String c1Str1 = d.getC1String("string5");
- String c1Str2 = d.getC1String2("string6", "string7");
-
- int b1Int = d.getB1Int(4000);
- float c1Float = d.getC1Float((float) 8.8);
-
- Integer c1Integer = d.getC1Integer(new Integer(9000));
-
- System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer);
- Assert.assertEquals("DService", dName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
- Assert.assertEquals("string5", c1Str1);
- Assert.assertEquals("string6string7", c1Str2);
- Assert.assertEquals((float) 8.8, c1Float);
- Assert.assertEquals(new Integer(9000), c1Integer);
- }
-
- /**
- * Lines 50-54:<br>
- * Binding:<br>
- * <br>
- * Tests wsdl.binding(BService3SOAP12Binding) which uses SOAP 1.2<br>
- */
- @Test
- public void testWsdlElementBinding5() throws Exception {
- String aName = a4.getName();
- String b1Str1 = a4.getB1String("string1");
- String b1Str2 = a4.getB1String2("string2", "string3");
- int b1Int = a4.getB1Int(5000);
-
- System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(5000, b1Int);
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/pom.xml
deleted file mode 100644
index c60871bf58..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-wsbinding</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding-wsdlelement</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Web Service Binding Verification Tests - wsdlElement</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>vtest-utilities</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
-
- </dependencies>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>service</module>
- <module>port</module>
- <module>binding</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/pom.xml
deleted file mode 100644
index ae14f68c74..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-wsbinding-wsdlelement</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding-wsdlelement-port</artifactId>
- <name>Apache Tuscany SCA Web Service Binding Verification Tests - WSDL wsdlElement wsdl.port</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/AService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/AService.java
deleted file mode 100644
index 6fa9906d45..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/AService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AService.
- */
-@Remotable
-public interface AService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
- public String getB2String(String aString);
-
- public int getB2Int(int i);
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService.java
deleted file mode 100644
index 978d515f92..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService2.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService2.java
deleted file mode 100644
index 766139ee92..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService2.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService2 {
-
- public String getString(String aString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/CService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/CService.java
deleted file mode 100644
index ee9ca25a4b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/CService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface CService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public Integer getInteger(Integer i);
-
- public float getFloat(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/DService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/DService.java
deleted file mode 100644
index 80d998d1a6..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/DService.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for DService.
- */
-@Remotable
-public interface DService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
- public String getC1String(String aString);
-
- public String getC1String2(String aString, String bString);
-
- public Integer getC1Integer(Integer i);
-
- public float getC1Float(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/AServiceImpl.java
deleted file mode 100644
index bec82776bf..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/AServiceImpl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService2;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference(required=false)
- public BService b1;
-
- @Reference(required=false)
- public BService2 b2;
-
- public String getName() {
- return "AService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
- public String getB2String(String aString) {
- return b2.getString(aString);
- }
-
- public int getB2Int(int i) {
- return b2.getInt(i);
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BService2Impl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BService2Impl.java
deleted file mode 100644
index b379a2e3ef..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BService2Impl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService2;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService2.class)
-public class BService2Impl implements BService2 {
-
- public String getName() {
- return "BService2";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BServiceImpl.java
deleted file mode 100644
index 069308a520..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- public String getName() {
- return "BService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/CServiceImpl.java
deleted file mode 100644
index 7ad9e3066c..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/CServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.CService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl implements CService {
-
- public String getName() {
- return "CService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public Integer getInteger(Integer i) {
- return i;
- }
-
- public float getFloat(float f) {
- return f;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/DServiceImpl.java
deleted file mode 100644
index 58ae1e9577..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/DServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.CService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.DService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements DService.
- */
-@Service(DService.class)
-public class DServiceImpl implements DService {
-
- @Reference
- public BService b1;
-
- @Reference
- public CService c1;
-
- public String getName() {
- return "DService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
- public String getC1String(String aString) {
- return c1.getString(aString);
- }
-
- public String getC1String2(String aString, String bString) {
- return c1.getString2(aString, bString);
- }
-
- public Integer getC1Integer(Integer i) {
- return c1.getInteger(i);
- }
-
- public float getC1Float(float f) {
- return c1.getFloat(f);
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/bservice.wsdl b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/bservice.wsdl
deleted file mode 100644
index d5c8d72dc1..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/bservice.wsdl
+++ /dev/null
@@ -1,238 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.port.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="wsdlelement" targetNamespace="http://vtest.wsbinding.wsdlelement.port.bservice" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
- <wsdl:types>
- <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.port.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="getString">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getStringResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2">
- <xsd:complexType>
- <xsd:sequence> <xsd:element name="in1" type="xsd:string"></xsd:element>
- <xsd:element name="in2" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2Response">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getInt">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:int"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getIntResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="getStringRequest">
- <wsdl:part element="tns:getString" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getStringResponse">
- <wsdl:part element="tns:getStringResponse" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getString2Request">
- <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Response">
- <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntRequest">
- <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntResponse">
- <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringRequest">
- <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringResponse">
- <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntRequest">
- <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntResponse">
- <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:portType name="BService1PortType">
- <wsdl:operation name="getString">
- <wsdl:input message="tns:getStringRequest"/>
- <wsdl:output message="tns:getStringResponse"/>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <wsdl:input message="tns:getString2Request"></wsdl:input>
- <wsdl:output message="tns:getString2Response"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <wsdl:input message="tns:getIntRequest"></wsdl:input>
- <wsdl:output message="tns:getIntResponse"></wsdl:output>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:portType name="BService2PortType">
- <wsdl:operation name="getString">
- <wsdl:input message="tns:getStringRequest"></wsdl:input>
- <wsdl:output message="tns:getStringResponse"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <wsdl:input message="tns:getIntRequest"></wsdl:input>
- <wsdl:output message="tns:getIntResponse"></wsdl:output>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="BService1SOAPBinding"
- type="tns:BService1PortType"> <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getString"> <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getString" /> <wsdl:input> <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output> <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getString2" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getInt" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="BService2SOAPBinding"
- type="tns:BService2PortType">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getString">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getString" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getInt" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="BService3SOAP12Binding"
- type="tns:BService1PortType">
-
- <soap12:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getString">
-
- <soap12:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getString" />
- <wsdl:input>
-
- <soap12:body use="literal" />
- </wsdl:input>
- <wsdl:output>
-
- <soap12:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
-
- <soap12:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getString2" />
- <wsdl:input>
-
- <soap12:body use="literal" />
- </wsdl:input>
- <wsdl:output>
-
- <soap12:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
-
- <soap12:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getInt" />
- <wsdl:input>
-
- <soap12:body use="literal" />
- </wsdl:input>
- <wsdl:output>
-
- <soap12:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="BService">
- <wsdl:port binding="tns:BService1SOAPBinding" name="BService1SOAP">
- <soap:address location=""/>
- </wsdl:port>
- <wsdl:port name="BService2SOAP"
- binding="tns:BService2SOAPBinding">
- <soap:address location="" />
- </wsdl:port>
- <wsdl:port name="BService3SOAP12"
- binding="tns:BService3SOAP12Binding">
- <soap12:address location=""></soap12:address>
- </wsdl:port>
- </wsdl:service>
- <wsdl:service name="BService2">
- <wsdl:port name="BService2Port" binding="tns:BService2SOAPBinding">
- <soap:address location="" />
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/cservice.wsdl b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/cservice.wsdl
deleted file mode 100644
index 8a715a2081..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/cservice.wsdl
+++ /dev/null
@@ -1,173 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.port.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CService" targetNamespace="http://vtest.wsbinding.wsdlelement.port.cservice">
- <wsdl:types>
- <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.port.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="getFloat">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:float"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getFloatResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:float"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getInteger">
- <xsd:complexType>
- <xsd:sequence> <xsd:element name="in" type="xsd:integer"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getIntegerResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:integer"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in1" type="xsd:string"></xsd:element>
- <xsd:element name="in2" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2Response">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getStringResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="getFloatRequest">
- <wsdl:part element="tns:getFloat" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getFloatResponse">
- <wsdl:part element="tns:getFloatResponse" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getIntegerRequest">
- <wsdl:part name="parameters" element="tns:getInteger"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntegerResponse">
- <wsdl:part name="parameters" element="tns:getIntegerResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Request">
- <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Response">
- <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringRequest">
- <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringResponse">
- <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Request">
- <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Response">
- <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
- </wsdl:message>
- <wsdl:portType name="CServicePortType">
- <wsdl:operation name="getFloat">
- <wsdl:input message="tns:getFloatRequest"/>
- <wsdl:output message="tns:getFloatResponse"/>
- </wsdl:operation>
- <wsdl:operation name="getInteger">
- <wsdl:input message="tns:getIntegerRequest"></wsdl:input>
- <wsdl:output message="tns:getIntegerResponse"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString">
- <wsdl:input message="tns:getStringRequest"></wsdl:input>
- <wsdl:output message="tns:getStringResponse"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <wsdl:input message="tns:getString2Request"></wsdl:input>
- <wsdl:output message="tns:getString2Response"></wsdl:output>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="CServiceSOAPBinding"
- type="tns:CServicePortType"> <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getFloat"> <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.cservice/getFloat" /> <wsdl:input> <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output> <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInteger">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.cservice/getInteger" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.cservice/getString" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.port.cservice/getString2" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="CService">
- <wsdl:port binding="tns:CServiceSOAPBinding" name="CServiceSOAP">
- <soap:address location=""/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/wsdlelement.port.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/wsdlelement.port.composite
deleted file mode 100644
index 5b9b77683e..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/main/resources/wsdlelement.port.composite
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest.wsbinding.wsdlelement.port"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="wsdlelement.port">
-
-
- <component name="BComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService1SOAP)"
- uri="http://localhost:8085/BComponent1"/>
- </service>
- </component>
-
- <component name="BComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService2SOAP)"
- uri="http://localhost:8085/BComponent2"/>
- </service>
- </component>
-
- <component name="BComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.BService2Impl"/>
- <service name="BService2">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService2"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService2/BService2Port)"
- uri="http://localhost:8085/BComponent3"/>
- </service>
- </component>
-
- <component name="BComponent4">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService3SOAP12)"
- uri="http://localhost:8085/BComponent4"/>
- </service>
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.CServiceImpl"/>
- <service name="CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.CService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.cservice#wsdl.port(CService/CServiceSOAP)"
- uri="http://localhost:8085/CComponent"/>
- </service>
- </component>
-
- <component name="AComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent1/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService1SOAP)" uri="http://localhost:8085/BComponent1"/>
- </reference>
- </component>
-
- <component name="AComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent2/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService2SOAP)" uri="http://localhost:8085/BComponent2"/>
- </reference>
- </component>
-
- <component name="AComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.AServiceImpl"/>
- <reference name="b2" target="BComponent3/BService2">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService2"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService2/BService2Port)" uri="http://localhost:8085/BComponent3"/>
- </reference>
- </component>
-
- <component name="AComponent4">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent4/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService3SOAP12)" uri="http://localhost:8085/BComponent4"/>
- </reference>
- </component>
-
- <component name="DComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.DServiceImpl"/>
- <reference name="b1" target="BComponent1/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService1SOAP)" uri="http://localhost:8085/BComponent1"/>
- </reference>
- <reference name="c1" target="CComponent/CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.CService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.cservice#wsdl.port(CService/CServiceSOAP)" uri="http://localhost:8085/CComponent"/>
- </reference>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/WsdlElementPortTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/WsdlElementPortTestCase.java
deleted file mode 100644
index 0db579002b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/port/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/WsdlElementPortTestCase.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port;
-
-import static org.junit.Assert.fail;
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.DService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests the simplest form of the binding element wsdl.port with WSDL
- * document described in section section 2.1 of SCA Web Services Binding
- * V1.00<br>
- */
-public class WsdlElementPortTestCase {
-
- protected static ServiceFinder serviceFinder;
- protected static String compositeName = "wsdlelement.port.composite";
- protected static AService a1;
- protected static AService a2;
- protected static AService a3;
- protected static AService a4;
- protected static DService d;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a1 = ServiceFinder.getService(AService.class, "AComponent1");
- a2 = ServiceFinder.getService(AService.class, "AComponent2");
- a3 = ServiceFinder.getService(AService.class, "AComponent3");
- a4 = ServiceFinder.getService(AService.class, "AComponent4");
- d = ServiceFinder.getService(DService.class, "DComponent1");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 42-45:<br>
- * Port (WSDL 1.1):<br>
- * <WSDL-namespace-URI>#wsdl.port(<service-name>/<port-name>)
- * In this case, the identified port in the WSDL 1.1 Service must have an
- * equivalent PortType with the SCA service or reference.<br>
- * <br>
- * Test wsdl.port(BService/BService1SOAP)<br>
- */
- @Test
- public void testWsdlElementPort1() throws Exception {
- String aName = a1.getName();
- String b1Str1 = a1.getB1String("string1");
- String b1Str2 = a1.getB1String2("string2", "string3");
- int b1Int = a1.getB1Int(1000);
-
- System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(1000, b1Int);
- }
-
- /**
- * Lines 42-45:<br>
- * Port (WSDL 1.1):<br>
- * <br>
- * Tests wsdl.port(BService/BService2SOAP) with BService where the port
- * does not define getString2, so exceptions are expected.<br>
- */
- @Test
- public void testWsdlElementPort2() throws Exception {
- String aName = a2.getName();
- System.out.println(aName + ": ");
- try {
- a2.getB1String("string1");
- fail("Should not be able to call getString");
- } catch (Exception e) {
- System.out.println(" Exception is expected: " + e.toString());
- }
- try {
- a2.getB1String2("string2", "string3");
- fail("Should not be able to call getString2");
- } catch (Exception e) {
- System.out.println(" Exception is expected: " + e.toString());
- }
- try {
- a2.getB1Int(2000);
- fail("Should not be able to call getInt");
- } catch (Exception e) {
- System.out.println(" Exception is expected: " + e.toString());
- }
- }
-
- /**
- * Lines 42-45:<br>
- * Port (WSDL 1.1):<br>
- * <br>
- * Tests wsdl.port(BService/BService2SOAP) with BService2<br>
- */
- @Test
- public void testWsdlElementPort3() throws Exception {
- String aName = a3.getName();
- String b2Str1 = a3.getB2String("string1");
- int b2Int = a3.getB2Int(1000);
-
- System.out.println(aName + ": " + b2Str1 + ", " + b2Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b2Str1);
- Assert.assertEquals(1000, b2Int);
- }
-
- /**
- * Lines 42-45:<br>
- * Port (WSDL 1.1):<br>
- * <br>
-= * Tests two references using wsdl.port.<br>
- */
- @Test
- public void testWsdlElementPort4() throws Exception {
- String dName = d.getName();
- String b1Str1 = d.getB1String("string1");
- String b1Str2 = d.getB1String2("string2", "string3");
- String c1Str1 = d.getC1String("string5");
- String c1Str2 = d.getC1String2("string6", "string7");
-
- int b1Int = d.getB1Int(4000);
- float c1Float = d.getC1Float((float) 8.8);
-
- Integer c1Integer = d.getC1Integer(new Integer(9000));
-
- System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer);
- Assert.assertEquals("DService", dName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
- Assert.assertEquals("string5", c1Str1);
- Assert.assertEquals("string6string7", c1Str2);
- Assert.assertEquals((float) 8.8, c1Float);
- Assert.assertEquals(new Integer(9000), c1Integer);
- }
-
- /**
- * Lines 42-45:<br>
- * Port (WSDL 1.1):<br>
- * <br>
-= * Tests wsdl.port(BService/BService3SOAP12) which uses SOAP 1.2<br>
- */
- @Test
- public void testWsdlElementPort5() throws Exception {
- String aName = a4.getName();
- String b1Str1 = a4.getB1String("string1");
- String b1Str2 = a4.getB1String2("string2", "string3");
- int b1Int = a4.getB1Int(5000);
-
- System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(5000, b1Int);
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/pom.xml b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/pom.xml
deleted file mode 100644
index 563f167b2a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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>vtest-wsbinding-wsdlelement</artifactId>
- <version>2.0-M1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>vtest-wsbinding-wsdlelement-service</artifactId>
- <name>Apache Tuscany SCA Web Service Binding Verification Tests - WSDL wsdlElement wsdl.service</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-M1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-M1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/AService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/AService.java
deleted file mode 100644
index 464a834570..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/AService.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for AService.
- */
-@Remotable
-public interface AService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
- public String getB2String(String aString);
-
- public int getB2Int(int i);
-
- public String getB3String(String aString);
-
- public int getB3Int(int i);
-
- public String getB4String(String aString);
-
- public String getB4String2(String aString, String bString);
-
- public int getB4Int(int i);
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService.java
deleted file mode 100644
index 37ccee6cd4..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService2.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService2.java
deleted file mode 100644
index c8355f8f1b..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService2.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface BService2 {
-
- public String getString(String aString);
-
- public int getInt(int i);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/CService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/CService.java
deleted file mode 100644
index d3f5ab1c47..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/CService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Simple Service used by another service
- */
-@Remotable
-public interface CService {
-
- public String getString(String aString);
-
- public String getString2(String aString, String bString);
-
- public Integer getInteger(Integer i);
-
- public float getFloat(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/DService.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/DService.java
deleted file mode 100644
index 1a64706a29..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/DService.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for DService.
- */
-@Remotable
-public interface DService {
-
- public String getName();
-
- public String getB1String(String aString);
-
- public String getB1String2(String aString, String bString);
-
- public int getB1Int(int i);
-
- public String getC1String(String aString);
-
- public String getC1String2(String aString, String bString);
-
- public Integer getC1Integer(Integer i);
-
- public float getC1Float(float f);
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/AServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/AServiceImpl.java
deleted file mode 100644
index 986027c08a..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/AServiceImpl.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements AService.
- */
-@Service(AService.class)
-public class AServiceImpl implements AService {
-
- @Reference(required=false)
- public BService b1;
-
- @Reference(required=false)
- public BService2 b2;
-
- @Reference(required=false)
- public BService2 b3;
-
- @Reference(required=false)
- public BService b4;
-
- public String getName() {
- return "AService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
- public String getB2String(String aString) {
- return b2.getString(aString);
- }
-
- public int getB2Int(int i) {
- return b2.getInt(i);
- }
-
- public String getB3String(String aString) {
- return b3.getString(aString);
- }
-
- public int getB3Int(int i) {
- return b3.getInt(i);
- }
-
- public String getB4String(String aString) {
- return b4.getString(aString);
- }
-
- public String getB4String2(String aString, String bString) {
- return b4.getString2(aString, bString);
- }
-
- public int getB4Int(int i) {
- return b4.getInt(i);
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BService2Impl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BService2Impl.java
deleted file mode 100644
index a58297de69..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BService2Impl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService2.class)
-public class BService2Impl implements BService2 {
-
- public String getName() {
- return "BService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BServiceImpl.java
deleted file mode 100644
index 3ecbc95901..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(BService.class)
-public class BServiceImpl implements BService {
-
- public String getName() {
- return "BService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public int getInt(int i) {
- return i;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/CServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/CServiceImpl.java
deleted file mode 100644
index 05af362a25..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/CServiceImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.CService;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(CService.class)
-public class CServiceImpl implements CService {
-
- public String getName() {
- return "CService";
- }
-
- public String getString(String aString) {
- return aString;
- }
-
- public String getString2(String aString, String bString) {
- return aString + bString;
- }
-
- public Integer getInteger(Integer i) {
- return i;
- }
-
- public float getFloat(float f) {
- return f;
- }
-
-}
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/DServiceImpl.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/DServiceImpl.java
deleted file mode 100644
index dadbb63873..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/DServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl;
-
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.CService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.DService;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements DService.
- */
-@Service(DService.class)
-public class DServiceImpl implements DService {
-
- @Reference
- public BService b1;
-
- @Reference
- public CService c1;
-
- public String getName() {
- return "DService";
- }
-
- public String getB1String(String aString) {
- return b1.getString(aString);
- }
-
- public String getB1String2(String aString, String bString) {
- return b1.getString2(aString, bString);
- }
-
- public int getB1Int(int i) {
- return b1.getInt(i);
- }
-
- public String getC1String(String aString) {
- return c1.getString(aString);
- }
-
- public String getC1String2(String aString, String bString) {
- return c1.getString2(aString, bString);
- }
-
- public Integer getC1Integer(Integer i) {
- return c1.getInteger(i);
- }
-
- public float getC1Float(float f) {
- return c1.getFloat(f);
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/bservice.wsdl b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/bservice.wsdl
deleted file mode 100644
index 521f077c46..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/bservice.wsdl
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.service.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="wsdlelement" targetNamespace="http://vtest.wsbinding.wsdlelement.service.bservice" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
- <wsdl:types>
- <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.service.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="getString">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getStringResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2">
- <xsd:complexType>
- <xsd:sequence> <xsd:element name="in1" type="xsd:string"></xsd:element>
- <xsd:element name="in2" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2Response">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getInt">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:int"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getIntResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:int"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="getStringRequest">
- <wsdl:part element="tns:getString" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getStringResponse">
- <wsdl:part element="tns:getStringResponse" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getString2Request">
- <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Response">
- <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntRequest">
- <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntResponse">
- <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringRequest">
- <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringResponse">
- <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntRequest">
- <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntResponse">
- <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:portType name="BService1PortType">
- <wsdl:operation name="getString">
- <wsdl:input message="tns:getStringRequest"/>
- <wsdl:output message="tns:getStringResponse"/>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <wsdl:input message="tns:getString2Request"></wsdl:input>
- <wsdl:output message="tns:getString2Response"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <wsdl:input message="tns:getIntRequest"></wsdl:input>
- <wsdl:output message="tns:getIntResponse"></wsdl:output>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:portType name="BService2PortType">
- <wsdl:operation name="getString">
- <wsdl:input message="tns:getStringRequest"></wsdl:input>
- <wsdl:output message="tns:getStringResponse"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <wsdl:input message="tns:getIntRequest"></wsdl:input>
- <wsdl:output message="tns:getIntResponse"></wsdl:output>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="BService1SOAPBinding"
- type="tns:BService1PortType"> <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getString"> <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getString" /> <wsdl:input> <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output> <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getString2" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getInt" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="BService2SOAPBinding"
- type="tns:BService2PortType">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getString">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getString" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getInt" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="BService3SOAP12Binding"
- type="tns:BService1PortType">
- <soap12:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getString">
- <soap12:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getString" />
- <wsdl:input>
- <soap12:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap12:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <soap12:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getString2" />
- <wsdl:input>
- <soap12:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap12:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInt">
- <soap12:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getInt" />
- <wsdl:input>
- <soap12:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap12:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="BService">
- <wsdl:port binding="tns:BService1SOAPBinding" name="BService1SOAP">
- <soap:address location=""/>
- </wsdl:port>
- </wsdl:service>
- <wsdl:service name="BService2">
- <wsdl:port name="BService2Port" binding="tns:BService2SOAPBinding">
- <soap:address location="" />
- </wsdl:port>
- </wsdl:service>
- <wsdl:service name="BService3">
- <wsdl:port name="BService3SOAP12" binding="tns:BService3SOAP12Binding">
- <soap12:address location=""></soap12:address>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/cservice.wsdl b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/cservice.wsdl
deleted file mode 100644
index bdf294b473..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/cservice.wsdl
+++ /dev/null
@@ -1,173 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.service.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CService" targetNamespace="http://vtest.wsbinding.wsdlelement.service.cservice">
- <wsdl:types>
- <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.service.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="getFloat">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:float"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getFloatResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:float"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getInteger">
- <xsd:complexType>
- <xsd:sequence> <xsd:element name="in" type="xsd:integer"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getIntegerResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:integer"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in1" type="xsd:string"></xsd:element>
- <xsd:element name="in2" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString2Response">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getString">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="in" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="getStringResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="out" type="xsd:string"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </wsdl:types>
- <wsdl:message name="getFloatRequest">
- <wsdl:part element="tns:getFloat" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getFloatResponse">
- <wsdl:part element="tns:getFloatResponse" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="getIntegerRequest">
- <wsdl:part name="parameters" element="tns:getInteger"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getIntegerResponse">
- <wsdl:part name="parameters" element="tns:getIntegerResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Request">
- <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Response">
- <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringRequest">
- <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getStringResponse">
- <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Request">
- <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="getString2Response">
- <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
- </wsdl:message>
- <wsdl:portType name="CServicePortType">
- <wsdl:operation name="getFloat">
- <wsdl:input message="tns:getFloatRequest"/>
- <wsdl:output message="tns:getFloatResponse"/>
- </wsdl:operation>
- <wsdl:operation name="getInteger">
- <wsdl:input message="tns:getIntegerRequest"></wsdl:input>
- <wsdl:output message="tns:getIntegerResponse"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString">
- <wsdl:input message="tns:getStringRequest"></wsdl:input>
- <wsdl:output message="tns:getStringResponse"></wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <wsdl:input message="tns:getString2Request"></wsdl:input>
- <wsdl:output message="tns:getString2Response"></wsdl:output>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="CServiceSOAPBinding"
- type="tns:CServicePortType"> <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getFloat"> <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.cservice/getFloat" /> <wsdl:input> <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output> <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getInteger">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.cservice/getInteger" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.cservice/getString" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="getString2">
- <soap:operation
- soapAction="http://vtest.wsbinding.wsdlelement.service.cservice/getString2" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="CService">
- <wsdl:port binding="tns:CServiceSOAPBinding" name="CServiceSOAP">
- <soap:address location=""/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/wsdlelement.service.composite b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/wsdlelement.service.composite
deleted file mode 100644
index 9801ecd037..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/main/resources/wsdlelement.service.composite
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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://vtest.wsbinding.wsdlelement.service"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="wsdlelement.service">
-
- <component name="BComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService)" uri="http://localhost:8085/BComponent1"/>
- </service>
- </component>
-
- <component name="BComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService2)" uri="http://localhost:8085/BComponent2"/>
- </service>
- </component>
-
- <component name="BComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BService2Impl"/>
- <service name="BService2">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService2)" uri="http://localhost:8085/BComponent3"/>
- </service>
- </component>
-
- <component name="BComponent4">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.port(BService/BService1SOAP)" uri="http://localhost:8085/BComponent4"/>
- </service>
- </component>
-
- <component name="BComponent5">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BService2Impl"/>
- <service name="BService2">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.binding(BService2SOAPBinding)" uri="http://localhost:8085/BComponent5"/>
- </service>
- </component>
-
- <component name="BComponent6">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BServiceImpl"/>
- <service name="BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService3)" uri="http://localhost:8085/BComponent6"/>
- </service>
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.CServiceImpl"/>
- <service name="CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.CService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.cservice#wsdl.service(CService)" uri="http://localhost:8085/CComponent"/>
- </service>
- </component>
-
- <component name="AComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent1/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService)" uri="http://localhost:8085/BComponent1"/>
- </reference>
- </component>
-
- <component name="AComponent2">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent2/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService2)" uri="http://localhost:8085/BComponent2"/>
- </reference>
- </component>
-
- <component name="AComponent3">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.AServiceImpl"/>
- <reference name="b2" target="BComponent3/BService2">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService2)" uri="http://localhost:8085/BComponent3"/>
- </reference>
- </component>
-
- <component name="AComponent4">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent4/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.port(BService/BService1SOAP)" uri="http://localhost:8085/BComponent4"/>
- </reference>
- <reference name="b2" target="BComponent3/BService2">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService2)" uri="http://localhost:8085/BComponent3"/>
- </reference>
- <reference name="b3" target="BComponent5/BService2">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.binding(BService2SOAPBinding)" uri="http://localhost:8085/BComponent5"/>
- </reference>
- <reference name="b4" target="BComponent6/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService3)" uri="http://localhost:8085/BComponent6"/>
- </reference>
- </component>
-
- <component name="AComponent5">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.AServiceImpl"/>
- <reference name="b1" target="BComponent6/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService3)" uri="http://localhost:8085/BComponent6"/>
- </reference>
- </component>
-
- <component name="DComponent1">
- <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.DServiceImpl"/>
- <reference name="b1" target="BComponent1/BService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService)" uri="http://localhost:8085/BComponent1"/>
- </reference>
- <reference name="c1" target="CComponent/CService">
- <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.CService"/>
- <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.cservice#wsdl.service(CService)" uri="http://localhost:8085/CComponent"/>
- </reference>
- </component>
-
-</composite>
diff --git a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/WsdlElementServiceTestCase.java b/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/WsdlElementServiceTestCase.java
deleted file mode 100644
index 22d2a80244..0000000000
--- a/tags/java/sca/2.0-M1/vtest/wsbinding/wsdlelement/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/WsdlElementServiceTestCase.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service;
-
-import static org.junit.Assert.fail;
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.AService;
-import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.DService;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests the simplest form of the binding element wsdl.service with WSDL
- * document described in section section 2.1 of SCA Web Services Binding
- * V1.00<br>
- */
-public class WsdlElementServiceTestCase {
-
- protected static ServiceFinder serviceFinder;
- protected static String compositeName = "wsdlelement.service.composite";
- protected static AService a1;
- protected static AService a2;
- protected static AService a3;
- protected static AService a4;
- protected static AService a5;
- protected static DService d;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- System.out.println("Setting up");
- ServiceFinder.init(compositeName);
- a1 = ServiceFinder.getService(AService.class, "AComponent1");
- a2 = ServiceFinder.getService(AService.class, "AComponent2");
- a3 = ServiceFinder.getService(AService.class, "AComponent3");
- a4 = ServiceFinder.getService(AService.class, "AComponent4");
- a5 = ServiceFinder.getService(AService.class, "AComponent5");
- d = ServiceFinder.getService(DService.class, "DComponent1");
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Lines 38-41:<br>
- * Service:<br>
- * <WSDL-namespace-URI>#wsdl.service(<service-name>)<br>
- * In this case, all the endpoints in the WSDL Service that have equivalent
- * PortTypes with the SCA service or reference must be available to the SCA
- * service or reference.<br>
- * <br>
- * Tests wsdl.service(BService)<br>
- */
- @Test
- public void testWsdlElementService1() throws Exception {
- String aName = a1.getName();
- String b1Str1 = a1.getB1String("string1");
- String b1Str2 = a1.getB1String2("string2", "string3");
- int b1Int = a1.getB1Int(1000);
-
- System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(1000, b1Int);
- }
-
- /**
- * Lines 38-41:<br>
- * Service:<br>
- * <br>
- * Tests wsdl.service(BService2) with with BService where the service
- * does not define getString2, so exceptions are expected.<br>
- */
- @Test
- public void testWsdlElementService2() throws Exception {
- String aName = a2.getName();
- System.out.println(aName + ": ");
- try {
- a2.getB1String("string1");
- fail("Should not be able to call getString");
- } catch (Exception e) {
- System.out.println(" Exception is expected: " + e.toString());
- }
- try {
- a2.getB1String2("string2", "string3");
- fail("Should not be able to call getString2");
- } catch (Exception e) {
- System.out.println(" Exception is expected: " + e.toString());
- }
- try {
- a2.getB1Int(2000);
- fail("Should not be able to call getInt");
- } catch (Exception e) {
- System.out.println(" Exception is expected: " + e.toString());
- }
- }
-
- /**
- * Lines 38-41:<br>
- * Service:<br>
- * <br>
- * Tests wsdl.service(BService2) with BService2<br>
- */
- @Test
- public void testWsdlElementService3() throws Exception {
- String aName = a3.getName();
- String b2Str1 = a3.getB2String("string1");
- int b2Int = a3.getB2Int(1000);
-
- System.out.println(aName + ": " + b2Str1 + ", " + b2Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b2Str1);
- Assert.assertEquals(1000, b2Int);
- }
-
- /**
- * Lines 38-41:<br>
- * Service:<br>
- * <br>
- * Tests two references using wsdl.service.<br>
- */
- @Test
- public void testWsdlElementService4() throws Exception {
- String dName = d.getName();
- String b1Str1 = d.getB1String("string1");
- String b1Str2 = d.getB1String2("string2", "string3");
- String c1Str1 = d.getC1String("string5");
- String c1Str2 = d.getC1String2("string6", "string7");
-
- int b1Int = d.getB1Int(4000);
- float c1Float = d.getC1Float((float) 8.8);
-
- Integer c1Integer = d.getC1Integer(new Integer(9000));
-
- System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer);
- Assert.assertEquals("DService", dName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(4000, b1Int);
- Assert.assertEquals("string5", c1Str1);
- Assert.assertEquals("string6string7", c1Str2);
- Assert.assertEquals((float) 8.8, c1Float);
- Assert.assertEquals(new Integer(9000), c1Integer);
- }
-
- /**
- * Lines 38-41:<br>
- * Service:<br>
- * <br>
- * Tests mixed bindings of using wsdl.port, wsdl.service, wsdl.binding,
- * and soap 1.2
- * <br>
- */
- @Test
- public void testWsdlElementService5() throws Exception {
- String aName = a4.getName();
- String b1Str1 = a4.getB1String("port");
- String b1Str2 = a4.getB1String2("string1", "string2");
- int b1Int = a4.getB1Int(1000);
- System.out.println(aName);
- System.out.println(" b1: " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("port", b1Str1);
- Assert.assertEquals("string1string2", b1Str2);
- Assert.assertEquals(1000, b1Int);
-
- String b2Str1 = a4.getB2String("service");
- int b2Int = a4.getB2Int(2000);
- System.out.println(" b2: " + b2Str1 + ", " + b2Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("service", b2Str1);
- Assert.assertEquals(2000, b2Int);
-
- String b3Str1 = a4.getB3String("binding");
- int b3Int = a4.getB3Int(3000);
- System.out.println(" b3: " + b3Str1 + ", " + b3Int);
- Assert.assertEquals("binding", b3Str1);
- Assert.assertEquals(3000, b3Int);
-
- String b4Str1 = a4.getB4String("soap12");
- String b4Str2 = a4.getB4String2("string3", "string4");
- int b4Int = a4.getB4Int(4000);
- System.out.println(" b4: " + b4Str1 + ", " + b4Str2 + ", " + b4Int);
- Assert.assertEquals("soap12", b4Str1);
- Assert.assertEquals("string3string4", b4Str2);
- Assert.assertEquals(4000, b4Int);
-
- }
-
- /**
- * Lines 38-41:<br>
- * Service:<br>
- * <br>
- * Tests wsdl.service(BService3) which uses SOAP 1.2<br>
- */
- @Test
- public void testWsdlElementService6() throws Exception {
- String aName = a5.getName();
- String b1Str1 = a5.getB1String("string1");
- String b1Str2 = a5.getB1String2("string2", "string3");
- int b1Int = a5.getB1Int(6000);
-
- System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int);
- Assert.assertEquals("AService", aName);
- Assert.assertEquals("string1", b1Str1);
- Assert.assertEquals("string2string3", b1Str2);
- Assert.assertEquals(6000, b1Int);
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- System.out.println("Cleaning up");
- ServiceFinder.cleanup();
- }
-}